caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive  function defintion
@ 2010-02-16 16:47 Grant Rettke
  2010-02-16 18:08 ` Jon Harrop
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Rettke @ 2010-02-16 16:47 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: Stefan Monnier, caml-list

On Tue, Feb 16, 2010 at 10:21 AM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
> let rec

Do OCaml'er look at let rec more as being a message to the programmer,
rather than the compiler, that the way I want to define this function
is recursively so even if 'f' was previously bound you know which one
I mean?

Considering the language allows mutation, I feel like it is more for
humans than the compiler, but of course, the compiler must be told,
too.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive  function defintion
  2010-02-16 16:47 WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion Grant Rettke
@ 2010-02-16 18:08 ` Jon Harrop
  2010-02-17 17:09   ` Andrej Bauer
  2010-05-29 21:27   ` Grant Rettke
  0 siblings, 2 replies; 5+ messages in thread
From: Jon Harrop @ 2010-02-16 18:08 UTC (permalink / raw)
  To: caml-list

On Tuesday 16 February 2010 16:47:03 Grant Rettke wrote:
> On Tue, Feb 16, 2010 at 10:21 AM, Ashish Agarwal <agarwal1975@gmail.com> 
wrote:
> > let rec
>
> Do OCaml'er look at let rec more as being a message to the programmer,
> rather than the compiler, that the way I want to define this function
> is recursively so even if 'f' was previously bound you know which one
> I mean?

I see it as resolving an ambiguity for both the programmer and compiler. There 
are alternatives as others have mentioned but none seem particularly good or 
bad to me. Moreover, the burden of "rec" is tiny so I don't think it is worth 
discussing in such detail.

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive  function defintion
  2010-02-16 18:08 ` Jon Harrop
@ 2010-02-17 17:09   ` Andrej Bauer
  2010-05-29 21:27     ` Grant Rettke
  2010-05-29 21:27   ` Grant Rettke
  1 sibling, 1 reply; 5+ messages in thread
From: Andrej Bauer @ 2010-02-17 17:09 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

>Moreover, the burden of "rec" is tiny so I don't think it is worth
>discussing in such detail.

Ah, but you are forgetting Wadler's Law.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive  function defintion
  2010-02-16 18:08 ` Jon Harrop
  2010-02-17 17:09   ` Andrej Bauer
@ 2010-05-29 21:27   ` Grant Rettke
  1 sibling, 0 replies; 5+ messages in thread
From: Grant Rettke @ 2010-05-29 21:27 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

On Tue, Feb 16, 2010 at 1:08 PM, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Tuesday 16 February 2010 16:47:03 Grant Rettke wrote:
>> On Tue, Feb 16, 2010 at 10:21 AM, Ashish Agarwal <agarwal1975@gmail.com>
> wrote:
>> > let rec
>>
>> Do OCaml'er look at let rec more as being a message to the programmer,
>> rather than the compiler, that the way I want to define this function
>> is recursively so even if 'f' was previously bound you know which one
>> I mean?
>
> I see it as resolving an ambiguity for both the programmer and compiler. There
> are alternatives as others have mentioned but none seem particularly good or
> bad to me. Moreover, the burden of "rec" is tiny so I don't think it is worth
> discussing in such detail.

It wasn't about the "burden" of having to type 4 extra characters;
rather I was trying to understand the philosophy behind the langguage.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive  function defintion
  2010-02-17 17:09   ` Andrej Bauer
@ 2010-05-29 21:27     ` Grant Rettke
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Rettke @ 2010-05-29 21:27 UTC (permalink / raw)
  To: Andrej Bauer; +Cc: Jon Harrop, caml-list

On Wed, Feb 17, 2010 at 12:09 PM, Andrej Bauer <andrej.bauer@andrej.com> wrote:
>>Moreover, the burden of "rec" is tiny so I don't think it is worth
>>discussing in such detail.
>
> Ah, but you are forgetting Wadler's Law.

You mean this:

" Wadler's Law:
       The emotional intensity of debate on a language feature
       increases as one moves down the following scale:
           Semantics,
           Syntax,
           Lexical syntax,
           Comments."?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-29 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-16 16:47 WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion Grant Rettke
2010-02-16 18:08 ` Jon Harrop
2010-02-17 17:09   ` Andrej Bauer
2010-05-29 21:27     ` Grant Rettke
2010-05-29 21:27   ` Grant Rettke

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).