Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Christophe Raffalli <Christophe.Raffalli@u...>
Subject: Re: Semantic of label: The best (only ?) solution to merge both mode
A small mistake:

f a     means a is the argument corresponding to the first non
optionnal    
        argument of f WHICH IS NOT GIVEN LATER WITH AN EXPLICIT LABEL !

Another precision: the restriction on types is just to make the
implementation possible:

When compiling f a1 ... an, 

If f has type (l:t -> t') one can first look for an argument with the
label l (this is done like this by moderne mode) and if not found and if
l is not optionnal, one can take the first argument (that's the new
part). 

If f has type (t -> t') there is no more labeled argument (because of
the restriction) and one can take the first argument.

Given the restriction, this coresponds to the semantics I gave. Without
the restriction, it is a bit messy ! 



-- 
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
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI