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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
Messages 2444 - 2473 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
2444
... Hi, 'a option is a predefined type, which is absolutely not magic and certainly not a keyword. You could have defined it by yourself, but this one is...
Martin Jambon
BioMim
Offline Send Email
Aug 1, 2004
8:44 am
2445
I found there are codes as follows: let outChannel : out_channel option ref = ref None let mergedChannel : out_channel option ref = ref None Here, "option" is...
Andy Yang
yyu08
Offline Send Email
Aug 1, 2004
4:59 pm
2446
... No. Arrays of weak pointers are found in the Weak module of the standard library. -- j h woodyatt <jhw@...> markets are only free to the people...
james woodyatt
dr_strychnine
Offline Send Email
Aug 1, 2004
5:11 pm
2447
... No. The option type has nothing to do with weak pointers. Ben...
Benjamin Geer
ben_geer
Offline Send Email
Aug 1, 2004
5:34 pm
2448
... No, not at all. Having 'out_channel option' rather than ''a option' just means that the type is completely specified. If you were to specify 'a option in a...
Matt Gushee
mcgushee
Offline Send Email
Aug 1, 2004
5:36 pm
2449
... The types are read backwards. Example: int list is a list of integers int option list is a list of optional integers int list option is an optional...
Richard Jones
rwmjones
Offline Send Email
Aug 1, 2004
5:45 pm
2450
... It means "evaluate 'bla' now". In this instance, 'bla' is assumed to be something which evaluates to / returns '()' (ie. the unit value). There is another...
Richard Jones
rwmjones
Offline Send Email
Aug 3, 2004
3:10 pm
2451
Hi, all When I define some record variables in toplevel, it can interactively give out the details of these variables. For example, # type myrec = { fld1 :...
Andy Yang
yyu08
Offline Send Email
Aug 3, 2004
10:38 pm
2452
... Well, one way to do it is to create a printer for each class and use #install_printer to get the effect you want. For example, with the point class you...
William Neumann
scoey13
Offline Send Email
Aug 4, 2004
1:27 am
2453
Hello all, There are two functions [f] and [g] defined as: let f n = match n with ... let g n = match n with ... When I employ [try with] as follows, (* --Ver...
ali khan
patternproject
Offline Send Email
Aug 4, 2004
9:26 am
2454
... It's because your definition ("try f with .....") of h is immediately evaluated (since you gave no argument after the "h"). So it does not fail, and h =...
Frederic van der Plan...
fplancke2001
Offline Send Email
Aug 4, 2004
9:34 am
2455
Hi, ... ^^ this expression computes nothing, thus cannot raise an exception ... This is therefore equivalent to: let h = f And it is (almost) the same as: let...
Martin Jambon
BioMim
Offline Send Email
Aug 4, 2004
9:40 am
2456
... This is equivalent to let h = f;; ... -- Issac Trotts Programmer, NIMH Human Brain Project University of California, Davis ...
Issac Trotts
issac_trotts
Offline Send Email
Aug 4, 2004
9:41 am
2457
The following function, does produce a file named [txt], but despite calling it multiple times, the file remains empty. Any possible explaination ??? let...
ali khan
patternproject
Offline Send Email
Aug 4, 2004
10:05 am
2458
... I suggest adding ''close_out oc'' somewhere! Unlike Perl, OCaml doesn't automatically flush and close channels. Rich. -- Richard Jones....
Richard Jones
rwmjones
Offline Send Email
Aug 4, 2004
10:22 am
2459
I have code that works just fine as a module, but as I try to convert it to a class, I'm running into problems with what looks like kprintf and that funky...
Jesse Guardiani
Trevarthan
Offline Send Email
Aug 4, 2004
9:46 pm
2460
... Mmmm... doing a little reading in the OCaml manual at section 3.11, it looks like I might need to define an explicit polymorphic method, but I'm not having...
Jesse Guardiani
Trevarthan
Offline Send Email
Aug 5, 2004
4:34 am
2461
... Yes, you will probably need to do that. I recommend looking at the [Cf_journal] module in my [Cf] library. It has a treatment of a similar problem. ...
james woodyatt
dr_strychnine
Offline Send Email
Aug 5, 2004
4:48 am
2462
... The syntax for polymorphic methods is not the above. (That's the syntax for a polymorphic class). Try a syntax similar to the map or fold_* methods on...
Richard Jones
rwmjones
Offline Send Email
Aug 5, 2004
8:25 am
2463
Hi all, I'm relatively new to Ocaml and I'm still trying to figure out the Ocaml way of doing things. Given a list like : let a = [ "qwe" ; "asd" ; "zxc" ] ;; ...
Erik de Castro Lopo
mega_erikd
Offline Send Email
Aug 5, 2004
10:28 am
2464
... <snip> ... String.concat ", " a Anyway, if you are interested in a generic way to concatenate string, it's butter to use the Buffer module which has better...
Stefano Zacchiroli
zacchiro
Offline Send Email
Aug 5, 2004
10:31 am
2465
... Many operations on list can be expressed succinctly by using List.fold_left or List.fold_right: let a = [ "qwe" ; "asd" ; "zxc" ];; let comma_concat l r = ...
Guido Kollerie
gkolleri
Offline Send Email
Aug 5, 2004
11:03 am
2466
... OK, thats really good for lists of strings, but what about arrays of strings? Is this a reasonable method: String.concat ", " (Array.to_list a) Erik...
mega_erikd
Offline Send Email
Aug 5, 2004
12:12 pm
2467
... Yes, IMO it's reasonable. It would be interesting to compare it with the following approach: let buf = Buffer.create <guess_a_size> in Array.iter...
Stefano Zacchiroli
zacchiro
Offline Send Email
Aug 5, 2004
12:21 pm
2468
... It is reasonable, it runs in O(n). List.fold_right ( ^ ) l "" is not reasonable since it runs in O(n^2). Martin...
Martin Jambon
BioMim
Offline Send Email
Aug 5, 2004
12:31 pm
2469
... The advantage of String.concat is that it copies the characters directly into the result string, not into a temporary buffer (which is himself a string). ...
Martin Jambon
BioMim
Offline Send Email
Aug 5, 2004
12:39 pm
2470
... Yes, but the other solution has also an additional linear pass on the array to convert it to a string. Probably is better than the buffer solution which...
Stefano Zacchiroli
zacchiro
Offline Send Email
Aug 5, 2004
12:42 pm
2471
... You're right. I forgot the 'a. in the beginning of my method type assignment. I had this: ...
Jesse Guardiani
Trevarthan
Offline Send Email
Aug 5, 2004
12:45 pm
2472
... Where do you get n^2? Looks like O(n) to me, with a high constant due to allocating a new string on every concatination. Karl...
Karl Zilles
kzilles
Offline Send Email
Aug 5, 2004
5:58 pm
2473
... You have to copy all these string fragments. To concatenate a list of N strings of length M, List.fold_right ( ^ ) copies a total of 2M + 3M + ... + NM =...
Frederic van der Plan...
fplancke2001
Offline Send Email
Aug 5, 2004
6:33 pm
Messages 2444 - 2473 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

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