Search the web
Sign In
New User? Sign Up
ocaml_beginners · Ocaml Beginners
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 10651 - 10680 of 11541   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
10651
... If I understand the problem correctly, what you need are called 'existential types'. OCaml doesn't have them directly, but you can emulate them using...
Richard Jones
rwmjones
Offline Send Email
Jan 1, 2009
11:42 pm
10652
Hello ... Note that the type you've provided are indeed less general than required by the module's type signature, since when 'a is constraint by <cmp: 'a ->...
code17
code_1977
Offline Send Email
Jan 2, 2009
11:24 am
10653
This question has been asked once before but had no replies: http://tech.groups.yahoo.com/group/ocaml_beginners/message/8722 Why does the following work under...
jshaw10
Offline Send Email
Jan 3, 2009
11:09 am
10654
This is just a quick check. Have you tried giving the full path to open_process ? Or specify "./wish85" instead of just "wish85" ? IIRC the current directory...
Adrien
camaradetux
Offline Send Email
Jan 3, 2009
11:24 am
10655
That worked, thanks! ... can be found...
jshaw10
Offline Send Email
Jan 3, 2009
1:36 pm
10656
... I think CamaradeTux nailed your problem with the $PATH. However I'd like to add that opening two channels like this isn't necessarily safe. You can easily...
Richard Jones
rwmjones
Offline Send Email
Jan 3, 2009
8:55 pm
10657
C is my native language, so I translate everything from/to C so far. So, my question will probably looks ridiculous, but... Please don't laugh at me ! :-) ...
Cedric Cellier
rixed
Offline Send Email
Jan 4, 2009
9:39 pm
10658
... Lots of possibilities for this. If you want a literal, fast translation then your array method isn't too bad, but ... ... int_of_fruit is faster if you...
Richard Jones
rwmjones
Offline Send Email
Jan 4, 2009
10:20 pm
10659
-[ Sun, Jan 04, 2009 at 10:19:59PM +0000, Richard Jones ]---- ... Wow, what's that ? Let me guess : "external" mean that we are going to define a symbol...
Cedric Cellier
rixed
Offline Send Email
Jan 4, 2009
11:35 pm
10660
... Yes. ... That's polymorphic variants. ... Not without meta-programming (camlp4 or else). You may also consider of solution of the following kind: let...
Martin Jambon
BioMim
Offline Send Email
Jan 5, 2009
2:16 am
10661
... I will avoid the solution given by R. W. M Jones, which works but is unsafe. FP programming (and in particular OCaml) allow to build directly compare...
Sylvain Le Gall
gildor16478
Offline Send Email
Jan 5, 2009
7:46 am
10662
... Hi Richard, could you join a license along with this module?...
Florent Monnier
fmonnier@...
Send Email
Jan 5, 2009
9:29 am
10663
Le lun 05 jan 2009 00:35:10 CET, ... yes. But as Richard Jones said this is only valid as long as you have constant constructors in your type (i.e. it is...
Virgile Prevosto
virgilepr
Offline Send Email
Jan 5, 2009
9:47 am
10664
... It's just a way to say that fruit_species can be treated directly as an integer. At this point you should read the infamous Chapter 18 of the manual: ...
Richard Jones
rwmjones
Offline Send Email
Jan 5, 2009
9:59 am
10665
... Public domain -- I don't care what you use it for. Rich. -- Richard Jones Red Hat...
Richard Jones
rwmjones
Offline Send Email
Jan 5, 2009
10:02 am
10666
-[ Mon, Jan 05, 2009 at 10:47:21AM +0100, Virgile Prevosto ]---- ... Yes it works but the problem with doing this in Ocaml is that NB_FRUITS would be treated...
cedric cellier
rixed
Offline Send Email
Jan 5, 2009
10:57 am
10667
-[ Mon, Jan 05, 2009 at 09:59:26AM +0000, Richard Jones ]---- ... I've started to read it. So %identity is a C function provided by the ocaml "environment"...
cedric cellier
rixed
Offline Send Email
Jan 5, 2009
11:47 am
10668
-[ Mon, Jan 05, 2009 at 07:46:41AM +0000, Sylvain Le Gall ]---- ... OK, I'm going to use a Map. With the troublesome impression of using a railgun to kill a...
cedric cellier
rixed
Offline Send Email
Jan 5, 2009
11:51 am
10669
... If you have an IDE that expands pattern matching and you'd like to provide initial values, this can be handy: let fruits_count f = match f with ... ;; incr...
Lukasz Stafiniak
luk_stafi
Offline Send Email
Jan 5, 2009
12:38 pm
10670
... That's correct. Attached is an example of an 'enum' camlp4 extension. As discussed previously, you can write: enum fruits = Apple | Banana | Orange and the...
Richard Jones
rwmjones
Offline Send Email
Jan 5, 2009
12:44 pm
10671
... I'm not sure if these internal functions are documented anywhere, but %identity is widely known and used. You'll find others if you read the source in...
Richard Jones
rwmjones
Offline Send Email
Jan 5, 2009
12:46 pm
10672
Yahoo screwed up the attachments. The files are also here: http://www.annexia.org/tmp/enum/ Rich. -- Richard Jones Red Hat...
Richard Jones
rwmjones
Offline Send Email
Jan 5, 2009
12:47 pm
10673
... Yes, yes and yes. Notice what OCaml's Hashtbl.hash function does to the elements of your enumeration: # type t = Apple | Orange | Banana;; type t = Apple |...
Jon Harrop
jon@...
Send Email
Jan 5, 2009
3:28 pm
10674
-[ Mon, Jan 05, 2009 at 03:31:42PM +0000, Jon Harrop ]---- ... Very interresting ! Is it by coincidence, or does Hashtbl.hash implementation for variants ...
Cedric Cellier
rixed
Offline Send Email
Jan 5, 2009
7:14 pm
10675
-[ Mon, Jan 05, 2009 at 01:38:25PM +0100, Lukasz Stafiniak ]---- ... Not that I like it, but I find it clever. I'd never have though of that by myself....
Cedric Cellier
rixed
Offline Send Email
Jan 5, 2009
7:17 pm
10676
... You'll still get collisions in the general case. Hashtbl.hash turns into a direct C function call to this function (with count = 10 and limit = 100 and...
Richard Jones
rwmjones
Offline Send Email
Jan 5, 2009
7:29 pm
10677
Ooops! I'm so sorry, I've been obviously wrong! ... let fruits_count = let r1, r2, r3 = ref 0, ref 0, ref 5 in function ... ;; OK, now this is really ugly ;-)...
Lukasz Stafiniak
luk_stafi
Offline Send Email
Jan 5, 2009
7:36 pm
10678
-[ Mon, Jan 05, 2009 at 08:36:51PM +0100, Lukasz Stafiniak ]---- ... I don't get the difference, Wouldn't the first fruits_count return the same ref if called...
Cedric Cellier
rixed
Offline Send Email
Jan 5, 2009
8:04 pm
10679
-[ Mon, Jan 05, 2009 at 07:29:37PM +0000, Richard Jones ]---- ... Funny to fall back on C for handling the polymorphism :-) ... Yes but as this is my first...
Cedric Cellier
rixed
Offline Send Email
Jan 5, 2009
8:09 pm
10680
... No, it wouldn't. [ref] is a function, [ref 0] creates a new reference cell the time it is computed. So, we need to create the reference cells when defining...
Lukasz Stafiniak
luk_stafi
Offline Send Email
Jan 5, 2009
8:15 pm
Messages 10651 - 10680 of 11541   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help