Re: but true

2003-12-23 Thread Larry Wall
etting the value to the enum value that means "nope". For example, there isn't a "true" property, per se. There's a Boolean role/property with a boolean attribute that can have the value either true or false. When you say "but true", it first makes sure that

Re: but true

2003-12-23 Thread Piers Cawley
correctly, adding a role at runtime using but > : won't override any methods defined by the class itself (but it > : will override inherited methods). But then if I create a class > : that has its own method of saying whether it's true or not, does > : that mean that

Re: but true

2003-12-20 Thread Simon Cozens
[EMAIL PROTECTED] (Larry Wall) writes: > is classof($x) Ouch. $x's class isn't a property or trait of it? > class AnonClass is classof($x) does FooBar { }.bless($x, foobar => bar) I don't understand what the bit at the end is doing. This is calling .bless on the overriden method? And I'm not

Re: but true

2003-12-20 Thread Jonathan Lang
Larry Wall wrote: > Maybe there's an intermediate syntactic form like: > > $x but subclass MyClass does FooBar[bar] { } IMHO, C should be defined as generating a singleton class that derives from the variable's class and composes a specified role - but not neccessarily a I role. How about de

Re: but true

2003-12-19 Thread Larry Wall
On Fri, Dec 19, 2003 at 12:24:29PM -0700, Luke Palmer wrote: : Abhijit A. Mahabal writes: : > On Fri, 19 Dec 2003, Larry Wall wrote: : > : > > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: : > > : Of course, when I do: : > > : : > >

Re: but true

2003-12-19 Thread Luke Palmer
Abhijit A. Mahabal writes: > On Fri, 19 Dec 2003, Larry Wall wrote: > > > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: > > : Of course, when I do: > > : > > : my $x = 0 but (true|false); > > : > > : then what happens? > > >

Re: but true

2003-12-19 Thread Abhijit A. Mahabal
On Fri, 19 Dec 2003, Larry Wall wrote: > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: > : Of course, when I do: > : > : my $x = 0 but (true|false); > : > : then what happens? > > That's the problem with making them methods. Any such operational

Re: but true

2003-12-19 Thread Larry Wall
On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: : Of course, when I do: : : my $x = 0 but (true|false); : : then what happens? That's the problem with making them methods. Any such operational definition is going to get you in trouble. I think I like them better as

Re: but true

2003-12-19 Thread Larry Wall
ide any methods : defined by the class itself (but it will override inherited methods). But then : if I create a class that has its own method of saying whether it's true or not, : does that mean that "but true" and "but false" won't do anything to it? :

Re: but true

2003-12-19 Thread Austin Hastings
; > > > > ... > > > > > > then somewhere in a function > > > > return Complex::new(0,0) but true; > > Alternatively, think of the "simple" properties not as C > specifications, but as method overrides. > > In this case, we're d

Re: but true

2003-12-19 Thread Austin Hastings
ded to a class cannot conflict (per the paper and $Larry), but traits added at run-time would be a different category. Larry said something about dynamic derivation of a singleton class, etc. > But then if I create a class that has its own method of saying > whether it's true or not,

but true

2003-12-19 Thread Adam D. Lopresto
methods). But then if I create a class that has its own method of saying whether it's true or not, does that mean that "but true" and "but false" won't do anything to it? class Complex { has $.real; has $.imag; ... #Actually, how do we define this? method asB

RE: Properties and "0 but true".

2001-05-18 Thread Austin Hastings
> That's not how I see it. The filehandle is naturally true if > it succeeds. It's the undef value that wants to have more > information. In fact, you could view $! as a poor-man's > way of extracting the error that was attached to the last > undef. Hmm. Thus? sub fuu() { my $retval is err

RE: Properties and "0 but true".

2001-05-18 Thread David Grove
> David Grove writes: > : > That's not how I see it. The filehandle is naturally true if it > : > succeeds. It's the undef value that wants to have more information. > : > In fact, you could view $! as a poor-man's way of extracting the error > : > that was attached to the last undef. > : > : If

Re: Properties and "0 but true".

2001-05-18 Thread Larry Wall
David Grove writes: : > That's not how I see it. The filehandle is naturally true if it : > succeeds. It's the undef value that wants to have more information. : > In fact, you could view $! as a poor-man's way of extracting the error : > that was attached to the last undef. : : If I were wealt

RE: Properties and "0 but true".

2001-05-18 Thread David Grove
> That's not how I see it. The filehandle is naturally true if it > succeeds. It's the undef value that wants to have more information. > In fact, you could view $! as a poor-man's way of extracting the error > that was attached to the last undef. If I were wealthy enough in time and patience t

Re: Properties and "0 but true".

2001-05-18 Thread Larry Wall
h, except in the places you currently would see "0 but true". I think the status will generally be returned as the actual argument, and extra info attached as a property: return undef is error("Gorkulator borked"); That is, it's returning the exception that it *would*

Re: Properties and "0 but true".

2001-05-18 Thread Austin Hastings
--- Jarkko Hietaniemi <[EMAIL PROTECTED]> wrote: > Yes... if you are using only the "true" property. But assume func() > can attach either "true" or "false" to its return value (and in the > latter case, also the "what_went_wrong" property to indicate the > cause, > $retval.what_went_wrong("Gork

Re: Properties and "0 but true".

2001-05-18 Thread Jarkko Hietaniemi
> The statement I read was "true in any possible way", which implies that > if $retval had a "true" property, the result of func would be > irrelevant, since if func gave 0, "any possible way" would see the > "$retval is true" property and take the "it worked" route. > > Thus, this code: > > my

Re: Properties and "0 but true".

2001-05-18 Thread Austin Hastings
> false" > > Any feature is incomprehensible if one is not used to it. Pointers > in C are incomprehensible if one has never met the concept before. > > As far as I understand one rationale behind the "false (in Perl 5 > terms) > but true (in Perl 6 terms)" is t

RFC: "Empty But True" Special String Value (was Re: RFC 25)

2000-08-04 Thread John Porter
-- John Porter