Timothy S. Nelson | 2 May 2009 08:03
Picon
Gravatar

Temporal

 	Hi.  Can someone (Dave Rolsky?) please tell me why rewriting 
S32/Temporal in terms of Enum roles would be bad?  See the example of Enum day 
roles here:

http://www.rakudo.org/node/39

 	Thanks,

---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayland <at> wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- 
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

pugs-commits | 3 May 2009 05:20
Picon

r26623 - docs/Perl6/Spec

Author: hinrik
Date: 2009-05-03 05:20:40 +0200 (Sun, 03 May 2009)
New Revision: 26623

Modified:
   docs/Perl6/Spec/S26-documentation.pod
Log:
[S26] Let's eat some more of our own dog food by using semantic Pod blocks where we can

Modified: docs/Perl6/Spec/S26-documentation.pod
===================================================================
--- docs/Perl6/Spec/S26-documentation.pod	2009-05-02 16:50:58 UTC (rev 26622)
+++ docs/Perl6/Spec/S26-documentation.pod	2009-05-03 03:20:40 UTC (rev 26623)
 <at>  <at>  -1,26 +1,21  <at>  <at> 
 =begin pod

-=for comment
-    This file is deliberately specified in Perl 6 Pod format
-    Clearly a Perl 6 -> Perl 5 documentation translator is a high priority ;-)
+=comment
+This file is deliberately specified in Perl 6 Pod format
+Clearly a Perl 6 -> Perl 5 documentation translator is a high priority ;-)

-
-=head1 TITLE
-
+=TITLE
 Synopsis 26 - Documentation

-
(Continue reading)

Hinrik Örn Sigurðsson | 3 May 2009 06:03
Picon
Gravatar

Docstrings in Perl 6

I've been thinking lately about how Perl 6 might offer functionality
similar to Python's docstrings. That is, documentation which is tied
directly to a particular routine, class or module[1]. This is
something which would is very useful in a REPL, and for documentation
readers[2].

Taking one case, the usual Perl 5 way to document methods is to put a
METHODS heading in the Pod and then list all the methods as
subheadings or list items underneath it. However, Synopsis 26 has this
notion of semantic blocks, and already defines some standard ones
including SYNOPSIS, so you can write something like this:

=begin SYNOPSIS
Bla bla
bla bla bla
=end SYNOPSIS

The formatter might then print out a "Synopsis" heading with the block
text beneath it, since the two are reliably tied together, while the
"=head1 SYNOPSIS + any number of paragraphs" combo doesn't tell the
formatter much about the structure.

Now, S26 also specifies METHOD and SUBROUTINE, but their use is not
discussed. As I understand, Perl 6 will give you access to all Pod
blocks through $=BLOCKNAME. I suppose there might be  <at> =BLOCKNAME if
there's more than one block by that name. If so, then using semantic
blocks seems like a shoe-in for providing docstring-like
functionality. We could have something like this:

=begin METHOD :name<reverse>
(Continue reading)

Moritz Lenz | 3 May 2009 20:20
Gravatar

Call for review: traits, lift

Hi,

I've written a few tests for two things that I feel I don't really
understand,
traits and the `lift' statement prefix. You can find them in

t/spec/S14-traits/basic.t
t/spec/S04-statements/lift.t

I'd appreciate it if you could take a look at them and tell me if they
conform
to what the spec says.

If I understood the specs correctly, variables can be lifted, so you can
write

sub f (lift $a + $b);
{
    my $a is context = 3;
    my $b is context = 4;
    say f();
}

(At least STD.pm doesn't complain about this)

Is that correct? And if yes, do these variables need to be context
variables?

Cheers,
Moritz
(Continue reading)

Moritz Lenz | 3 May 2009 20:25
Gravatar

Re: Call for review: traits, lift

Moritz Lenz wrote:
> sub f (lift $a + $b);

I mean 'sub f() { lift $a + $b }', sorry.

pugs-commits | 3 May 2009 21:17
Picon

r26645 - docs/Perl6/Spec

Author: moritz
Date: 2009-05-03 21:17:22 +0200 (Sun, 03 May 2009)
New Revision: 26645

Modified:
   docs/Perl6/Spec/S05-regex.pod
Log:
[S05] a quantified capture that matches zero times produces a Nil

Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod	2009-05-03 18:19:33 UTC (rev 26644)
+++ docs/Perl6/Spec/S05-regex.pod	2009-05-03 19:17:22 UTC (rev 26645)
 <at>  <at>  -2694,7 +2694,7  <at>  <at> 
 If a subpattern is directly quantified (using I<any> quantifier), it no
 longer produces a single C<Match> object. Instead, it produces a list
 of C<Match> objects corresponding to the sequence of individual matches
-made by the repeated subpattern.
+made by the repeated subpattern (or a C<Nil> if it matched zero times).

 =item *

pugs-commits | 3 May 2009 21:17
Picon

r26647 - docs/Perl6/Spec

Author: moritz
Date: 2009-05-03 21:17:38 +0200 (Sun, 03 May 2009)
New Revision: 26647

Removed:
   docs/Perl6/Spec/update
   docs/Perl6/Spec/update.bat
Log:
[docs] remove update scripts

Those are now unnecessary after the syn documents moved from perl.org
to the pugs repo

Deleted: docs/Perl6/Spec/update
===================================================================
--- docs/Perl6/Spec/update	2009-05-03 19:17:32 UTC (rev 26646)
+++ docs/Perl6/Spec/update	2009-05-03 19:17:38 UTC (rev 26647)
 <at>  <at>  -1,89 +0,0  <at>  <at> 
-#!/usr/bin/env perl
-
-exit;
-use strict;
-use warnings;
-
-use FindBin;
-use File::Path;
-
-refresh_specs();
-
-sub refresh_specs {
(Continue reading)

pugs-commits | 3 May 2009 21:17
Picon

r26648 - docs/Perl6/Spec

Author: moritz
Date: 2009-05-03 21:17:43 +0200 (Sun, 03 May 2009)
New Revision: 26648

Modified:
   docs/Perl6/Spec/S04-control.pod
Log:
[S04] a few more X<...> tags

Modified: docs/Perl6/Spec/S04-control.pod
===================================================================
--- docs/Perl6/Spec/S04-control.pod	2009-05-03 19:17:38 UTC (rev 26647)
+++ docs/Perl6/Spec/S04-control.pod	2009-05-03 19:17:43 UTC (rev 26648)
 <at>  <at>  -578,6 +578,7  <at>  <at> 
     { say $^x } if foo();

 =head2 The C<gather> statement prefix
+X<gather>X<take>

 A variant of C<do> is C<gather>.  Like C<do>, it is followed by a
 statement or block, and executes it once.  Unlike C<do>, it evaluates
 <at>  <at>  -645,6 +646,7  <at>  <at> 
 happen more than once).

 =head2 The C<lift> statement prefix
+X<lift>

 When writing generic multi routines you often want to write a bit of
 code whose meaning is dependent on the context of the caller.  It's
 <at>  <at>  -679,6 +681,7  <at>  <at> 
(Continue reading)

Damian Conway | 4 May 2009 02:03

Re: Docstrings in Perl 6

Hinrik Örn Sigurðsson wrote:

> I've been thinking lately about how Perl 6 might offer functionality
> similar to Python's docstrings. That is, documentation which is tied
> directly to a particular routine, class or module[1]. This is
> something which would is very useful in a REPL, and for documentation
> readers[2].

For the latest S26 proposal that I'm (very quietly) working on, I'm
considering two possible mechanisms to support tying docs to specific
components of a program.

The first is an C<is doc> trait:

    method reverse (
        Bool $recursive  is doc<Reverse any nested L<List>s too>
    )
    is doc<Returns a copy of the L<List> with the order of elements reversed.>
    {
        my  <at> result;
        for  <at> .list {
             <at> result.unshift($_);
        }
        return  <at> result;
    }

The second is a generalized Pod comment form:

    method reverse  #={ Returns copy of L<List> with order of elems reversed. }
    (
(Continue reading)

pugs-commits | 4 May 2009 05:36
Picon

r26655 - docs/Perl6/Spec

Author: lwall
Date: 2009-05-04 05:36:15 +0200 (Mon, 04 May 2009)
New Revision: 26655

Modified:
   docs/Perl6/Spec/S04-control.pod
Log:
[S04] clarify parsing of statement controls

Modified: docs/Perl6/Spec/S04-control.pod
===================================================================
--- docs/Perl6/Spec/S04-control.pod	2009-05-04 03:14:22 UTC (rev 26654)
+++ docs/Perl6/Spec/S04-control.pod	2009-05-04 03:36:15 UTC (rev 26655)
 <at>  <at>  -12,8 +12,8  <at>  <at> 

   Maintainer: Larry Wall <larry <at> wall.org>
   Date: 19 Aug 2004
-  Last Modified: 19 Apr 2009
-  Version: 76
+  Last Modified: 3 May 2009
+  Version: 77

 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
 <at>  <at>  -695,6 +695,29  <at>  <at> 
 For purposes of flow control, none of these forms are considered loops,
 but they may easily be applied to a normal loop.

+Note that any construct in the statement_prefix category defines
+special syntax.  If followed by a block it does not parse as a
(Continue reading)


Gmane