Re: Meditations on a Loop

2009-05-21 Thread Larry Wall
On Wed, May 20, 2009 at 07:55:55PM -0500, John M. Dlugosz wrote:
 If you would be so kind, please take a look at  
 http://www.dlugosz.com/Perl6/web/med-loop.html.  I spent a couple days  
 on this, and besides needing it checked for correctness, found a few  
 issues as well as more food for thought.

It's been legal (for more than two years) to nest a condtional inside
a loop modifier without extra parens:

@array = ($_ if .prime for 1..10);

In fact, the first example in S04 Loop statements is:

@evens = ($_ * 2 if .odd for 0..100);

And since the when modifier counts as a conditional, you can rewrite

grep Dog, @mammals

as

$_ when Dog for @mammals;

So perhaps will see a lot of subtypes used this way: 

subset Odd if Int where { $_ % 2 };
@evens = ($_ * 2 when Odd for 0..*);

Well, those examples are pretty silly.  Anyone with better
examples should feel free to edit the specs.

Larry


Re: Meditations on a Loop

2009-05-21 Thread Carl Mäsak
Timothy (), John ():
 If you would be so kind, please take a look at
 http://www.dlugosz.com/Perl6/web/med-loop.html.  I spent a couple days on
 this, and besides needing it checked for correctness, found a few issues as
 well as more food for thought.

        John, I very much enjoyed your article.  I'm hoping that at some
 point, it would be possible to merge it into U4X, which is the Userdocs for
 Christmas project (I think Carl Masak is the appropriate contact person for
 this).

Not yet having read the article, I just wanted to pop by saying that
there's a good chance something like this can end up in the
'tutorials' section of u4x. The best way to ascertain this is to put a
mention in u4x/TODO, so I just did this.

// Carl


Parrot 1.2.0 Bird Brain released!

2009-05-21 Thread Mark Glines
On behalf of the Parrot team, I'm proud to announce Parrot 1.2.0
Bird Brain.  Parrot (http://parrot.org/) is a virtual machine aimed
at running all dynamic languages.

Parrot 1.2.0 is available on Parrot's FTP site, or follow the
download instructions at http://parrot.org/download.  For those who
would like to develop on Parrot, or help develop Parrot itself, we
recommend using Subversion on the source code repository to get the
latest and best Parrot code.

Parrot 1.2.0 News:
- Core
  + Fixes for pir classes inheriting from core pmcs.
  + Cleaned up headers and reorganized some sources into subsystem
directories.
  + Clean up PMCs so libparrot.so exports far fewer vtable/method symbols.
  + Clean up the GC API.
  + Several unicode identifier improvements in IMCC.
- Deprecations
  + Protoobject stringification is gone.
- Documentation
  + Rewrite several core documents.
  + Many reworks, improvements  additions to the Parrot Book.
  + Installation PDD is launched out of draft.
- Tools
  + Fixes for running the language shell generator outside the parrot tree.
  + Several fixes for developing and building HLLs from an installed parrot.
  + Configure.pl now has a --no-line-directives option to ease source
level debugging.
- Miscellaneous
  + Portability updates for macports, netbsd, mingw32, hpux.
  + Several (build time, runtime) performance improvements.
  + Lots of updates to examples and tests.
  + Various bugfixes, code cleanups, and coding standard fixes.


Many thanks to all our contributors for making this possible, and our
sponsors for supporting this project.  Our next scheduled release is 16
June 2009.

Enjoy!




What is U4X?

2009-05-21 Thread John M. Dlugosz

Can someone post a link?


Re: What is U4X?

2009-05-21 Thread Leon Timmermans
On Thu, May 21, 2009 at 4:18 PM, John M. Dlugosz
2nb81l...@sneakemail.com wrote:
 Can someone post a link?

http://svn.pugscode.org/pugs/docs/u4x/README

Google is your friend ;-)


Re: What is U4X?

2009-05-21 Thread Carl Mäsak
Leon (), John ():
 Can someone post a link?

 http://svn.pugscode.org/pugs/docs/u4x/README

It might also be informative to refer to the blog post that
precipitated the project:

Pretending that Envy is one of the Perl virtues
 http://use.perl.org/~masak/journal/38279

The second section of the post is about a documentation tool. The
comments and out-of-band replies to the post made me realize that I'm
not alone in wanting something like this.

I'm also proud and pleased to note that Hinrik Örn Sigurðsson
(literal++) has secured a Google Summer of Code project to implement
the command-line tool, currently referred to as grok. His work
officially begins this Saturday. Here's his project schedule:

 http://nix.is/gsoc/gsoc-u4x.html

Please consider supporting literal in any way you see fit. With the
proper support from the community, I'm convinced we can create a
documentation tool which not only satisfies, but excels.

// Carl


Rakudo Perl 6 development release #17 (Stockholm)

2009-05-21 Thread Patrick R. Michaud
On behalf of the Rakudo development team, I'm pleased to announce
the May 2009 development release of Rakudo Perl #17 Stockholm.
Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1].
The tarball for the May 2009 release is available from
http://github.com/rakudo/rakudo/downloads .

Due to the continued rapid pace of Rakudo development and the
frequent addition of new Perl 6 features and bugfixes, we continue
to recommend that people wanting to use or work with Rakudo obtain
the latest source directly from the main repository at github.
More details are available at http://rakudo.org/how-to-get-rakudo .

Rakudo Perl follows a monthly release cycle, with each release code named
after a Perl Mongers group.  This release is named Stockholm;
Stockholm Perl Mongers will be holding a Perl 6 hackathon on May 29 [3].
Perl 6 developer Carl Mäsak is a member of Stockholm Perl Mongers and
a main author of November [4], Druid [5], proto [6], and other
Perl 6-based packages.  Carl also contributes patches to Rakudo,
and has been stress-testing Rakudo over the past year, submitting
nearly 400 bug reports.

In this release of Rakudo Perl, we've made the following major changes
and improvements:

* Rakudo is now passing 11,342 spectests, an increase of 875
  passing tests since the April 2009 release.  With this release
  Rakudo is now passing 68% of the available spectest suite.

* We now have an updated docs/ROADMAP .

* Errors and stack traces now report the file name and line number
  in the original source code.

* Some custom operators can be defined, and it's possible to
  refer to operators using infix:op syntax.

* We can start to load libraries written in other Parrot languages.

* Regexes now produce a Regex sub.

* More builtin functions and methods have been rewritten in
  Perl 6 and placed as part of the setting.

* There are many additional improvements and features in this release,
  see docs/ChangeLog for a more complete list.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible.  If you would like to contribute,
see http://rakudo.org/how-to-help , ask on the perl6-compi...@perl.org
mailing list, or ask on IRC #perl6 on freenode.

The next release of Rakudo (#18) is scheduled for June 18, 2009.
A list of the other planned release dates and codenames for 2009 is
available in the docs/release_guide.pod file.  In general, Rakudo
development releases are scheduled to occur two days after each
Parrot monthly release.  Parrot releases the third Tuesday of each month.

Have fun!

References:
[1]  Parrot, http://parrot.org/
[2]  Stockholm.pm, http://sthlm.pm.org/
[3]  Stockholm Perl 6 hackathon, 
http://vic20.blipp.com/pipermail/kameler/2009-May/000318.html
[4]  November wiki engine, http://github.com/viklund/november/
[5]  Druid, http://github.com/masak/druid/
[6]  Proto, http://github.com/masak/proto/


Re: Rakudo Perl 6 development release #17 (Stockholm)

2009-05-21 Thread François Perrad
2009/5/21 Patrick R. Michaud pmich...@pobox.com:
 On behalf of the Rakudo development team, I'm pleased to announce
 the May 2009 development release of Rakudo Perl #17 Stockholm.
 Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1].
 The tarball for the May 2009 release is available from
 http://github.com/rakudo/rakudo/downloads .


A Windows setup is available at http://parrotwin32.sourceforge.net/
with many others languages.
Parrot-1.2.0 :
http://sourceforge.net/project/showfiles.php?group_id=211372package_id=254691release_id=684051
Parrot-1.2.0-Rakudo-17 (addon) :
http://sourceforge.net/project/showfiles.php?group_id=211372package_id=310553release_id=684268

The Parrot documentation is also available as a CHM (Compiled HTML Help)
http://sourceforge.net/project/showfiles.php?group_id=211372package_id=312161release_id=684050

 Due to the continued rapid pace of Rakudo development and the
 frequent addition of new Perl 6 features and bugfixes, we continue
 to recommend that people wanting to use or work with Rakudo obtain
 the latest source directly from the main repository at github.
 More details are available at http://rakudo.org/how-to-get-rakudo .

 Rakudo Perl follows a monthly release cycle, with each release code named
 after a Perl Mongers group.  This release is named Stockholm;
 Stockholm Perl Mongers will be holding a Perl 6 hackathon on May 29 [3].
 Perl 6 developer Carl Mäsak is a member of Stockholm Perl Mongers and
 a main author of November [4], Druid [5], proto [6], and other
 Perl 6-based packages.  Carl also contributes patches to Rakudo,
 and has been stress-testing Rakudo over the past year, submitting
 nearly 400 bug reports.

 In this release of Rakudo Perl, we've made the following major changes
 and improvements:

 * Rakudo is now passing 11,342 spectests, an increase of 875
  passing tests since the April 2009 release.  With this release
  Rakudo is now passing 68% of the available spectest suite.

 * We now have an updated docs/ROADMAP .

 * Errors and stack traces now report the file name and line number
  in the original source code.

 * Some custom operators can be defined, and it's possible to
  refer to operators using infix:op syntax.

 * We can start to load libraries written in other Parrot languages.

 * Regexes now produce a Regex sub.

 * More builtin functions and methods have been rewritten in
  Perl 6 and placed as part of the setting.

 * There are many additional improvements and features in this release,
  see docs/ChangeLog for a more complete list.

 The development team thanks all of our contributors and sponsors for
 making Rakudo Perl possible.  If you would like to contribute,
 see http://rakudo.org/how-to-help , ask on the perl6-compi...@perl.org
 mailing list, or ask on IRC #perl6 on freenode.

 The next release of Rakudo (#18) is scheduled for June 18, 2009.
 A list of the other planned release dates and codenames for 2009 is
 available in the docs/release_guide.pod file.  In general, Rakudo
 development releases are scheduled to occur two days after each
 Parrot monthly release.  Parrot releases the third Tuesday of each month.

 Have fun!

 References:
 [1]  Parrot, http://parrot.org/
 [2]  Stockholm.pm, http://sthlm.pm.org/
 [3]  Stockholm Perl 6 hackathon, 
 http://vic20.blipp.com/pipermail/kameler/2009-May/000318.html
 [4]  November wiki engine, http://github.com/viklund/november/
 [5]  Druid, http://github.com/masak/druid/
 [6]  Proto, http://github.com/masak/proto/




Re: Meditations on a Loop

2009-05-21 Thread Daniel Ruoso
Em Qua, 2009-05-20 às 20:58 -0500, Patrick R. Michaud escreveu:
 On Wed, May 20, 2009 at 07:55:55PM -0500, John M. Dlugosz wrote:
  If you would be so kind, please take a look at  
  http://www.dlugosz.com/Perl6/web/med-loop.html.  
 The reason this [.prime] works is because the method-call 
 syntax will call an ordinary non-member sub also.
 I think this is no longer the case (and hasn't been for some time).

It is no longer the case. I was about to send a mail about this... so
I'll just make sure that is noticed ;)

daniel



Re: Meditations on a Loop

2009-05-21 Thread Daniel Ruoso
Em Qua, 2009-05-20 às 19:55 -0500, John M. Dlugosz escreveu:
 If you would be so kind, please take a look at 
 http://www.dlugosz.com/Perl6/web/med-loop.html.  I spent a couple days 
 on this, and besides needing it checked for correctness, found a few 
 issues as well as more food for thought.

Some issues...

* The way to get an iterator is to ask for .Iterator() (this is in S07)
* It's not the capture itself that presents two different versions of
being a list, but rather the assignment in itself that traverses the
capture while flattening it.

i.e.:

 my $x := map { $_ * 2 for 1,2,3 }, 1,2,3;
 say $x[0]; # (1,2,3)
 say $x[0;0]; # 1
 say $x[1]; # (2,4,6)
 say $x[1;0]; # 2

as a contrast to

 my @x = map { $_ * 2 for 1,2,3 }, 1,2,3;
 say @x[0]; # 1;
 say @x[0;0]; # ERROR
 say @x[1]; # 1;
 say @x[1;0]; # ERROR

So, the list assignment really looks like

 my $iterator = (map { $_ * 2 for 1,2,3 }, 1,2,3).Iterator();
 my @x := Array.new;
 while ((my $it = $iterator.get) !=== Nil) { @x.push($it) }
 
Where the map is consumes an iterator by itself, so you could expand it
as...

 # this happens inside the map function installed in CORE
 my $map_input = (1,2,3).Iterator();
 my $map_output = $MapIteratorInternalType.new(
   :input($map_input),
   :code({ $_ * 2 for 1,2,3 })
 );
 # this happens in the assignment
 my $iterator = $map_output.Iterator();
 my @x := Array.new;
 while ((my $it = $iterator.get) !=== Nil) { @x.push($it) }
 

The text is fantastic... it's really awesome how you got into the guts
of Perl 6 while still preserving brevity and clarity...

daniel



Re: Meditations on a Loop

2009-05-21 Thread Daniel Ruoso
Em Qui, 2009-05-21 às 21:33 -0300, Daniel Ruoso escreveu:
  my @x = map { $_ * 2 for 1,2,3 }, 1,2,3;
  say @x[0]; # 1;
  say @x[0;0]; # ERROR
  say @x[1]; # 1;
  say @x[1;0]; # ERROR

er... there should be a 2 as output of the fourth line there...

daniel



Re: Meditations on a Loop

2009-05-21 Thread John M. Dlugosz

What is Userdocs for Christmas?  Someone have a link?


Carl Mäsak cmasak-at-gmail.com |Perl 6| wrote:

Timothy (), John ():
  

If you would be so kind, please take a look at
http://www.dlugosz.com/Perl6/web/med-loop.html.  I spent a couple days on
this, and besides needing it checked for correctness, found a few issues as
well as more food for thought.
  

   John, I very much enjoyed your article.  I'm hoping that at some
point, it would be possible to merge it into U4X, which is the Userdocs for
Christmas project (I think Carl Masak is the appropriate contact person for
this).



Not yet having read the article, I just wanted to pop by saying that
there's a good chance something like this can end up in the
'tutorials' section of u4x. The best way to ascertain this is to put a
mention in u4x/TODO, so I just did this.

// Carl

  




Re: Meditations on a Loop

2009-05-21 Thread Carl Mäsak
John ():
 What is Userdocs for Christmas?  Someone have a link?

So, Userdocs for Christmas, also known as U4X, is an effort to
create both comprehensive, consistent user documentation, and the
means to access this documentation efficiently and easily.

You asked about U4X the other day, which makes me suspect that the
abbreviation may have been ill-chosen. :-) But I'll take the chance to
re-paste the two URLs that summarize the project.

Pretending that Envy is one of the Perl virtues
 http://use.perl.org/~masak/journal/38279
u4x/README
 http://svn.pugscode.org/pugs/docs/u4x/README

// Carl