Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocaml and named constants
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] ocaml and named constants
Xavier Leroy wrote:
 
> > I ask because it seems odd that camlp4 includes
> > a feature for creating real defined constants that are textually
> > substituted before compilation begins.
> 
> One motivation for this is to be able to put named constants in
> patterns, e.g.
> 
>      match get_next_byte() with
>        mpg_joint_stereo -> ...
>      | mpg_78rpm -> ...
>      | _ -> ...
> 
> which cannot be done in plain ML.

	Is there any semantic reason why
one cannot use variables, or even expressions? Apart from
the obvious syntactic problem.

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr