caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Prevost <prevost@maya.com>
To: Damien Doligez <Damien.Doligez@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: Why is this not allowed?
Date: 02 Dec 1999 13:40:44 -0500	[thread overview]
Message-ID: <87n1rtb2z7.fsf@isil.maya.com> (raw)
In-Reply-To: Damien Doligez's message of "Thu, 2 Dec 1999 12:13:32 +0100"

Damien Doligez <Damien.Doligez@inria.fr> writes:

> ># let rec id'' = id;;
> >This kind of expression is not allowed as right-hand side of `let rec'
> 
> Because we don't know how to compile "let rec x = x" or
>   let rec x = y
>   and y = x
> 
> Moreover, you can just remove the "rec" and it works.  It is possible
> to implement "let rec var1 = var2", but the usefulness is quite small
> compared to the amount of code we would need to write.

Well, you can't quite.  Because of the value restriction, id'' defined
like this:

let id'' = id;;

has type:

id'' : '_a -> '_a

(That is, it'll only work for a single type.)

John.




  reply	other threads:[~1999-12-03 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-02 11:13 Damien Doligez
1999-12-02 18:40 ` John Prevost [this message]
1999-12-03 13:50   ` Pierre Weis
  -- strict thread matches above, loose matches on Subject: below --
1999-11-30 16:07 Claudio Sacerdoti Coen

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=87n1rtb2z7.fsf@isil.maya.com \
    --to=prevost@maya.com \
    --cc=Damien.Doligez@inria.fr \
    --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).