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 OAA17510 for caml-redistribution; Fri, 3 Dec 1999 14:53:31 +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 TAA07377 for ; Thu, 2 Dec 1999 19:49:22 +0100 (MET) Received: from isil.maya.com (isil.maya.com [192.70.254.5]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA29510; Thu, 2 Dec 1999 19:49:19 +0100 (MET) Received: (from prevost@localhost) by isil.maya.com (8.9.3/8.9.3) id NAA12183; Thu, 2 Dec 1999 13:40:44 -0500 Sender: weis To: Damien Doligez Cc: caml-list@inria.fr Subject: Re: Why is this not allowed? References: <199912021113.MAA11254@tobago.inria.fr> From: John Prevost Date: 02 Dec 1999 13:40:44 -0500 In-Reply-To: Damien Doligez's message of "Thu, 2 Dec 1999 12:13:32 +0100" Message-ID: <87n1rtb2z7.fsf@isil.maya.com> User-Agent: Gnus/5.070099 (Pterodactyl Gnus v0.99) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Damien Doligez 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.