Re: Everything is an object.
[EMAIL PROTECTED] (Dave Storrs) writes: ...and map, grep, etc, would be elements of Collection, overriden in sensible ways by the derived classes? Once again we're getting steadily closer to inventing Ruby. -- void russian_roulette(void) { char *target; strcpy(target, bullet); }
Re: Everything is an object.
[EMAIL PROTECTED] (Dave Storrs) writes: Just so I'm clear, are you saying that you think L2R is a bad idea, and should not be supported? Or just that it has not yet been demonstrated that this is a good idea? I think supporting two distinct syntaces, one being a mirror image of the other, is a bad idea. I'll leave people to argue over which one is better because it keeps them out of the way. ;) -- Congratulations, Simon - I think I've finally discovered someone with a mind that is more warped than mine. - Lionel Lauer
Re: Everything is an object.
On Tue, Dec 17, 2002 at 03:12:09AM -0600, Josh Jore wrote: This is just your friendly neighborhood curmudgeon reminding you that in Perl 6, everything is an object. This is a concept that, as Perl programmers, we're not familiar with. Are these objects class based or where do the methods come from? Is there an accomodation for something like classless objects? Being forced into class based objects might be problematic for a capabilities system where you wouldn't want to have objects bristling with exposed methods. These are questions about the general design of Perl 6's OO system and out of the scope of ths discussion. The Perl 6 OO Cookbook does a good job of documenting what OO will look like in Perl 6 this week: http://cog.cognitivity.com/perl6/
Re: Everything is an object.
At 5:45 PM -0800 12/16/02, Dave Storrs wrote: On Mon, Dec 16, 2002 at 03:44:21PM -0500, Dan Sugalski wrote: At 11:12 AM -0800 12/16/02, Dave Storrs wrote: You find R2L easier to read, I find L2R easier. TIMTOWDI. Perl6 should be smart enough to support both. Why? Yes, technically we can do both R2L and L2R. We can also support an alternative Scheme/Lisp form of perl's syntax, as well as a Forth/Postscript style. Heck, we can probably manage a prolog-style unification style for a not-insignificant subset of perl programs. That doesn't mean its a good idea. Just so I'm clear, are you saying that you think L2R is a bad idea, and should not be supported? Or just that it has not yet been demonstrated that this is a good idea? I think it's a good idea, and that it should *not* be supported. -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
Re: Everything is an object.
At 11:38 AM + 12/17/02, Andy Wardley wrote: Simon Cozens wrote: Once again we're getting steadily closer to inventing Ruby. Agreed, but I don't think this is necessarily a Bad Thing. Disagreed--we're getting steadily closer to inventing Smalltalk. :) Which isn't altogether a bad thing. (As long as we don't vet closer to inventing Lisp...) -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
Re: Everything is an object.
On Tuesday, December 17, 2002, at 01:53 AM, [EMAIL PROTECTED] wrote: These are questions about the general design of Perl 6's OO system and out of the scope of ths discussion. The Perl 6 OO Cookbook does a good job of documenting what OO will look like in Perl 6 this week: http://cog.cognitivity.com/perl6/ ...except for the parts I completely made up, as placeholders for real stuff later. :-) (But I think I have those sections all marked now.) MikeL
Re: Everything is an object.
Umm... I think some of these recent messages have had typos between L2R and R2L. (?) In that people seem to have been arguing against themselves. (??) I'll try using -- and --. On Monday, December 16, 2002, at 05:45 PM, Dave Storrs wrote: Just so I'm clear, are you saying that you think L2R is a bad idea, and should not be supported? Or just that it has not yet been demonstrated that this is a good idea? We _must_ (for some value of must that is real close to being a 100% drop-dead requirement) support -- (L2R), in the form of @a.grep( {...} ) .map( {...} ) .sort; i.e. however else we do it, array processing functions _MUST_ exist as methods of Array. That may not be the preferred spelling, or anything close to attractive, but it would be simply pathetic for it not to exist. Almost everyone's been clamoring over how we want OO and OO is cool and everything should be treatable as an object. If arrays are objects, the above is How It's Gonna Look, unless we want to invent a method-call syntax for arrays that is completely different from that of scalars. So if anyone _doesn't_ want the above dot-syntax to exist AT ALL, please explain the rationale! _However_, the above code is probably the most formal usage of the array-manipulation methods. If we want another way to say it, e.g. -- (R2L) or a prettier -- (L2R), we could probably have it. But it would have to be in _addition_ to the above, not _instead_ of. We can add the Perl5-style: @out = sort map {...} grep {...} @a; if we want to, but I don't think it should be given a free ride in Perl6. It's not regular (not like anything else in the language), sucks up those names as globally reserved (as opposed to merely methods of arrays), implies more possible wacky behaviors of curlies, and cannot credibly be tortured into being OO upon @a. So whether prettyified -- (R2L) and -- (L2R) forms exist and what they look like, we can argue about. But the method form (L2R) @a.grep, etc, simply _must_ be valid, if not encouraged. MikeL
Re: Everything is an object.
At 9:54 AM -0800 12/17/02, Michael Lazzaro wrote: Umm... I think some of these recent messages have had typos between L2R and R2L. (?) In that people seem to have been arguing against themselves. (??) I'll try using -- and --. On Monday, December 16, 2002, at 05:45 PM, Dave Storrs wrote: Just so I'm clear, are you saying that you think L2R is a bad idea, and should not be supported? Or just that it has not yet been demonstrated that this is a good idea? We _must_ (for some value of must that is real close to being a 100% drop-dead requirement) support -- (L2R), in the form of @a.grep( {...} ) .map( {...} ) .sort; Those are simple method calls, so there's no reason we shouldn't support them, though they will *only* work if each returns an actual array, rather than a list. They are, however, not the same as doing: @b = @a grep {} map {} sort {}; because that's true L2R, as it'll work for: @b = (*@a, *@b, foobar()) grep {} map {} sort {}; That can't work as methods of the list, unless we're wildly redefining how lists work, which I don't think we're going to do. *That's* the sort of way, the L2R way, that I'd argue against. Shifting directions in mid-stream is, well, really tough for us old codgers. And you can't get rid of the old way, since it's just implicit function calls. To forbid @b = sort {} map {} grep {} @a; is the same as forbidding @b = sort({}, map({}, grep({}, @a))); which I think would be... unwise. As would chopping sort/map/grep and friends from the language entirely. One of the hallmarks of perl is its richness, and I think losing that would be ill-advised. -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
Re: Everything is an object.
At 2:47 PM -0800 12/17/02, [EMAIL PROTECTED] wrote: On Tue, Dec 17, 2002 at 09:48:56AM -0500, Dan Sugalski wrote: Simon Cozens wrote: Once again we're getting steadily closer to inventing Ruby. Agreed, but I don't think this is necessarily a Bad Thing. Disagreed--we're getting steadily closer to inventing Smalltalk. :) Silly rabbit, Ruby is Smalltalk! And it's part of this nutritious breakfast! Well, adjacent to it, at least... :-P -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk