Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function definition with multiple patterns in multiple equations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] Function definition with multiple patterns in multiple equations
John Prevost wrote:
> 
> I still feel it may be a better choice, since in SML you can write:
> 
> fun foo a b = e1 a b
>   | foo c   = e1 c

No, you can't. All function rules must have the same number of argument
patterns.

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

"Computer games don't affect kids; I mean if Pac Man affected us
 as kids, we would all be running around in darkened rooms, munching
 magic pills, and listening to repetitive electronic music."
 - Kristian Wilson, Nintendo Inc.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr