On 18 Jul 2008, at 12:41, Quentin Mathé wrote: > Le 18 juil. 08 à 10:24, David Chisnall a écrit : > >>> Collection >>> operations such as -collect:, -select:, etc., would be nice too but >>> probably are less critical. Writing collection related code in ObjC >>> style does the trick for now ;-) >> >> map:, foreach:, select: and fold: are implemented on NSArray. None >> are implemented on NSDictionary (patches welcome!) or NSSet yet >> though. > > Looks like I missed a commit :-) > Shouldn't we used Smalltalk terminology or simply provides both when > it makes sense like: > - map / collect > - fold / inject > - filter / select > ?
Yup, that would be ideal (I added these ages ago to test that blocks worked from ObjC). I think I just took the standard defs from functional lanaguages, but Smalltalk-80-compatible ones would be better. Just add them to Support. You can implement them easily in ObjC, just call -value:value: or whatever on the block that you're passed (for efficiency, you might want to cache the block's IMP, or call it directly - which is why the block function is a public ivar). David _______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
