... It was a problem of localization, I solve it exporting the variable LC_ALL=C in /etc/profile.d. "LC_ALL" refers to all localization variables, "C"...
krl
pleasecontactus@...
Apr 2, 2004 2:52 pm
1803
Hello, I'm learning OCaml by writting small toy programs. Maybe you can give me some stilistical advice on a piece of code: how can it be made more...
... There is no standard function because this is easily achieved using the List iterators: let list_count elem list = List.fold_left (fun count el -> if el ==...
... ;; They way I got used to write embedded recursive functions was to always use pattern matching. In this case its no difference but as soon as you have 3 ...
... ^^ In general, I prefer to use = and <> rather than == and != in order to avoid some problems such as the following: # 1 == 1;; - : bool = true ... but: #...
... Some additional recommendation beyond the others already made to the list... 1) The nested function 'get_digit_list_rec' is probably no more deserving of...
... Just to add my grain of salt: I think, the Invalid_argument exception should be used. I would also rename the [s] variable to [acc] to make its purpose...
Christophe TROESTLER
Christophe.Troestler@...
Apr 4, 2004 2:07 pm
1809
Does anyone know of some good sites to help me with E-Machines? thanks!...
Hello, folks-- I'm thinking I might like to use the Format module from the standard lib, but I'm having trouble understanding how to work with it (and probably...
... Well, I'm interested in it too. I've tried some things with the format module and after that experiments I thought: Seems like there is an implementation...
oliver@...
Apr 5, 2004 11:34 pm
1812
(Apologies if this is a repost, but another message I sent after this has already appeared on the list, and this hasn't, so I'm resending) Hello, all-- I...
Hello, all-- I wonder if anyone can explain the rationale (or provide examples) for Stream.from taking a function of type "int -> 'a option"? I don't really ...
... [...] The result of the Stream.count is the argument that will be given to the function you called with Stream.next. So if you may read the n-th value out...
oliver@...
Apr 6, 2004 9:40 am
1815
On Mon, 5 Apr 2004, Matt Gushee wrote:
> Hello, folks--
>
> I'm thinking I might like to use the Format module from the standard
> lib, but I'm having trouble...
Maybe IoXML is a good example, because it outputs XML, which requires nested boxes to get a nice indentation: http://pauillac.inria.fr/~ddr/IoXML/ftp/ Martin...
Thanks to all for your comments. ... It seems there was a recent trend to move from assertions to exceptions. While assertions where known since Turing and...
Dear Camlists, It's a pleasure to announce the first public release of NAB (Network in a Box). NAB is a network simulator targeted at wireless ad hoc and...
... 1) OCaml's assert is just a little more than raising an exception, with the possibility to turn it off when compiled with the -noassert option. 2) In the...
Is assert a new feature? I didn't found anythinbg about assert... Ciao, Oliver...
oliver@...
Apr 6, 2004 3:12 pm
1821
Le mardi 06 avril, à 16h30 +0200, ... Not really (at least, I always saw it in ocaml), but the manual references it only in the "language extensions" chapter ...
... OK, but how to use it? There is no Assert-module nor is it directly usable. Does this feature needs camlp4 like the streams-extensions? Ciao, Oliver...
oliver@...
Apr 6, 2004 11:41 pm
1823
... It is usable like this: (* Ordinary toplevel with only Pervasives loaded *) # let x = -5;; val x : int = -5 # assert (x >= 0);; Exception: Assert_failure...
... Thank you! It looks like a good example to learn from--and it happens to be quite close to the real-world use I have in mind, so probably I can glean...
... Oh, is that all? I was imagining something much more esoteric ... I like to make things complicated. Thanks for clearing up my confusion. -- Matt Gushee...
... ==========================> $ ocaml Objective Caml version 3.04 Findlib has been successfully loaded. Additional directives: #require "package";; to...
oliver@...
Apr 7, 2004 12:00 pm
1827
I have a function defined: let plot ?(labels = string_of_int) graph = (* ... *) The idea of the optional 'labels' argument is to specify a polymorphic function...
... i'm not a professional typer, but wouldn't that be unsafe? according to the polymorphic type above, it would be authorized to do: plot 3.0 yet of course...
... The 'a types should be the same. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving...
... so if i understand you , you would want the compiler to refuse plot 3.0 because 3.0 is not an int? in that case the compiler would be contradicting itself...
... Hi Rich! I do not think you can initialize it then -- which make the optionality of the argument void of course. The better is then IMHO to define a...