Re: how about just juxtaposing? (Re: Sane "+" string concat proposal)

2001-04-26 Thread Michael G Schwern
On Wed, Apr 25, 2001 at 12:36:33AM -0500, David L. Nicol wrote: > > Ah.. I knew I'd find the thread in here somewhere. > > The problems go away if you allow white space to signify. > > > > [...] Consider > > > > print "Foo" > > foo("bar"); > > > > Did the author forget a

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 la

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

Re: how about just juxtaposing? (Re: Sane "+" string concat proposal)

2001-04-24 Thread David L. Nicol
Ah.. I knew I'd find the thread in here somewhere. The problems go away if you allow white space to signify. > [...] Consider > > print "Foo" > foo("bar"); > > Did the author forget a semi-colon, or did they intend to concatinate > there? Also, consider this... they for

Re: Sane "+" string concat proposal

2001-04-24 Thread Bart Lateur
On Wed, 25 Apr 2001 00:37:53 +0100, Simon Cozens wrote: >>$string3 = $string1 . $string2; >>$string3 = "$string1" + "$string2"; > >That's now *five* characters required to perform a very common operation. > >Rather than one. I'm really beginning to like $string3 = $string1 _ $s

Re: Sane "+" string concat proposal

2001-04-24 Thread Simon Cozens
On Tue, Apr 24, 2001 at 11:42:00AM -0700, Nathan Wiger wrote: > THESE ARE NOT THE SAME TIRED ARGUMENTS! Ooh, different tired arguments! >$string3 = $string1 . $string2; >$string3 = "$string1" + "$string2"; That's now *five* characters required to perform a very common operation. Rathe

Re: Sane "+" string concat proposal

2001-04-24 Thread Dan Sugalski
At 03:38 PM 4/24/2001 -0700, Nathan Wiger wrote: >"Stephen P. Potter" wrote: > > > > You still haven't given a good explanation of > > > > $a += sub(); # is it a string or a number? > > > > Does your plan mean that we can no longer have subs that are context > > dependent? > >No, Schwern aske

Re: Sane "+" string concat proposal

2001-04-24 Thread Nathan Wiger
"Stephen P. Potter" wrote: > > You still haven't given a good explanation of > > $a += sub(); # is it a string or a number? > > Does your plan mean that we can no longer have subs that are context > dependent? No, Schwern asked me this same thing off list, here's what I said: One possibi

Re: Sane "+" string concat proposal

2001-04-24 Thread Dan Brian
> | Under what I originally posted: > | > |$a += "$b";# string > |$a += $b; # numeric > > You still haven't given a good explanation of > > $a += sub();# is it a string or a number? The quotes don't work. Anything but the most basic statement introduces way more ambiguity

Re: Sane "+" string concat proposal

2001-04-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Nathan Wiger <[EMAIL PROTECTED]> whisper ed: | Michael G Schwern wrote: | > | > Oh, not to seed the clouds or anything, but what about "+=" and ".="? | > Any proposal will have to deal with those. | | Under what I originally posted: | |$a += "$b";#

Re: Sane "+" string concat proposal

2001-04-24 Thread Nathan Wiger
Michael G Schwern wrote: > > Oh, not to seed the clouds or anything, but what about "+=" and ".="? > Any proposal will have to deal with those. Under what I originally posted: $a += "$b";# string $a += $b; # numeric Seems easy enough... -Nate

Re: how about just juxtaposing? (Re: Sane "+" string concat proposal)

2001-04-24 Thread Edward Peschko
> This is going to make finding syntax errors a bit difficult, as many > will simply become concatination operators. Consider > > print "Foo" > foo("bar"); > > Did the author forget a semi-colon, or did they intend to concatinate > there? Also, consider this... *sigh*. Ok,

Re: Sane "+" string concat proposal

2001-04-24 Thread Dan Brian
> The only reason you'd have to use the op form of a string concat is when > you have to add stuff in that isn't evaluated inside quotes, like funcs. That doesn't make sense. Your proposal was to cause quotes to force concat context, but here you say the op is only useful when evaluating stuff ou

Re: Sane "+" string concat proposal

2001-04-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Casey West <[EMAIL PROTECTED]> whispere d: | I would consider thinking about the bigger problem of: | | $string = foo() [something here] bar(); In either case, quoting the operands isn't going to work. $string = "foo()" + "bar()"; And, my one argument sti

Re: Sane "+" string concat proposal

2001-04-24 Thread Nathan Wiger
"Stephen P. Potter" wrote: > > | In Perl 6, you would do this like so: > | > |$string3 = "$string1" + "$string2"; > > Once you go this route, you've pretty much destroyed the usefulness of > having a concat operator. It is far less typing to do > >$string3 = "$string1$string2"; Ag

Re: how about just juxtaposing? (Re: Sane "+" string concat proposal)

2001-04-24 Thread Casey West
On Tue, Apr 24, 2001 at 08:42:10PM +0100, Michael G Schwern wrote: : On Tue, Apr 24, 2001 at 02:32:39PM -0500, Jarkko Hietaniemi wrote: : > Has the road of just putting things next to each other been extensively : > tried? It works for Awk... "juxtapose", the Famous Invisible Perl : > Operator.

Re: Sane "+" string concat proposal

2001-04-24 Thread Casey West
On Tue, Apr 24, 2001 at 08:32:09PM +0100, Michael G Schwern wrote: : On Tue, Apr 24, 2001 at 12:23:24PM -0700, Austin Hastings wrote: : > Some of the objections have gone by, but what if you reverse the : > quotes? : > Make operator-in-quotes be a string operator (hell, make that true for : > the

Re: how about just juxtaposing? (Re: Sane "+" string concat proposal)

2001-04-24 Thread Michael G Schwern
On Tue, Apr 24, 2001 at 02:32:39PM -0500, Jarkko Hietaniemi wrote: > Has the road of just putting things next to each other been extensively > tried? It works for Awk... "juxtapose", the Famous Invisible Perl > Operator. > > Perl 5 Perl 6 > > $a = $b . $c;

Re: Sane "+" string concat proposal

2001-04-24 Thread jc vazquez
From: "Austin Hastings" <[EMAIL PROTECTED]> > Perl 5Perl 6 > - > $name = "This" . "that"; $name = "This" "+" "that"; $name = "+" "+" "+" "+"; # uh???

how about just juxtaposing? (Re: Sane "+" string concat proposal)

2001-04-24 Thread Jarkko Hietaniemi
I think the magical "+" isn't going to work. Has the road of just putting things next to each other been extensively tried? It works for Awk... "juxtapose", the Famous Invisible Perl Operator. Perl 5 Perl 6 $a = $b . $c; $a = $b $c; # or $b$c

Re: Sane "+" string concat proposal

2001-04-24 Thread Michael G Schwern
On Tue, Apr 24, 2001 at 12:23:24PM -0700, Austin Hastings wrote: > Some of the objections have gone by, but what if you reverse the > quotes? > Make operator-in-quotes be a string operator (hell, make that true for > the other ops, too) > > Perl 5 Perl 6 > --- ---

Re: Sane "+" string concat proposal

2001-04-24 Thread Austin Hastings
Some of the objections have gone by, but what if you reverse the quotes? Make operator-in-quotes be a string operator (hell, make that true for the other ops, too) Perl 5 Perl 6 --- --- -> . + + . "+" eq "=" or

Re: Sane "+" string concat proposal

2001-04-24 Thread Casey West
On Tue, Apr 24, 2001 at 03:09:18PM -0400, Stephen P. Potter wrote: : Lightning flashed, thunder crashed and Nathan Wiger <[EMAIL PROTECTED]> whisper : ed: : | Under this proposal, string concatenation would be acheived by the : | *combination* of "" and +. So, in Perl 5 you would have something li

Re: Sane "+" string concat proposal

2001-04-24 Thread John Porter
Nathan Wiger wrote: > string concatenation would be acheived by the > *combination* of "" and +. >$string3 = "$string1" + "$string2"; > Here's the key: The quotes are REQUIRED. If you left them > off, you'd get numeric addition. There is no magic type > inference. That, imho, is bending way

Re: Sane "+" string concat proposal

2001-04-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Nathan Wiger <[EMAIL PROTECTED]> whisper ed: | Under this proposal, string concatenation would be acheived by the | *combination* of "" and +. So, in Perl 5 you would have something like | this: | |$string3 = $string1 . $string2; | | In Perl 6, you woul

Re: Sane "+" string concat proposal

2001-04-24 Thread Jonathan Scott Duff
On Tue, Apr 24, 2001 at 11:42:00AM -0700, Nathan Wiger wrote: >Perl 5Perl 6 >- >$res = $var + $var2; $res = $var + $var2; >$name = "This" . "that"; $name = "This" + "that"; >$name = "

Re: Sane "+" string concat proposal

2001-04-24 Thread Casey West
On Tue, Apr 24, 2001 at 11:53:49AM -0700, Mark Koopman wrote: : >Perl 5Perl 6 : >- : >print "Next is " . $i + 1;print "Next is " + $i + 1; : : : this is the root of the problemPerl 5 version is e

Re: Sane "+" string concat proposal

2001-04-24 Thread Michael G Schwern
On Tue, Apr 24, 2001 at 11:53:49AM -0700, Mark Koopman wrote: > >Perl 5Perl 6 > >- > >print "Next is " . $i + 1;print "Next is " + $i + 1; > > > this is the root of the problemPerl 5 version is e

Re: Sane "+" string concat proposal

2001-04-24 Thread Dan Brian
> If, instead, you wrote: > >$me = $name + getpwuid($<); > > You would get numeric addition. Always. In this way, you maintain a > reliable semantic separation of string concat and numeric addition, > while gaining a syntax that is similar to other HLL's. Having "$var" > expand $var is the r

Re: Sane "+" string concat proposal

2001-04-24 Thread Michael G Schwern
Seems servicable. Doesn't exactly make me jump up and down, though. A few nits... On Tue, Apr 24, 2001 at 11:42:00AM -0700, Nathan Wiger wrote: > More Details > > Ok, if you're still reading, cool. Let's get down to the nitty-gritty. > Here are some more examples of code: > >

Re: Sane "+" string concat proposal

2001-04-24 Thread Mark Koopman
>Perl 5Perl 6 >- >print "Next is " . $i + 1;print "Next is " + $i + 1; this is the root of the problemPerl 5 version is easy to understand, Perl 6 version is still ambiguous