caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: William Lovas <wlovas@stwing.upenn.edu>
To: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] baffled by semicolon
Date: Sun, 29 Aug 2004 00:45:36 -0400	[thread overview]
Message-ID: <20040829044535.GA21833@force.stwing.upenn.edu> (raw)
In-Reply-To: <16685.28589.807412.69960@soggy.deldotd.com>

On Wed, Aug 25, 2004 at 10:05:49PM -0700, briand@aracnet.com wrote:
> [...]
> However your response woke up some neurons - why wouldn't it be :
> 
>   let w = (area#misc#realize ()); area#misc#window ;;

... and the easy way to remember the reason it parses this way is to recall
that O'Caml is a *function*al language, so *function* application binds
most tightly. :)  So in ``area#misc#realize (); area#mist#window'', the
application of ``area#misc#realize'' -- and not the `;' --  gets the ().
It's the same as with things like ``f x + g 3'' (= ``(f x) + (g 3)'', not
``f (x + g) 3'', or any other weird thing like that).

Hope this helps.

cheers,
William

-------------------
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


  reply	other threads:[~2004-08-29  4:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-26  3:22 briand
2004-08-26  3:30 ` David Brown
2004-08-26  4:18 ` Alex Valdez
2004-08-26  5:05   ` briand
2004-08-29  4:45     ` William Lovas [this message]
2004-08-30  7:12 ` Baffeld by manual (Was: [Caml-list] baffled by semicolon) Florian Hars
2004-08-30  8:06   ` skaller
2004-08-30  8:23     ` Radu Grigore
2004-08-30  8:25     ` Ville-Pertti Keinonen
2004-08-30 11:07       ` skaller

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=20040829044535.GA21833@force.stwing.upenn.edu \
    --to=wlovas@stwing.upenn.edu \
    --cc=caml-list@pauillac.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).