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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Poly variants
On Sat, 2004-12-18 at 06:05, Christophe TROESTLER wrote:
> On Fri, 17 Dec 2004, Tiago Dionizio <tngd81@gmail.com> wrote:
> > 
> > On Fri, 17 Dec 2004 19:24:13 +0100 (CET), Christophe TROESTLER
> > <Christophe.Troestler@umh.ac.be> wrote:
> > > Hi,
> > > 
> > >         Objective Caml version 3.08.2
> > > # `a;;
> > > - : [> `a ] = `a
> > > 
> > > Is the lack of capitalisation in the tag-name really wanted?
> > 
> > Note on variant tags: the current implementation accepts lowercase
> > variant tags in addition to uppercase variant tags, but we suggest you
> > avoid lowercase variant tags for portability and compatibility with
> > future OCaml versions.
> 
> Thanks, I read too fast ;) -- hopefully this will be removed soon.

Why? Capitalisation is a really nasty hack, to get around
the lack of characters in the ASCII character set.

The idea is also seriously incompatible with
an i18n version of Ocaml, which should follow
ISO Standards with respect to acceptable identifiers:
these include letters from many human languages,
some of which lack any concept of capitalisation.

I went to some trouble in Felix to avoid this bug.
All 'names' can use any 'unicode' letter.
There is a price -- in Felix patterns you can see

	match x with | ctor ?v => ...

a ? is needed to distinguish variables from
constructors.

Polymorphic variants use lead ` character, so don't suffer
from this capitalisation hack.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net