From: MikkelFJ Date: 2001-09-02T22:11:32+09:00 Subject: [ruby-talk:20699] Re: RCR: non-bang equivalent to []= "Tobias Reif" wrote in message news:3B911E57.8090306@pinkjuice.com... > Hi David, > Would the following make sense? I think it makes perfect sense. It relates to functional programming and the concept of "referential transparency" (the non-bang version). Arrays are perhaps not the most brilliant example of non-destructive update, but if you look at a set or a list, where you can have two versions sharing most of the non-modified datastructure, it starts to make sense. But it would complicate the internals of Ruby because it would either have to track usage count on datastructures, or assume that datastructures are not modified by default - which isn't very rubish. A non-destructive update that performs a full copy each time is generally not very useful. An explicit duplication is probably better here, as someone suggested. Even so - it is nice to have the semantics in place. Mikkel