caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven LUTHER <luther@dpt-info.u-strasbg.fr>
To: Arturo Borquez <artboreb@netscape.net>
Cc: Chris Hecker <checker@d6.com>, caml-list@inria.fr
Subject: Re: [Caml-list] eval order and 'and'
Date: Wed, 11 Sep 2002 09:47:53 +0200	[thread overview]
Message-ID: <20020911074753.GA1315@iliana> (raw)
In-Reply-To: <57C8A9DF.126A17DD.00958B05@netscape.net>

On Wed, Sep 11, 2002 at 01:05:46AM -0400, Arturo Borquez wrote:
> Chris Hecker <checker@d6.com> wrote:
> 
> >
> >Does "let a and b in" guarantee a is evaluated before b, like "let a in let 
> >b in" does?
> >
> Sorry but I don't understand the purpose of your question.
> If a and b are functions with 'related side effects' the secure
> way should be the later ('let a in let b ..'), otherwise
> the order of evaluation in the first case is irrelevant
> as a and b are two unrelated functions (with no side effects),
> or 'let a and b in ..' is the same as 'let b and a in ..' 

So he can do things like :

if x <> 0 and 1 / x ... 

like it is possible to do in C, instead of doing :

if x <> 0 then if 1 / x ...

which gives more lines of code, and needs to redefine two time the else
condition.

Anyway, i don't think the order is defined, but in any case, i guess
it would be revere sequential if anything (execution starts from the
right).

But then again, it could be different in bytecode and in native code.

Friendly,

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2002-09-11  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-11  5:05 Arturo Borquez
2002-09-11  7:19 ` Chris Hecker
2002-09-11  7:47 ` Sven LUTHER [this message]
2002-09-11  8:32   ` Hendrik Tews
  -- strict thread matches above, loose matches on Subject: below --
2002-09-11  1:21 Chris Hecker
2002-09-11  7:30 ` malc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020911074753.GA1315@iliana \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=artboreb@netscape.net \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).