From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 61CECBC37 for ; Wed, 10 Feb 2010 23:25:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0BAArBckvRVdrUkGdsb2JhbACDCot6hBuHPwgVAQEBAQkJDAcTAyCvDYF4hGWIcgEBAwWBKoJLWwSLfw X-IronPort-AV: E=Sophos;i="4.49,447,1262559600"; d="scan'208";a="52443339" Received: from mail-bw0-f212.google.com ([209.85.218.212]) by mail1-smtp-roc.national.inria.fr with ESMTP; 10 Feb 2010 23:25:45 +0100 Received: by bwz4 with SMTP id 4so588610bwz.22 for ; Wed, 10 Feb 2010 14:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=DeDqjLH9K5Xj8dgoJpyDhS3zdbo8cKtenNTsz1q7ycw=; b=bt55dZ1lQx0R+SxIMtxM1zl6XSnb/G8o+MB+d9/f4aflK8XTFhie7pHbRHNf6n1FUM iCk4XQqv3c7+rjpUHW9gjHFCPBFI7XXtlP/HjZmiUSjyD7Q7X3VnS7UYvCRs6E/78d0V z0/K69gVlQdFsWsQIYNkKFzXMcwy7eEJ83NMs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=xfJ4f6g99oTK30JwRvfPUn+TIfox7p2wXF/+8qymuH+CjdGF5CmcUXVXJ8YfpzCFiv c6oyjc1Gqr6SI2wf2gOFq7rlB8SjY9STG4o0E49Aoe56oNGl6yAljZEhSMA3ygYeAyKY bFL6pzT8g1Q6x56Qi0dUK5mSK6nFprqtV5fng= MIME-Version: 1.0 Sender: till.varoquaux@gmail.com Received: by 10.204.32.15 with SMTP id a15mr169147bkd.142.1265840744631; Wed, 10 Feb 2010 14:25:44 -0800 (PST) In-Reply-To: References: <1e7471d51002091250of7a686fq537a03c9401c868f@mail.gmail.com> Date: Wed, 10 Feb 2010 17:25:44 -0500 X-Google-Sender-Auth: 6dc3a1743cfdd991 Message-ID: <9d3ec8301002101425k356b92e0p6ca2690d8cd6399d@mail.gmail.com> Subject: Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion From: Till Varoquaux To: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; recursive:01 defintion:01 recursive:01 haskell:01 printf:01 printf:01 beginner's:01 ocaml:01 bug:01 10,:98 .......:98 beginners:01 wrote:01 rec:01 rec:01 On Wed, Feb 10, 2010 at 5:01 PM, Stefan Monnier wrote: >> Wouldn't one of way of detecting a recursive function would be to see >> if the indeed the function calls itself? > > That's what Haskell does, yes. > > Let's make things clear here: the "rec" *really* is a feature; it is very convenient to reuse the same identifier to express something in the process of being built (e.g. something going through a pipeline). For instance: let g () =3D let f s =3D if !debug then Printf.printf "f is called with value: %s\n%!" s f s in ....... Some (including me) would even argue that it is sad that type definitions don't use "rec". Till > =C2=A0 =C2=A0 =C2=A0 =C2=A0Stefan > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >