Version française
Home     About     Download     Resources     Contact us    
Browse thread
Immediate recursive functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christian Szegedy <szegedy@t...>
Subject: Re: [Caml-list] Immediate recursive functions
Alex Baretta wrote:

> I sometimes feel the need for a mu operator. I'm thinking of something 
> like the following:
>
> # (rec f x -> if x <= 0 then 1 else x * (f (pred x))) 5
> - : int = 120
>
> as opposed to
>
> (let rec f x = if x <= 0 then 1 else x * (f (pred x)) in f) 5
> - : int = 120

Feel free to write your CamlP4 extension ;)