Re: [pure-lang-users] Proposed syntax changes
Status: Beta
Brought to you by:
agraef
From: Eddie R. <er...@bm...> - 2008-08-15 14:09:27
|
On Fri, 2008-08-15 at 15:52 +0200, Albert Graef wrote: > Eddie Rucker wrote: > >> 1 2 3 > > Hey Libor, that's cute! Tain't thought of that one. But, ... How do you > > get at the elements? > > That's easy: > > > f x = a [] x with a xs (x@_ y) = a (y:xs) x; a xs x = x:xs end; > > f (1 2 3 4); > [1,2,3,4] > > > Would be nice if we could have something like [1 2 3 4] > > That would wreak havoc on the Pure grammar. But the above hack should do > the trick as long as the first element can't be mistaken for a closure. Understood about the havoc on the pure grammar. I thought you had something very useful for me for a second. However, > f x = a [] x with a xs (x@_ y) = a (y:xs) x; a xs x = x:xs end; > let k = f (); when I highlight a sequence of numbers vertically from an openoffice spreadsheet and middle click in the () I get > let k = f ();34 > 56 > 78 > 34 > 56 > 12 And when I highlight a sequence of numbers horizontally from an openoffice spreadsheet and middle click in the () I get > let k = f();34122334 Note quite what I was looking for but don't worry about it and be happy ;-) e.r. |