Re: properties

2001-05-18 Thread Edward Peschko
On Fri, May 18, 2001 at 08:08:54PM -0700, Daniel S. Wilkerson wrote: > Damian Conway wrote: > > > You may also be wondering what happens if a variable and the value it > > contains both have a property of the same name. The answer is that we > > always get back the variable's property in preferen

Re: properties

2001-05-18 Thread Daniel S. Wilkerson
Damian Conway wrote: > You may also be wondering what happens if a variable and the value it > contains both have a property of the same name. The answer is that we > always get back the variable's property in preference to the value's: > > my $var is Purpose("var demo") = 1 is Purpose("v

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: Exegesis2 and the "is" keyword

2001-05-18 Thread Simon Cozens
On Fri, May 18, 2001 at 06:29:11PM -0700, Daniel S. Wilkerson wrote: > Therefore, if it isn't a back-end and it isn't a front-end, what is it?! Both! > Can someone say what it is? OK. Most languages out there are separate from their implementation. For C, you have an ANSI specification that tel

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: properties

2001-05-18 Thread Damian Conway
Thanks to everyone who has been contributing to the discussion on properties, and especially to those who have emailed me off-list about the issue. Unfortunately, I'm currently not able to respond individually to further messages on this topic. My latest Conway Channel diary entry at

Re: Exegesis2 and the "is" keyword

2001-05-18 Thread Daniel S. Wilkerson
Please forgive the naiveté of this question. 1 - If Perl6 is going to have multiple back-ends, rather like the cross-compilation feature of gcc, "Perl6" won't be a specific virtual machine or back-end. (As Perl5 is now, and, say, Java has as a fundamental part of its design.) 2 - If Perl6 is goi

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: Exegesis2 and the "is" keyword

2001-05-18 Thread Buddha Buck
Austin Hastings <[EMAIL PROTECTED]> writes: > Let it be. > > Not a flame, but a suggestion: > > let $pi be constant; Personally, I'd rather save let for: (let ($x,$y,$z,...) = (1,2,3,...) in { ... }) which would be equivilant to: ((sub {my ($x,$y,$z,...) = @_; ... })(1,2,3,...)) Many fu

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: Exegesis2 and the "is" keyword

2001-05-18 Thread Austin Hastings
Let it be. Not a flame, but a suggestion: let $pi be constant; That any better? =Austin --- Dan Schmidt <[EMAIL PROTECTED]> wrote: > Peter Scott <[EMAIL PROTECTED]> writes: > > | I've been reading "is" as a declarative imperative, something which > | declares a property of something you are

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: Exegesis2 and the "is" keyword

2001-05-18 Thread Dan Schmidt
Peter Scott <[EMAIL PROTECTED]> writes: | I've been reading "is" as a declarative imperative, something which | declares a property of something you are creating. Here it's being | used to modify the properties of something that already exists, and | it reads funny to me. Many properties that o

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: '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: 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
[EMAIL PROTECTED] writes: : I guess a good rule would be, "Use return values consistently. If you : have to return data, then use the true property to return status. If : you can't use :true, then use :result." By and large, it's best if the data itself is properly oriented so that there's little

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
--- Jarkko Hietaniemi <[EMAIL PROTECTED]> wrote: > On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote: > > Hmm. I can easily see this producing incomprehensible code when > spread > > across large systems. To wit, those developers used to "0 means > false" > > Any feature is incompr

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: > >