English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Why are type functions postfix?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-23 (12:42)
From: Sven LUTHER <luther@d...>
Subject: Re: [Caml-list] Why are type functions postfix?
On Fri, Aug 23, 2002 at 11:24:04AM +0200, Xavier Leroy wrote:
> > In OCAML and other ML dialects I've used, you say:
> > 
> >    let x: int ref = ref 3
> > 
> > Is there any reason that type functions like the first "ref" are
> > postfix, unlike function application like the second "ref" that is
> > prefix?
> I think it's mostly historical: the original LCF ML used the postfix
> syntax, and this syntax was kept in SML as well as in Caml.

Is it not because in the type notation, int ref is similar to int list,
while in the function application, ref 3 is similar to a constructor
application like Some 3 for example ?

Or are you saying that even this kind of notations come from the
original LCF ML ?


Sven Luther
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners