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
Re: Syntax for label
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-04-02 (21:47)
From: Christophe Raffalli <Christophe.Raffalli@u...>
Subject: Re: Semantic of label: The best (only ?) solution to merge both mode

> Now, the commuting label mode is just for those who are ready
> to change a bit their habits.
> And since it is my personal creation (with others), I will just
> refrain from explaining why it is so wonderfully clean theoretically.

Ok keep two modes if you want ...

Let's only talk about the modern mode !

I wanted to really use commuting labels, I was ready to change my habit,
but I found them to restrictive. I find my proposal, which is just to
change a bit the semantics of function application (and nothing else) on
non-labelled arguments quite nice and useful (no need to always remember
all the label names if you prefer to remember the order of the

As my proposal only cost to change about 20 lines why not have an option
to the modern mode to let people try it for real and see what they think

About the "so wonderfully clean theoretically" .. it is not so clear:
look at this example:

> lama-d134:~> ocaml -modern
>         Objective Caml version 2.99 (99/12/08)
> # let h f = f x:1 y:2;;
> val h : (x:int -> y:int -> 'a) -> 'a = <fun>
> # let h f = f y:1 x:2;;
> val h : (y:int -> x:int -> 'a) -> 'a =
> <fun>                                                    
> The infered type depends on the way you write thing while one could think 
> they are equivalent (the labels commute in modern mode, don't they ?)
I could live with this kind of problem ... but in the current version
labels are more painful than useful in modern mode (this is my opinion)

Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42