English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Patterns that evaluate
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-02-14 (21:11)
From: Jacques Carette <carette@m...>
Subject: Re: [Caml-list] Patterns that evaluate
Nathaniel Gray wrote:
> On 2/13/07, Jacques Carette <carette@mcmaster.ca> wrote:
>> So I wrote (in part):
>> let buildsimp cast e f1 f2 = fun e1 -> fun e2 -> match (e1,e2) with
>>                                                  | ({st = Some e}, _) 
>> -> e2
>> and I expected it to work.  Only a code review by a colleague 'found'
>> this bug in my code.
> I guess I'm not seeing it.  How did you expect it to work?  Is this
> what you mean:
> ... | ({st = Some v}, _) when v = e -> e2
Yes. that is what I meant.

> Is there some functionality that you're looking for that when clauses
> don't provide?
No, there is not.  I was just (mistakenly) assuming that the "more 
pleasant" syntax for this ``worked''.

Explanation: when I was a language designer, I learned a lot from user 
'mistakes' like this.  Such mistakes told me of the mismatch between 
user expectations and current reality.  So I try to take the time to 
document my own 'mistakes'. 
Philosophy: if I don't take the time to give feedback, why should I 
expect users of my own work to be any different?


PS: there is no real functionality that I am looking for that Turing 
Machines don't provide (or C or Java or ...).  And yet I prefer 
languages like (Meta)OCaml and Haskell.  The "raw functionality" 
argument does not seem to be the optimal way to look at these issues, IMHO.