Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Peter Scott
At 09:06 PM 4/24/2001 -0700, Larry Wall wrote: Edward Peschko writes: : Ok, so what does: : : my %hash = ( 1 = 3); : my $hash = { 1 = 4}; : : print $hash{1}; : : print? 4. You must say %hash{1} if you want the other. I was teaching an intro class yesterday and as usual, there were several

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread David L. Nicol
John Porter wrote: We could y/$@%/@%$/ ... ... and create an alternate parser able to handle the full internal internals API. I have finally figured out the main motivation behind the whole perl6 effort: the obfuscated perl contests were getting repetitive. Good night.

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Bart Lateur
On Tue, 24 Apr 2001 18:39:09 -0700 (PDT), Larry Wall wrote: Edward Peschko writes: : I guess my question is what would be the syntax to access hashes? Would : : $hashref.{ } : : be that desirable? I really like -{ } in that case.. It won't be either of those. It'll simply be $hashref{ }.

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Bart Lateur
On Tue, 24 Apr 2001 21:06:56 -0700 (PDT), Larry Wall wrote: : Ok, so what does: : : my %hash = ( 1 = 3); : my $hash = { 1 = 4}; : : print $hash{1}; : : print? 4. You must say %hash{1} if you want the other. Ok. So how about hash slices? Is $hash{$a, $b}, the faked multidimensional hash,

Re: Another string concat proposal

2001-04-25 Thread Nicholas Clark
On Wed, Apr 25, 2001 at 11:53:33AM +0100, Dave Hartnoll wrote: What about using double-dot as the string concat operator: P5P6 -. . .. .=..= (or =.. for concat after) You have missed a row for what the P5 .. operator becomes. And the ... operator [I am neutral as to

Another string concat proposal

2001-04-25 Thread Dave Hartnoll
What about using double-dot as the string concat operator: P5P6 -. . .. .=..= (or =.. for concat after) Many other operators already use doubled characters so this would not be an oddity for perl and it would leave single dot for all the things Larry wants it for without

Re: Another string concat proposal

2001-04-25 Thread Dave Hartnoll
On Wed, Apr 25, 2001 at 11:53:33AM +0100, Dave Hartnoll wrote: What about using double-dot as the string concat operator: P5P6 -. . .. .=..= (or =.. for concat after) You have missed a row for what the P5 .. operator becomes. And the ... operator [I am neutral

Re: Another string concat proposal

2001-04-25 Thread Dave Hartnoll
I wrote.. ..(I would have suggested - but that introduces problems with it meaning the same as comma in some situations.) Ignore that. I'm getting confused with = sometimes meaning the same as comma. I think I'll quit now before I dig myself any deeper :-) Dave.

Re: Sane + string concat proposal

2001-04-25 Thread Bart Lateur
On Wed, 25 Apr 2001 08:25:40 -0400, Stephen P. Potter wrote: | I'm really beginning to like | | $string3 = $string1 _ $string2; | | The underscore indeed connects the two strings. This still breaks because _ is a valid word character. So are cmp, and, lt, and the proposed cat and cc.

Re: Sane + string concat proposal

2001-04-25 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Bart Lateur [EMAIL PROTECTED] whis pered: | I'm really beginning to like | | $string3 = $string1 _ $string2; | | The underscore indeed connects the two strings. This still breaks because _ is a valid word character. Again, we have to make the

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Larry Wall
Bart Lateur writes: : Er... hip hip hurray?!?! : : This is precisely the reason why I came up with the raw idea of : highlander variables in the first place: because it's annoying not being : able to access a hash passed to a sub through a hash reference, in the : normal way. Not unless you do

Re: YA string concat proposal

2001-04-25 Thread John Porter
Uri Guttman wrote: .= could still be left working as that is a complete separate op from method invocation. I see a major potential problem with that. Assuming (which I do) that the equals operator will be overridable, then you'll need to be able to write $obj.='x'; meaning this

Re: Tying Overloading

2001-04-25 Thread James Mastros
From: Larry Wall [EMAIL PROTECTED] Sent: Monday, April 23, 2001 1:10 PM Subject: Re: Tying Overloading Helgason writes: : I _really_ think dot-syntax would make perl prettier as well as make it : more acceptable to the world of javacsharpbasic droids. Which is some : kind of goal, no?

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Eric Roode
Nathan Wiger wrote: Here's something I was thinking about at lunch: $concated_number = $number + $other_number; $numerical_add = $number + $other_number; One major, MAJOR pet peeve I have wrt Javascript is that it uses + to mean concatenation as well as addition, and that it (like

Re: Tying Overloading

2001-04-25 Thread Jonathan Scott Duff
On Wed, Apr 25, 2001 at 12:44:11PM -0400, James Mastros wrote: I hate yelling without good reason, but this /is/ good reason. CAN SOMBODY PLEASE TELL ME A _GOOD_ REASON TO SWITCH TO . FOR METHOD CALLS? You've made it impossible for anyone to answer you until you tell us what good means to

Re: Flexible parsing (was Tying Overloading)

2001-04-25 Thread Dan Sugalski
At 01:36 PM 4/25/2001 -0400, Eric Roode wrote: John Porter wrote: Dan Sugalski wrote: The one downside is that you'd have essentially your own private language. Whether this is a bad thing or not is a separate issue, of course. IIUC, this ability is precisely what Larry was saying

Re: Flexible parsing (was Tying Overloading)

2001-04-25 Thread Eric Roode
John Porter wrote: Dan Sugalski wrote: The one downside is that you'd have essentially your own private language. Whether this is a bad thing or not is a separate issue, of course. IIUC, this ability is precisely what Larry was saying Perl6 would have. I may have my history wrong here, but

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Simon Cozens
On Mon, Apr 23, 2001 at 12:59:54PM -0700, Nathan Wiger wrote: Doesn't ~ look like a piece of string to you? :-) It looks like a bitwise op to me, personally. That's because every time you've used it in Perl, it's been a bitwise op. Sapir-Whorf, and all that. -- So what if I have a fertile

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Graham Barr
On Wed, Apr 25, 2001 at 06:46:20PM +0100, Simon Cozens wrote: On Mon, Apr 23, 2001 at 12:59:54PM -0700, Nathan Wiger wrote: Doesn't ~ look like a piece of string to you? :-) It looks like a bitwise op to me, personally. That's because every time you've used it in Perl, it's been a

YAYAYA string concat proposal

2001-04-25 Thread Garrett Goebel
Suggestion: prepend a ~ or , to numeric comparison operators Addresses the key concerns: o frees up . o spaces insensitive (though cmp, eq, ...do care about spaces) o using the , instead of ~ would be 1 keystroke on most keyboards o ~ and , visually intuit a string (~ more than ,) o avoids:

Re: Dot can DWIM without whitespace

2001-04-25 Thread Simon Cozens
On Tue, Apr 24, 2001 at 07:38:50PM -0700, Brent Dax wrote: IMHO, . can DWIM in most cases even if it's both object deref _and_ concat--without paying any attention to whitespace. Please, no. Some of us have to *teach* this language. -- The trouble with computers is that they do what you tell

Curious: - vs .

2001-04-25 Thread Nathan Wiger
I'm just gonna post this, then back off and listen (been yapping too much...) The previous discussions about string concat and how to replace . have revealed that people are somewhat divided over whether replacing - with . is actually good thing or not. I'm just curious what the arguments for

Re: Tying Overloading

2001-04-25 Thread Andy Dougherty
On Wed, 25 Apr 2001, James Mastros wrote: I hate yelling without good reason, but this /is/ good reason. CAN SOMBODY PLEASE TELL ME A _GOOD_ REASON TO SWITCH TO . FOR METHOD CALLS? It might be prudent to avoid rushing to judgment until the bigger picture becomes clearer. We have yet to see

Re: Curious: - vs .

2001-04-25 Thread Russ Allbery
Nathan Wiger [EMAIL PROTECTED] writes: - C compatibility. One of Perl's great strengths over other HLL's is C compatibility. Though this is still arguably not as good as it can be, why distance ourselves from the language we're trying to interact with? You're

Re: s/./~/g

2001-04-25 Thread David L. Nicol
Eric Roode wrote: What is it about . that seems to inspire allergic reactions in people? Surely it's not the . itself, but the requirement that you fit everything into that one syntactic mold. Perl's not going to do that. No, more like . is already used for something. The only reason I

Re: Dot can DWIM without whitespace

2001-04-25 Thread Edward Peschko
On Wed, Apr 25, 2001 at 06:30:37PM +0100, Simon Cozens wrote: On Tue, Apr 24, 2001 at 07:38:50PM -0700, Brent Dax wrote: IMHO, . can DWIM in most cases even if it's both object deref _and_ concat--without paying any attention to whitespace. Please, no. Some of us have to *teach* this

Re: Dot can DWIM without whitespace

2001-04-25 Thread Paul Johnson
On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote: I think its really time to have a vote on this Aaargh. I don't. Wouldn't you rather wait and see what Larry is planning with all this? I doubt the proposed changes are gratuitous, and I think he's got a pretty good track record

Re: Dot can DWIM without whitespace

2001-04-25 Thread Edward Peschko
On Thu, Apr 26, 2001 at 01:03:50AM +0200, Paul Johnson wrote: On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote: I think its really time to have a vote on this Aaargh. I don't. Wouldn't you rather wait and see what Larry is planning with all this? I doubt the proposed

Re: Dot can DWIM without whitespace

2001-04-25 Thread Bryan C . Warnock
On Wednesday 25 April 2001 18:33, Edward Peschko wrote: On Wed, Apr 25, 2001 at 06:30:37PM +0100, Simon Cozens wrote: On Tue, Apr 24, 2001 at 07:38:50PM -0700, Brent Dax wrote: IMHO, . can DWIM in most cases even if it's both object deref _and_ concat--without paying any attention to

a modest proposal Re: s/./~/g

2001-04-25 Thread Fred Heutte
It seems to me that ~ relates to forces (operators, functions and methods) more than to atoms (scalars), so to speak. It's the curve of binding Perl at work here. So why not leave . alone and have ~ substitute for - $mydsn-Sql($mysqlstmt . $moresql) ; $mydsn~Sql($mysqlstmt . $moresql) ;

Re: a modest proposal Re: s/./~/g

2001-04-25 Thread Casey West
On Wed, Apr 25, 2001 at 06:19:40PM +, Fred Heutte wrote: : It seems to me that ~ relates to forces (operators, functions and methods) : more than to atoms (scalars), so to speak. It's the curve of binding Perl : at work here. : : So why not leave . alone and have ~ substitute for - :

Re: Dot can DWIM without whitespace

2001-04-25 Thread Edward Peschko
'.' is already, to some extent, space sensitive anyway, because it has to pull double duty as a decimal point, as well. '4.5' (4.5) vs '4 .5' (45) vs '4. 5' (missing operator) beautiful. Then extending this is simple, consistent, easy to read, compatible with perl5.. Ed

Re: Dot can DWIM without whitespace

2001-04-25 Thread Simon Cozens
On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote: Please, no. Some of us have to *teach* this language. Then I guess that either space sensitive '.' is the answer Sorry. I'll try it again. SPACE SENSITIVE and SOME OF US HAVE TO TEACH IT. Do you understand yet? Are you *really*

Re: Dot can DWIM without whitespace

2001-04-25 Thread Edward Peschko
On Thu, Apr 26, 2001 at 03:16:46AM +0100, Simon Cozens wrote: On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote: Please, no. Some of us have to *teach* this language. Then I guess that either space sensitive '.' is the answer Sorry. I'll try it again. SPACE SENSITIVE and

Re: Dot can DWIM without whitespace

2001-04-25 Thread Bryan C . Warnock
On Wednesday 25 April 2001 21:37, Edward Peschko wrote: '.' is already, to some extent, space sensitive anyway, because it has to pull double duty as a decimal point, as well. '4.5' (4.5) vs '4 .5' (45) vs '4. 5' (missing operator) beautiful. Then extending this is simple, consistent,

Re: Dot can DWIM without whitespace

2001-04-25 Thread Edward Peschko
beautiful. Then extending this is simple, consistent, easy to read, compatible with perl5.. I'm not sure that that was the point I was trying to make. If nothing else, the '.' would then be responsible for *three* different actions. Right, but what *I* am saying is that any given user

Re: Dot can DWIM without whitespace

2001-04-25 Thread Casey West
On Wed, Apr 25, 2001 at 07:23:47PM -0700, Edward Peschko wrote: : On Thu, Apr 26, 2001 at 03:16:46AM +0100, Simon Cozens wrote: : On Wed, Apr 25, 2001 at 03:33:52PM -0700, Edward Peschko wrote: :Please, no. Some of us have to *teach* this language. : Then I guess that either space

Re: Dot can DWIM without whitespace

2001-04-25 Thread Edward Peschko
More often that you might think. I see Perl folks who love white space writing: print $cgi - header, $cgi - start_html, $cgi - h2( 'my page' ), $cgi - hr, $cgi - a( { -href = 'http://geeknest.com' }, $cgi -

Re: Dot can DWIM without whitespace

2001-04-25 Thread Buddha Buck
Edward Peschko [EMAIL PROTECTED] writes: beautiful. Then extending this is simple, consistent, easy to read, compatible with perl5.. I'm not sure that that was the point I was trying to make. If nothing else, the '.' would then be responsible for *three* different actions.

Re: a modest proposal Re: s/./~/g

2001-04-25 Thread Graham Barr
On Wed, Apr 25, 2001 at 06:19:40PM +, Fred Heutte wrote: It seems to me that ~ relates to forces (operators, functions and methods) more than to atoms (scalars), so to speak. It's the curve of binding Perl at work here. So why not leave . alone and have ~ substitute for -