caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andreas Rossberg <rossberg@ips.cs.tu-bs.de>
To: caml-list@inria.fr
Subject: Restrictions of let rec
Date: Mon, 09 Mar 1998 17:15:57 +0100	[thread overview]
Message-ID: <350415BD.2781E494@ips.cs.tu-bs.de> (raw)

Hello,


working with OCaml I recently found the following (syntactic?)
restriction quite odd. Consider:

  let rec f = f' some_defaul_arg
  and f' v = function ... -> ...f' v' x... | ... -> ...f y... | ...

The compiler argues that "this kind of expression is not allowed with
`let rec'", probably because the RHS of f is neither an abstraction nor
a constructor application nor does f appear in it.

I know it's easy to avoid this by doing eta conversion, but I don't see
the point in disallowing such definitions. What's the rationale? Maybe
it's an oversight and the compiler should actually check whether f
appears on _any_ RHS of the let rec?


	- Andreas





             reply	other threads:[~1998-03-09 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-09 16:15 Andreas Rossberg [this message]
1998-03-09 17:36 Damien Doligez

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=350415BD.2781E494@ips.cs.tu-bs.de \
    --to=rossberg@ips.cs.tu-bs.de \
    --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).