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: Perl, the new generation

2001-05-18 Thread Nathan Torkington
Stephen P. Potter writes: > Atoms- Unicode. If everything is Unicode, you're going to have to grok > Unicode (at least tangentally) to be able to use perl. Others have well dealt to this. > RFC 161- Everything becomes an object. Filehandles are more object > oriented in Perl6, and the special

Re: Perl, the new generation

2001-05-18 Thread Nathan Torkington
Stephen P. Potter writes: > Objection, your honor! This is a logical extention of part of the > discussion. If we're discussing what is wrong with perl5 to make perl6 > better differentiating between philosophies is quite on target. The corner of the discussion about search.cpan.org and broken

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: Perl, the new generation

2001-05-18 Thread Adam Turoff
On Fri, May 18, 2001 at 08:08:40PM +0100, Simon Cozens wrote: > On Fri, May 18, 2001 at 12:55:55PM -0400, Stephen P. Potter wrote: > > Atoms- Unicode. If everything is Unicode, you're going to have to grok > > Unicode (at least tangentally) to be able to use perl. > > Bah. Rubbish, no more than

Re: Perl, the new generation

2001-05-18 Thread Simon Cozens
On Fri, May 18, 2001 at 12:55:55PM -0400, Stephen P. Potter wrote: > Atoms- Unicode. If everything is Unicode, you're going to have to grok > Unicode (at least tangentally) to be able to use perl. Bah. Rubbish, no more than you need to grok Unicode to use Perl 5.6. Do you know what data of yours

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: Perl, the new generation

2001-05-18 Thread Trond Michelsen
On Fri, May 18, 2001 at 07:16:36PM +0100, Michael G Schwern wrote: > Sean Burke wrote up an excellent article about OO for module users > which I thought was on perl.com but I can't find at the moment. Maybe > it was in TPJ. http://search.cpan.org/doc/SBURKE/HTML-Tree-3.11/lib/HTML/Tree/AboutObj

Re: Perl, the new generation

2001-05-18 Thread Michael G Schwern
On Fri, May 18, 2001 at 12:22:56PM -0400, Stephen P. Potter wrote: > For example, take a look at Camel1. It was a small book; you could carry > it around without building up huge biceps. You could reasonable read it in > a couple of days and get started with perl. I tried to get us to maintain

Re: Perl, the new generation

2001-05-18 Thread Michael G Schwern
On Fri, May 18, 2001 at 11:24:45AM -0400, Stephen P. Potter wrote: > You are also saying that OOP is now required, because many/most CPAN > modules use OOP. This is a piece of FUD along the lines of "inline POD slows code down" that keeps people fearful of CPAN and I'd really rather see die. To

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: Perl, the new generation

2001-05-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Nathan Torkington <[EMAIL PROTECTED]> whi spered: | This is off-topic for perl6. Objection, your honor! This is a logical extention of part of the discussion. If we're discussing what is wrong with perl5 to make perl6 better differentiating between philoso

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: Perl, the new generation

2001-05-18 Thread David Grove
> > What is Camel4 going to look like for perl 6? What is going to > be required > > knowledge for perl6. Let's just start by looking at Apoc2. To > use perl, > > you'll have to know Unicode, you'll have to know OO, you'll have to > > understand references. Those are three very technical conce

Re: Perl, the new generation

2001-05-18 Thread Trond Michelsen
On Fri, May 18, 2001 at 11:24:45AM -0400, Stephen P. Potter wrote: > Lightning flashed, thunder crashed and Russ Allbery <[EMAIL PROTECTED]> whispere > d: > | All Perl programmers, including lone ones, really should be using CPAN as > | much as they can, which means that the parts of the language

Re: Perl, the new generation

2001-05-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Jarkko Hietaniemi <[EMAIL PROTECTED]> whispered : | Ummm, I must have missed the "have to know Unicode, have to to know OO, | have to know references" part in the Apoc2. Could you show it to me? Atoms- Unicode. If everything is Unicode, you're going to hav

Re: Perl, the new generation

2001-05-18 Thread Nathan Torkington
Stephen P. Potter writes: > | You don't need to know any of the modules in CPAN to use perl, but once > | you learn how to use search.cpan.org, your productivity will most > | probably increase dramatically. Just like knowing how to use the > | documentation will make you more productive. > > Th

Re: Perl, the new generation

2001-05-18 Thread Nick Stankus
> > Someone looking at that is going to think they have to know all that to be > > effective. Who reads the book. I just use it as reference. I am not the best Perl guru in the world, but I can program everything I need perl to do. If I ever need help...it is back to the Perl Camel Book. 2nd edit

Re: Perl, the new generation

2001-05-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Trond Michelsen <[EMAIL PROTECTED]> whis pered: | You don't need to know any of the modules in CPAN to use perl, but once | you learn how to use search.cpan.org, your productivity will most | probably increase dramatically. Just like knowing how to use the |

Re: Perl, the new generation

2001-05-18 Thread Nathan Torkington
Stephen P. Potter writes: > For example, take a look at Camel1. It was a small book; you could carry > it around without building up huge biceps. You could reasonable read it in > a couple of days and get started with perl. I tried to get us to maintain > that in Camel2, but it grew to almost 7

Re: Perl, the new generation

2001-05-18 Thread Jarkko Hietaniemi
> What is Camel4 going to look like for perl 6? What is going to be required > knowledge for perl6. Let's just start by looking at Apoc2. To use perl, > you'll have to know Unicode, you'll have to know OO, you'll have to > understand references. Those are three very technical concepts that mak

Re: Perl, the new generation

2001-05-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Nathan Torkington <[EMAIL PROTECTED]> whi spered: | I'm trying to understand what people fear, and why they fear it, so | that I know how to respond. Ridiculing, inflaming, or exaggerating | those fears don't make them go away. Dan may be correct that a lot

Re: Perl, the new generation

2001-05-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Russ Allbery <[EMAIL PROTECTED]> whispere d: | All Perl programmers, including lone ones, really should be using CPAN as | much as they can, which means that the parts of the language needed to use | CPAN modules are part of the understanding you need. This

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