Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
compilation of lablgl examples.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-02-08 (18:50)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: compilation of lablgl examples.
From: John Max Skaller <>

[See John's post for his detailed expample]
> I.e., polymorphic variants are more useful for prototyping,
> since types do not need to be declared before writing
> algorithms, yet the declarations can still be added later
> when the design is solider to check just how solid it really is.
> At least, this is my expectation. For example, an 'expression'
> type can be defined to include BOTH 'string name' and
> 'name as integer index into symbol table', allowing
> a single routine 'print expression', while it is still
> possible to give a type for 'expression not containing
> any string names' (to be used after all the names are bound).

Well, theoretically yes, but do not forget that early type-checking
plays a great role in making prototyping faster.
Using polymorphic variants partly disables that, by delaying the check
until the call point. This means that you may have a harder to
understand where errors come from.

I suggest you first check the concept on a small example before going
for a full-fledge interpreter.
By the way, I've wrote a paper (almost) on this subject.
See it at


Jacques Garrigue
Jacques Garrigue      Kyoto University     garrigue at
		<A HREF=>JG</A>