Re: enums and bitenums

2003-12-13 Thread Andy Wardley
Larry Wall wrote: Well, we can't use - because we're using that for something else. But it's certainly true that we'll have to have some mechanism for disambiguating Color.green from Blackberry.green. After all, Blackberry.green == Color.red Or maybe it's Blackberry::green ==

Re: enums and bitenums

2003-12-13 Thread Paul Hodges
--- Larry Wall [EMAIL PROTECTED] wrote: On Fri, Dec 12, 2003 at 03:10:30PM -0800, Paul Hodges wrote: : Ok, wait a sec. Does that mean different references to the same : critter can have differing sets of aspects? : : my Dog $Spot; : my $doggie = Dog.new(); : my $meandog =

RE: enums and bitenums

2003-12-13 Thread Austin Hastings
-Original Message- From: Larry Wall [mailto:[EMAIL PROTECTED] Sent: Friday, December 12, 2003 7:39 PM To: Perl6 Subject: Re: enums and bitenums On Fri, Dec 12, 2003 at 03:10:30PM -0800, Paul Hodges wrote: : Ok, wait a sec. Does that mean different references to the same critter

RE: enums and bitenums

2003-12-13 Thread Austin Hastings
-Original Message- From: Luke Palmer [mailto:[EMAIL PROTECTED] Sent: Saturday, December 13, 2003 9:30 AM To: Andy Wardley; Larry Wall; Perl6; [EMAIL PROTECTED] Subject: Re: enums and bitenums Andy Wardley writes: Larry Wall wrote: Well, we can't use - because we're using

Re: enums and bitenums

2003-12-13 Thread Larry Wall
On Sat, Dec 13, 2003 at 01:42:58PM +, Andy Wardley wrote: : How about a single colon? : : Color:green Vaguely possible, but the lexer would have to distinguish Color:green Color: green Color :green It may yet do that, but probably not for this reason. : This is the same

Re: enums and bitenums

2003-12-13 Thread Larry Wall
On Sat, Dec 13, 2003 at 12:22:00PM -0500, Austin Hastings wrote: : We might be able to make it work, though as you say, there are other : ways to get there, and the chances are that at least one of them will : be a better way. Certainly when the Dog object's class is composed, it : will have

Re: enums and bitenums

2003-12-13 Thread Larry Wall
On Sat, Dec 13, 2003 at 07:16:21AM -0800, Paul Hodges wrote: : $Spot = $visitor.nephew ?? $nicedog :: $meandog; : : Which brings up a small side note: that's a successfully applied : boolean context for $visitor.nephew, right? Yes, but $visitor.nephew is no longer .does(nephew) in my current

Re: enums and bitenums

2003-12-13 Thread Paul Hodges
--- Larry Wall [EMAIL PROTECTED] wrote: On Sat, Dec 13, 2003 at 07:16:21AM -0800, Paul Hodges wrote: : $Spot = $visitor.nephew ?? $nicedog :: $meandog; : : Which brings up a small side note: that's a successfully applied : boolean context for $visitor.nephew, right? Yes, but

Re: enums and bitenums

2003-12-13 Thread Larry Wall
On Sat, Dec 13, 2003 at 03:43:00PM -0800, Paul Hodges wrote: : Amen, brutha. Accordingly, do we have an idea what it actually means to : add a type to something? I mean, I get that we could say : : print yup if $Spot ~~ AttackDog; : : but is there still : : print ref $Spot; : : and if so

Re: enums and bitenums

2003-12-12 Thread Andy Wardley
Larry Wall wrote: Anyway, this all implies that use of a role as a method name defaults to returning whether the type in question matches the subtype. That is, when you say: $foo.true $bar.red [...] $bar.red [...] $baz.Byte it's asking whether the Int property fulfills

Re: enums and bitenums

2003-12-12 Thread Eirik Berg Hanssen
Larry Wall [EMAIL PROTECTED] writes: On Thu, Dec 11, 2003 at 04:18:19PM -0700, Luke Palmer wrote: : Larry Wall writes: : Anyway, this all implies that use of a role as a method name defaults to : returning whether the type in question matches the subtype. Why? Why should it be a method?

Re: enums and bitenums

2003-12-12 Thread Larry Wall
On Fri, Dec 12, 2003 at 04:05:25PM +0100, Eirik Berg Hanssen wrote: : Larry Wall [EMAIL PROTECTED] writes: : : On Thu, Dec 11, 2003 at 04:18:19PM -0700, Luke Palmer wrote: : : Larry Wall writes: : : Anyway, this all implies that use of a role as a method name defaults to : : returning

Re: enums and bitenums

2003-12-12 Thread Larry Wall
On Fri, Dec 12, 2003 at 09:36:45AM +, Andy Wardley wrote: : Larry Wall wrote: : Anyway, this all implies that use of a role as a method name defaults to : returning whether the type in question matches the subtype. That is, : when you say: : : $foo.true : $bar.red : [...] :

RE: enums and bitenums

2003-12-12 Thread Austin Hastings
-Original Message- From: Larry Wall [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 1:04 PM [Warning: speculation ahead.] Noted. I've been thinking that enums might just be subtypes of roles/properties. After all, when you say 0 but true it might really mean

RE: enums and bitenums

2003-12-12 Thread Austin Hastings
-Original Message- From: Larry Wall [mailto:[EMAIL PROTECTED] Sent: Friday, December 12, 2003 1:44 PM Potentially, though roles are more properly thought of as types than classes. That is, they're abstract sets of values. You can instantiate one sufficiently well to take a

Re: enums and bitenums

2003-12-12 Thread Paul Hodges
Larry said: The interesting question to me is what $ref = \$foo.as(Color); returns. It looks like a typed reference to me, but it's still a reference to the object in $foo, or can behave as one somehow. I don't think it should generate a reference to the bare role, because roles

Re: enums and bitenums

2003-12-12 Thread Smylers
Larry Wall writes: I think roles are a little bit like quarks--they're fine in theory, but it's scary to have loose ones floating around. Wow. (And please can whoever looks after the quote of the day on Perl.com add that one to the hopper ...) Smylers

Re: enums and bitenums

2003-12-12 Thread Eirik Berg Hanssen
Larry Wall [EMAIL PROTECTED] writes: On Fri, Dec 12, 2003 at 04:05:25PM +0100, Eirik Berg Hanssen wrote: : I for one would appreciate the visual clue that we access properties : and subclasses as roles ($foo~~bareword), while we access attributes : (with accessors) as methods

Re: enums and bitenums

2003-12-12 Thread Larry Wall
On Fri, Dec 12, 2003 at 10:30:06PM +0100, Eirik Berg Hanssen wrote: : Larry Wall [EMAIL PROTECTED] writes: : : On Fri, Dec 12, 2003 at 04:05:25PM +0100, Eirik Berg Hanssen wrote: : : : I for one would appreciate the visual clue that we access properties : : and subclasses as roles

Re: enums and bitenums

2003-12-12 Thread Larry Wall
On Fri, Dec 12, 2003 at 03:10:30PM -0800, Paul Hodges wrote: : Ok, wait a sec. Does that mean different references to the same critter : can have differing sets of aspects? : : my Dog $Spot; : my $doggie = Dog.new(); : my $meandog = \$doggie.as(AttackDog); : my $nicedog =

enums and bitenums

2003-12-11 Thread Stéphane Payrard
Hi, I don't remember anything about enums and bitenums in the apocalypses. This is probably not very difficult to roll out something using macros but I feel that should belong to the standard language. -- stef

Re: enums and bitenums

2003-12-11 Thread Larry Wall
On Thu, Dec 11, 2003 at 02:48:06PM +0100, Stéphane Payrard wrote: : Hi, : : I don't remember anything about enums and bitenums in the : apocalypses. This is probably not very difficult to roll out : something using macros but I feel that should belong to the : standard language. [Warning

Re: enums and bitenums

2003-12-11 Thread Michael Lazzaro
On Thursday, December 11, 2003, at 10:04 AM, Larry Wall wrote: Explicitly: $bar.does(Color)# does $bar know how to be a Color? $bar.as(Color) # always cast to Color Implicitly boolean: $bar ~~ Color # $bar.does(Color) ?$bar.Color # $bar.does(Color) if

Re: enums and bitenums

2003-12-11 Thread Luke Palmer
Larry Wall writes: Anyway, this all implies that use of a role as a method name defaults to returning whether the type in question matches the subtype. That is, when you say $foo.true it's asking whether the Boolean property fulfills the true constraint. When you say $bar.red

Re: enums and bitenums

2003-12-11 Thread Larry Wall
On Thu, Dec 11, 2003 at 02:01:17PM -0800, Michael Lazzaro wrote: : So Cas would be for casting, not coercion, right? : : Suppose you have a class Foo, such that: : : class Foo does (Bar, Baz) { : ... : } : : ... or however that looks. May I then presume that : : $foo.Bar.zap

Re: enums and bitenums

2003-12-11 Thread Larry Wall
On Thu, Dec 11, 2003 at 04:18:19PM -0700, Luke Palmer wrote: : Larry Wall writes: : Anyway, this all implies that use of a role as a method name defaults to : returning whether the type in question matches the subtype. That is, : when you say : : $foo.true : : it's asking whether the

Re: enums and bitenums

2003-12-11 Thread Uri Guttman
LW == Larry Wall [EMAIL PROTECTED] writes: Or are you worried that these have to be declared at all? I think we need to declare them or we can't use them as bare identifiers. There are no barewords in Perl 6, so they have to be something predeclared, or otherwise syntactically

Re: enums and bitenums

2003-12-11 Thread Larry Wall
On Thu, Dec 11, 2003 at 04:18:19PM -0700, Luke Palmer wrote: : Larry Wall writes: : Anyway, this all implies that use of a role as a method name defaults to : returning whether the type in question matches the subtype. That is, : when you say : : $foo.true : : it's asking whether the

roles (Was: enums and bitenums)

2003-12-11 Thread Jonathan Lang
I'm invoking the principle that the only stupid question is the one not asked: Larry Wall wrote: if indeed properties can be unified with roles (and roles with classes). Based on the source material pointed to as your inspiration for roles, I'm a little confused as to how roles and classes

Re: roles (Was: enums and bitenums)

2003-12-11 Thread Paul Hodges
--- Jonathan Lang [EMAIL PROTECTED] wrote: Incidently, I think I've caught on to _one_ of the concepts in the upcoming object-orientation proposal: linguistically, there's a triad of basic verbs - namely be, do, and have. If I'm following things properly, one could think of an object's

Re: roles (Was: enums and bitenums)

2003-12-11 Thread chromatic
On Thu, 2003-12-11 at 18:15, Jonathan Lang wrote: Based on the source material pointed to as your inspiration for roles, I'm a little confused as to how roles and classes could be unified. From what I read in the source material, a key point of a role (well, they weren't actually calling it

Re: roles (Was: enums and bitenums)

2003-12-11 Thread Jonathan Lang
Paul Hodges wrote: Jonathan Lang [EMAIL PROTECTED] wrote: Incidently, I think I've caught on to _one_ of the concepts in the upcoming object-orientation proposal: linguistically, there's a triad of basic verbs - namely be, do, and have. If I'm following things properly, one could think