Re: A shorter long dot
On Saturday 29 April 2006 21:50, Damian Conway wrote: > Is: > > > $antler. .bar; > > $xyzzy. .bar; > > $blah. .bar; > > $foo. .bar; > > really so intolerable, for those who are gung-ho to line up the method > names? I'm still wondering what's awful about: $antler.bar; $xyzzy.bar; $blah.bar; $foo.bar; -- c
Re: A shorter long dot
Austin Hastings wrote: > Or, to put it another way: what hard problem is it that you guys are > actively avoiding, that you've spent a week talking about making > substantial changes to the language in order to facilitate lining up > method names? That's a very good point too. Initially it's just a cute idea for filling in the 2-character method invocation gap, as well as making $x.+method and $x.:method line up, but it's probably not worth people's time in arguing this any further... Consider my suggestion retracted, and sorry for the disturbance in the force. :) Thanks, Audrey signature.asc Description: OpenPGP digital signature
german perl6 tutorial
dear camels, especially all german speaking camels. im currently writing a perl6 tutorial in a wiki at: http://wiki.perl-community.de/bin/view/Wissensbasis/Perl6Tutorial Please join if you like or help when finished and nothing better there to translate to english. Its nearly half ready, vars, ops, flow control is (with some holes) covered currentl work is on subroutine chapter. herbert aka lichtkind
Re: A shorter long dot
Damian Conway skribis 2006-04-30 9:49 (+1000): > This would make the enormous semantic difference between: >foo. :bar() > and: >foo :bar() And how is that very different from the enormous semantic difference between: foo. .bar() and: foo .bar() that already exists? I understand your point, and tend to agree with it, but it counts for both ".:" AND ". .". > PS: While I can understand the appeal to laziness, I'm not at all convinced > by the argument: > > And it's a lot of work (many, many keystrokes!) > > to go back and change something. > In vim, the exact number of keystrokes to realign the long dots of > N lines is 7+N. If you plan it, sure. But without planning, you easily get to 12 and more. It's not just about the number of keystrokes, though. Having to go back itself is awkward. > We need to be careful not to require the language to solve > problems that are better solved with tools. I think we should be careful, and are careful, to support lots of tools. Many programmers prefer simple editors. Many programmers who use advanced editors, like to keep them at the default settings. And whenever you have to create a macro to do something that's common in a certain programming language, that programming language was badly designed. Let's not let Perl 6 be such a language. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
Audrey Tang skribis 2006-04-30 17:31 (+0800): > Austin Hastings wrote: > > Or, to put it another way: what hard problem is it that you guys are > > actively avoiding, that you've spent a week talking about making > > substantial changes to the language in order to facilitate lining up > > method names? Sorry, I disagree strongly. Lining things up is an important aspect to how people use Perl. > Consider my suggestion retracted, and sorry for the disturbance in the > force. :) I still want to talk about it. Good arguments (about trailing dot being hard to spot, and about underscores) are made, and I think healthy discussion can lead to a much better solution than the current long dot. People who think it wastes their time, by now know what this thread is about, and can choose to ignore it. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
chromatic skribis 2006-04-30 2:06 (-0700): > I'm still wondering what's awful about: > $antler.bar; >$xyzzy.bar; > $blah.bar; > $foo.bar; That's what I will do when current long dot stays, but I prefer to keep things left-aligned to the indentation level. These cascades look messy. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
Yuval Kogman skribis 2006-04-30 2:58 (+0300): > > We need to be careful not to require the language to solve problems that > > are better solved with tools. > On that point I agree, but I think it was a question of > aesthetics... Juerd? Yes, it was about both aesthetics and the extra work involved. But mostly aesthetics and a bad feeling. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
Jonathan Lang skribis 2006-04-29 19:08 (-0700): > Is there a reason that we've been insisting that a long dot should use > whitespace as filling? I don't know. > foo.___.bar Would still have the problem of clashing with .. when there's no _ in between. > foo.___:bar Would suffice for my needs. Not sure if people are willing to give up their underscore-only method names, though. Perhaps whitespace can be allowed in numbers too: 5 000 000; 5_000_000; Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
On 4/30/06 7:44 AM, Juerd wrote: > Jonathan Lang skribis 2006-04-29 19:08 (-0700): >> Is there a reason that we've been insisting that a long dot should use >> whitespace as filling? > > I don't know. > >> foo.___.bar > > Would still have the problem of clashing with .. when there's no _ in > between. > >> foo.___:bar > > Would suffice for my needs. Not sure if people are willing to give up > their underscore-only method names, though. No one's going to use either of these because they're ugly. Lining things up is at least partly about making things pretty for most people. -John
Re: A shorter long dot
John Siracusa skribis 2006-04-30 8:15 (-0400): > >> foo.___:bar > > Would suffice for my needs. Not sure if people are willing to give up > > their underscore-only method names, though. > No one's going to use either of these because they're ugly. "I am not going to use either of these because I think they're ugly." I don't think it's ugly. It's not any less tidy. $xyzzy.foo() $xyzzy.foo() $fooz.:foo() $fooz.:foo() $foo._:foo() $foo. :foo() $da.__:foo() $fa. :foo() My variable names aren't so long that I'm likely to have foo.___:bar, and $foo.__:bar is clean. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
> I don't think it's ugly. It's not any less tidy. > > $xyzzy.foo() $xyzzy.foo() > $fooz.:foo() $fooz.:foo() > $foo._:foo() $foo. :foo() > $da.__:foo() $fa. :foo() > > My variable names aren't so long that I'm likely to have > foo.___:bar, and $foo.__:bar is clean. But it doesn't work across lines: $xyzzy.foo() $fooz.:foo() $foo. :foo() $fa. :foo() $and_a_long_one_I_still_want_to_align. :foo() $etc. :foo() -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/
Re: A shorter long dot
Juerd wrote: > foo.___:bar Would suffice for my needs. Not sure if people are willing to give up their underscore-only method names, though. When is the last time that you saw an underscore-only method name? Gaal Yahas wrote: But it doesn't work across lines: Take another look at my original proposal: I didn't suggest _replacing_ whitespace with underscores; I suggested _supplementing_ it[1] - so $xyzzy.foo() $fooz.:foo() $foo. :foo() $fa. :foo() $and_a_long_one_I_still_want_to_align. :foo() $etc. :foo() would still work, but so would $foo._:foo() $fa.__:foo() $and_a_long_one_I_still_want_to_align._ __:foo() $etc._:foo() ...and the latter five would be the recommended way of doing it. -- Jonathan Lang [1] This is a nod to TIMTOWTDI; technically, one could be as restrictive as requiring any block of whitespace in a long dot to begin with a newline (thus restricting its use to line wrapping and alignment of the new line) and still have a perfectly viable long dot syntax.
Re: A shorter long dot
On Sat, Apr 29, 2006 at 05:15:08PM +0200, Juerd wrote: : Larry indicated that changing the long dot would have to involve : changing the first character. The only feasible solution in the "tiny : glyphs" section was the backtick. I refrain from explaining why that : will widely be considered a bad idea. "Only feasible"? I think you guys give up too easily. I believe either or both of ¬ or \ qualify as feasible, actually: $xyzzy.foo(); $fooz\.foo(); $foo\ .foo(); $xyzzy.foo(); $fooz¬.foo(); $foo¬ .foo(); Neither of those are currently legal in infix position. The backslash has the advantage of "hiding" semantics, so it would mean "hide any whitespace before the next dot (including no whitespace)". The NOT operator can have similar semantics "Here is some *not* whitespace." Actually, there is a postfix \(...), but that wouldn't interfere with a \. construct. Visually you'd never use \. in a place where there weren't also longer dots, so there's surrounding context indicating that \ is not trying to backslash the dot itself. Alternately, as with French quotes, the ¬ could be the primary form, and \ (or something like it, -| maybe) would be the Texas version. Backslash also has the advantage of making sense to a C programmer: $foo\ .foo(); even though it has been generalized to quote any whitespace, not just newline, so that $foo\ # comment .foo(); works. So of course the $foo\#[ comment ].foo(); also would work if you want more visual distinction on both ends of the whitespace. Larry
Re: A shorter long dot
Gaal Yahas skribis 2006-04-30 16:05 (+0300): > But it doesn't work across lines: > $and_a_long_one_I_still_want_to_align. > :foo() Explain to me why it wouldn't work, please. I don't get it. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
Larry Wall skribis 2006-04-30 9:58 (-0700): > On Sat, Apr 29, 2006 at 05:15:08PM +0200, Juerd wrote: > : Larry indicated that changing the long dot would have to involve > : changing the first character. The only feasible solution in the "tiny > : glyphs" section was the backtick. I refrain from explaining why that > : will widely be considered a bad idea. > "Only feasible"? I think you guys give up too easily. ... in the "tiny glyphs" section. We could go with larger glyphs, like \, of course -- it just hadn't been considered yet. > Actually, there is a postfix \(...), but that wouldn't interfere with > a \. construct. There's prefix \, though: It creates a big difference between $foo \.bar and $foo\ .bar # currently the same thing But I don't think that's a problem. > $foo\ > .foo(); I've never liked continuation characters, but I could live with this limited application. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: A shorter long dot
On Sun, Apr 30, 2006 at 09:58:21AM -0700, Larry Wall wrote: > Neither of those are currently legal in infix position. The backslash > Backslash also has the advantage of making sense to a C programmer: > > $foo\ > .foo(); So this also would be legal? $foo\ .foo(); ? (and therefore presumably the variant that is a bug in C or Makefiles: $foo\ .foo(); I don't mean that as a counter argument. It's an argument in favour. That space you can't see is a really annoying invisible bug in C source code that's sometimes hard to track down. Making it not-a-bug seems good.) Nicholas Clark
Re: A shorter long dot
On Sun, Apr 30, 2006 at 07:01:06PM +0200, Juerd wrote: > Gaal Yahas skribis 2006-04-30 16:05 (+0300): > > But it doesn't work across lines: > > $and_a_long_one_I_still_want_to_align. > > :foo() > > Explain to me why it wouldn't work, please. I don't get it. This form certainly will. I hadn't read Jonathan's original proposal carefully enough, where he also shows how the other form could, if you allow mixing whitespace with the underscores. My bad. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/
Re: A shorter long dot
On Sun, Apr 30, 2006 at 06:33:01PM +0100, Nicholas Clark wrote: : On Sun, Apr 30, 2006 at 09:58:21AM -0700, Larry Wall wrote: : : > Neither of those are currently legal in infix position. The backslash : : > Backslash also has the advantage of making sense to a C programmer: : > : > $foo\ : > .foo(); : : So this also would be legal? : : $foo \ : .foo(); : : ? That's a legal long dot but still a Perl syntax error because you've got two terms in a row. A postfix still isn't allowed to have space before it, so the backslash must be the first thing. : (and therefore presumably the variant that is a bug in C or Makefiles: : : $foo \ : .foo(); It does fix that bug, since \ quotes any whitespace, not just newline. : I don't mean that as a counter argument. It's an argument in favour. That : space you can't see is a really annoying invisible bug in C source code that's : sometimes hard to track down. Making it not-a-bug seems good.) Seems so to me too. I don't see much downside to \. as a long dot. Larry
[svn:perl6-synopsis] r9042 - doc/trunk/design/syn
Author: larry Date: Sun Apr 30 10:43:33 2006 New Revision: 9042 Modified: doc/trunk/design/syn/S02.pod doc/trunk/design/syn/S03.pod doc/trunk/design/syn/S04.pod doc/trunk/design/syn/S12.pod Log: Long dot is now introduced by backslash. Modified: doc/trunk/design/syn/S02.pod == --- doc/trunk/design/syn/S02.pod(original) +++ doc/trunk/design/syn/S02.podSun Apr 30 10:43:33 2006 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 10 Aug 2004 - Last Modified: 26 Apr 2006 + Last Modified: 30 Apr 2006 Number: 2 - Version: 34 + Version: 35 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -141,33 +141,35 @@ =item * -In addition to the general comment forms above, there is a whitespace-only -comment form that begins and ends with a single dot, separated by whitespace, +In addition to the general comment forms above, there is a +whitespace-only comment form that begins with backslash and ends +with a single dot, separated by 0 or more characters of whitespace, which is equivalent to a single dot: -%hash. .{$key} -@array. .{$key} +%hash\ .{$key} +@array\ .[$ix] +$subref\.($arg) This is useful for lining up postfixes. This is known as the "long dot", -partly because it substitutes for a dot without the need for a third dot: +partly because it substitutes for a dot without the need for an extra dot: -$object. .say(); +$object\ .say(); The whitespace in the middle may include any of the comment forms above. -Because comments always count as whitespace, the dots in +Because comments always count as whitespace, the C<\.> in -$object.#{ foo }.say +$object\#{ foo }.say reduce to a "long dot" rather than the range operator. Valid ways to insert a line break into a sequence of method calls include: -$object. # comment +$object\ # comment .say -$object.#[ comment +$object\#[ comment ].say -$object. +$object\ .say =item * @@ -659,8 +661,8 @@ corresponding C<.()> operator, plus the "long dot" forms that allow you to insert optional whitespace and comments between dots: -&foo. .($arg1, $arg2); -&foo.#[ +&foo\ .($arg1, $arg2); +&foo\#[ embedded comment ].($arg1, $arg2); Modified: doc/trunk/design/syn/S03.pod == --- doc/trunk/design/syn/S03.pod(original) +++ doc/trunk/design/syn/S03.podSun Apr 30 10:43:33 2006 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 8 Mar 2004 - Last Modified: 26 Apr 2006 + Last Modified: 30 Apr 2006 Number: 3 - Version: 24 + Version: 25 =head1 Changes to existing operators @@ -802,8 +802,8 @@ I syntax: %monsters.{'cookie'} = Monster.new; - %people. .{'john'} = Person.new; - %cats. .{'fluffy'} = Cat.new; + %people\ .{'john'} = Person.new; + %cats\ .{'fluffy'} = Cat.new; =head1 Precedence Modified: doc/trunk/design/syn/S04.pod == --- doc/trunk/design/syn/S04.pod(original) +++ doc/trunk/design/syn/S04.podSun Apr 30 10:43:33 2006 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 19 Aug 2004 - Last Modified: 25 Apr 2006 + Last Modified: 30 Apr 2006 Number: 4 - Version: 18 + Version: 19 This document summarizes Apocalypse 4, which covers the block and statement syntax of Perl. @@ -674,7 +674,7 @@ if $term{$x} # subscript because postfix expected if $term {$x} # expression followed by statement block if $term.{$x} # valid subscript with dot -if $term. .{$x}# valid subscript with "long dot" +if $term\ .{$x}# valid subscript with "long dot" Similar rules apply to array subscripts: @@ -682,7 +682,7 @@ if $term[$x] # subscript because postfix expected if $term [$x] # syntax error (two terms in a row) if $term.[$x] # valid subscript with dot -if $term. .[$x]# valid subscript with "long dot" +if $term\ .[$x]# valid subscript with "long dot" And to the parentheses delimiting function arguments: @@ -690,7 +690,7 @@ if $term($x) # function call because operator expected if $term ($x) # syntax error (two terms in a row) if $term.($x) # valid function call with dot -if $term. .($x)# valid function call with "long dot" +if $term\ .($x)# valid function call with "long dot" Outside of any kind of expression brackets, a final closing curly on a line (not counting whitespace or comments) always reverts Modified: doc/trunk/design/syn/S12.pod
Re: Fw: ([EMAIL PROTECTED]) Re: A shorter long dot
On Sun, Apr 30, 2006 at 03:47:54AM +0300, Yuval Kogman wrote: > On Sat, Apr 29, 2006 at 18:12:34 +0100, Nicholas Clark wrote: > > On Sat, Apr 29, 2006 at 05:59:37PM +0200, Juerd wrote: > > > I get a message like this for every message that I send to this list. > > > Trying to contact [EMAIL PROTECTED] did not result in response or change. > > > > > > Any ideas? > > > > Forward that message (with full headers) to [EMAIL PROTECTED] > > who will then apply the LART. > > > > As I figure I'm about to get one, I'll (also) forward mine. > > Just got one... > > By LARTing you mean forcibly unsubscribing? because the message was > sent to me directly too... Yes, I believe that that's the usual solution to resolve the problem of any system that is sufficiently borked to be sending garbage to the list or the sender. I think that at times there have been utterly brain dead challenge response systems that have managed to repeatedly get themselves subscribed - they tend to get banned. (Seems totally reasonable, given that the perl.org sysadmins are volunteers, and have many better things to do than offer free consulting to the admins of badly behaved third party systems.) Nicholas Clark
Re: [svn:perl6-synopsis] r9042 - doc/trunk/design/syn
In a message dated Sun, 30 Apr 2006, [EMAIL PROTECTED] writes: The whitespace in the middle may include any of the comment forms above. -Because comments always count as whitespace, the dots in +Because comments always count as whitespace, the C<\.> in -$object.#{ foo }.say +$object\#{ foo }.say reduce to a "long dot" rather than the range operator. Valid ways to The reference to the range operator doesn't make sense anymore. Trey
Re: A shorter long dot
Larry Wall wrote: Seems so to me too. I don't see much downside to \. as a long dot. The only remaining problem that I see for the long dot is largely orthogonal to the selection of the first and last characters - namely, that your only choice for filler is whitespace. Although the C<\.> option opens an intriguing possibility of defining the long dot pattern as "backslash, dot or whitespace (repeated zero or more times), dot": $xyzzy.foo() $fooz\.foo() $foo\..foo() $fa\...foo() $and_a_long_one_I_still_want_to_align\ ...foo() $etc\..foo() -- Jonathan Lang
[svn:perl6-synopsis] r9047 - doc/trunk/design/syn
Author: larry Date: Sun Apr 30 18:51:14 2006 New Revision: 9047 Modified: doc/trunk/design/syn/S02.pod Log: More long dot cleanup from trey++ et al. Modified: doc/trunk/design/syn/S02.pod == --- doc/trunk/design/syn/S02.pod(original) +++ doc/trunk/design/syn/S02.podSun Apr 30 18:51:14 2006 @@ -107,9 +107,9 @@ say #( embedded comment ) "hello, world!"; -$object.#{ embedded comments }.say; +$object\#{ embedded comments }.say; -$object.#「 +$object\ #「 embedded comments 」.say; @@ -160,7 +160,7 @@ $object\#{ foo }.say -reduce to a "long dot" rather than the range operator. Valid ways to +reduce to a "long dot". Valid ways to insert a line break into a sequence of method calls include: $object\ # comment @@ -202,23 +202,23 @@ $x.++ -$x. .++ +$x\ .++ -$x.#( comment ).++ -$x.#((( comment ))).++ +$x\#( comment ).++ +$x\#((( comment ))).++ -$x. +$x\ .++ -$x.# comment +$x\# comment # more comment .++ -$x.#『 comment +$x\#『 comment more comment 』.++ -$x.#[ comment 1 +$x\#[ comment 1 comment 2 =begin podstuff whatever (pod comments ignore current parser state) @@ -1368,18 +1368,15 @@ =item 6. A sequence of one or more unparenthesized method call, followed by any of 1 through 5 -=item 7. An embedded comment that uses bracketing characters, such -as .#(comment). - =back In other words, this is legal: -"Val = $a.ord.#( Yikes! ).as('%x')\n" +"Val = $a.ord.as('%x')\n" and is equivalent to -"Val = { $a.ord.#( Yikes! ).as('%x') }\n" +"Val = { $a.ord.as('%x') }\n" =item *
[svn:perl6-synopsis] r9048 - doc/trunk/design/syn
Author: larry Date: Sun Apr 30 18:55:42 2006 New Revision: 9048 Modified: doc/trunk/design/syn/S02.pod Log: Couple more long dots. Modified: doc/trunk/design/syn/S02.pod == --- doc/trunk/design/syn/S02.pod(original) +++ doc/trunk/design/syn/S02.podSun Apr 30 18:55:42 2006 @@ -255,7 +255,7 @@ Use some variant of -foo. +foo\ .method if you mean the postfix method call. @@ -1606,7 +1606,7 @@ foo.bar# foo().bar -- postfix prevents args foo .bar # foo($_.bar) -- no postfix starts with whitespace -foo. .bar # foo().bar -- long dot, so postfix +foo\ .bar # foo().bar -- long dot, so postfix foo++ # foo()++ -- postfix foo 1,2,3 # foo(1,2,3)-- args always expected after listop foo + 1# foo(+1) -- term always expected after listop