Re: r24809 - docs/Perl6/Spec
pugs-comm...@feather.perl6.nl writes: > +=item -x > + > +Run program embedded in ASCII text. Infrequently used, and doesn't > +deserve its own command-line option. I understand the use case for that option is piping a mail or news message to `perl -x` to run a script contained within it. If that use case is to be handled, it pretty much does need to be able to be triggered from the command line, even if not with a single-char option. I'd be in favour of either explaining why this ability is not considered valuable (if that is indeed the case), or (preferably) restoring a simple command-line-accessible way of achieving the same thing. -- Aaron Crane ** http://aaroncrane.co.uk/
r24844 - docs/Perl6/Spec
Author: particle Date: 2009-01-09 21:57:14 +0100 (Fri, 09 Jan 2009) New Revision: 24844 Modified: docs/Perl6/Spec/S19-commandline.pod Log: [S19] a little copy-editing Modified: docs/Perl6/Spec/S19-commandline.pod === --- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 19:36:48 UTC (rev 24843) +++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 20:57:14 UTC (rev 24844) @@ -80,13 +80,13 @@ =head1 Backward (In)compatibility -Muscles have a long memory. You may find yourself typing your favorite Perl 5 -options, even after Christmas has arrived. As you'll see below, common -options are provided which behave similarly. Less common options, however, -may not be available or may have changed syntax. If you provide Perl with -unrecognized command-line syntax, Perl gives you a friendly error message. -If the unrecognized syntax is a valid Perl 5 option, Perl provides helpful -suggestions to allow you to perform the same action using the current syntax. +You may find yourself typing your favorite Perl 5 options, even after +Christmas has arrived. As you'll see below, common options are provided +which behave similarly. Less common options, however, may not be available +or may have changed syntax. If you provide Perl with unrecognized command- +line syntax, Perl gives you a friendly error message. If the unrecognized +syntax is a valid Perl 5 option, Perl provides helpful suggestions to allow +you to perform the same action using the current syntax. =head2 Unchanged Syntactic Features
r24846 - docs/Perl6/Spec
Author: particle Date: 2009-01-09 22:05:46 +0100 (Fri, 09 Jan 2009) New Revision: 24846 Modified: docs/Perl6/Spec/S19-commandline.pod Log: [S19] describe how to avoid ambiguity when nesting delimited options Modified: docs/Perl6/Spec/S19-commandline.pod === --- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:03:17 UTC (rev 24845) +++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:05:46 UTC (rev 24846) @@ -276,10 +276,8 @@ The opening and closing delimiters begin with two or more plus characters, for example C<++>. You'll usually use two plus characters, but more are -allowed to avoid ambiguity. +allowed to avoid ambiguity when nesting delimited options. -{{TODO put more below, or refer to somewhere with more}} - =item * Opening and closing delimited option names follow option identifier naming @@ -311,9 +309,26 @@ ++PARSER --prelude=Perl6-autoloop-no-print ++/PARSER is available inside your script as C<< %+OPTS >>, and contains -C<--prelude=Perl6-autoloop-no-print>. +C<--prelude=Perl6-autoloop-no-print>. Since eager matching is used, if you +need to pass something like: + ++foo -bar ++foo baz ++/foo ++/foo +you'll end up with + + %+OPTS = '-bar ++foo baz'; + +which is probably not what you wanted. Instead, add extra C<+> characters + + +++foo -bar ++foo baz ++/foo +++/foo + +which will give you + + %+OPTS = '-bar ++foo baz ++/foo'; + +allowing you to properly nest delimited options. + + Values are parsed with the following rules: =over 4
r24847 - docs/Perl6/Spec
Author: particle Date: 2009-01-09 22:13:19 +0100 (Fri, 09 Jan 2009) New Revision: 24847 Modified: docs/Perl6/Spec/S19-commandline.pod Log: [S19] add notes for further design review Modified: docs/Perl6/Spec/S19-commandline.pod === --- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:05:46 UTC (rev 24846) +++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:13:19 UTC (rev 24847) @@ -14,8 +14,8 @@ Maintainer: Jerry Gay Date: 12 Dec 2008 - Last Modified: 8 Jan 2009 - Version: 13 + Last Modified: 9 Jan 2009 + Version: 14 This is a draft document. This document describes the command line interface. It has changed extensively from previous versions of Perl in order to increase @@ -215,7 +215,10 @@ =back +{{TODO for the removed Perl 5 options, address how the same functionality +can be expressed with the command-line syntax}} + =head1 Options and Values Command line options are parsed using the following rules: @@ -402,6 +405,9 @@ arguments passed to C, and is available at C time, so C can respond to command-line options. +{{TODO may create a ++DOC subsystem here. also, may use -d for short name, +even though it clashes with perl 5}} + =item ++DEBUGGER [*switches*, *flags*] ++/DEBUGGER Set debugging switches and flags.
Re: r24846 - docs/Perl6/Spec
pugs-comm...@feather.perl6.nl writes: > +C<--prelude=Perl6-autoloop-no-print>. Since eager matching is used, if you > +need to pass something like: > > + ++foo -bar ++foo baz ++/foo ++/foo > > +you'll end up with > + > + %+OPTS = '-bar ++foo baz'; That doesn't look very "eager" to me. Eirik -- "So this is the Sword of Immortality? Huh? What's it doin' in a CRYPT?!" --- John S. Novak, III, quoting an unnamed player
r24848 - docs/Perl6/Spec
Author: particle Date: 2009-01-09 22:17:42 +0100 (Fri, 09 Jan 2009) New Revision: 24848 Modified: docs/Perl6/Spec/S19-commandline.pod Log: [S19] a note on assumptions Modified: docs/Perl6/Spec/S19-commandline.pod === --- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:13:19 UTC (rev 24847) +++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 21:17:42 UTC (rev 24848) @@ -15,7 +15,7 @@ Maintainer: Jerry Gay Date: 12 Dec 2008 Last Modified: 9 Jan 2009 - Version: 14 + Version: 15 This is a draft document. This document describes the command line interface. It has changed extensively from previous versions of Perl in order to increase @@ -51,14 +51,14 @@ This interface to Perl 6 is special in that it occurs at the intersection of the program and the operating system's command line shell, and thus is not -accessed via a consistent syntax everywhere. Perl is born of Unix, and as such -the syntax presented in this document is expected to work in a Unix-style -shell. To explore the particularities of other operating systems, see -L (TBD). +accessed via a consistent syntax everywhere. A few assumptions are made here, +which will hopefully stand the test of time: All command-line arguments are +assumed to be in Unicode unless proven otherwise; and Perl is born of Unix, +and as such the syntax presented in this document is expected to work in a +Unix-style shell. To explore the particularities of other operating systems, +see L (TBD). -[my notes/conjectures below are all in square brackets --TimToady] - =head1 Command Line Elements The command line is broken down into two basic elements: a I, and @@ -574,15 +574,6 @@ This should try to use whatever option does the same thing to a new filehandle when S16 is further developed. -Do I need to address any unicode concerns? - -[You can try "all command line arguments are assumed to be in unicode -unless proven otherwise" and see how well it flies. :) but this starts -to get into filenames-are-blobs kind of issues...maybe we need a way -of marking arguments as needing to be encoded into a Buf. but for sanity -we must try to settle on unicode as the default expectation. I hope POSIX -dies before Perl 6 does...] - Sandboxing? maybe-r Env var? maybe -E.
Re: r24846 - docs/Perl6/Spec
On Fri, Jan 9, 2009 at 13:16, Eirik Berg Hanssen wrote: > pugs-comm...@feather.perl6.nl writes: > >> +C<--prelude=Perl6-autoloop-no-print>. Since eager matching is used, if you >> +need to pass something like: >> >> + ++foo -bar ++foo baz ++/foo ++/foo >> >> +you'll end up with >> + >> + %+OPTS = '-bar ++foo baz'; > > That doesn't look very "eager" to me. > it's "eager" for the match to close, which is the opposite of "greedy" matching. in perl 5 documentation, it's called "non-greedy". for use and explanation of the terminology, see http://perlcabal.org/syn/S05.html#Backtracking_control. ~jerry
Re: r24846 - docs/Perl6/Spec
"jerry gay" writes: > On Fri, Jan 9, 2009 at 13:16, Eirik Berg Hanssen > wrote: >> That doesn't look very "eager" to me. >> > it's "eager" for the match to close, which is the opposite of "greedy" > matching. in perl 5 documentation, it's called "non-greedy". for use > and explanation of the terminology, see > http://perlcabal.org/syn/S05.html#Backtracking_control. > ~jerry If that's now the case, that's unfortunately confusing. In other contexts, "eagerness" is "leftmost" ("eager" for matching to start, if you like), which is orthogonal to "greed": # Perl Cookbook illustration of eagerness, expanded to demonstrate # that the non-greedy case is equivalent: $string = 'good food'; if ($greedy) { $string =~ s/o*/e/; # 'egood food' } else { $string =~ s/o*?/e/; # 'egood food' } Why not stick to "non-greedy", if that's what you mean? Surely that's not ambiguous? Eirik -- The basic facts are that the rate of decrease of the population growth rate has been falling for decades, at an ever increasing rate. --jsn...@netcom.com (John R. Snead)
Re: r24846 - docs/Perl6/Spec
On Fri, Jan 9, 2009 at 14:26, Eirik Berg Hanssen wrote: > "jerry gay" writes: > >> On Fri, Jan 9, 2009 at 13:16, Eirik Berg Hanssen >> wrote: >>> That doesn't look very "eager" to me. >>> >> it's "eager" for the match to close, which is the opposite of "greedy" >> matching. in perl 5 documentation, it's called "non-greedy". for use >> and explanation of the terminology, see >> http://perlcabal.org/syn/S05.html#Backtracking_control. >> ~jerry > > If that's now the case, that's unfortunately confusing. In other > contexts, "eagerness" is "leftmost" ("eager" for matching to start, if > you like), which is orthogonal to "greed": > ># Perl Cookbook illustration of eagerness, expanded to demonstrate ># that the non-greedy case is equivalent: >$string = 'good food'; >if ($greedy) { > $string =~ s/o*/e/; # 'egood food' >} >else { > $string =~ s/o*?/e/; # 'egood food' >} > > Why not stick to "non-greedy", if that's what you mean? Surely > that's not ambiguous? > > i agree the wording isn't clear here, but it is consistent with the current design language. i don't want to define something with a negative, so i purposefully did not use "non-greedy". i'll bring it up at the next design meeting, so the linguists can weigh in. ~jerry