Is there a way to get module abbreviations in .mli files? In my .ml files, I frequently do something like this: module Foo = Really_long_verbose_module_name ...
... Well, I didn't forget it... I'll try to explain In a stream like [< 'element1; element2; element3 = a_parser >], element1 is a real token, preceded by a...
... Let's say that in Rémi's grammar E --> E+E E --> E*E E --> (E) E --> i Now, let's eliminate left recursion. The rule that I know says: given rules of the...
... well, in fact, the way i write LL parser, i first remove the priority problem: 2+3 * 4 can be see as (2+3) * 4 or 2 + (3*4) by this parser. Arg, there is a...
... So, we start with E --> E+E E --> E*E E --> (E) E --> i Now, every expression is analysed as if the elements with the highest priority were the stones that...
... MM, yes of course. The fact is that with expression, there is the problem of associativity : E --> A A --> A + A A --> B B --> B * B B --> C C --> (E) C...
... level A) to be a stone of a level with higher priority (level T). This means that in 2 + 3 + 4 2 is detected to be a F that is a T (a stone with higher...
Hello OCamlers... do you know of any library function that enables me to get a sublist out of a list? Unfortunately I couldn't find any function in the List ...
Christian Schaller
Christian.Schaller@...
Apr 4, 2002 6:50 pm
225
... You may make a bug report if you really believe this should be done. ... It's better to stick to caml, it's enough effective for that (and most function of...
Sorry, me again ;-) after playing around some more time with OCaml, I'm wondering how to read from a file in a "good" manner with OCaml. Mostly when reading a...
Christian Schaller
Christian.Schaller@...
Apr 4, 2002 8:41 pm
227
... Yes it should... ... Yes. But the way of making the separation may differ. And most often you read a file, parse it and then use the ... An exception is...
... I think so, BUT you're using a list as an Array when you manipulate items according to their ABSOLUTE position. In a "list" the ABSOLUTE position is...
... In O'Caml it is relatively simple to control the evaluation order of functional code, so this has lower priority than for other functional languages. I...
Gerd Stolpmann
info@...
Apr 5, 2002 3:35 pm
230
... Not so bad :) ... You can have a functionnal version of your function : let rec read_lines func ch = try let line = func (input_line ch) in ...
I am looking at Xavier Leroy's recently released cryptokit as an example of OOP using OCaml. I'm interested in why OOP was chosen for the cryptokit, and...
... It seem that there is problem with your installation of labltk or tcl/tk. For some unknown reason it doesn't find one of the function of the tcl library :...
The problem was in finding the libraries, which I fixed (it's a FreeBSD-specific problem and is documented in the Makefile.config, so I feel like an idiot). I...
I am trying to understand the use of type 'a option = None | Some of 'a ... # let somtotaal x y = match x y with ... val somtotaal : ('a -> int option * int...
Johann Spies
jspies@...
Apr 16, 2002 4:22 pm
237
(I consider myself a beginner too, so take all this with a grain of salt. Corrections are welcome.) ... Have a look at the type of your function, it is clearly...
Henrik Motakef
henrik.motakef@...
Apr 16, 2002 5:19 pm
238
Le Tue, 16 Apr 2002 17:05:31 +0200 ... Look closely at the printed type : ocaml "thinks", according to your code, that x is a function and that match x y with...
Michel Quercia
michel.quercia@...
Apr 16, 2002 5:44 pm
239
... let is_empty = function | "" -> true | _ -> false will work just fine ( constant strings can be matched as well as constant ints or other constant complex...
... Some others have answered this question pretty well, but I thought I'd follow up with an interesting variant, using optional arguments: # let sometotal...
I am trying to use functors to abstract out portions of my code. But I quickly ran into a problem. The following gives the flavor of it: module type HANDLER...
Thank you everybody who replied. This list is indeed a wonderful help! Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie,...
Johann Spies
jspies@...
Apr 18, 2002 2:02 am
243
I think I don't see the problem, but I'd like to understand. What exactly is wrong with this? module type HANDLER = sig type t val upcall : t -> unit end ...