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.

Messages

  Messages Help
Advanced
Messages 1300 - 1329 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
1300
Find out value of max_int without using the the constant max_int ... Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software [Non-text...
Pawan Jain
pawanjain19
Offline Send Email
Sep 1, 2003
1:18 pm
1301
... You can try min_int - 1;; Otherwise you can use shift functions (lsl, lsr, ...) or an arithmetic approach: increase an int until its value decreases....
José Manuel Nunes
Jose.deAbreuNunes@...
Send Email
Sep 1, 2003
1:42 pm
1302
... let rec find_max x = if x + 1 < x then x else find_max (x + 1) ;; find_max 17 ;; (* have a drink *) Cheers. -- Stefano Zacchiroli -- Master in Computer...
Stefano Zacchiroli
zacchiro
Offline Send Email
Sep 2, 2003
10:58 am
1303
... Or on a binary computer ... let rec find_max x = if x * 2 > x then find_max (x * 2) else x * 2 - 1;; print_string (string_of_int (find_max 1) ^ "\n");; ...
Richard Jones
rwmjones
Offline Send Email
Sep 2, 2003
11:08 am
1304
... Why? To me this sounds suspiciously like a homework assignment. max_int is in pervasives, you don't even need to preface with Sys.max_int or Int.max_int...
Brian Hurt
brian.hurt@...
Send Email
Sep 2, 2003
2:10 pm
1305
Warning: I'm very new to OCAML. I may need some patience :) Example: type ratio = {num: int; denum: int};; type number = Int of int | Float of float | Error;; ...
vyvepe
Offline Send Email
Sep 3, 2003
3:23 am
1306
I'm just wondering how you can guarantee that certain imperative effects occur, like adding a name into a symbol table hash. I'm writing a compiler whose...
Rafael 'Dido' Sevilla
dido_sevilla
Offline Send Email
Sep 3, 2003
5:32 am
1307
... Hey, records have little to do with variants. And I think that it is quite personal of you to state "The reason that "Int" is constructor and "num" is not...
Stalkern 2
stalkern2
Offline Send Email
Sep 3, 2003
7:50 am
1308
... Well, the : mean "have the type", for example: - in {num: int; denum: int} the num field have the type int - in « val foo : bar » the function foo have...
Remi Vanicat
dl_ens
Offline Send Email
Sep 3, 2003
2:00 pm
1309
Hello, I am a beginners, and I ask for some help When you use Lex, you can use the directive BEGIN for a analyse (ex: expr* [ BEGIN(EXPR); return athing;] ...
Adrien Henriet
adrien_henriet
Offline Send Email
Sep 3, 2003
4:35 pm
1310
I find that I need a mutable, variable-sized Array type. Is there one available, either in the standard library or an external library for OCaml? Rich. -- ...
Richard Jones
rwmjones
Offline Send Email
Sep 3, 2003
5:50 pm
1311
... This is one in the ExtLib that do what you want and does not require a default value. You can get on the CVS from : ...
Nicolas Cannasse
ncannasse
Offline Send Email
Sep 3, 2003
6:27 pm
1312
Markus Mottl wrote something for this called RES. It's here: http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html Issac...
Issac Trotts
issac_trotts
Offline Send Email
Sep 3, 2003
6:29 pm
1313
Great, I like this answer, thanks....
vyvepe
Offline Send Email
Sep 4, 2003
2:14 am
1314
... [...] ... You have been mixing the tokens and the rules, it seems. Read carefully, and reproduce, the ocamllex/ocamlyacc complete example in the manual...
Stalkern 2
stalkern2
Offline Send Email
Sep 4, 2003
6:27 am
1315
... Ok, so, i can't, like with lex, 'send' a token to the parser(ocamlyacc) and continue my parsing with ocamllex like a wrote with : (t)* {ATHING; expr...
adrien_henriet
Offline Send Email
Sep 4, 2003
7:22 am
1316
... If mot, mot2, mot3 are just generic "WORDS", you can't distinguish them at the parsing level (they are lexemes of the same token). I'll suppose that...
Stalkern 2
stalkern2
Offline Send Email
Sep 4, 2003
9:24 am
1317
I'm just wondering how you can guarantee that certain imperative effects occur in an ocamlyacc grammar, like adding a name into a symbol table hash. I'm...
Rafael 'Dido' Sevilla
dido_sevilla
Offline Send Email
Sep 5, 2003
7:47 am
1318
# let fn () = let static_var = ref 0 in let r = !static_var in static_var := !static_var + 1; r;; val fn : unit -> int = <fun> # fn ();; - : int = 0 # fn ();; ...
Richard Jones
rwmjones
Offline Send Email
Sep 5, 2003
9:56 am
1319
... let fn = let static_var = ref 0 in fun () -> let r = !static_var in incr static_var; r ;; val fn : unit -> int = <fun> # fn ();; - : int = 0 # fn ();; - :...
Stefano Zacchiroli
zacchiro
Offline Send Email
Sep 5, 2003
10:04 am
1320
... It is. You just need to put the static_var before the actual arguments of fn (otherwise static_var is part of the closure) # let fn = let static_var = ref...
Boris Yakobowski
Boris.Yakobowski@...
Send Email
Sep 5, 2003
10:07 am
1321
let make_counter init = let counter = ref init in ((fun () -> incr counter), (fun () -> !counter)) let (step, get) = make_counter 0 Using this way, you can...
Martin Jambon
m.jambon@...
Send Email
Sep 5, 2003
11:10 am
1322
The ocaml interpreter is able to get the string representation of arbitrary types. (You can define any type you like, the execute a function that returns that...
Jim Farrand
jynxzero
Offline Send Email
Sep 6, 2003
1:10 am
1323
A different problem relating to the same debugging session as my previous message. :) How can I use the ocaml debugger to debug a program that uses ncurses? I...
Jim Farrand
jynxzero
Offline Send Email
Sep 6, 2003
1:31 am
1324
I am wasting my time now and I just don't see it: Task: I want to parse a datafile containing lines like this: Course|Description|Designer|Email|Phone ...
Johann Spies
jspies@...
Send Email
Sep 6, 2003
2:30 pm
1325
... A lot of information that are available at compile time (such as type) are lost at execution time. The ocaml toplevel is (at the same time) the compiler...
Remi Vanicat
dl_ens
Offline Send Email
Sep 6, 2003
2:36 pm
1326
... Thanks, I'll look into it. ... Don't worry, you won't be inconvenienced, because you are replying to the list and not to me personally. If you were writing...
Jim Farrand
jynxzero
Offline Send Email
Sep 6, 2003
3:53 pm
1327
... One can use http://pauillac.inria.fr/~xleroy/software.html#spamoracle (or spamassain as I do). [...] -- Rémi Vanicat vanicat@... ...
Remi Vanicat
dl_ens
Offline Send Email
Sep 6, 2003
5:15 pm
1328
Without looking too deeply into your problem: ... val hanteer_eposse : string list -> (string * string * string * string) list = <fun> ... kurshuskode and...
Karl Zilles
kzilles
Offline Send Email
Sep 7, 2003
12:09 am
1329
... Just an idea: maybe if you write with english-like identifiers, the ocamlers with mother-tongues different that yours would understand your purposes...
Stalkern 2
stalkern2
Offline Send Email
Sep 7, 2003
1:06 pm
Messages 1300 - 1329 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