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...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
Messages 7618 - 7647 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
7618
Hi ! In order to define a multi-tree with an integer at each node, it is possible to write something like this : type int_tree = Content of int * int_tree list...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 1, 2007
10:34 am
7619
... "infinity" like "nan" are special floating point values. In your case, infinity is given as because the result exceededs the range of FP numbers. Other...
Christophe TROESTLER
Christophe.Troestler+...
Send Email
May 1, 2007
11:22 am
7620
Is there anything in one of the standard libraries that implements the decorate-sort-undecorate pattern, as in ruby's sort_by? (sort_by f list should build the...
Martin DeMello
martindemello
Offline Send Email
May 1, 2007
11:42 am
7621
Fabrice, I don't think this it is possible to recursively define a type and a module in this way (i.e., you want to define TreeSet in terms of int_tree and...
Christopher L Conway
postalchris
Offline Send Email
May 1, 2007
12:52 pm
7622
... No. ... Probably one line of code: # let sort_by f l = map snd (sort compare (map (fun x -> f x, x) l));; val sort_by : ('a -> 'b) -> 'a list -> 'a list =...
Jon Harrop
harropjon
Offline Send Email
May 1, 2007
3:04 pm
7623
exp is a type. What's VarExp, why i need to use ( ) to declare type: # let ifs = IfExp NilExp NilExp NilExp;; Syntax error # let i = IfExp(NilExp, NilExp,...
happyhangzhou@...
iyanglian
Offline Send Email
May 1, 2007
3:10 pm
7624
... The mutual recursion is between two types, one of which is in a module. To do this, you just put both definitions in a set of mutually recursive modules so...
Jon Harrop
harropjon
Offline Send Email
May 1, 2007
3:16 pm
7625
Is "_" the entry point of ocaml like C's main ? program will start from "let _"? Thanks. let compile ch = let base_env = V.new_env base_tenv base_venv in let...
happyhangzhou@...
iyanglian
Offline Send Email
May 1, 2007
3:18 pm
7626
... Note that OCaml's Sets are ordered whereas lists are not. ... Use mutually recursive modules: # module rec Tree : sig type t = Content of int * TreeSet.t ...
Jon Harrop
harropjon
Offline Send Email
May 1, 2007
3:22 pm
7627
... Sort of, but not really. OCaml evaluates your code from top to bottom, and it will execute any code not sitting behind a functional abstraction when it...
William D. Neumann
scoey13
Offline Send Email
May 1, 2007
3:36 pm
7628
... Have a look at min_float, max_float, infinity, neg_infinity and nan. Consider how machines represent numbers and why they cannot do computations on huge ...
Jon Harrop
harropjon
Offline Send Email
May 1, 2007
3:41 pm
7629
... The correct expression is let i = IfExp(NilExp, NilExp, Some NilExp, 3);; or, probably, let i = IfExp(NilExp, NilExp, None, 3);; IfExp is a type...
Christopher L Conway
postalchris
Offline Send Email
May 1, 2007
3:58 pm
7630
... VarExp is one of the inhabitants of the type exp. A value of this has the label VarExp and a component of type var -- whatever type var is. As for the...
William D. Neumann
scoey13
Offline Send Email
May 1, 2007
4:50 pm
7631
Folks, This doesn't work but how can I work around it? let tab = EasySymtab.symtab () in module P = EasyParser.Make ( struct type t = EasySymtab.symtab_t let...
Joel Reymont
jreymont
Online Now Send Email
May 1, 2007
6:30 pm
7632
Hi Christopher ! ... Thanks for the explanations. I'm very sorry : should have told in my question I focus on learning non-O Caml for now. It's enough for me...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 1, 2007
7:35 pm
7633
Many thanks Jon ! ... That's absolutely perfect ! I begin to grasp the core language but have a lot to work on modules... ... I come from C++ ( and its heavy...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 1, 2007
7:40 pm
7634
Shalom ! Set functor needs ordered types to make Set modules with ordered compare test. I wonder if it exists a kind of Set library that would rather be based...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 1, 2007
10:02 pm
7635
You know there is a built-in structural comparison function "compare" in OCaml? So you don't need to write your own... ... ...
Jon Harrop
harropjon
Offline Send Email
May 1, 2007
10:13 pm
7636
How to printf a ref of a bool? like ast and print_ast() here. print a ref of bool let ast = ref false let print_ast() = !ast printf "%B" ast;; Thanks! ...
happyhangzhou@...
iyanglian
Offline Send Email
May 1, 2007
11:03 pm
7637
... Thanks Jon ! You gave me today lot of things to experiment with ! ( Never heard about Mr Pernici programs before and I'm surprised to have missed JCF ds/...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 1, 2007
11:20 pm
7638
... Maybe with a "!" before ast : Printf.printf "%B" !ast;;...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 1, 2007
11:27 pm
7639
... No problem. While we're on the subject of sets, you may be interested in the set-based example program from my book: ...
Jon Harrop
harropjon
Offline Send Email
May 1, 2007
11:53 pm
7640
Hi all, Could somebody please help me make sense of OMake / suggest something else or point me at a simple template. I have a simple (but growing) program and...
mo.deeq
Offline Send Email
May 1, 2007
11:59 pm
7641
it works in interactive mode. but got some problems in file driver.ml printf "%B" ! ast error info: File "driver.ml ", line 62, characters 8-12: This...
happyhangzhou@...
iyanglian
Offline Send Email
May 2, 2007
12:29 am
7642
ast defined in option and print in driver.ml. attached it works in interactive mode. but got some problems in file driver.ml printf "%B" ! ast error info: ...
yanglian@...
iyanglian
Offline Send Email
May 2, 2007
1:31 am
7643
The following should do the trick. <code> OCAMLINCLUDES += +extLib OCAML_OTHER_LIBS += extLib OCAMLPPFLAGS = -pp camlp4o FILES = node sum .DEFAULT:...
Christopher L Conway
postalchris
Offline Send Email
May 2, 2007
1:45 am
7644
... ... Sorry, but what is this file : "driver.ml" ? This code correctly compiles : (* Beg of code *) let ast = ref false let _ = Printf.printf "%B" ! ast ...
Fabrice Marchant
fabrice.marc...
Offline Send Email
May 2, 2007
10:26 am
7645
is there any codes or related resources? thanks. [Non-text portions of this message have been removed]...
yanglian@...
iyanglian
Offline Send Email
May 2, 2007
3:10 pm
7646
... I'd suppose that would depend on what you mean by code generation. Could you be a bit more specific as to what you are interested in? William D. Neumann ...
William D. Neumann
scoey13
Offline Send Email
May 2, 2007
3:23 pm
7647
... If you want to generate native-code at run-time then check out MetaOCaml. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. The F#.NET Journal ...
Jon Harrop
harropjon
Offline Send Email
May 2, 2007
3:25 pm
Messages 7618 - 7647 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