r25645 - docs/Perl6/Spec
Author: lwall Date: 2009-03-01 09:48:35 +0100 (Sun, 01 Mar 2009) New Revision: 25645 Modified: docs/Perl6/Spec/S02-bits.pod docs/Perl6/Spec/S28-special-names.pod Log: doc tweaks. $?OSVER should be $?OS.ver or some such Modified: docs/Perl6/Spec/S02-bits.pod === --- docs/Perl6/Spec/S02-bits.pod2009-03-01 08:43:49 UTC (rev 25644) +++ docs/Perl6/Spec/S02-bits.pod2009-03-01 08:48:35 UTC (rev 25645) @@ -2123,9 +2123,6 @@ &?ROUTINE Which routine am I in? &?BLOCK Which block am I in? -All the nested C<@?> variables are ordered from the innermost to the -outermost, so C<@?BLOCK[0]> is always the same as C<&?BLOCK>. - The following return objects that contain all pertinent info: $?OSWhich operating system am I compiled for? Modified: docs/Perl6/Spec/S28-special-names.pod === --- docs/Perl6/Spec/S28-special-names.pod 2009-03-01 08:43:49 UTC (rev 25644) +++ docs/Perl6/Spec/S28-special-names.pod 2009-03-01 08:48:35 UTC (rev 25645) @@ -86,7 +86,6 @@ $*GID Int # group id $*IN S16 IO # Standard input handle; is an IO object $*INC S11# where to search for user modules (but not std lib!) - $?LABEL # label of current block (XXX unnecessary?) $?LANGS02# Which Perl parser should embedded closures parse with? $*LANGS02 Str # LANG variable from %*ENV that defines what human language is used $?LINE Int # current line number in source file @@ -96,8 +95,6 @@ %*OPT... S19 Hash of XXX # Options from command line to be passed down $?OSStr # operating system compiled for $*OSStr # operating system running under - $?OSVER Str # operating system version compiled for - $*OSVER Str # operating system version running under $*OUT S16 IO # Standard output handle $?PARSER S02 Grammar # Which Perl grammar was used to parse this statement? $?PACKAGE Package # current package
Re: Masak's S29 list
Timothy S. Nelson wrote: > Here's my comments on Carl Masak's S29 list. Note that some of the > things that say that they're "now in" something still need a lot of work. > > # Range objects have .from, .to, .min, .max and .minmax methods > > Now in S32/Containers.pod > > # .contains on Hash and Array > > Where's this from? This had been in S03, and was removed since then. You can safely ignore it. > # Code has a .sig > > Seems (from what I can tell) to be synonymous with .signature, so I > standardised on .signature. This leads me to another question - afaict we also have .arity on the code object, but shouldn't that be method on the .signature instead? Do we have any methods in Code that are not related to the signature? > # .ACCEPTS and .REJECTS on most everything -- provided by the Pattern role. > Likely a mistake to put one under each section, though. Perhaps put one under > Object and put a reference to S03. > > What does Pattern? Should we have Object does Pattern? If everything does Pattern, I see no good reason to have a role at all - just stuff the thing into Object. > # Block types have .next, .last, .redo and .leave on them. These are also > functions, and need to be specced as such. Ah, that answers my previous question already ;-) > # .match, .subst and .trans from S05. > > Now in S32/Str.pod. But I wasn't sure what subst() returns. The modified string. (It doesn't do in-place substitution by default). Cheers, Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/
Re: Range and continuous intervals
On Friday, 27. February 2009 07:42:17 Darren Duncan wrote: > I was thinking that Perl 6 ought to have a generic interval type that is > conceptually like Range, in that it is defined using a pair of values of an > ordered type and includes all the values between those, but unlike Range > that type is not expected to have discrete consecutive values that can be > iterated over. Hmm, it might not be a bad idea to make Interval a subtype of Range and allow for iteration if that is requested. This allows an Interval where Range is expected. The benefit of a dedicated Interval type comes from supporting set operations (&), (|) etc. which are still unmentioned in S03. BTW, what does (1..^5).max return? I think it should be 4 because this is the last value in the Range. Only in 4.7 ~~ 1..^5 does the five matter. How does ~~ retrieve that information? For open intervals the .min and .max methods should return the bound outside. Or better, we should introduce infimum and supremum as .inf and .sup respectively. > I'm thinking of a Range-alike that one could use with Rat|Num or Instant > etc, and not just Int etc. There would be operators to test membership of > a value in the interval, and set-like operators to compare or combine > intervals, such as is_inside, is_subset, is_overlap, union, intersection, > etc. Such an interval would be what you use for inexact matching and would > be the result of a ± infix operator or % postfix operator. Also, as Range > has a .. constructor, this other type should have something. Since the Interval type shall be an addition to the Set subsystem I propose the (..) Interval creation operator together with the open versions. Admittedly that leaves (^..^) at a lengthy six chars. But Jon's proposal of setting the by to zero isn't any shorter. Note that the open versions are more important for Interval than they are for Range because for Range you can always write it without ^ at the ends. > Barring a better name coming along, I suggest calling the type "Interval", > and it would be immutable. The only other name that comes to mind is RangeSet. But I prefer Interval because this is the name of the concept in math. Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare "Simplicity does not precede complexity, but follows it." -- A.J. Perlis 1 + 2 + 3 + 4 + ... = -1/12 -- Srinivasa Ramanujan
Re: Range and continuous intervals
Thomas Sandlaß wrote: > The benefit of a dedicated Interval type comes from supporting set > operations (&), (|) etc. which are still unmentioned in S03. Have set operations been implemented in either Rakudo or Pugs? > BTW, > what does (1..^5).max return? I think it should be 4 because this > is the last value in the Range. Only in 4.7 ~~ 1..^5 does the five > matter. How does ~~ retrieve that information? For open intervals > the .min and .max methods should return the bound outside. Or better, > we should introduce infimum and supremum as .inf and .sup respectively. No offense, but I've noticed a tendency on your part to suggest highly technical names for things. "Infimum" and "supremum" may be technically accurate; but I wouldn't know, since I don't know for certain what they mean. "Min" and "max" may be misleading in terms of the specifics; but they get the general point across. >> I'm thinking of a Range-alike that one could use with Rat|Num or Instant >> etc, and not just Int etc. There would be operators to test membership of >> a value in the interval, and set-like operators to compare or combine >> intervals, such as is_inside, is_subset, is_overlap, union, intersection, >> etc. Such an interval would be what you use for inexact matching and would >> be the result of a ± infix operator or % postfix operator. Also, as Range >> has a .. constructor, this other type should have something. > > Since the Interval type shall be an addition to the Set subsystem I > propose the (..) Interval creation operator together with the open > versions. Admittedly that leaves (^..^) at a lengthy six chars. But > Jon's proposal of setting the by to zero isn't any shorter. Note that > the open versions are more important for Interval than they are for Range > because for Range you can always write it without ^ at the ends. In defense of my proposal, note that it _can be_ shorter if you say that :by defaults to zero when the endpoints are of continuous types such as Num, Instance, or Rat. That said, I admit that my proposal is something of a kludge - albeit te type of kludge that Perl tends to embrace (where reasonable, make a best guess as to the programmer's intentions; but provide a means gor him to be more explicit if your guess is wrong). -- Jonathan "Dataweaver" Lang
Re: pod variables?
On Fri, 27 Feb 2009, Darren Duncan wrote: Jon Lang wrote: Under the section about twigils in S02, "$=var" is described as a "pod variable". I'm not finding any other references to pod variables; what are tey, and how are they used? (In particular, I'm wondering if they're a fossil; if they aren't, I'd expect further information about them to be in S26.) The principle of pod variables as I recall them discussed a few years ago is that it is a way for code to programmatically access its own documentation, such as, for example code introspecting a routine could also print out the documentation for that routine, I suppose. Whatever it was, it sounded useful at the time. -- Darren Duncan To further clarify, I put this exact question to Larry, and he basically said that the clarification of POD variables will happen as Damian continues work on S26-Documentation. :) - | Name: Tim Nelson | Because the Creator is,| | E-mail: wayl...@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-
Re: r25541 - docs/Perl6/Spec
On Fri, 27 Feb 2009, Henry Baragar wrote: I am starting to get overwhelmed by the number of special names and I am wondering why we need to have a flat naming space? For example, wouldn't it be easier to remember (and to introspect) the following? I vote in favour of the general idea, although I disagree with some aspects of this. I think there are many things that could be grouped together, but I think we should be careful not to go too far. Larry wanted to Huffmanise many of these too, hence the great number. I think we could probably reduce the number by maybe 1/3. If I get around to doing this before someone else does, I'll certainly refer to your groupings below for ideas. $*SYSTEM.uid $*SYSTEM.euid $*SYSTEM.pid $*SYSTEM.perl $*SYSTEM.env $*SYSTEM.program_name $*SYSTEM.error_handle $?COMPILER.vm $?COMPILER.svm $?COMPILER.perl $?COMPILER.parser $?COMPILER.setting $?COMPILER.os_distro $?PROGRAM.scope $?PROGRAM.routine $?PROGRAM.role $?PROGRAM.class This way we only have a few special names (objects?) that organize everything in this synopsis. Regards, Henry pugs-comm...@feather.perl6.nl wrote: Author: wayland Date: 2009-02-25 07:08:52 +0100 (Wed, 25 Feb 2009) New Revision: 25541 Modified: docs/Perl6/Spec/S28-special-names.pod Log: S28: Incorporated some more stuff from the old documentation lower down, and a few variables from S02. Modified: docs/Perl6/Spec/S28-special-names.pod === --- docs/Perl6/Spec/S28-special-names.pod 2009-02-25 05:31:24 UTC (rev 25540) +++ docs/Perl6/Spec/S28-special-names.pod 2009-02-25 06:08:52 UTC (rev 25541) @@ -50,6 +50,7 @@ $?CLASS # current class (as variable) %?CONFIG # configuration hash $=DATA# data block handle (=begin DATA ... =end) + $?DISTROS02 # Which OS distribution am I compiling under $*EGID# effective group id %*ENV # system environment $*ERR S16 # Standard error handle; is an IO object @@ -71,16 +72,20 @@ $?OSVER # operating system version compiled for $*OSVER # operating system version running under $*OUT S16 # Standard output handle; is an IO object + $?PARSERS02 # Which Perl grammar was used to parse this statement? $?PACKAGE # current package (as object) $?PACKAGENAME S10 # name of current package - $?PERLVER # perl version compiled for - $*PERLVER # perl version running under + $?PERL S02 # Which Perl am I compiled for? + $*PERL# perl version running under $*PROGRAM_NAME# name of the program being executed $*PID # system process id ::?ROLE # current role (as package name) $?ROLE# current role (as variable) &?ROUTINE S06 # current sub or method (itself) + $?SCOPE S02 # Current "my" scope $*UID # system user id + $?VMS02 # Which virtual machine am I compiling under + $?XVM S02 # Which virtual machine am I cross-compiling for Note that contextual variables such as C<$*OUT> may have more than one current definition in the outer dynamic context, in which case @@ -166,10 +171,11 @@ $^H - These were only ever internal anyway %^H - - $! Current exception (see L) - $! $ERRNO $OS_ERROR - Can get some info from new $! - $? $CHILD_ERROR- - $@ $EVAL_ERROR - Just throws an exception now (see L) - $^E - + $! $ERRNO $OS_ERROR - Use shiny new $! + $? $CHILD_ERROR- Use shiny new $! + $@ $EVAL_ERROR - Use shiny new $! + $^E - Use shiny new $! + $^S - $. $NR $*IN.input_record_number() $/ $RS $*IN.input_record_separator() $| $*OUT.autoflush() @@ -203,14 +209,22 @@ ARGVOUT $*ARGVOUT Another IO object @F @*INPLACE_AUTOSPLIT_FIELDS ..or some such %ENV%*ENV + ${^OPEN}- This was internal; forget it =head2 Old stuff for p5/p6 comparison This section will eventually die, but for now, it contains some old information on which -Perl5 special variables will turn into Perl6 special variables. +Perl5 special variables will turn into Perl6 special variables. The reason they are +retained is either: -=over 4 +=over +=item * Their status is undecided + +=item * They have some commentary on stuff that needs consideration + +=back + Because a blank entry in either column could be taken to mean either "not in Perl 6" or "
Google's Summer of Code 2009
Google has announced this year's Summer of Code[1]. The Perl Foundation accepted one project (mentored by Moritz) related to Perl 6 last year[2]. I was wondering if there are any developers interested in mentoring students on Perl 6-related projects this year. I for one would like to apply (as a student) for some Perl 6 work. 1. http://code.google.com/soc/ 2. http://code.google.com/soc/2008/perl/about.html
Re: Google's Summer of Code 2009
On Sun, Mar 1, 2009 at 17:26, Hinrik Örn Sigurðsson wrote: > Google has announced this year's Summer of Code[1]. The Perl > Foundation accepted one project (mentored by Moritz) related to Perl 6 > last year[2]. I was wondering if there are any developers interested > in mentoring students on Perl 6-related projects this year. I for one > would like to apply (as a student) for some Perl 6 work. > > 1. http://code.google.com/soc/ > 2. http://code.google.com/soc/2008/perl/about.html > i'm glad your interest is building, based on last year's successes. this year, the perl foundation will again apply as a mentoring organization for google summer of code. leading the effort will be jonathan leto, one of last year's mentors, stepping up to fill eric wilhelm's role as organization administrator. like last year, tpf will encourage applications for both perl 5 and perl 6 projects, and parrot projects as well (as long as they're perl-related). last year, if i recall correctly, 44 mentors applied for tpf, and 25 student applications were received (of which 16 met the tpf standard for acceptance). google allocated 6 slots to tpf, and 5 projects were completed. this year, i expect more organizations and more students will apply, and i know both fewer organizations and fewer students will be accepted into the program. if the perl foundation is accepted again (i have high hopes), you should know that the perl community is extremely generous. i have no doubt tpf will again see more volunteers show interest in mentoring students than students applicants, and i expect there will be many more project applications than acceptances. stay tuned for more info, as tpf is just starting up the hype machine. until that gets going, you might start looking at last year's projects page [1] for previous ideas, and if you're really serious, you can start working on your proposal. expect this year's standard for acceptance to be similar to last year's, and expect the competition to be greater. ~jerry 1. http://www.perlfoundation.org/perl5/index.cgi?gsoc2008_projects)
r25650 - docs/Perl6/Spec
Author: wayland Date: 2009-03-02 06:29:37 +0100 (Mon, 02 Mar 2009) New Revision: 25650 Added: docs/Perl6/Spec/S21-calling-foreign-code.pod Log: Wrote this a few days ago, but forgot to svn add. Added: docs/Perl6/Spec/S21-calling-foreign-code.pod === --- docs/Perl6/Spec/S21-calling-foreign-code.pod (rev 0) +++ docs/Perl6/Spec/S21-calling-foreign-code.pod2009-03-02 05:29:37 UTC (rev 25650) @@ -0,0 +1,52 @@ + +=encoding utf8 + +=head1 Title + +DRAFT: Synopsis 21: Calling Foreign Code + +=head1 Version + + Author:Tim Nelson + Maintainer:Larry Wall + Contributions: Tim Nelson +Larry Wall + Date: 27 Feb 2009 + Last Modified: 27 Feb 2009 + Version: 1 + +The document is a draft. + +If you read the HTML version, it is generated from the pod in the pugs +repository under /docs/Perl6/Spec/S21-calling-foreign-code.pod so edit it there in +the SVN repository if you would like to make changes. + +=head1 Overview + +Unfortunately, calling foreign code properly is quite platform dependent. This means that +parts of the external calling conventions can't be standardised. But the parts that can +be standardised are specified here. + +=head1 Specification + +The C statement allows an external language to be specified in +addition to (or instead of) an authority, so that you can use modules +from other languages. The C adverb also parses any additional +parts as short-form arguments. For instance: + +use Whiteness:from:name:ver<1.12>:auth; +use Whiteness:from; # same thing + +use libc:from; + +=head1 Other Considerations + +=head2 Linking to common platforms + +XXX We need a discussion of how to link to some of the common platforms + +=head1 Additions + +Please post errors and feedback to perl6-language. If you are making +a general laundry list, please separate messages by topic. +
r25651 - docs/Perl6/Spec
Author: wayland Date: 2009-03-02 06:51:23 +0100 (Mon, 02 Mar 2009) New Revision: 25651 Modified: docs/Perl6/Spec/S28-special-names.pod Log: S28: - Did more heading changes to make it "Special Names" instead of "Special Variables" - Added lots of spec cross-references - Added a $*DISTRO variable (hopefully this was just an omission) - Added a SoftwarePackage class that represents the name and version of the software mentioned, whether this be Perl, and OS, or a Distro. Modified: docs/Perl6/Spec/S28-special-names.pod === --- docs/Perl6/Spec/S28-special-names.pod 2009-03-02 05:29:37 UTC (rev 25650) +++ docs/Perl6/Spec/S28-special-names.pod 2009-03-02 05:51:23 UTC (rev 25651) @@ -11,8 +11,10 @@ Last Modified: 25 Feb 2009 Version: 5 -=head1 Introduction +=head1 Special Variables +=head2 Introduction + This document serves as a collection point for what is known about special variables in Perl 6 and correlates them with the changes from Perl 5. @@ -23,9 +25,9 @@ Perl 5 variable(s). The list of main entries is also followed by a table showing the 5 and 6 variables side-by-side. -=head1 Overview +=head2 Overview -=head2 Secondary Sigils (also known as "twigils") +=head3 Secondary Sigils (also known as "twigils") A quick reminder of the relevant twigils from S02: @@ -56,7 +58,7 @@ rather than compiler control. The structure of these variables will be fleshed out in S26. -=head2 Named variables +=head3 Named variables Variable Spec Type Description --- @@ -68,44 +70,45 @@ @*ARGSS06 Array of Str # command-line arguments $*ARGFILESS02 IO # The magic command-line input handle &?BLOCK S06 Block# current block (itself) - ::?CLASSStr # current class (as package or type name) - $?CLASS Class# current class - @=COMMENT# All the comment blocks in the file - %?CONFIGHash of XXX # configuration hash - $=DATA # data block handle (=begin DATA ... =end) - @=DATA # Same as above, but array + ::?CLASS S12 Str # current class (as package or type name) + $?CLASS S02 Class# current class + @=COMMENT(S26) # All the comment blocks in the file + %?CONFIGHash of XXX # configuration hash XXX What does this do? + $=DATA (S26) IO # data block handle (=begin DATA ... =end) + @=DATA (S26) Array# Same as above, but array %?DEEPMAGIC S13 Hash of XXX # Controls the mappings of magical names to sub definitions - $?DISTRO S02 Str # Which OS distribution am I compiling under + $?DISTRO S02 SoftwarePackage # Which OS distribution am I compiling under + $*DISTROSoftwarePackage # Which OS distribution am I running under $*EGID Int # effective group id - %*ENV Hash of Str # system environment variables + %*ENV S02 Hash of Str # system environment variables $*ERR S16 IO # Standard error handle $*EUID Int # effective user id $*EXECUTABLE_NAME Str # executable name - $?FILE Str # current filename of source file - $?GRAMMAR Grammar # current grammar + $?FILES02 Str # current filename of source file + $?GRAMMAR S02 Grammar # current grammar $*GID Int # group id $*IN S16 IO # Standard input handle; is an IO object $*INC S11# where to search for user modules (but not std lib!) $?LANGS02# Which Perl parser should embedded closures parse with? $*LANGS02 Str # LANG variable from %*ENV that defines what human language is used - $?LINE Int # current line number in source file + $?LINES02 Int # current line number in source file %*META-ARGS S19 Hash of XXX # Meta-arguments - $?MODULEModule # current module + $?MODULE S02 Module # current module %*OPTSS19 Hash of XXX # Options from command line %*OPT... S19 Hash of XXX # Options from command line to be passed down - $?OSStr # operating system compiled for - $*OSStr # operating system running under + $?OSSoftwarePackage # operating system compiled for + $*OSSoftwarePackage # operating system running under $*OUT S1
r25652 - docs/Perl6/Spec
Author: wayland Date: 2009-03-02 07:00:47 +0100 (Mon, 02 Mar 2009) New Revision: 25652 Modified: docs/Perl6/Spec/S28-special-names.pod Log: Should've looked first -- $*DISTRO is documented in S02 :) Modified: docs/Perl6/Spec/S28-special-names.pod === --- docs/Perl6/Spec/S28-special-names.pod 2009-03-02 05:51:23 UTC (rev 25651) +++ docs/Perl6/Spec/S28-special-names.pod 2009-03-02 06:00:47 UTC (rev 25652) @@ -78,7 +78,7 @@ @=DATA (S26) Array# Same as above, but array %?DEEPMAGIC S13 Hash of XXX # Controls the mappings of magical names to sub definitions $?DISTRO S02 SoftwarePackage # Which OS distribution am I compiling under - $*DISTROSoftwarePackage # Which OS distribution am I running under + $*DISTRO S02 SoftwarePackage # Which OS distribution am I running under $*EGID Int # effective group id %*ENV S02 Hash of Str # system environment variables $*ERR S16 IO # Standard error handle
$?OS change
Hi. I note that we have $?OS, $?VM, and $?DISTRO (and their $* counterparts). I'd like to recommend that we eliminate $?OS, and replace it with $?KERNEL (ie. Linux) and maybe $?ARCH (ie. i386). Thoughts? :) - | Name: Tim Nelson | Because the Creator is,| | E-mail: wayl...@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-