more slots in the glob, 'but', Re: 'is' and action at a distance

2001-06-18 Thread David L. Nicol
I had imagined the way things like $R = 0 but true would work is that the scalar would grow another couple of slots in it, which would be the conversion operators. Everything defaults to how it has worked in the past, but could be overridden. So the boolean value starts as "default c

Re: 'is' and action at a distance

2001-06-17 Thread Johan Vromans
Larry Wall <[EMAIL PROTECTED]> writes: > That's part of why I named it "btw" in the first place. The problem with > "prop" is it's not quite obscure enough. In the Netherlands, we have a value added tax named BTW. So it's not unlikely for financial programs to implement a btw property or method

Re: 'is' and action at a distance

2001-05-20 Thread Uri Guttman
> "LW" == Larry Wall <[EMAIL PROTECTED]> writes: LW> I think it would be better if we stilled two curds with one bone. We LW> can have a more obscure name, plus differentiate the prop tables at the LW> same time. So how 'bout we have two methods, such as: LW> $foo.variable_is

Re: 'is' and action at a distance

2001-05-20 Thread Michael G Schwern
On Sat, May 19, 2001 at 11:26:36AM +1000, Damian Conway wrote: > Not. The run-time property is set on the *value* in $Foo, not on the variable > itself. Change the value, change the properties. Ok, that makes me happy. :) -- Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~sch

Re: 'is' and action at a distance

2001-05-19 Thread Larry Wall
[EMAIL PROTECTED] writes: : Graham wrote: : :> On Fri, May 18, 2001 at 10:36:59PM -0400, John Siracusa wrote: :> > > print keys $foo.prop; # prints "NumberHeard" :> > > print values $foo.prop; # prints "loneliestever" :> :> This is an example of one of my co

Re: 'is' and action at a distance

2001-05-19 Thread Graham Barr
On Sat, May 19, 2001 at 06:41:29PM +1000, Damian Conway wrote: > > Graham wrote: > >> On Fri, May 18, 2001 at 10:36:59PM -0400, John Siracusa wrote: >> > > print keys $foo.prop; # prints "NumberHeard" >> > > print values $foo.prop; # prints "loneliestever" >> >

Re: 'is' and action at a distance

2001-05-19 Thread Damian Conway
Graham wrote: > On Fri, May 18, 2001 at 10:36:59PM -0400, John Siracusa wrote: > > > print keys $foo.prop; # prints "NumberHeard" > > > print values $foo.prop; # prints "loneliestever" > > This is an example of one of my concerns about namespace overlap > wit

Re: 'is' and action at a distance

2001-05-19 Thread Damian Conway
Piers wrote: > > >> Can 'undef' valued thingys have properties > > > > > > Yes. > > > > > >> and functions? > > > > > > No. > > > > > > > Why not? > > You can always set a property on a function reference. But it seems a > little weird that

Re: 'is' and action at a distance

2001-05-19 Thread Graham Barr
On Fri, May 18, 2001 at 10:36:59PM -0400, John Siracusa wrote: > > print keys $foo.prop; # prints "NumberHeard" > > print values $foo.prop; # prints "loneliestever" This is an example of one of my concerns about namespace overlap with methods. What would happen if there was a me

Re: 'is' and action at a distance

2001-05-19 Thread Piers Cawley
Graham Barr <[EMAIL PROTECTED]> writes: > On Fri, May 18, 2001 at 08:31:21AM -0500, Jarkko Hietaniemi wrote: > > On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote: > > > > > > --- Damian Conway <[EMAIL PROTECTED]> wrote: > > > > > > > It's probably just a matter of coding what yo

Re: 'is' and action at a distance

2001-05-19 Thread Piers Cawley
Graham Barr <[EMAIL PROTECTED]> writes: > On Fri, May 18, 2001 at 03:01:38PM +1000, Damian Conway wrote: > >> Also, what's the difference between a 'property' and an > >> 'attribute', ie, are: > >> > >>$fh is true; > >> > >> and > >> > >>$fh.true(1); >

Re: 'is' and action at a distance

2001-05-19 Thread Piers Cawley
Richard Proctor <[EMAIL PROTECTED]> writes: > On Fri 18 May, Damian Conway wrote: > > > > Ed wrote: > > > > > >> Can 'undef' valued thingys have properties > > > > Yes. > > > >> and functions? > > > > No. > > > > Why not? You can always set a property on a function referenc

Re: 'is' and action at a distance

2001-05-18 Thread John Siracusa
On 5/18/01 9:23 PM, Damian Conway wrote: > print %{(+$fh).prop};# All the value's properties ...and my question is: why is the %{...} there? Doesn't .prop return a hash? Looks like it here: > print keys $foo.prop; # prints "NumberHeard" > print values $foo.prop; # prints

Re: 'is' and action at a distance

2001-05-18 Thread Damian Conway
Ed asked: > > print %{(+$fh).prop};# All the value's properties > > > > um.. I'm not the greatest fan of this syntax.. what's the '+' for? As I explained at the end of the "re: properties" message, it's to evaluate $fh, so we get the hash of properties belonging the value in

Re: 'is' and action at a distance

2001-05-18 Thread Edward Peschko
>> So... why the *$#$ is it getting into the loop? >> >> There has to be a method to print out the *contents* of $fh, not >> just the values. > > print $fh.true; # Just the truth > > print %{(+$fh).prop}; # All the value's properties > um.. I'm not the greatest f

Re: 'is' and action at a distance

2001-05-18 Thread Damian Conway
Schwern wrote: > Let me see if I understand this... > > $Foo is true; > > # Meanwhile, in another part of the city... > > $Foo = 0; > print "My spider sense is tingling" if $Foo; > > Does that print or not? Not. The run-time property is set on the *value* i

Re: 'is' and action at a distance

2001-05-18 Thread Damian Conway
Ed said: > No, because you can say: >print "$fh"; > and find out exactly what is going on. > > In the case with > undef $fh; > $fh is true. > > if ($fh) { print "HERE!!!\n"; } > > print "$fh"; > > you get nada, right? Right. > So... why t

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Larry Wall
Jarkko Hietaniemi writes: : Maybe I missed it... but what is the relationship of (Perl 5) attributes : and Perl 6 properties? : : my $answer : constant = 42; : my $answer is constant = 42; : : my sub ... dang, no lexical subs, but can we please have them : in Perl6? :-)

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Damian Conway
Bart wrote: > >While I understand how "0 but true" is a cute hack that is destined to > >be replaced by a truth property, I fail to realize how it's useful to > >have a value that's true no matter what value you assign to it later. > > I thought the "truth" property was attached t

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Bart Lateur
On Fri, 18 May 2001 23:26:53 +0200, Trond Michelsen wrote: >While I understand how "0 but true" is a cute hack that is destined to >be replaced by a truth property, I fail to realize how it's useful to >have a value that's true no matter what value you assign to it later. I thought the "truth" p

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Jarkko Hietaniemi
Maybe I missed it... but what is the relationship of (Perl 5) attributes and Perl 6 properties? my $answer : constant = 42; my $answer is constant = 42; my sub ... dang, no lexical subs, but can we please have them in Perl6? :-) sub terfuge : loc

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Larry Wall
I've seen uses for compile-time properties on variables, and run-time properties on values, but I've not yet seen any decent use for run-time properties on variables. So I'd be inclined to disallow properties on lvalues unless they're in a "my" or "our". Offhand, I do kinda like the notion of di

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Trond Michelsen
On Fri, May 18, 2001 at 01:34:55PM -0700, Nathan Wiger wrote: > Dammit, I got the example exactly backwards. Try this: >>$Foo is true; >>$Foo = 0; >>print "Stuff" if $Foo; # *WOULD* print - "is" assigns a >> # permanent "true" property Sorry to ju

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Buddha Buck
At 01:34 PM 05-18-2001 -0700, Nathan Wiger wrote: >Dammit, I got the example exactly backwards. Try this: > > >$Foo is true; > >$Foo = 0; > >print "Stuff" if $Foo; # *WOULD* print - "is" assigns a > > # permanent "true" property > > > >$Foo as

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Dave Storrs
On Fri, 18 May 2001, Nathan Wiger wrote: > Maybe there are two different features being conflated here. First, we > have "is", which is really for assigning permanent properties: >my $PI is constant = '3.1415927'; > So, those make sense, and we'd want them to remain through assignment. >

Re: Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Nathan Wiger
Dammit, I got the example exactly backwards. Try this: >$Foo is true; >$Foo = 0; >print "Stuff" if $Foo; # *WOULD* print - "is" assigns a > # permanent "true" property > >$Foo as true = ""; >$Foo = 0; >print "Stuff" if $Foo; # *

Separate "as" keyword? (Re: 'is' and action at a distance)

2001-05-18 Thread Nathan Wiger
* Michael G Schwern <[EMAIL PROTECTED]> [05/18/2001 12:32]: > Let me see if I understand this... > > $Foo is true; > > # Meanwhile, in another part of the city... > > $Foo = 0; > print "My spider sense is tingling" if $Foo; > > Does that print or not? Maybe there are two different fea

Re: 'is' and action at a distance

2001-05-18 Thread Michael G Schwern
Let me see if I understand this... $Foo is true; # Meanwhile, in another part of the city... $Foo = 0; print "My spider sense is tingling" if $Foo; Does that print or not? I can see the need for wanting to disassociate truth from value (I've wanted it myself) but if $Foo remains true

Re: 'is' and action at a distance

2001-05-18 Thread Edward Peschko
> I don't see that at all. We're simply providing one more > way for a value to be true, and one more way for it to be false. > You might as well argue that the following is "action-at-a-distance": > > undef $fh; > > $fh = "0 but true"; > > ... 1200 lines later... > >

Re: 'is' and action at a distance

2001-05-18 Thread Larry Wall
[EMAIL PROTECTED] writes: :> Also, what's the difference between a 'property' and an :> 'attribute', ie, are: :> :>$fh is true; :> :> and :> :>$fh.true(1); :> :> synonyms? : : No. The former means: : : "Set the true property to 1 and r

Re: 'is' and action at a distance

2001-05-18 Thread Graham Barr
On Fri, May 18, 2001 at 08:31:21AM -0500, Jarkko Hietaniemi wrote: > On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote: > > > > --- Damian Conway <[EMAIL PROTECTED]> wrote: > > > > > It's probably just a matter of coding what you actually mean. > > > In Perl 5 and 6 your version

Re: 'is' and action at a distance

2001-05-18 Thread Jarkko Hietaniemi
On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote: > > --- Damian Conway <[EMAIL PROTECTED]> wrote: > > > It's probably just a matter of coding what you actually mean. > > In Perl 5 and 6 your version means "if $fh is true in *any* > > possible way...", whereas you seem to want

Re: 'is' and action at a distance

2001-05-18 Thread Austin Hastings
--- Damian Conway <[EMAIL PROTECTED]> wrote: > It's probably just a matter of coding what you actually mean. > In Perl 5 and 6 your version means "if $fh is true in *any* > possible way...", whereas you seem to want "if $fh is defined", > which is: Hmm. I can easily see this producing incomp

Re: 'is' and action at a distance

2001-05-18 Thread Graham Barr
On Fri, May 18, 2001 at 03:01:38PM +1000, Damian Conway wrote: >> Also, what's the difference between a 'property' and an >> 'attribute', ie, are: >> >>$fh is true; >> >> and >> >>$fh.true(1); >> >> synonyms? > > No. The former means: > >

Re: 'is' and action at a distance

2001-05-17 Thread Richard Proctor
On Fri 18 May, Damian Conway wrote: > > Ed wrote: > > >> Can 'undef' valued thingys have properties > > Yes. > >> and functions? > > No. > Why not? Richard -- [EMAIL PROTECTED]

Re: 'is' and action at a distance

2001-05-17 Thread Damian Conway
Ed wrote: > Any ideas on how to handle this with the 'is' keyword? I was > reading the slashdot comments to Exegesis II, and this seemed to be > the one issue that had merit. A couple of the posters bemoaned the > fact that they were debugging PL/I about 25 years ago, and had code