Re: encapsulation issue
by Seebs other posts by this author
Nov 6 2009 8:50AM messages near this date
Re: encapsulation issue
|
Re: encapsulation issue
On 2009-11-06, James French <James.French@[...].com> wrote:
> But then I can't legitimately push to it in addDependency...
No, but you could dup-and-append when you hit that.
I think you pretty much have to dup the object in this case.
Hmm. Okay, imagine this. Define a new Array-like class, which has an
Array as an internal member, but overrides all the things which modify that
array, then return one wrapped around the object. At least you're then
limiting the amount of duplication you do.
A question naturally arises: What do you want to happen if I try to
send a modify-yourself message to a member of the array?
-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet-nospam@[...].net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
Thread:
James French
Josh Cheek
James French
Ralph Shnelvar
Gavin Sinclair
James French
Seebs
Aldric Giacomoni
David A. Black
James French
David A. Black
Tom Stuart
James French
|