From: bbense+comp.lang.ruby.Sep.20.02@... Date: 2002-09-23T21:15:35+09:00 Subject: Re: select and select -----BEGIN PGP SIGNED MESSAGE----- In article <3D8A90F4.8080400@path.berkeley.edu>, Joel VanderWerf wrote: >Yukihiro Matsumoto wrote: >.. >> We want to have a new method to replace "indices", because of >> inconsistency between "indices" (or "indexes") and "index". "index" >> returns index of a value, "indices" returns values corresponding to >> indices. >> >> A new method (say "quux" for example) should satisfy >> >> * obj.quux(a,b,c) returns [obj[a],obj[b],obj[c]] for all indexable >> collections (i.e. Array, Hash, MatchData and Struct), perhaps >> except for String, which is mere string of characters rather than >> indexable collection. So preferably it should sound natural both >> for arrays, hashes and others. >> >> * obj.quux() either returns an empty array or causes exception, due >> to the case like obj.quux(*ary) where ary is an empty array. > >I have to agree, that's the right behavior. So we will have > >[0,1,2,3,4].entries #==> [0,1,2,3,4] >[0,1,2,3,4].quux #==> [] (or an exception) > >So far, so good. But what should the name be? Both "items" and >"elements" seem too close to entries in their natural language meaning. >There were good arguments against using "at" (doesn't seem to fit >hashes, reduces efficiency of Array#at). > >Does "indexable collection" mean anything that responds to #[] ? > >If so, then proc and method objects come into play, and the perfect name >would make sense for them as well. But in this case the quux method >would be just another way of writing #map, so maybe this isn't important >to consider after all. - - How about "axiom_of_choice[1]" ? That's really what you're implementing. You could use "zermelo" or "zerm" for short. Nobody but a mathematical logican will have any prior meaning attached to that. Just think of the possiblities: "Yeah, I need to zerm the Hash" "Hey is Mailbox class zermable ?" - - Personally, I kind of like "choose", but I think that's already been rejected in this debate. - - Booker C. Bense [1] - http://www.math.vanderbilt.edu/~schectex/ccc/choice.html -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBPYtmxWTWTAjn5N/lAQHExgP+K6qmsO7UEPfnw5x3yg4PYlXTuLEMzSsE ibkl6fYaXx+wZ5uhkb2PrjgFlOb92u5z9+xTNocFxFoO+UhaduJa7bZUB7cH1Jyf wnAhtrwPLjr+LLl5HEdfWi7NE46o7v/EqZuahlri9uZywYRSEcOinmtiVShqvk+x ++d6kv/L+NU= =4S3S -----END PGP SIGNATURE-----