Oh, then I misinterpreted the page (or someone misinterpreted Haskell)
/ Martin Nilsson (ja till euro, nej till cent)
Previous text:
2003-09-04 00:24: Subject: Re: Language comparisions
It would be an this_function() or a magic variable this_function. No, I don't know what it should be used for.
That sounds more like FORTH's "SELF" than Haskell's "id". Haskell's "id" can be defined in Pike as
mixed id(mixed x) { return x; }
array a = ({ 1,3,5,7 }); array b = ({ 2,4,6,8 }); Array.zip(a,b); ({1,2,3,4,5,6,7,8});
To work like in Haskell, it should give ({({1,2}),({3,4}),({5,6}),({7,8})}) The inner things should really be pairs (2-tuples), but since we don't have that...
Prelude> zip [1,3,5,7] [2,4,7,8] [(1,2),(3,4),(5,7),(7,8)] Prelude>
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)