Browse thread
Immediate recursive functions
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Alex Baretta <alex@b...> |
| Subject: | Re: [Caml-list] Immediate recursive functions |
Christian Szegedy wrote: > 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 ;) I have had a short love story with Camlp4, but I find it's syntax far too wild to be worth learning. Hence, I abandoned camlp4 except for its ocpp incarnation with its quotation expansion support. I have written a short patch to parsing/parser.mly to support my syntax, but I am unable to get anything sensible out of it. I'll look more into this problem and post the patch if I manage to figure things out. Alex -- ********************************************************************* http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. +39 02 370 111 55 fax. +39 02 370 111 54 Our technology: The Application System/Xcaml (AS/Xcaml) <http://www.asxcaml.org/> The FreerP Project <http://www.freerp.org/>