Re: r25172 - docs/Perl6/Spec

2009-02-04 Thread Leon Timmermans
On Tue, Feb 3, 2009 at 8:34 AM, Richard Hainsworth  wrote:
> I strongly believe the current S16 needs rewriting from scratch. This
> approach seems far more more perl6-ish. I tried to draft a new S16, but
> realised I simply dont have the knowledge (or the time to acquire the
> knowledge) necessary for even an initial draft. But in trying, these are
> some of the ideas I had.

I fully agree.

> c) the file tests :r and :w are not adverbs. They are methods on File
> objects to determine the properties readability and writeability and return
> Booleans. Things which are different should be named differently. Also, in
> my (very limited) experience, testing readability and writeability are less
> frequent in use than opening for read and write, thus for Huffman reasons,
> they should be longer. May be .readable .writeable?

I think what S16 currently proposes is just fine.

> d) The vast majority of S16 seems to be about functions that are essentially
> wrappers around unix calls. To be honest, I have never used most of them
> within a perl program.

Yeah, many of them should be moved to POSIX::, and/or be replaced by
something better.

> When originally developed, it was to fill a need
> directly related to managing unix systems. There are now better tools for
> these tasks, so perl6 does not need to address them in the core.

I'm not sure what you mean with that. I don't think there is any
reason why Perl 6 is inferior to some other tool for managing unix
systems. If it is, we should fix that.

> The success
> of perl on the internet was due to the much deeper design values
> incorporated in perl and that these deeper insights were more adaptable to a
> different environment. There are now a variety of tools for handling the
> internet environment. Perl6 - I believe - is now addressing an even wider
> set of issues - a larger problem space. Leaving unix wrappers in the core
> specifications will tie it down and perhaps hinder its development. Suppose
> perl6 becomes the defacto language for an internet browser, IO would not
> even be related to files or an operating system.)

We have pluggable preludes. We can neutralize that problem easily.

> g) Statbuf is mentioned in S03. It is not really dealt with in S16. It seems
> to me from the context in S03 that Stafbuf is a sort of 'eager'  filehandle,
> in that the whole file is pulled into memory and then can be operated on. If
> this is the case, would it not be more appropriate for the eagerness to be
> defined as an adverb for 'open()' ? eg.
> my $filehandle .= open(, :r, :e);
> Wouldn't this eliminate the need for Statbuf as a defined object type?
>

No, it's just the caching result of stat(), that happens to remember
what file/handle is was called on.

It seems S03 and S16 disagree on the meaning of $filename ~~ :e
though. According to S16 it means $filename.:e, according to S03 it
means $filename.e. I think it was discussed some time ago and S16 is
correct.

> h) Would it not be possible to write the IO specification in such a way as
> to make everything 'outside' the program a single category of IO? Thus
> files, http and ftp connections are all streams into containers and the same
> verb ( 'open()' ) with attendant adverbs (:w, :r) are used to establish them
> and the same set of tests (.readable, .writeable) used to verify the steams
> have the required properties at some point in the programe. All directories
> and urls would all be locations with the same methods to discover container
> objects (files, archives, databases) in them.
>

There's nothing special about IO objects. Nothing is stopping anyone
from writing their own objects implementing the IO roles (in fact,
roles encourage doing just that). I don't understand what's the
question, really.

Though if you mean with open() that is should do what PHP's fopen does
(open anything, from files to http connections and more): absolutely
not. That's the kind of behavior that must be explicit, else we open
up to a whole range of security problems.

Regards,

Leon Timmermans


Re: r25172 - docs/Perl6/Spec

2009-02-04 Thread Carl Mäsak
Leon (>):
> It seems S03 and S16 disagree on the meaning of $filename ~~ :e
> though. According to S16 it means $filename.:e, according to S03 it
> means $filename.e. I think it was discussed some time ago and S16 is
> correct.

No, $filename.e is the newer one; S16 is out-of-date on that point.

// Carl


[perl #63004] A literal array with eight elements gives an imcc parsing error in Rakudo

2009-02-04 Thread Carl Mäsak
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #63004]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=63004 >


Parrot r36318 (before the merge that broke Rakudo), and Rakudo 21f374.

For some reason, creating a literal array with seven elements works,
but not eight.

$ perl6 -e 'my @layers = [0, 0, 0, 0, 0, 0, 0]; .perl.say for @layers'
[0, 0, 0, 0, 0, 0, 0]
$ perl6 -e 'my @layers = [0, 0, 0, 0, 0, 0, 0, 0]; .perl.say for @layers'
error:imcc:syntax error, unexpected ')' (')')
in file 'EVAL_16' line 58
Null PMC access in isa()
[...]


[perl #63014] Array indices in list context should result in a list in Rakudo

2009-02-04 Thread Carl Mäsak
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #63014]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=63014 >


 I just got bitten by a logical bug of sorts: @array[0..0]
results in an element, not in a list.
 what would be the best way to make sure that it is a list I
get? @array[0..0].list?
 aye
 seems to work.
 I expect to be bitten by this one in the future, too. :/
 especially since the endpoints of the range need not be literals.
 I think use of a range operator should imply list
 much like @array[0,] should
 one should think so, yes...
 what do the synopses think?
 does @array[0..0,] work?
 moritz_: the problem, as I hinted, is that my zeroes aren't literals.
 or @array[0..0,()] ?
 TimToady: I'll try, hold on.
 TimToady: no and no, respectively :/
 whatever interpolates a range into a capture should make
sure it's listy in list context
 but I'm not sure rakudo really believes in Captures yes
 seems not.
* masak hesitates on the rakudobug submit button
* moritz_ shouts "go, go, go!"
* mberends too
* masak goes, goes, goes


r25182 - docs/Perl6/Spec

2009-02-04 Thread pugs-commits
Author: ruoso
Date: 2009-02-04 16:37:16 +0100 (Wed, 04 Feb 2009)
New Revision: 25182

Modified:
   docs/Perl6/Spec/S16-io.pod
Log:
[spec/S16] proposed role-based api

Modified: docs/Perl6/Spec/S16-io.pod
===
--- docs/Perl6/Spec/S16-io.pod  2009-02-04 15:21:11 UTC (rev 25181)
+++ docs/Perl6/Spec/S16-io.pod  2009-02-04 15:37:16 UTC (rev 25182)
@@ -15,16 +15,108 @@
  Version:   18
 
 This is a draft document. Many of these functions will work as in Perl
-5, except we're trying to rationalize everything into packages.  For
+5, except we're trying to rationalize everything into roles.  For
 now you can assume most of the important functions will automatically
 be in the * namespace.  However, with IO operations in particular,
 many of them are really methods on an IO handle, and if there is a
 corresponding global function, it's merely an exported version of
 the method.
 
-As a starting point, you can help by finding the official Perl 5 documentation
-for these functions and copying it here. 
+=head1 Roles
 
+The functionality of IO objects is broken down into several roles,
+which should identify the features each object supports.
+
+=head2 IO
+
+The base role only tags that this is an IO object for more generic
+purposes. It doesn't specify any methods or attributes.
+
+=head2 IO::Readable
+
+This role provides unbuffered read access to the data stream.
+
+=over
+
+=item method Int read($buf is rw, int $length)
+
+Tries to read $lenght bytes and store in $buf. The contents of $buf
+are replaced and the actual number of bytes read is returned. A return
+of 0 means end of file. It might return unthrown failures, to be
+specified by each IO implementation.
+
+=back
+
+=head2 IO::Writeable
+
+This role provides unbuffered write access to the data stream.
+
+=over
+
+=item method Int write($buf, int $length)
+
+Tries to write $length bytes of $buf. The actual number of bytes
+written is returned. It might return unthrown failures, to be
+specified by each IO implementation.
+
+=back
+
+=head2 IO::FileDescriptor
+
+This role indicates that this object actually represents an open file
+descriptor in the os level.
+
+=over
+
+=item has int $.fileno
+
+File descriptors are always native integers, conforming to C89.
+
+=back
+
+=head2 IO::Closeable
+
+This role indicates that this object can be closed.
+
+=over
+
+=item method Bool close()
+
+returns True on success, but might return an unthrown failure.
+
+=back
+
+=head2 IO::Buffered
+
+Indicates that this object performs buffering. The management of the
+buffer is completely implementation specific.
+
+=item method Bool flush()
+
+Flushes the buffers associated with this object.
+
+=item has Bool $.autoflush is rw
+
+Forces this object to keep its buffers empty
+
+=head2 IO::POSIX
+
+Indicates that this object can perform standard posix IO operations.
+
+=over
+
+=item method IO dup()
+
+=item has Bool $.blocking is rw
+
+=item method Bool flock(:$r,:$w)
+
+=item method Bool funlock()
+
+=item ...
+
+=back
+
 =head1 Filehandles, files, and directories
 
 =over 4



Re: r25182 - docs/Perl6/Spec

2009-02-04 Thread Aaron Crane
pugs-comm...@feather.perl6.nl writes:
> +=item method Int read($buf is rw, int $length)

I'm not sure that using a native int is the right thing here.  If
whatever the implementation uses as int is narrower than size_t, that
forces the programmer to use an Int and do the necessary loop.

On the other hand, accepting Int allows bignums.  If a bignum $length
is too big to be represented by a native int, but still small enough
to use as a byte count for an I/O operation, then .read can do the
loop internally, freeing the programmer from worrying about such
things.  (And if $length is too big for the memory space, or otherwise
inappropriate for .read, we can throw an exception.)

> +Tries to read $lenght bytes and store in $buf. The contents of $buf

Typo; should be "$length", obviously.

> +=head2 IO::Writeable

FWIW, I prefer the traditional spelling, "writable".  Google suggests
that "writeable" is more common on the web, though; 4.8 versus 3.7
Mghits.

> +=head2 IO::POSIX
> +
> +Indicates that this object can perform standard posix IO operations.

I don't like that wording, but getting it right seems tricky.  The
problem is that I don't think you mean for IO::POSIX to contain
methods corresponding to POSIX-ish read(2), write(2), given that
methods of those names exist in other roles.  But those are precisely
what I'd think of as most obviously falling into the category of
"standard POSIX I/O operations".

> +=item method Bool flock(:$r,:$w)

I realise this part of the specification still seems to be at the stub
stage, but I'll note that:

* We'll also need a way of getting at the LOCK_NB behaviour

* The normal terms for flock() are "shared" and "exclusive" locks, not
  "read" and "write" locks

* It seems a little odd to put an flock method in an IO::POSIX role,
  given that POSIX specifies fcntl(F_SETLK) in place of traditional
  BSD-ish flock().  I'd be in favour of having .fcntl in IO::POSIX, but
  with an additional role providing .flock (IO::Flock, presumably).

-- 
Aaron Crane ** http://aaroncrane.co.uk/


Re: r25182 - docs/Perl6/Spec

2009-02-04 Thread Daniel Ruoso
Em Qua, 2009-02-04 às 16:45 +, Aaron Crane escreveu:
> pugs-comm...@feather.perl6.nl writes:
> > +=item method Int read($buf is rw, int $length)
> I'm not sure that using a native int is the right thing here.  If
> whatever the implementation uses as int is narrower than size_t, that
> forces the programmer to use an Int and do the necessary loop.

native int can't be undefined, failures are undefined. The use of Int
here is to support it returning unthrown exceptions.

> > +=head2 IO::POSIX
> > +
> > +Indicates that this object can perform standard posix IO operations.
> I don't like that wording, but getting it right seems tricky.  The
> problem is that I don't think you mean for IO::POSIX to contain
> methods corresponding to POSIX-ish read(2), write(2), given that
> methods of those names exist in other roles.  But those are precisely
> what I'd think of as most obviously falling into the category of
> "standard POSIX I/O operations".

That actually surprised me, for some reason I did think read and write
were standard C, not POSIX (that's what happens when you don't have
experience in non-unix OSs).

And maybe you're indeed right, since you can change the way you access a
file in POSIX, it would be strange to de-compose a Writeable role if you
change the way you access the io.

but having separated roles for read and write would make it easier to
implement application level io objects (not backed by operating system
file descriptors). That probably means IO::POSIX does IO::Readable does
IO::Writeable.

> > +=item method Bool flock(:$r,:$w)
> I realise this part of the specification still seems to be at the stub
> stage, but I'll note that:

Yes, it was meant purely as an example, a more carefull planning of that
would be needed.

daniel



Re: r25182 - docs/Perl6/Spec

2009-02-04 Thread Aaron Crane
Daniel Ruoso writes:
> Em Qua, 2009-02-04 às 16:45 +, Aaron Crane escreveu:
> > pugs-comm...@feather.perl6.nl writes:
> > > +=item method Int read($buf is rw, int $length)
> > I'm not sure that using a native int is the right thing here.  If
> > whatever the implementation uses as int is narrower than size_t, that
> > forces the programmer to use an Int and do the necessary loop.
> 
> native int can't be undefined, failures are undefined. The use of Int
> here is to support it returning unthrown exceptions.

Sorry, it was the native-int $length parameter I was talking about --
I think it should be a boxed Int instead.

> > POSIX-ish read(2), write(2)
> 
> That actually surprised me, for some reason I did think read and write
> were standard C, not POSIX

C stdio has fread(), fwrite() working on FILE*, with APIs similar
(but not identical) to POSIX read(), write().  C stdio doesn't known
anything about POSIX-ish file descriptors.

> That probably means IO::POSIX does IO::Readable does IO::Writeable.

Yes, indeed.  Sorry, I should have thought of that.

-- 
Aaron Crane ** http://aaroncrane.co.uk/


r25189 - docs/Perl6/Spec

2009-02-04 Thread pugs-commits
Author: ruoso
Date: 2009-02-04 18:45:46 +0100 (Wed, 04 Feb 2009)
New Revision: 25189

Modified:
   docs/Perl6/Spec/S16-io.pod
Log:
[spec/S16] IO::Encoded role, including an idea I just had to allow 
(IN|OUT)PUT_(RECORD|FIELD)_SEPARATOR semantics

Modified: docs/Perl6/Spec/S16-io.pod
===
--- docs/Perl6/Spec/S16-io.pod  2009-02-04 17:16:57 UTC (rev 25188)
+++ docs/Perl6/Spec/S16-io.pod  2009-02-04 17:45:46 UTC (rev 25189)
@@ -38,9 +38,9 @@
 
 =over
 
-=item method Int read($buf is rw, int $length)
+=item method Int read($buf is rw, Int $length)
 
-Tries to read $lenght bytes and store in $buf. The contents of $buf
+Tries to read $length bytes and store in $buf. The contents of $buf
 are replaced and the actual number of bytes read is returned. A return
 of 0 means end of file. It might return unthrown failures, to be
 specified by each IO implementation.
@@ -53,7 +53,7 @@
 
 =over
 
-=item method Int write($buf, int $length)
+=item method Int write($buf, Int $length)
 
 Tries to write $length bytes of $buf. The actual number of bytes
 written is returned. It might return unthrown failures, to be
@@ -101,7 +101,8 @@
 
 =head2 IO::POSIX
 
-Indicates that this object can perform standard posix IO operations.
+Indicates that this object can perform standard posix IO
+operations. It implies IO::Readable and IO::Writeable.
 
 =over
 
@@ -117,6 +118,108 @@
 
 =back
 
+=head2 IO::Encoded
+
+This is a generic role for encoded data streams.
+
+=over
+
+=item has $.encoding is rw
+=item has $.locale is rw
+
+Encoding and locale are required for sane conversions.
+
+=item has $.input_record_separator is rw
+
+This regulates how "readline" behaves.
+
+=item has $.output_record_separator is rw
+
+This regulates how say and print(%hash) behaves.
+
+=item has $.input_field_separator is rw
+
+This regulates how "readfield" behaves.
+
+=item has $.output_field_separator is rw
+
+This regulates how print(@arr), say(@arr), print(%hash) and
+say(%hash) behave.
+
+=item has $.input_escape is rw
+
+This allows the definition of a escape character, which should be used
+by readline and readfield.
+
+=item has $.output_escape is rw
+
+This allows the definition of a escape character, which should be used
+by say and print to preserve the record/field semantics.
+
+
+=back
+
+=head2 IO::Readable::Encoded
+
+This role provides encoded access to a readable data stream, implies
+IO::Encoded. Might imply IO::Buffered, but that's not a requirement.
+
+=over
+
+=item method Str readline
+
+Reads the stream before it finds a $.input_record_separator and
+returns it (including the separator). If $.input_escape is set, it
+should pay attention to that.
+
+=item method Str readfield
+
+Reads the stream before it finds a $.input_field_separator and returns
+it (including the separator). If a readfield finds a
+$.input_record_separator it skips it and reads the next field. If
+$.input_escape is set, it should pay attention to that.
+
+=item method Str getc
+
+Reads the next character in the set $.encoding according to the
+$.locale.
+
+=cut
+
+=head2 IO::Writeable::Encoded
+
+This role provides encoded access to a writeable data stream, implies
+IO::Encoded. Might imply IO::Buffered, but that's not a requirement.
+
+=over
+
+=item method Bool print(Str $str)
+=item method Bool say(Str $str)
+
+Sends $str to the data stream doing proper encoding conversions. Say
+sends an additional $.output_record_separator. This should also
+convert "\n" to the desired $.output_record_separator.
+
+=item method Bool print(Array @arr)
+=item method Bool say(Array @arr)
+
+Sends each element of @arr separated by $.output_field_separator. Say
+should add an additional $.output_record_separator. If an element
+contains the $.output_record_separator or the
+$.output_field_seaparator and a $.output_escape is defined, it should
+do the escaping.
+
+=item method Bool print(Hash %hash)
+=item method Bool say(Hash %hash)
+
+Sends each pair of the hash separated by $.output_record_separator,
+with key and value separated by $.output_field_separator. If one of
+those contains a $.output_record_separator or a
+$.output_field_seaparator and $.output_escape is set, it should do the
+escaping.
+
+=back
+
 =head1 Filehandles, files, and directories
 
 =over 4



Re: r25182 - docs/Perl6/Spec

2009-02-04 Thread Leon Timmermans
On Wed, Feb 4, 2009 at 4:37 PM,   wrote:
> +=head2 IO
> +
> +The base role only tags that this is an IO object for more generic
> +purposes. It doesn't specify any methods or attributes.
> +

Shouldn't IO::readable and IO::Writable do IO?

> +
> +=head2 IO::Closeable
> +

I still think this should be in a more general namespace than IO.

> +
> +=item method IO dup()
> +

Do we really want that? POSIX' dup does something different from what
many will expect. In particular, the new file descriptors share the
offset, which can result in some really confusing situations.

Leon


Re: r25182 - docs/Perl6/Spec

2009-02-04 Thread Aaron Crane
Leon Timmermans writes:
> On Wed, Feb 4, 2009 at 4:37 PM,   wrote:
> > +=item method IO dup()
> 
> Do we really want that?

If we label a thing as "POSIX", it should certainly make all the POSIX
functionality available, IMHO.  I'd consider arguments that we should
pick different names for specific functions where the POSIX names are
particularly awkward, but I think a good default would be to match the
names as well.  Or else avoid the label "POSIX".

> POSIX' dup does something different from what many will expect. In
> particular, the new file descriptors share the offset, which can
> result in some really confusing situations.

To my knowledge, there's no alternative -- that is, there's no POSIX
functionality which allows the creation of a file descriptor open on
the same underlying object as an existing fd, but with its own file
offset.  Assuming I'm right, that doesn't mean users shouldn't get
access to POSIX dup() for when it *is* what they want.

I agree that also providing a less surprising method would be a good
thing, assuming it can be widely implemented.  But it needn't live in
IO::POSIX.

-- 
Aaron Crane ** http://aaroncrane.co.uk/


Programmatic REPL history/result access?

2009-02-04 Thread Mark J. Reed
In csh-influenced shells, you have access to the command history in a
way that lets you say "insert the third argument from the fourth
previous command here".  In Lisp, you have the * variables with the
result of recent exppressions  I think both of these capabilities are
very valuable in an interactive programming environment.  Anything
like that planned for Perl6?

I'm envisioning a global variable like @HISTORY, where either
@HISTORY[0] or @HISTORY[*] would be the most recent command,
@HISTORY[1] or @HISTORY[*-1] the next, etc, and each entry would be an
object containing both the expression evaluated and the result of that
expression...

Without bikeshedding the details, does this seem like something worth
including in the language, or something that would better be provided
by a tool external to the language itself?

-- 
Mark J. Reed 


Re: [perl #63038] AutoReply: Test.pm eats the "Use of uninitialized value" warnings

2009-02-04 Thread Gabor Szabo
apparently this is a feature of Test.pm
though I think a very bad one
Gabor

On Wed, Feb 4, 2009 at 9:00 PM, perl6 via RT
 wrote:
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
>"Test.pm eats the "Use of uninitialized value" warnings",
> a summary of which appears below.
>
> There is no need to reply to this message right now.  Your ticket has been
> assigned an ID of [perl #63038].
>
> Please include the string:
>
> [perl #63038]
>
> in the subject line of all future correspondence about this issue. To do so,
> you may reply to this message.
>
>Thank you,
>perl6-bugs-follo...@perl.org
>
> -
> the following code prints a warning "Use of uninitialized value"
>
> 
> use v6;
>
> my %h;
> say %h;
> 
>
> If this is within a test as follows, the warnings is not printed
>
> 
> use v6;
>
> use Test;
> plan 1;
> ok(1);
>
>
> my %h;
> say %h;
>
> 
>
>


Re: Programmatic REPL history/result access?

2009-02-04 Thread Jonathan Scott Duff
On Wed, Feb 04, 2009 at 01:52:17PM -0500, Mark J. Reed wrote:
> In csh-influenced shells, you have access to the command history in a
> way that lets you say "insert the third argument from the fourth
> previous command here".  In Lisp, you have the * variables with the
> result of recent exppressions  I think both of these capabilities are
> very valuable in an interactive programming environment.  Anything
> like that planned for Perl6?
> 
> I'm envisioning a global variable like @HISTORY, where either
> @HISTORY[0] or @HISTORY[*] would be the most recent command,
> @HISTORY[1] or @HISTORY[*-1] the next, etc, and each entry would be an
> object containing both the expression evaluated and the result of that
> expression...
> 
> Without bikeshedding the details, does this seem like something worth
> including in the language, or something that would better be provided
> by a tool external to the language itself?

Sounds usefulish for the perl 6 REPL.  But not so much for "ordinary"
programming. So, given that, I'd say an external tool (module) is the
way to go.

-Scott
-- 
Jonathan Scott Duff
d...@lighthouse.tamucc.edu


[perl #63038] Test.pm eats the "Use of uninitialized value" warnings

2009-02-04 Thread Patrick R. Michaud via RT
Currently Test.pm disables the warnings to prevent tons of "Use of
uninitialized value" warnings when running the spectests.

Personally I think the spectests should not produce these warnings in
the first place, but I haven't found a good way to avoid/disable them yet.

Pm


r25198 - docs/Perl6/Spec

2009-02-04 Thread pugs-commits
Author: particle
Date: 2009-02-05 02:56:04 +0100 (Thu, 05 Feb 2009)
New Revision: 25198

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] adding --extract-from-text, -x; similar behavior to perl 5, but file may 
now contain unicode text

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-02-05 01:50:35 UTC (rev 25197)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-02-05 01:56:04 UTC (rev 25198)
@@ -14,8 +14,8 @@
 
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
-  Last Modified: 1 Feb 2009
-  Version: 16
+  Last Modified: 4 Feb 2009
+  Version: 17
 
 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
@@ -212,14 +212,6 @@
 Enable all warnings.  This is infrequently used, and doesn't deserve its
 own command-line option.
 
-=item -x
-
-Run program embedded in ASCII text.  Infrequently used, and doesn't
-deserve its own command-line option.
-
-=for consideration
-[but there's no other way to get that functionality if we ever want it. --law]
-
 =item -X
 
 Disable all warnings.  This is infrequently used, and doesn't deserve its
@@ -525,6 +517,16 @@
 Display configuration details.  Desugars to
 C<++CMD -V ++/CMD ++PARSER -V ++/PARSER ++DEBUGGER -V ++/DEBUGGER>.
 
+=item --extract-from-text, -x
+
+Run program embedded in Unicode text.  Scan for the first line starting
+with C<#!> and containing the word C, and start there instead.
+This is useful for running a program embedded in a larger message.
+(In this case you would indicate the end of the program using the C<=END>
+block, as defined in L.)
+
+Desugars to C<--PARSER --Perl6-extract-from-text --/PARSER>.
+
 =back
 
 



r25200 - docs/Perl6/Spec t/spec

2009-02-04 Thread pugs-commits
Author: particle
Date: 2009-02-05 03:14:01 +0100 (Thu, 05 Feb 2009)
New Revision: 25200

Added:
   t/spec/S19-command-line/
   t/spec/S19-invalid/
Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] --autoloop-split, -a: assigns result to @_; signature and option name 
fixups

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-02-05 01:59:03 UTC (rev 25199)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-02-05 02:14:01 UTC (rev 25200)
@@ -15,7 +15,7 @@
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
   Last Modified: 4 Feb 2009
-  Version: 17
+  Version: 18
 
 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
@@ -369,20 +369,21 @@
 =head2 Synopsis
 
   multi sub perl6(
-Bool :a($autosplit),
+Bool :a($autoloop-split),
 Bool :c($check-syntax),
 Bool :$doc,
  :e($execute),
- :F($autoloop-split),
+ :F($autoloop-delim),
 Bool :h($help),
  :I(@include),
- :u($use),
+ :L($language),
 Bool :n($autoloop-no-print),
  :O($output-format) = 'exe',
  :o($output-file) = $*OUT,
 Bool :p($autoloop-print),
 Bool :S($search-path),
 Bool :T($taint),
+ :u($use),
 Bool :v($version),
 Bool :V($verbose-config),
   );
@@ -391,12 +392,13 @@
 
 =over 4
 
-=item --autosplit, -a
+=item --autoloop-split, -a
 
-Turns on autosplit mode.
+When used with C<-n> or C<-p>, implicitly splits input on whitespace
+(by default) and assigns the result to C<@_> within the loop produced
+by the C<-n> or C<-p>.
 
-=for consideration
-[what does it split to?  @F like P5?  Or should we switch to @_? --law]
+An alternate delimiter may be specified with C<--autoloop-delim>, a.k.a. C<-F>.
 
 =item ++CMD --command-line-parser *parser* ++/CMD
 
@@ -440,7 +442,7 @@
 =for consideration
 [doesn't work without a semicolon! (unless we special case it) --law]
 
-=item --autoloop-split, -F *expression*
+=item --autoloop-delim, -F *expression*
 
 Pattern to split on (used with -a).  Substitutes an expression for the default
 split function, which is C<{split ' '}>.  Accepts unicode strings (as long as



Re: r25200 - docs/Perl6/Spec t/spec

2009-02-04 Thread Jon Lang
 wrote:
> -=item --autoloop-split, -F *expression*
> +=item --autoloop-delim, -F *expression*
>
>  Pattern to split on (used with -a).  Substitutes an expression for the 
> default
>  split function, which is C<{split ' '}>.  Accepts unicode strings (as long as

Should the default pattern be ' ', or should it be something more like /\s+/?

-- 
Jonathan "Dataweaver" Lang


r25201 - docs/Perl6/Spec

2009-02-04 Thread pugs-commits
Author: particle
Date: 2009-02-05 03:32:49 +0100 (Thu, 05 Feb 2009)
New Revision: 25201

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] shortened ++DEBUGGER to ++BUG, which seems a better mnemonic then ++DEB.

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-02-05 02:14:01 UTC (rev 25200)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-02-05 02:32:49 UTC (rev 25201)
@@ -15,7 +15,7 @@
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
   Last Modified: 4 Feb 2009
-  Version: 18
+  Version: 19
 
 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
@@ -153,7 +153,7 @@
 
 =item -d, -dt, -d:foo, -D, etc.
 
-Debugging commands.  Replaced with the C<++DEBUGGER> metasyntactic option.
+Debugging commands.  Replaced with the C<++BUG> metasyntactic option.
 
 =item -E *line*
 
@@ -421,15 +421,12 @@
 {{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
+=item ++BUG [*switches*, *flags*] ++/BUG
 
-Set debugging switches and flags.
+Set switches and flags for the debugger.
 
-Note: This is speculative, for lack of a debugger specification.
+Note: The debugger needs further specification.
 
-=for consideration
-[a bit unweildy for common use. ++DEB maybe?  -law]
-
 =item --execute, -e *line*
 
 Execute a single-line program.  Multiple C<-e> options may be chained together,
@@ -512,12 +509,12 @@
 =item --version, -v
 
 Display program name, version, patchlevel, etc.  Desugars to
-C<++CMD -v ++/CMD ++PARSER -v ++/PARSER ++DEBUGGER -v ++/DEBUGGER>.
+C<++CMD -v ++/CMD ++PARSER -v ++/PARSER ++BUG -v ++/BUG>.
 
 =item --verbose-config, -V
 
 Display configuration details.  Desugars to
-C<++CMD -V ++/CMD ++PARSER -V ++/PARSER ++DEBUGGER -V ++/DEBUGGER>.
+C<++CMD -V ++/CMD ++PARSER -V ++/PARSER ++BUG -V ++/BUG>.
 
 =item --extract-from-text, -x
 
@@ -540,7 +537,7 @@
 variable.
 
 Standard in Perl 6 are three underlying components, C, C,
-and C.  Implementations may expose other components via this
+and C.  Implementations may expose other components via this
 interface, so consult the documentation for your Perl 6 implementation.
 
 {{TODO more description and examples}}



r25202 - docs/Perl6/Spec

2009-02-04 Thread pugs-commits
Author: particle
Date: 2009-02-05 03:42:30 +0100 (Thu, 05 Feb 2009)
New Revision: 25202

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] don't special-case C<-e6>, require C<-e '6;'>

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-02-05 02:32:49 UTC (rev 25201)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-02-05 02:42:30 UTC (rev 25202)
@@ -15,7 +15,7 @@
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
   Last Modified: 4 Feb 2009
-  Version: 19
+  Version: 20
 
 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
@@ -433,12 +433,9 @@
 each one representing an input line with an implicit newline at the end.
 
 If you wish to run in lax mode, without strictures and warnings enabled,
-pass a value of '6' to the first -e on the command line, like C<-e6>.
+pass a value of '6;' to the first -e on the command line, like C<-e '6;'>.
 See L for details.
 
-=for consideration
-[doesn't work without a semicolon! (unless we special case it) --law]
-
 =item --autoloop-delim, -F *expression*
 
 Pattern to split on (used with -a).  Substitutes an expression for the default



r25205 - docs/Perl6/Spec

2009-02-04 Thread pugs-commits
Author: particle
Date: 2009-02-05 06:19:27 +0100 (Thu, 05 Feb 2009)
New Revision: 25205

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] remove -o, as -O now defaults to STDOUT -- TimToady++. shuffle some list 
items around, to match order in perl6() signature

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-02-05 03:24:20 UTC (rev 25204)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-02-05 05:19:27 UTC (rev 25205)
@@ -15,7 +15,7 @@
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
   Last Modified: 4 Feb 2009
-  Version: 20
+  Version: 21
 
 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
@@ -378,14 +378,14 @@
  :I(@include),
  :L($language),
 Bool :n($autoloop-no-print),
- :O($output-format) = 'exe',
- :o($output-file) = $*OUT,
+ :O($output-format),
 Bool :p($autoloop-print),
 Bool :S($search-path),
 Bool :T($taint),
  :u($use),
 Bool :v($version),
 Bool :V($verbose-config),
+Bool :X($extract-from-text),
   );
 
 =head2 Reference
@@ -453,16 +453,12 @@
 standard library follows the policies laid out in
 L.
 
-=item --use, -u *module*
+=item --language, -L *dsl*
 
-C<--use *module*> and C<-u *module*> desugars to C<-e 'use *module*'>.
-Specify version info and import symbols by appending info to the module name:
+Set the domain specific language for parsing the script file.  (That is,
+specify the I (often known as the prelude) for the program.)
+C<++PARSER --setting=*dsl* ++/PARSER>.
 
-  -u'Sense:ver<1.2.1>:auth '
-
-You'll need the quotes so your shell doesn't complain about redirection.
-There is no special command-line syntax for C<'no *module*>, use C<-e>.
-
 =item --autoloop-no-print, -n
 
 Act like awk.  Desugars to
@@ -470,30 +466,15 @@
 
 =item --output-format, -O *format*
 
-Specify the file format for the output file requested with C<--output-file>.
-This option is implementation-specific, so consult the documentation for your
-Perl 6 implementation.
+Emit compiler output to STDOUT in the specified format, rather than invoking
+the compiled code immediately. This option is implementation-specific, so
+consult the documentation for your Perl 6 implementation for further details.
 
-=item --output-file, -o [*filename*]
-
-Compile to a file, rather than run immediately.  If no filename is specified,
-STDOUT is used.  Specify the output format with C<--output-format>.
-
-=for consideration
-[perhaps -o is unnecessary if -O implies STDOUT.  --law]
-
 =item --autoloop-print, -p
 
 Act like sed.  Desugars to
 C<++PARSER --setting=Perl6-autoloop-print ++/PARSER>.
 
-=item --language, -L *dsl*
-
-Set the domain specific language for parsing the script file.  (That is,
-specify the I (often known as the prelude) for the program.)
-C<++PARSER --setting=*dsl* ++/PARSER>.
-
-
 =item --search-path, -S
 
 Use PATH environment variable to search for script specified on command-line.
@@ -503,6 +484,16 @@
 Turns on "taint" checking. See L for details.
 Commits very early.  Put this option as early on the command-line as possible.
 
+=item --use, -u *module*
+
+C<--use *module*> and C<-u *module*> desugars to C<-e 'use *module*'>.
+Specify version info and import symbols by appending info to the module name:
+
+  -u'Sense:ver<1.2.1>:auth '
+
+You'll need the quotes so your shell doesn't complain about redirection.
+There is no special command-line syntax for C<'no *module*>, use C<-e>.
+
 =item --version, -v
 
 Display program name, version, patchlevel, etc.  Desugars to