From: Reuben T. <rr...@sc...> - 2004-02-14 13:29:13
|
> On Saturday 07 February 2004 23:15, Jamie Webb wrote: > > Well, Reuben already has zip = unzip = transpose. Maybe there's an argument > > for having foldl = reduce, map = foreach, etc. > > Actually, map = transform is probably better, following C++. I'd rather reduce the number of names if possible. I had zip = unzip = transpose because I thought that it was unlikely that programmers used to zip and unzip would realise that they were both transpose in Lua. OTOH, that's a fairly small community I'm catering too, and discussion among users of the libraries might be hampered by having all these names... OTOOH, those names are much more obvious when you're reading code and you're trying to work out what it's doing... I think the answer is probably (as usual) to strike a balance. My view of that balance would be to provide those names that make code easier to read, and not provide extra names just to give people the names they're used to. zip, unzip and transpose are different ideas (they have different types in strongly-typed languages, after all!). map and transform aren't. In the end, the only way to keep this thing small and simple (as it should be) is to have a "one true way". This should really be as close as possible to *the* One True Way, and I'm quite happy to argue over it lots, but in the end, I think we have to make a decision. -- http://www.mupsych.org/~rrt/ | wit, n. educated insolence (Aristotle) |