From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA12865 for caml-redistribution; Mon, 9 Mar 1998 17:33:22 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA28671 for ; Mon, 9 Mar 1998 17:16:07 +0100 (MET) Received: from infbssys.ips.cs.tu-bs.de (root@infbssys.ips.cs.tu-bs.de [134.169.32.1]) by nez-perce.inria.fr (8.8.7/8.8.5) with ESMTP id RAA14107 for ; Mon, 9 Mar 1998 17:16:05 +0100 (MET) Received: from infbsstx (rossberg@infbsstx.ips.cs.tu-bs.de [134.169.32.76]) by infbssys.ips.cs.tu-bs.de with SMTP id RAA20194 (8.8.8/IDA-1.6); Mon, 9 Mar 1998 17:16:01 +0100 Sender: weis Message-ID: <350415BD.2781E494@ips.cs.tu-bs.de> Date: Mon, 09 Mar 1998 17:15:57 +0100 From: Andreas Rossberg Organization: Inst. f. Programmiersprachen u. Informationssysteme, Abt. Softwaretechnologie, TU Braunschweig X-Mailer: Mozilla 3.03 (X11; I; SunOS 4.1.4 sun4m) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Restrictions of let rec Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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