caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Teller <David.Teller@univ-orleans.fr>
To: malc <av1474@comtv.ru>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Optional arguments
Date: Sun, 09 Nov 2008 20:51:44 +0100	[thread overview]
Message-ID: <1226260304.6585.16.camel@Blefuscu> (raw)
In-Reply-To: <Pine.LNX.4.64.0811092215570.8870@linmac.oyster.ru>

What were you expecting?

Your definition of [a] always passes argument [i] to [b], so the default
value is never used.

Cheers,
 David

On Sun, 2008-11-09 at 22:17 +0300, malc wrote:
> Objective Caml version 3.10.0
> 
> # let a i = let b ?(i=i mod 3) () = i in b ~i ();;
> val a : int -> int = <fun>
> # for i = 0 to 5 do print_int (a i); done;;
> 012345- : unit = ()
> 
> Is this something to be expected? Or perhaps something which calls
> for an upgrade?
> 
-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act brings liquidations. 


  reply	other threads:[~2008-11-09 19:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-09 19:17 malc
2008-11-09 19:51 ` David Teller [this message]
2008-11-10 20:52   ` [Caml-list] " malc
  -- strict thread matches above, loose matches on Subject: below --
2003-11-17  8:52 [Caml-list] optional arguments Selentek 24331-03
2003-11-17 10:13 ` Richard Jones
2003-11-17 10:44   ` Selentek 24331-03
2003-11-17 10:13 ` Artem Prisyznuk
2003-11-17 17:24 ` Brian Hurt

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=1226260304.6585.16.camel@Blefuscu \
    --to=david.teller@univ-orleans.fr \
    --cc=av1474@comtv.ru \
    --cc=caml-list@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).