From: Mathieu Bouchard Date: 2001-04-06T16:12:18+09:00 Subject: [ruby-talk:13528] Re: Newbie Question On Fri, 6 Apr 2001, Clemens Wyss wrote: > I would have expected that Ruby raised an error here! > Smalltalk has the following methods: > at: put: > which would raise an exception if the key/index does not exist. Well, Ruby's #[]=(key,value) is not an equivalent to #at:put: method. It's more like: if in ordered collection: if key is negative: add length to key if key not found: if collection is auto-extensible: extend collection to key+1 elements else: whine now do Smalltalk's (self at: key put: value). this does not describe support for ranges, lengths, strings, and regexps, as arguments to #[]= for (ordered) collections that support them. matju