[svn:parrot-pdd] r35191 - trunk/docs/pdds

2009-01-08 Thread infinoid
Author: infinoid
Date: Wed Jan  7 22:53:23 2009
New Revision: 35191

Modified:
   trunk/docs/pdds/pdd13_bytecode.pod

Log:
[pdd13] Clarify a TODO item somewhat regarding the potential use of
ManagedStruct and/or UnmanagedStruct.

Modified: trunk/docs/pdds/pdd13_bytecode.pod
==
--- trunk/docs/pdds/pdd13_bytecode.pod  (original)
+++ trunk/docs/pdds/pdd13_bytecode.pod  Wed Jan  7 22:53:23 2009
@@ -731,12 +731,8 @@
 will provide a programatic way to construct and walk packfiles, both for the
 Parrot internals and from programs running on the Parrot VM.
 
-{{ TODO... QUESTION: Will the CStruct PMC make it into Parrot? If so, we
-may want to change the interface of these PMCs to take advantage of it.
-ANSWER: Yes it will (most likely with a different name), but it needs to
-be prototyped first. Do you want to hold off on implementing the
-bytecode changes until it's available? I say go ahead and implement now,
-then revise when the new PMC is available. }}
+{{ TODO... ManagedStruct and UnmanagedStruct may be helpful for these;
+consider switching these PMCs over to use them at some point. }}
 
 
 =head3 Packfile.pmc


[perl #62064] tr/// and s/// dont work yet

2009-01-08 Thread via RT
# New Ticket Created by  Richard Hainsworth 
# Please include the string:  [perl #62064]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=62064 >


These dont appear to be implimented, but are not listed in the 
unimplimented page
$ perl6
 > $_='mOkjOkl';tr/O/0/;.say
Statement not terminated properly at line 1, near "/;.say\n"
 > $_='mOkjOkl';tr/'O'/'0'/;.say
Statement not terminated properly at line 1, near "/;.say\n"
 > $_='mOkjOkl';s/ O / 0 /;.say
Statement not terminated properly at line 1, near "/;.say\n"




Re: Writing to an iterator

2009-01-08 Thread Daniel Ruoso
Em Qui, 2009-01-08 às 13:42 +1100, Timothy S. Nelson escreveu:
> On Wed, 7 Jan 2009, Jon Lang wrote:
> > How would I define the method for writing to an iterator?
>   I guess I'd assumed that writing to an iterator wouldn't be possible, 
> as there are kinds of iterators where writing to them makes no sense; I'd 
> assumed that if you wanted to write to something you'd use a list.  Other 
> than 
> as an interesting exercise, I don't see the point of using an iterator for 
> this purpose (there may *be* uses, but I don't see them).

There is at least one use: Some databases (berkeley db comes to my mind)
allow you to perform inserts using a cursor (which would be an iterator
in this case). The Java API also provides a insert mechanism...

Although in some cases, the update API will be specific to the object
you're dealing with, it can just be a regular object which happens to
implement the Iterator role...

daniel



[perl #62066] Null PMC access on (*-1).WHAT in Rakudo

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


 perl6: say (*-1).WHAT
 ..rakudo 35195: OUTPUT«Null PMC access in get_number() [...]
* masak reports rakudobug


[perl #62068] output from .perl for regex

2009-01-08 Thread via RT
# New Ticket Created by  Richard Hainsworth 
# Please include the string:  [perl #62068]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=62068 >


The output from .perl for a regex could be more useful than currently.
I have
$ perl6
 > my $x = /+/; say $x.perl
{ ... }

Doesnt seem to matter what the regex is.

Perhaps,

Regex { + }




[perl #62070] macro not working

2009-01-08 Thread via RT
# New Ticket Created by  Richard Hainsworth 
# Please include the string:  [perl #62070]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=62070 >


I have the following in a file test.pl

macro doit ($word) {
  return quasi >> <<<$word>>> ;>
};

doit('one');
doit('two');
doit('three');


It should - I think - be outputting:
one one
two two
three three

Instead I get:
$ perl6 ./test.pl
Statement not terminated properly at line 1, near "{\n  return"

current instr.: 'parrot;PGE;Util;die' pc 129 
(runtime/parrot/library/PGE/Util.pir:83)
called from Sub 'parrot;Perl6;Grammar;eat_terminator' pc 28962 
(src/gen_grammar.pir:3368)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 27610 
(src/gen_grammar.pir:2835)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 25043 
(src/gen_grammar.pir:1841)
called from Sub 'parrot;Perl6;Grammar;TOP' pc 20899 
(src/gen_grammar.pir:210)
called from Sub 'parrot;PCT;HLLCompiler;parse' pc 634 
(src/PCT/HLLCompiler.pir:388)
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 428 
(src/PCT/HLLCompiler.pir:301)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 862 
(src/PCT/HLLCompiler.pir:500)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1217 
(src/PCT/HLLCompiler.pir:669)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1398 
(src/PCT/HLLCompiler.pir:759)
called from Sub 'parrot;Perl6;Compiler;main' pc 19195 (perl6.pir:162)




STD proposal: Make capture part of the parsing

2009-01-08 Thread Daniel Ruoso
Hi,

I already spoke that on IRC, but this issue seems pretty important, so I
decided to post here instead.

STD currently doesn't make a difference from 

 foo(1,2,3,a=>1,:b(2),:c<4>)

and

 (1,2,3,a=>1,:b(2),:c<4>)

regarding the content inside the parens.

But the spec is pretty much clear that both have very different
meanings, the second is simply a list with 3 ints and 3 pairs, while the
first is a capture with 3 positional arguments and 3 named arguments. It
even exemplifies that in the context of a function/method call you need
to:

 foo(1,2,3,(a=>1),(:b(2)),(:c<4>))

to make it 6 positional arguments

But in order to implement this with current STD, the compiler will need
to hack into the semilist, splice the pairs out to DWIM, which, IMHO, is
a dirty hack.

I'm not sure how that could be done in the grammar, but it would be much
nice if the  token was more detailed than  and used in
some of the places where  is used (at first glance, it looks
like in the  token and ).

Or  could become aware of named arguments, since the comment
before the token is "embedded semis, context-dependent semantics" which
looks very much like a capture.

Of course this is going to break mildew and others like hell, but it
will make things clearer IMHO.

daniel




Scripting competition: password solution

2009-01-08 Thread Richard Hainsworth
Here's a solution to the scripting competition test. Patrick suggested 
publishing solutions somewhere, including this list.


#!/usr/local/bin/perl6
=pod
Patrick Michaud suggested 
(http://use.perl.org/~pmichaud/journal/38134?from=rss) writing solutions to

scripting game definitions as a way of experimenting with perl6.

This program is a suggested solution to event 5, strong passwords, in 
the scripting games. The scenario is described at

http://www.microsoft.com/technet/scriptcenter/funzone/games/games08/aevent5.mspx

So here is my first attempt. I have kept to the definition in the 
competition, even though this means hard coding the top score (13) and 
evaluation points (11,7).


Although I suppose part of the competition is to get funcky ways of 
solving the problem, I just used a straightforward implimentation of the 
tests.
They are so easy in perl6! The only real problem is to associate a test 
with the string to be printed when a test fails.

=cut

use v6;

my $pw = @*ARGS[0];
my @msg;

# Here we have an array of rules that if matched yield a test failure as 
per the game, and the error string to go with it.

my @rules = (
   [{!(10 < .chars < 20)},'Length is under 10 or over 20 characters'],
# Note the .chars! This will be called as the argument of a when clause 
and so $_ will contain the value of $pw.

   [ / ^ <-digit>+ $ / , 'Does not contain a digit'],
=pod
I think this is so neat! It took a while and an email from Patrick to 
find.
 is supplied by PGE (perl6 grammar engine). So by definition, 
<-digit> is not a digit.
A string that does not contain a digit will consist entirely of 
non-digits. Hence by "stretching" the
match pattern from the start ^ of the string to the end of the string $ 
with a pattern containing

as many chars as necessary +, we match a string without a single digit.
=cut
   [ / ^ <-upper>+ $ / , 'Does not contain an upper case letter'],
   [ / ^ <-lower>+ $ / , 'Does not contain an lower case letter'],
   [ / ^ + $ / , 'Does not contain a symbol character'],
   [ /  **4 / , 'Four or more lower case characters in succession'],
   [ /  **4 / , 'Four or more upper case characters in succession'],
   [ / (.) [.+] $0 / , 'A duplicate character with same case is used']
   );
=pod
Developing and testing a pattern that yielded a duplicate character 
ignoring case was so easy it took two minutes to

work out and test.

In order to see how a pattern would work out, I compiled perl6 to an 
executable and put a link to it in /usr/local/bin

then perl6 on the command line in a console and something like
>my $x='abcedeA';$x~~m//??say 'M' !! say 'NM'
M
The > is the prompt from perl6. The M is the response.
What's nice is that a simple cursor-up brings back the previous line 
for experimenting.


see below for why the next section is commented out
=cut
#my @rules4list = (
#['', m/ (:i $pw) /,'Matches a real word'],
#['s/^ . (.*) $ / $0 /', / (:i $pw) /, 'Matches a real word without 
the first character'],
#['s/^ (.*) . $/ $0 /', / (:i $pw) /,'Matches a real word without 
the last character'],
#['tr/O/0/', / (:i $pw) /, 'Matches a real word with digit 0 in 
place of letter O'],
#['tr/l/1/', / (:i $pw) /, 'Matches a real word with digit 1 in 
place of letter l']

#);
#my $orig;

if $pw { # trap zero-length passwords

=pod
This commented out section does not work because three things do not 
appear to have been implimented:
a) m/$pw/ matching a scalar. According to S05 the should be passed raw 
to the matching engine and treated as a string if it does not contain a rule

b) s///
c) tr///
It might not work even so due to some error I've missed.
=cut

#my $words = open('wordlist.txt', :r) or die $!;
#for =$words {
#for @rules4list -> @r {
#$orig = $_;
#eval(@r[0]);
#when @r[1] { push @msg, @r[2] }
#};
#};

   given $pw {
   for @rules -> @r {
   when @r[0] { push @msg, @r[1] }
   }
   };
 
=pod
Isnt perl6 compact? Five lines to run all the tests against $pw and 
capture any error messages

'given' moves the password automatically to $_
'for' takes each of the array and puts it into @r, in this case another 
array because @rules is an array of arrays
'when' applies the test statement to $_, and if a boolean true is the 
result, the next block pushes the message onto the array
Note that one of the tests was a bare block, which is treated as code, 
while the others were bare regexen. when does the rest
Since an error message is pushed onto the array for each failure 
condition, the size of the array gives the score.

=cut

   say 'A password score of '
   ~ 13 - @msg.elems
   ~ ' indicates a '
   ~ (given 13 - @msg.elems {
   when $_ > 10 { 'strong'}
   when $_ > 7 { 'moderately strong'}
   default { 'weak' }
   })
   ~ ' password';
=pod
Here I used the fact that the value of a 'given' block is the value of 
the last block. Since a 'when' block 'breaks' out of the block when 
'called', it is easy
to create thre

Rakudo in Perl culture

2009-01-08 Thread Andy Lester

I like the sound of "Rakudo Tuesday".

xoa


Begin forwarded message:


From: Joe Kline 
Date: January 8, 2009 2:51:53 PM CST
To: Purdue Perl Mongers 
Subject: [Purdue-pm] meeting date

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

- From a recent blog entry by chromatic on use.perl.org:

"We release a new stable version of Rakudo on the third Tuesday every
month, as we've done every month since November 2007"

So our meeting date is Rakudo Tuesday. :-)

joe
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org

iD8DBQFJZmdob0mzA2gRTpkRAqidAJ9bG6olYr+HZZosOG75BiM77SWEoQCeLxns
5jxJ3qOuWNDlfqiwSxmIm8k=
=7VJE
-END PGP SIGNATURE-
___
Purdue-pm mailing list
purdue...@pm.org
http://mail.pm.org/mailman/listinfo/purdue-pm



--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance





Re: Rakudo in Perl culture

2009-01-08 Thread chromatic
On Thursday 08 January 2009 12:53:49 Andy Lester wrote:

> I like the sound of "Rakudo Tuesday".

I can't read the word "Purdue" without thinking "Year of the Purdue Wonder 
Chicken" -- but try working that into Perl 6 advocacy.

-- c


Re: Rakudo in Perl culture

2009-01-08 Thread Andy Lester


On Jan 8, 2009, at 3:11 PM, chromatic wrote:

I can't read the word "Purdue" without thinking "Year of the Purdue  
Wonder

Chicken" -- but try working that into Perl 6 advocacy.



Except that's Perdue.

xoa

--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance





r24809 - docs/Perl6/Spec

2009-01-08 Thread pugs-commits
Author: particle
Date: 2009-01-08 23:06:35 +0100 (Thu, 08 Jan 2009)
New Revision: 24809

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] address backward (in)compatibilities

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-01-08 19:20:06 UTC (rev 24808)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-01-08 22:06:35 UTC (rev 24809)
@@ -14,8 +14,8 @@
 
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
-  Last Modified: 7 Jan 2009
-  Version: 11
+  Last Modified: 8 Jan 2009
+  Version: 12
 
 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
@@ -81,8 +81,14 @@
 =head1 Backward (In)compatibility
 
 Muscles have a long memory. You may find yourself typing your favorite Perl 5
-options, even after Christmas has arrived. {{TODO}}
+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
 
 Several features have not changed from Perl 5, including:
@@ -120,15 +126,96 @@
 
 =back
 
+
 =head2 Removed Syntactic Features
 
-{{ -jg
-need to tell a story about how perl 6 handles the migration from perl 5.
-for example, if -0 is not a valid perl 6 command line option, how does perl 6
-help the user realize and correct the mistake?
-}}
+Some Perl 5 command-line features are no longer available, either because
+there's a new and different way to do it in Perl 6, or because they're
+no longer relevant.  Here's a breakdown of what's been removed:
 
+=over 4
 
+=item -0 *octal/hex*
+
+Sets input record separator.  Missing due to lack of specification in
+L.  There is a comment about this in the L
+section at the end of this document.
+
+=item -C *number/list*
+
+Control unicode features.  Perl 6 has unicode semantics, and assumes a
+UTF-8 command-line interface (until proven otherwise, at which point this
+functionality may be readdressed).
+
+=item -d, -dt, -d:foo, -D, etc.
+
+Debugging commands.  Replaced with the C<++DEBUGGER> metasyntactic option.
+
+=item -E *line*
+
+Execute a line of code, with all features enabled.  This is specific to
+Perl 5.10, and not relevant to Perl 6.
+
+=item -i *extension*
+
+Modify files in-place.  Haven't thought about it enough to add yet, but
+I'm certain it has a strong following. {{TODO review decision here}}
+
+=item -l
+
+Enable automatic line-ending processing.  This is the default behavior.
+
+=item -M *module*, -m *module*, etc.
+
+use/no module.  Replaced by C<--use>.
+
+=item -P
+
+Obsolete.  Removed.
+
+=item -s
+
+Enable rudimentary switch parsing.  By default, Perl 6 parses the
+arguments passed to a script using the rules defined in this document,
+rendering this switch obsolete.
+
+=item -t
+
+Enable taint warnings mode.  Taint mode needs more thought, but it's
+much more likely that the C<-T> switch will take options rather than
+use a second command-line flag for similar behavior.
+
+=item -u
+
+Obsolete.  Removed.
+
+=item -U
+
+Allow unsafe operations.  This is extremely dangerous and infrequently
+used, and doesn't deserve its own command-line option.
+
+=item -w
+
+Enable warnings.  This is the default behavior.
+
+=item -W
+
+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.
+
+=item -X
+
+Disable all warnings.  This is infrequently used, and doesn't deserve its
+own command-line option.
+
+=back
+
+
 =head1 Options and Values
 
 Command line options are parsed using the following rules:



Re: [perl #62010] [PATCH] fix PARROT_EXPORT visibility=default for gcc other than 4.x

2009-01-08 Thread donald . hunter
I was pretty averse to adding an additional configure step myself. The  
problem is that warnings.pm checks specifically for supported compiler  
flags and I didn't want to include other things there. The bug is that  
gcc.pm is hardcoded for version 4.x rather than checking. I didn't want to  
add a duplicate check for -fvisibility=hidden in this file.


As I understand it, -fvisibility=hidden goes hand in hand with  
__attribute__((visibility("default") so a single check covers both. If you  
want to implement the fix as an explicit check for  
__attribute__((visibility("default") in gcc.pm then that would work.


Perhaps the simplest thing to do is just move my check into warnings.pm  
after all. My guess is that it's never right to use -fvisibility=hidden  
without also using __attribute__ ... so if one is used then the other needs  
to be as well. That seems to be the best argument for keeping them in the  
same place.


Cheers,
Donald.


[perl #62086] ~ in regexes shouldn't cause thrown excpetions

2009-01-08 Thread via RT
# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #62086]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=62086 >


Rakudo r35221:

regex t1 {
'(' ~ ')' 'ab'
}

'x(ab'  !~~ m//;
say "done",

The regex match throws an exception because the final ')' isn't found
anywhere.
According to Larry, it shouldn't:
http://irclog.perlgeek.de/perl6/2009-01-08#i_816425

This is tested in t/spec/S05-metachars/tilde.t (which I hope to enhance
soon).

Cheers,
Moritz


-- 
Moritz Lenz
http://perlgeek.de/ |  http://perl-6.de/ | http://sudokugarden.de/


Re: [perl #62010] [PATCH] fix PARROT_EXPORT visibility=default for gcc other than 4.x

2009-01-08 Thread Mark Glines

donald.hun...@gmail.com wrote:
I was pretty averse to adding an additional configure step myself. The 
problem is that warnings.pm checks specifically for supported compiler 
flags and I didn't want to include other things there. The bug is that 
gcc.pm is hardcoded for version 4.x rather than checking. I didn't want 
to add a duplicate check for -fvisibility=hidden in this file.


As I understand it, -fvisibility=hidden goes hand in hand with 
__attribute__((visibility("default") so a single check covers both. If 
you want to implement the fix as an explicit check for 
__attribute__((visibility("default") in gcc.pm then that would work.


Perhaps the simplest thing to do is just move my check into warnings.pm 
after all. My guess is that it's never right to use -fvisibility=hidden 
without also using __attribute__ ... so if one is used then the other 
needs to be as well. That seems to be the best argument for keeping them 
in the same place.


Is there any version of gcc which accepts -fvisibility=hidden but not 
__attribute__((visibility("default")))?  If not, then I'm worrying about 
nothing, and we can probably just use the existing check for both.  But 
I agree, neither of these features makes much sense without the other.


Mark


Re: [perl #62010] [PATCH] fix PARROT_EXPORT visibility=default for gcc other than 4.x

2009-01-08 Thread jerry gay
On Thu, Jan 8, 2009 at 15:42, Mark Glines  wrote:
> donald.hun...@gmail.com wrote:
>>
>> I was pretty averse to adding an additional configure step myself. The
>> problem is that warnings.pm checks specifically for supported compiler flags
>> and I didn't want to include other things there. The bug is that gcc.pm is
>> hardcoded for version 4.x rather than checking. I didn't want to add a
>> duplicate check for -fvisibility=hidden in this file.
>>
>> As I understand it, -fvisibility=hidden goes hand in hand with
>> __attribute__((visibility("default") so a single check covers both. If you
>> want to implement the fix as an explicit check for
>> __attribute__((visibility("default") in gcc.pm then that would work.
>>
>> Perhaps the simplest thing to do is just move my check into warnings.pm
>> after all. My guess is that it's never right to use -fvisibility=hidden
>> without also using __attribute__ ... so if one is used then the other needs
>> to be as well. That seems to be the best argument for keeping them in the
>> same place.
>
> Is there any version of gcc which accepts -fvisibility=hidden but not
> __attribute__((visibility("default")))?  If not, then I'm worrying about
> nothing, and we can probably just use the existing check for both.  But I
> agree, neither of these features makes much sense without the other.
>
decoupling is usually a good thing, but here i don't think it's worth
it. stick this functionality in an existing configure step.
~jerry


Re: Rakudo in Perl culture

2009-01-08 Thread ajr
>
> On Jan 8, 2009, at 3:11 PM, chromatic wrote:
>
>> I can't read the word "Purdue" without thinking "Year of the Purdue
>> Wonder Chicken" -- but try working that into Perl 6 advocacy.
>
> Except that's Perdue
>
> Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance

"A La Recherche Du Temps Perdue"?


--

Email and shopping with the feelgood factor!
55% of income to good causes. http://www.ippimail.com



r24819 - docs/Perl6/Spec

2009-01-08 Thread pugs-commits
Author: lwall
Date: 2009-01-09 02:00:04 +0100 (Fri, 09 Jan 2009)
New Revision: 24819

Modified:
   docs/Perl6/Spec/S02-bits.pod
Log:
[S02] clarify that Pairs and Mappings are mutable in value, but not in key


Modified: docs/Perl6/Spec/S02-bits.pod
===
--- docs/Perl6/Spec/S02-bits.pod2009-01-09 00:41:20 UTC (rev 24818)
+++ docs/Perl6/Spec/S02-bits.pod2009-01-09 01:00:04 UTC (rev 24819)
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall 
   Date: 10 Aug 2004
-  Last Modified: 30 Dec 2008
+  Last Modified: 8 Jan 2009
   Number: 2
-  Version: 147
+  Version: 148
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -954,8 +954,6 @@
 Set Unordered collection of values that allows no duplicates
 Bag Unordered collection of values that allows duplicates
 JunctionSet with additional behaviors
-PairA single key-to-value association
-Mapping Set of Pairs with no duplicate keys
 Signature   Function parameters (left-hand side of a binding)
 Capture Function call arguments (right-hand side of a binding)
 BlobAn undifferentiated mass of bits
@@ -982,6 +980,8 @@
 KeyHash Perl hash that autodeletes values matching default
 KeySet  KeyHash of Bool (does Set in list/array context)
 KeyBag  KeyHash of UInt (does Bag in list/array context)
+PairA single key-to-value association
+Mapping Set of Pairs with no duplicate keys
 Buf Perl buffer (a stringish array of memory locations)
 IO  Perl filehandle
 Routine Base class for all wrappable executable objects
@@ -1034,6 +1034,12 @@
 replicated the number of times specified by its corresponding value.
 (Use C<.kv> or C<.pairs> to suppress this behavior in list context.)
 
+As with C types, C and C are mutable in their
+values but not in their keys.  (A key can be a reference to a mutable
+object, but cannot change its C<.WHICH> identity.  In contrast,
+the value may be rebound to a different object, just as a hash
+element may.)
+
 =head2 Value types
 
 Explicit types are optional. Perl variables have two associated types:



r24822 - docs/Perl6/Spec

2009-01-08 Thread pugs-commits
Author: particle
Date: 2009-01-09 03:07:28 +0100 (Fri, 09 Jan 2009)
New Revision: 24822

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] delimited options use eager matching semantics, are invisible to MAIN, 
but are available via %+OPTS<...>

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 01:02:25 UTC (rev 24821)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 02:07:28 UTC (rev 24822)
@@ -275,8 +275,8 @@
 =item *
 
 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 disambiguate (more below).
+for example C<++>.  You'll usually use two plus characters, but more are
+allowed to avoid ambiguity.
 
 {{TODO put more below, or refer to somewhere with more}}
 
@@ -296,17 +296,24 @@
 
 =item *
 
+Eager matching semantics are used, so the first closing delimeter found
+completes the match.
+
+=item *
+
 Delimited options cannot be negated.
 
 =back
 
-[From the P6 viewpoint, these options should probably be shoved into
-context variables and be invisible to MAIN except as %+OPTS
-or @+PARSER_ARGS or some such.]
+These options are made available in context variables matching their name,
+and are invisible to C except as C<< %+OPTS >>.  For example:
 
-{{TODO %+OPTS it is. explain this.}}
+  ++PARSER --prelude=Perl6-autoloop-no-print ++/PARSER
 
+is available inside your script as C<< %+OPTS >>, and contains
+C<--prelude=Perl6-autoloop-no-print>.
 
+
 Values are parsed with the following rules:
 
 =over 4



r24823 - docs/Perl6/Spec

2009-01-08 Thread pugs-commits
Author: particle
Date: 2009-01-09 03:20:40 +0100 (Fri, 09 Jan 2009)
New Revision: 24823

Modified:
   docs/Perl6/Spec/S19-commandline.pod
Log:
[S19] incorporate more of TimToady++'s notes, and format Notes section as 
proper Pod

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-01-09 02:07:28 UTC (rev 24822)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-01-09 02:20:40 UTC (rev 24823)
@@ -15,7 +15,7 @@
   Maintainer: Jerry Gay 
   Date: 12 Dec 2008
   Last Modified: 8 Jan 2009
-  Version: 12
+  Version: 13
 
 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
@@ -510,13 +510,12 @@
 
 =item PERL6LIB
 
-A list of directories in which to look for Perl library files.
+A list of directories in which to look for ad hoc Perl library files.
 
-Note: this is speculative, as library loading is not yet specified.
+Note: this is speculative, as library loading is not yet specified,
+except insofar as S11 mandates various behaviors incompatible with
+mere directory probing.
 
-[except insofar as S11 mandates various behaviors incompatible with
-mere directory probing...]
-
 =item PERL6OPT
 
 Default command-line arguments. Arguments found here are prepended to the
@@ -548,16 +547,14 @@
 
 =head1 Notes
 
-{{ -jg
-i'd like to be able to adjust the input record separator from command line,
-for instance to specify the equivalent of perl 5's C<$/ = \32768;>. so far,
-i don't have a solution, but perhaps pass a closure that evaluates to an int?
+I'd like to be able to adjust the input record separator from command line,
+for instance to specify the equivalent of perl 5's C<$/ = \32768;>. So far,
+I don't have a solution, but perhaps pass a closure that evaluates to an Int?
+This should try to use whatever option does the same thing to a new
+filehandle when S16 is further developed.
 
-[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?
 
-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
@@ -565,16 +562,9 @@
 we must try to settle on unicode as the default expectation.  I hope POSIX
 dies before Perl 6 does...]
 
-loading a switch parsing module by a switch, instead of using the default.
-maybe via ++RTS, since it needs to happen *before* switches are evaluated.
+Sandboxing? maybe-r
 
-[suggest ++CMD --use_cmd_module ++/CMD]
+Env var? maybe -E.
+Could be posed in terms of substituting a different prelude.
 
-sandboxing? maybe-r
-
-env var? maybe -E
-
-[could be posed in terms of substituting a different prelude]
-}}
-
 =for vim:set expandtab sw=4:



Re: r24819 - docs/Perl6/Spec

2009-01-08 Thread Darren Duncan

pugs-comm...@feather.perl6.nl wrote:

Log:
[S02] clarify that Pairs and Mappings are mutable in value, but not in key



 KeyHash Perl hash that autodeletes values matching default
 KeySet  KeyHash of Bool (does Set in list/array context)
 KeyBag  KeyHash of UInt (does Bag in list/array context)
+PairA single key-to-value association
+Mapping Set of Pairs with no duplicate keys



+As with C types, C and C are mutable in their
+values but not in their keys.  (A key can be a reference to a mutable
+object, but cannot change its C<.WHICH> identity.  In contrast,
+the value may be rebound to a different object, just as a hash
+element may.)


Following this change, it looks to me like Mapping is exactly the same as Hash. 
 So under what circumstances should one now choose whether they want to use a 
Hash or a Mapping?  How do they still differ? -- Darren Duncan


Re: r24809 - docs/Perl6/Spec

2009-01-08 Thread Geoffrey Broadwell
On Thu, 2009-01-08 at 23:06 +0100, pugs-comm...@feather.perl6.nl wrote:
> +=item -0 *octal/hex*
> +
> +Sets input record separator.  Missing due to lack of specification in
> +L.  There is a comment about this in the L
> +section at the end of this document.

I use this option quite a bit -- but only in the bare '-0' syntax,
meaning null-terminated lines, necessary for robust command line pipes.
I only rarely use the full form.  In fact, really rarely.

> +=item -i *extension*
> +
> +Modify files in-place.  Haven't thought about it enough to add yet, but
> +I'm certain it has a strong following. {{TODO review decision here}}

Oh yeah.  I use this a LOT.

> +=item -l
> +
> +Enable automatic line-ending processing.  This is the default behavior.

And there was much rejoicing 


-'f




Re: r24819 - docs/Perl6/Spec

2009-01-08 Thread Jon Lang
Darren Duncan wrote:
> pugs-comm...@feather.perl6.nl wrote:
>>
>> Log:
>> [S02] clarify that Pairs and Mappings are mutable in value, but not in key
>
> 
>>
>> KeyHash Perl hash that autodeletes values matching default
>> KeySet  KeyHash of Bool (does Set in list/array context)
>> KeyBag  KeyHash of UInt (does Bag in list/array context)
>> +PairA single key-to-value association
>> +Mapping Set of Pairs with no duplicate keys
>
> 
>>
>> +As with C types, C and C are mutable in their
>> +values but not in their keys.  (A key can be a reference to a mutable
>> +object, but cannot change its C<.WHICH> identity.  In contrast,
>> +the value may be rebound to a different object, just as a hash
>> +element may.)
>
> Following this change, it looks to me like Mapping is exactly the same as
> Hash.  So under what circumstances should one now choose whether they want
> to use a Hash or a Mapping?  How do they still differ? -- Darren Duncan

I don't think they do.  IMHO, Mapping should definitely be immutable
in both key and value; it is to Hash as Seq is to Array.  (Side note:
why is List considered to be immutable?  Doesn't it change whenever
its iterator is read?)

The question in my mind has to do with Pair: if Pair is being
redefined as mutable in value, should it have an immutable
counterpart?  If so, what should said counterpart be called?

-- 
Jonathan "Dataweaver" Lang