Version française
Home     About     Download     Resources     Contact us    
Browse thread
OCaml troll on Slashdot
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] OCaml troll on Slashdot
On Thu, Mar 17, 2005 at 10:06:45AM -0800, brogoff wrote:
[...]
> Also, as I state above, the number is arbitrary, and having OCaml choke at some
> particular size rather than letting me use large lists violates that least
> surprise principle. I had an offline discussion recently with another caml-list
> person in which he told me that he wished OCaml used Bignums instead of int's
> by default. I disagree, but I don't think it's a dumb idea. The behavior of
> the standard List functions is worse IMO. Maybe the standard Lisp.map should be
> named List.unsafe_map (1/2 :-))?


Well, or call
ocaml ocaml_unsafe,
ocamlc ocamlc_unsafe
ocamlopt ocamlopt_unsafe
as long as they are not able to convert simple-recursive
programs into tail-recursive programs (per default or
per cli-option or at all).


> 
> I realize that this problem can be coded around, sometimes with better data
> structures, or by the double reversing approach (which is what I used to use)
> but my own sense of programming language aesthetics is that this is a flaw, or
> at least a hole in the language that should be filled one day.

M aybe one day, the cli-switch "-tailrec-all" or "-force-tailrec"
will automatically convert all functions that aren't tailrec
into tailrec ones.
Or maybe a pragma (something like in _inline_)
will be used to convert certain functions
into it's tailrec counterpart internally (maybe only
when a switch "-tailrec-by-pragma" is set).


Ciao,
   Oliver