List Info

Thread: "ocaml_beginners"::[] range list with step parameter




"ocaml_beginners"::[] range list with step parameter
user name
2006-08-26 12:24:58
On Aug 26, 2006, at 3:20 AM, LORENZO wrote:

> let output elem = Printf.printf "%d " elem
in
>   let a = int_of_string Sys.argv.(1)
>   and b = int_of_string Sys.argv.(2) in
>       List.iter  output (range a b c);;

Is there a particular advantage to using let above as
opposed to  
another let ... in?

--
http://wagerlabs.com/







Archives up to August 22, 2005 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
The archives of the very official ocaml list (the seniors'
one) can be found at http://caml.inria.fr
Attachments are banned and you're asked to be polite, avoid
flames etc. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http:/
/groups.yahoo.com/group/ocaml_beginners/

<*> To unsubscribe from this group, send an email to:
    ocaml_beginners-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 


"ocaml_beginners"::[] range list with step parameter
user name
2006-08-26 12:32:54
> > let output elem = Printf.printf "%d "
elem in
> >   let a = int_of_string Sys.argv.(1)
> >   and b = int_of_string Sys.argv.(2) in
> >       List.iter  output (range a b c);;
>
> Is there a particular advantage to using let above as
opposed to
> another let ... in?

Not that I know of. It may let the compiler optimise it
somehow, as
the evaluation order of the bindings is now decided by the
compiler.

When evaluation order matters, you must use let .. in let
... in
rather than let .. and ... in.

Jonathan


Archives up to August 22, 2005 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
The archives of the very official ocaml list (the seniors'
one) can be found at http://caml.inria.fr
Attachments are banned and you're asked to be polite, avoid
flames etc. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http:/
/groups.yahoo.com/group/ocaml_beginners/

<*> To unsubscribe from this group, send an email to:
    ocaml_beginners-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 



[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )