ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved