Re: Perl 6's bless is (seriously) broken

2006-01-20 Thread Rob Kinyon
On 1/20/06, Juerd [EMAIL PROTECTED] wrote: Note, by the way, that JS has primitive strings, and Strings, only the latter being objects. Fortunately for us, though, a string is automatically promoted to a String when the string is USED AS an object. In other words, according to userland,

Perl 6's bless is (seriously) broken

2006-01-19 Thread Stevan Little
Hello, I am forking this off the Perl 6 OO and bless thread since that seems to have gotten bogged down in what it all means to Perl 5 interoperability. This was not really my intent with the original thread, but I think it is still a fruitful discussion so I will re- make my original

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Juerd
Stevan Little skribis 2006-01-19 15:45 (-0500): class Foo { method new ($class: %params) { $class.bless(%params); Wouldn't that be %params.bless($class), or more directly, %params.blessed = $class? This *won't* work the same in Perl 6 though. This is because, what is

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Rob Kinyon
To further extend Steve's argument (which I wholeheartedly agree with), I wanted to point out one thing: bless has nothing to do with OO programming as conceived of in Perl6. It does one thing and only one thing: - tag a reference with a package name. This is used in a few places: - to

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread chromatic
On Thursday 19 January 2006 13:10, Rob Kinyon wrote: bless was a brilliant idea for Perl5. It's wrong for Perl6. Perhaps you meant to write Tagging a reference with a package name worked for Perl 5. It's wrong for Perl 6. Certainly I can agree with that. Yet this whole discussion feels like

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Juerd
Rob Kinyon skribis 2006-01-19 16:10 (-0500): There are no references in Perl6. When you said that one can't use OO in Perl 5, I had something to say because it's a recurring subject. I have to admit, though, that I've never seen this statement, or anything implying it. It's entirely new to me.

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Juerd
Juerd skribis 2006-01-19 22:18 (+0100): Could you live with @foo being an array, and @foo in scalar context returning a reference to that array? And with arrays being interfaces to underlying Arrays, which are objects, which makes arrays non-objects that can be used *as* objects? This turns

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Stevan Little
On Jan 19, 2006, at 4:10 PM, Rob Kinyon wrote: Packages don't have anything to do with the class system. Actually ^Class.isa(^Package) ;) Stevan

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Stevan Little
Juerd, On Jan 19, 2006, at 4:10 PM, Juerd wrote: Stevan Little skribis 2006-01-19 15:45 (-0500): class Foo { method new ($class: %params) { $class.bless(%params); Wouldn't that be %params.bless($class), or more directly, %params.blessed = $class? Nope, according to S12:

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Stevan Little
Juerd, On Jan 19, 2006, at 4:21 PM, Juerd wrote: Juerd skribis 2006-01-19 22:18 (+0100): Could you live with @foo being an array, and @foo in scalar context returning a reference to that array? And with arrays being interfaces to underlying Arrays, which are objects, which makes arrays

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Juerd
Stevan Little skribis 2006-01-19 16:59 (-0500): But we cannot automagically inject a role into a class, for a number of reasons. 1) thats just plain evil But then, so is bless, so the two can play along. 2) what if the role conflicts with other roles being does-ed by Foo? Debugging hell

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Juerd
Stevan Little skribis 2006-01-19 17:06 (-0500): This turns everything is an object into everything can be used with OO syntax, which I think is more true Alternatively and simultaneously, everything represents an object. Well, if everything is NOT an object, then the synopsis need to

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Jonathan Scott Duff
On Thu, Jan 19, 2006 at 11:07:49PM +0100, Juerd wrote: Stevan Little skribis 2006-01-19 16:59 (-0500): 2) what if the role conflicts with other roles being does-ed by Foo? Debugging hell there. Very good point. Aren't role conflicts resolved at composition time (possibly by failure)?

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Stevan Little
On Jan 19, 2006, at 5:09 PM, Juerd wrote: Stevan Little skribis 2006-01-19 17:06 (-0500): This turns everything is an object into everything can be used with OO syntax, which I think is more true Alternatively and simultaneously, everything represents an object. Well, if everything is NOT

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Stevan Little
On Jan 19, 2006, at 5:19 PM, Jonathan Scott Duff wrote: On Thu, Jan 19, 2006 at 11:07:49PM +0100, Juerd wrote: Stevan Little skribis 2006-01-19 16:59 (-0500): 2) what if the role conflicts with other roles being does-ed by Foo? Debugging hell there. Very good point. Aren't role conflicts

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Rob Kinyon
On 1/19/06, Juerd [EMAIL PROTECTED] wrote: Rob Kinyon skribis 2006-01-19 16:10 (-0500): There are no references in Perl6. I have to admit, though, that I've never seen this statement, or anything implying it. It's entirely new to me. Is your Perl the same as that of other people on this

Re: Perl 6's bless is (seriously) broken

2006-01-19 Thread Juerd
Rob Kinyon skribis 2006-01-19 20:54 (-0500): There are no references in Perl6. Is your Perl the same as that of other people on this list? :) There are no references in Perl6 in the way Perl5 conceives of references. There are references in Perl 6. Do note that @foo evaluates to a