Symbolic references, was Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-21 Thread Steve Fink
(thread intentionally broken) Nathan Torkington wrote: Steve Fink writes: True. Would anyone mourn @$scalar_containing_variable_name if it died? I've never used it, and I'm rather glad I haven't. Perl5's -w doesn't notice $x="var"; print @$x either -- it'll complain if you mention @var

Re: Symbolic references, was Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-21 Thread Nathan Torkington
Steve Fink writes: My code for doing what I thought Exporter did is: sub import { my $p = caller(1); *{"${p}::E"} = \%{"${p}::E"}; } but that doesn't run afoul of use strict 'refs'. Can you point me to the passage in Exporter.pm that uses this? It does run afoul of use strict

Re: Symbolic references, was Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-21 Thread Steve Fink
Thanks! Ok, from a type inferencing perspective... Nathan Torkington wrote: Symbolic references are used for dynamic function generation: foreach my $func (qw(red green blue)) { *$func = sub { "FONT COLOR=$func@_/FONT" } } Probably have to punt on checking user code in a main

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-18 Thread Ted Ashton
Thus it was written in the epistle of Steve Fink, Which has next to nothing to do with any particular issue. And it's too hard to argue when we agree. :-). If I asked you which variable $x[4] is accessing, I bet you'd say @x. Which is one source of the confusion -- in one case, you use

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-18 Thread Casey R. Tweten
Today around 2:04pm, Casey R. Tweten hammered out this masterpiece: : Today around 10:45am, Steve Fink hammered out this masterpiece: : : : Ted Ashton wrote: : : : : all : : dereferencing can be done with -. : : : : Is that

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-18 Thread Nathan Torkington
Don't forget that the rationale behind the infix dereferencing is this: @variable_name @{variable_name} @$scalar_containing_variable_name @$scalar_containing_value_ref @{ code evaluating to variable name } @{ code giving value ref } Nat

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread John Porter
Mike Pastore wrote: On Wed, 16 Aug 2000, John Porter wrote: grep() always treats its "second" arg as a list, even if it's a scalar, or some other list-of-one (or none); and grep() always returns a list, even if it's a list of one (or none). True on the first part, false on the second.

RE: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Myers, Dirk
Karl Glazebrook wrote: But what is $x[3] ? It could be a scalar. BUT it could be a reference to a list. It could be a reference to a 2D PDL image. ... but references are scalar. So, $x[3] *is* a scalar. That scalar could be a reference to a list. It could be a reference to a 2D PDL

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Steve Fink
Ted Ashton wrote: But the most direct way to measure how well the language slides into people's heads is by seeing how hard it is for them to get the hang of it. Nope. I've yet to be convinced that "fits in your head" is the same as "went in easily". Hang it all,

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Steve Fink
Karl Glazebrook wrote: Ariel Scolnicov wrote: Karl Glazebrook [EMAIL PROTECTED] writes: [...] o Why do I think perl has too much line noise? Because of code like this: @{$x-{$$fred{Blah}}}[1..3] This is indeed horrible. However, I fail to see how cutting out the

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Damien Neil
On Thu, Aug 17, 2000 at 03:10:44PM -0700, Steve Fink wrote: My proposal would be what I implemented for perl5 a while back (Sarathy didn't dislike it, but wasn't convinced enough to put it in): all dereferencing can be done with -. $x-@ is the same as @$x $x-% is the same as %$x

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Russ Allbery
Karl Glazebrook [EMAIL PROTECTED] writes: o Why do I think perl has too much line noise? Because of code like this: @{$x-{$$fred{Blah}}}[1..3] You're taking the value of the key "Blah" in the hash referred to by $fred and using it as the key into the hash referred to by $x, treating the

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Ted Ashton
Thus it was written in the epistle of Steve Fink, Bah. I will claim neither that being easy to learn is Perl's main goal, nor that I know what Perl's main goal is, but I have enough of an intuition (or did I misspell "opinion"?) to assert that ease of learning is a far more important

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Andy Wardley
I thought very carefully about this before writing the Highlander Variables RFC, and came to the conclusion that it's a bad idea. I've read your proposal, but I'm afraid I still think it's a bad idea. Those funny characters tell the programmer what's going on, and they tell the compiler what the

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Kai Henningsen
[EMAIL PROTECTED] (Nathan Torkington) wrote on 15.08.00 in [EMAIL PROTECTED]: * you misunderstand the purpose of $ and @, which is to indicate singular vs plural. Yes. That's one of the things that's wrong with it - maybe the biggest of all. It's one of the things that require

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Kai Henningsen
[EMAIL PROTECTED] (Russ Allbery) wrote on 15.08.00 in [EMAIL PROTECTED]: All variables should be C$x. They should behave appropriately according to their object types and methods. No thanks. I frequently use variables $foo, @foo, and %foo at the same time when they contain the same

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Karl Glazebrook
Damien Neil wrote: What makes you presume this? Perhaps snrub() is something like this: sub snrub { foreach (@_) { frobnicate $_; } } You appear to arguing that expressions in function argument lists should not be evaluated in a list context. Is this really what

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Karl Glazebrook
Damien Neil wrote: On Tue, Aug 15, 2000 at 05:45:04PM -0400, Karl Glazebrook wrote: I hope people will actually read the RFC before coming back with these canned responses which I (and presumably everyone else on this list) am completely familiar with. I used to believe that too!

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Karl Glazebrook
"J. David Blackstone" wrote: =head1 TITLE Less line noise - let's get rid of @% I understand that with the pervasiveness of object-orientation we are now more than ever seeing objects that behave like arrays and hashes and that it seems strange to see these listlike or hashlike

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Porter
Jonathan Scott Duff wrote: As for $a[$something], if @a had been declared as "my @a : assoc;", then perl should stringify $something, otherwise numify. Hmm.. I guess this implies that all hashes need to be pre-declared. :-( That was kinda along the lines of my suggestion; that the behavior

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Piers Cawley
"J. David Blackstone" [EMAIL PROTECTED] writes: I find the standard prefix symbols so intuitive I find it hard to articulate the reasons why I balk at giving them up. It's like explaining breathing or the ability to distinguish colors. Bravo! What he said! Hear, hear! [FX: Waves order

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Russ Allbery
John Porter [EMAIL PROTECTED] writes: Russ Allbery wrote: $args = 'first second third'; @args = split (' ', $args); my $i = 0; %args = map { $_ = ++$i } @args; This is very Perlish to me; the punctuation is part of the variable name and disambiguates nicely. No, it's

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Nathan Torkington
Karl Glazebrook writes: Well said! My take: I like perl, I don't mind it the way it is. But I'd be happier if it was a lot more like python! (indentation aside) This begs the question of why you're not using python. If it's just indentation, that's silly. Surely there are patches to the

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Porter
What makes Perl feel like Perl is, of course, subjective, but to me the punctuation is a lot of it. We're trying to improve Perl, not replace it. This is an extremely loaded statement, and we've been hearing it a lot. RFC 0, remember? Invoking RFC0 immediately after stating your own

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Jon Ericson
Karl Glazebrook wrote: Jon Ericson wrote: I've spent almost a day trying to come up with a polite response to this suggestion. I have started this mail 3 or 4 times but deleted what I wrote because it was too sarcastic, angry or dismissive. This RFC Thanks! strikes to the very

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Mike Pastore
On Wed, 16 Aug 2000, David Corbin wrote: Mike Pastore wrote: $hashish{'dog'}# one whutzit @hashish{'dog', 'cat'} # more than one whutzits each %hashish # one whutzit, indexed %hashish # all whutzits, indexed keys %hashish #

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Porter
Mike Pastore wrote: Scenario 2: ret = grep(/hand/, var); *puzzled expression* "Grepping a scalar for a string? Grepping a list for a string? Returning a list or a scalar?" You have failed to enter the mind of an expert perl programmer. ;-) grep() always treats its "second" arg as

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Mike Pastore
Real quick: On Wed, 16 Aug 2000, John Porter wrote: grep() always treats its "second" arg as a list, even if it's a scalar, or some other list-of-one (or none); and grep() always returns a list, even if it's a list of one (or none). True on the first part, false on the second. In scalar

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Barnette
John Porter wrote: Russ Allbery wrote: $args = 'first second third'; @args = split (' ', $args); my $i = 0; %args = map { $_ = ++$i } @args; This is very Perlish to me; the punctuation is part of the variable name and disambiguates nicely. No, it's not. Where

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Jonathan Scott Duff
On Wed, Aug 16, 2000 at 10:38:30AM -0600, John Barnette wrote: John Porter wrote: Russ Allbery wrote: $args = 'first second third'; @args = split (' ', $args); my $i = 0; %args = map { $_ = ++$i } @args; This is very Perlish to me; the punctuation is part of

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Porter
Jonathan Scott Duff wrote: Gee, I'd hate to lose simple assignment to a hash from a list. foo %= bar; Hmm, I think I need to write an RFC! -- John Porter

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Jonathan Scott Duff
On Wed, Aug 16, 2000 at 12:44:50PM -0400, John Porter wrote: Jonathan Scott Duff wrote: Gee, I'd hate to lose simple assignment to a hash from a list. foo %= bar; Hmm, I think I need to write an RFC! I'll give you my comments right now ... It seems we are eliminating

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Barnette
No, it's not. Where are we taught this? It's a myth. The punctuation imposes context on the variable expression. $foo[0] accesses an array. Where's the "@"? It accesses an *element* of the array, which is a scalar. This scalar might be blessed into a class, or a

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Jonathan Scott Duff
On Wed, Aug 16, 2000 at 10:04:22AM -0700, Damien Neil wrote: I'm not certain that I like the idea of string-indexed arrays; I don't know that I like the thought that $a[5] and $a[05] might suddenly mean something different. They wouldn't. In $a[05], 05 is a number. To get a string, quotes

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread John Porter
Russ Allbery wrote: $args = 'first second third'; @args = split (' ', $args); my $i = 0; %args = map { $_ = ++$i } @args; This is very Perlish to me; the punctuation is part of the variable name and disambiguates nicely. No, it's not. Where are we taught this? It's

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-15 Thread Jon Ericson
Perl6 RFC Librarian wrote: [snip reconstructionist history and newer-is-better fallacy] I argue in this Brave New World the distinction between C$x, C@x and C%x are no longer useful and should be abolished. We might want to use all kinds of array objects, why should @x be special? Rather

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-15 Thread Karl Glazebrook
Jon Ericson wrote: Perl6 RFC Librarian wrote: [snip reconstructionist history and newer-is-better fallacy] I argue in this Brave New World the distinction between C$x, C@x and C%x are no longer useful and should be abolished. We might want to use all kinds of array objects, why

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-15 Thread Damien Neil
On Tue, Aug 15, 2000 at 05:45:04PM -0400, Karl Glazebrook wrote: I hope people will actually read the RFC before coming back with these canned responses which I (and presumably everyone else on this list) am completely familiar with. I used to believe that too! Honest... I think you do a