caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "'Ashish Agarwal'" <agarwal1975@gmail.com>,
	"'Ben Aurel'" <ben.aurel@gmail.com>
Cc: <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] how to print (or cast) an integer
Date: Wed, 6 Aug 2008 19:34:59 +0100	[thread overview]
Message-ID: <224EBB28F6FD486C85129EB4B644EAEE@countertenor> (raw)
In-Reply-To: <d8be5ae20808060738u563dd2ctb2aa8e83579f2e51@mail.gmail.com>

> Also note you do not need "and". That is only required when the variables
> being defined are mutually recursive. It would be better style to write:
> 
> let x = 1;;
> let y = 2;;

The style aspect of your comment is a definite matter of opinion![*]

Given that this is a beginner question, it's probably worth clarifying that
in the context of "let .. and .. ;;" or "let .. and .. in ..;;" the "and" is
a shorthand allowing you to group multiple lets together without introducing
a new environment.

"and" only provides mutually recursive definitions in a "let rec" statement.


David



[*] I personally find it neater to group a series of definitions at the same
level using "let .. and .. in" and only use let again for nested definitions
but that's because I indent code after an "in" but I think that my indenting
scheme is somewhat less common...


      reply	other threads:[~2008-08-06 18:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 14:08 Ben Aurel
2008-08-06 14:13 ` [Caml-list] " Andrew Gacek
2008-08-06 14:38 ` Ashish Agarwal
2008-08-06 18:34   ` David Allsopp [this message]

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=224EBB28F6FD486C85129EB4B644EAEE@countertenor \
    --to=dra-news@metastack.com \
    --cc=agarwal1975@gmail.com \
    --cc=ben.aurel@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /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).