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 9308 - 9337 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
9308
I'm writing a wordsearch program that reads a dictionary file into a global array: ...
Martin DeMello
martindemello
Offline Send Email
Feb 2, 2008
1:12 pm
9309
... I'm not quite sure where your pain point is, but if I'm understanding this you want to hide the _symbols? As you said, avoid classes. Instead, use...
Richard Jones
rwmjones
Offline Send Email
Feb 2, 2008
8:18 pm
9310
... No, I now have let dawg = let fd = Unix.openfile "csw.dwg" [ Unix.O_RDONLY ] 0 in Array1.map_file fd int32 c_layout false (-1);; which is a global array...
Martin DeMello
martindemello
Offline Send Email
Feb 2, 2008
8:52 pm
9311
... Yes: take "dawg" out of the "main" file and put it in its own file that everything using it can depend upon. This is typically done for the definition of...
Jon Harrop
harropjon
Offline Send Email
Feb 2, 2008
10:47 pm
9312
... How does that work with code that has side effects? Would appreciate a pointer to the relevant section of the docs - I didn't know where to look. martin...
Martin DeMello
martindemello
Offline Send Email
Feb 3, 2008
8:39 am
9313
... Hmmm, still not entirely clear to me. There is only one 'dawg'? It must be initialized once when the program starts up? If so, just make it a global...
Richard Jones
rwmjones
Offline Send Email
Feb 3, 2008
10:01 am
9314
... Same as C/C++/Java/... -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e...
Jon Harrop
harropjon
Offline Send Email
Feb 3, 2008
1:27 pm
9315
... Thanks, that works nicely. I'm taking an extra dereference hit every time I access the dawg, but I can always optimise later. martin...
Martin DeMello
martindemello
Offline Send Email
Feb 3, 2008
2:06 pm
9316
... You might also like to try: let dawg = lazy (Array. ...) and accessing it with "Lazy.force dawg". The code is then evaluated only the first time it is...
Jon Harrop
harropjon
Offline Send Email
Feb 3, 2008
2:24 pm
9317
... That's pretty neat! martin...
Martin DeMello
martindemello
Offline Send Email
Feb 4, 2008
12:45 pm
9318
... Hash: SHA1 ... Just would like to point out there's nothing wrong with using classes. One of the best points of OCaml in my opinion is the ability to...
Peng Zang
peng.zang@...
Send Email
Feb 4, 2008
1:48 pm
9319
I would propose a functor-based code which does pretty much the same :) like Jon has suggested in http://tech.groups.yahoo.com/group/ocaml_beginners/ ...
yami_no_shoryuu
Offline Send Email
Feb 6, 2008
5:34 pm
9320
Hi ! I began to read about camlp4 and moved back. Will try to study again. Please have you got an example of preprocessor code to generate something like this...
Fabrice Marchant
fabrice.marc...
Offline Send Email
Feb 9, 2008
9:26 pm
9321
Hi ! I encounter a problem of "type variable" with this attempt to extend "Map" ( I tried to follow this method with Map : ...
Fabrice Marchant
fabrice.marc...
Offline Send Email
Feb 9, 2008
10:28 pm
9322
... Hash: SHA1 Eta expansion: module MapPlus( Map : Map.S ) = struct include Map let of_list l = List.fold_left (fun m (x, y) -> add x y m) empty l end Peng ...
Peng Zang
peng.zang@...
Send Email
Feb 10, 2008
4:22 am
9323
On Sat, 9 Feb 2008 23:21:57 -0500 ... Thanks a lot Peng for your efficient answer ! I didn't thought to have these 2 mistakes : you corrected them and all...
Fabrice Marchant
fabrice.marc...
Offline Send Email
Feb 10, 2008
9:27 am
9324
... Hash: SHA1 There's nothing wrong with using Map.add and Map.empty. I just used "add" and "empty" because it was shorter (I can do this because we already...
Peng Zang
peng.zang@...
Send Email
Feb 10, 2008
3:44 pm
9325
Thanks for the detailed explanations ! On Sun, 10 Feb 2008 10:44:33 -0500 ... Another mistake I did, seeing unexistent errors ! ... Thanks, I've been able to...
Fabrice Marchant
fabrice.marc...
Offline Send Email
Feb 10, 2008
10:49 pm
9326
I'm trying to translate some code to OCaml, but my OCaml is a little rusty. I ran into an interesting case though, and I can't seem to figure out how to...
SDM
s_david_m
Offline Send Email
Feb 12, 2008
5:31 pm
9327
Hello, ... [...] You have to provide the module type B, but you provide the module B. If you declare that there must be a module type B, then you have to...
Oliver Bandel
oliver@...
Send Email
Feb 12, 2008
6:00 pm
9328
Hello, or better like this, because you need module B, not only the type... ================================ module type Bob = sig type t val read : t ->...
Oliver Bandel
oliver@...
Send Email
Feb 12, 2008
6:03 pm
9329
...possibly functors make sense here. depends on what you want to have at the end (and how you want to use it). Ciao, oliver...
Oliver Bandel
oliver@...
Send Email
Feb 12, 2008
6:07 pm
9330
Ah yes, I understand now, thanks. I only tried this unnatural nesting because entering the signatures separately produces an "unbound type constructor". For...
SDM
s_david_m
Offline Send Email
Feb 12, 2008
6:27 pm
9331
... You made the classical "module type contain another module type" error. You meant: module type Bob = sig type t val read : t -> string module B = sig type...
Remi Vanicat
dl_ens
Offline Send Email
Feb 12, 2008
7:25 pm
9332
... Do you really need module type ? You don't seem to be using functor, so why don't you let the compiler find the module type by itself ? Or better, you...
Remi Vanicat
dl_ens
Offline Send Email
Feb 12, 2008
7:30 pm
9333
... I believe I tried that. It produces a syntax error: Characters 18-21: sig ^^^ Syntax error: 'end' expected, the highlighted 'sig' might be unmatched ... I...
SDM
s_david_m
Offline Send Email
Feb 12, 2008
7:49 pm
9334
... I'll describe my abstract goals, so perhaps it's clearer what I'm trying to achieve. I want to define a pair of signatures that must both be provided ...
SDM
s_david_m
Offline Send Email
Feb 12, 2008
7:59 pm
9335
... Arg, my mistake. It is of course : module type Bob = sig type t val read : t -> string module B : sig type bt val compile : bt -> string -> t -> unit end ...
Remi Vanicat
dl_ens
Offline Send Email
Feb 12, 2008
10:01 pm
9336
... a version that will do it: module type O = sig type t val read : t -> string end;; module type B = sig type bt type ot val compile : bt -> string -> ot ->...
Remi Vanicat
dl_ens
Offline Send Email
Feb 12, 2008
10:10 pm
9337
... Excellent, thanks. This seems much more natural, and the point I'm trying to make is intact. ... Hmm, what's the reason for that? I would like to be able...
SDM
s_david_m
Offline Send Email
Feb 12, 2008
10:43 pm
Messages 9308 - 9337 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