Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Moritz Lenz
Dave Whipp wrote: > To squint at this slightly, in the context that we already have 0...1e10 > as a sequence generator, perhaps the semantics of iterating a range > should be unordered -- that is, > >for 0..10 -> $x { ... } > > is treated as > >for (0...10).pick(*) -> $x { ... } Sorry

Re: series operator issues

2010-07-23 Thread Moritz Lenz
Am 23.07.2010 00:29, schrieb Damian Conway: However, those *are* clunky and nigh unreadable, so I certainly wouldn't object to having the index of the next generated element readily available as an explicit variable in a series' generator block. That would make all manner of evil both easier and

Re: series operator issues

2010-07-22 Thread Moritz Lenz
Hi, Am 22.07.2010 17:18, schrieb Jon Lang: When I last reviewed the writeup for the series operators, I noticed two issues: First, why is the RHS argument a list? You only ever use the first element of it; so why don't you just reference a single value? The idea is that you can continue seri

Re: r31755 -[S05] specifiy that .parse can invoke other subrules than TOP by name

2010-07-19 Thread Moritz Lenz
Hi, Am 19.07.2010 04:20, schrieb Stéphane Payrard: Note that I sent a patch to that effect to p6c Jun 2 in a mail titled "support of parsing from a non TOP rule" Either somebody applied it, or it was superfluous - :rule works in Rakudo (though I don't know if it works in nqp-rx). Anyway, th

Re: Suggested magic for "a" .. "b"

2010-07-18 Thread Moritz Lenz
Ruud H.G. van Tol wrote: > Aaron Sherman wrote: > >> Having established this range for each correspondingly indexed letter, the >> range for multi-character strings is defined by a left-significant counting >> sequence. For example: >> >> "Ab" .. "Be" >> >> defines the ranges: >> >> and >> >

Re: Perl 6 in non-English languages

2010-06-24 Thread Moritz Lenz
Am 23.06.2010 22:51, schrieb Aaron Sherman: Moving on to more general theories on the matter, I believe that localized dialects of programming languages are always a bad idea. I totally agree. However there are things that can be translated to other languages, and that is documentation, error

Re: r31043 -[S32/Containers] Buf does Stringy, too

2010-06-02 Thread Moritz Lenz
Jason Switzer wrote: > On Wed, Jun 2, 2010 at 5:10 AM, wrote: > >> Author: masak >> Date: 2010-06-02 12:10:22 +0200 (Wed, 02 Jun 2010) >> New Revision: 31043 >> >> Modified: >> docs/Perl6/Spec/S32-setting-library/Containers.pod >> Log: >> [S32/Containers] Buf does Stringy, too >> >> -class

Re: r31050 -[S03] refine hyper dwimminess to be more like APL, with modular semantics

2010-06-02 Thread Moritz Lenz
Solomon Foster wrote: > On Wed, Jun 2, 2010 at 3:52 PM, Aaron Sherman wrote: >> Is there some automatic translation of these examples into tests? If not, >> here's what they'd be: >> >> ok(( (1,2,3,4) «+» (1,2) ) ~~ (2,4,4,6) ) >> ok(( (1,2,3) «+» (1,2) ) ~~ (2,4,4) ) >> ok(( (1,2,3,4) «+« (1,

Re: Command-line args (weekly contribution to P6)

2010-05-26 Thread Moritz Lenz
Hi David, thanks for your contribution. I'll review it thoroughly in the next few days. Am 24.05.2010 21:14, schrieb David Green: Also the line that sets the "but False" variations is commented out for now, because "but" isn't working. That's a reason why the challenge included only the si

Re: Perl6 and "accents"

2010-05-18 Thread Moritz Lenz
FYI, Larry "accents" to "marks" in this commit, as well as some refactoring of the short adverbs associated with them: http://www.nntp.perl.org/group/perl.perl6.language/2010/05/msg33671.html Thanks, Moritz

Re: Fwd: URI replacement pseudocode

2010-05-17 Thread Moritz Lenz
Aaron Sherman wrote: > Ooops, took this off-list by accident. > > -- Forwarded message -- > From: ajs > Date: Mon, May 17, 2010 at 2:59 PM > Subject: Re: URI replacement pseudocode > To: Moritz Lenz > > > Thank you for your responses! >

Re: Perl6 and "accents"

2010-05-17 Thread Moritz Lenz
Tom Christiansen wrote: > Exegesis 5 @ http://dev.perl.org/perl6/doc/design/exe/E05.html reads: The Exegesis are historical documents, and should be treated as such. (If any volunteer is around, submitting a patch that puts "HISTORICAL DOCUMENT ONLY" in big red letter on these pages would be great

Re: URI replacement pseudocode

2010-05-17 Thread Moritz Lenz
Hi, Aaron Sherman wrote: > Over the past week, I've been using my scant bits of nighttime coding to > cobble together a pseudocode version of what I think the URI module should > look like. There's already one available as example code, but it doesn't > actually implement either the URI or IRI spe

Re: optional rules cluttering parse trees

2010-04-29 Thread Moritz Lenz
Am 28.04.2010 18:08, schrieb cognominal: On Apr 28, 2:05 pm, mor...@faui2k3.org (Moritz Lenz) wrote: Am 27.04.2010 06:31, schrieb Stéphane Payrard: There's also another problem with your approach: If you have ? in your regex, and it matches the empty string, it is still a successful

Re: optional rules cluttering parse trees

2010-04-28 Thread Moritz Lenz
Am 27.04.2010 06:31, schrieb Stéphane Payrard: When doing an analyse of a sample parse tree, I note that it is cluttered by the reduction of optional subrules to generate a zero length parse subtree. That is, rules with a '?' quantifier matching zero time. Suppressing such matching rules from th

Rakudo Perl 6 development release #28 ("Moscow")

2010-04-22 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm pleased to announce the March 2010 development release of Rakudo Perl #28 "Moscow". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the April 2010 release is available from http://github

Re: r30398 - docs/Perl6/Spec/S32-setting-library

2010-04-21 Thread Moritz Lenz
Am 20.04.2010 16:59, schrieb Dave Rolsky: On Fri, 16 Apr 2010, pugs-comm...@feather.perl6.nl wrote: +=head2 Semi-internal methods + +[This section is severely conjectural] + +For efficient implementation of arithmetics on C objects, two more +methods are exposed: + + $d.daycount + Date.new-from

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Moritz Lenz
Dave Whipp wrote: > masak wrote: >> Modified: >>docs/Perl6/Spec/S32-setting-library/Numeric.pod >> Log: >> [S32/Numeric] removed method form of srand >> >> Overwhelming consent on #perl6 about this. >> >> - multi method srand ( Real $seed: ) >> multi srand ( Real $seed = default_seed_algori

Re: underscores vs hyphens (was Re: A new era for Temporal)

2010-04-12 Thread Moritz Lenz
Peter Scott wrote: > Am I the only one who sees a hyphen and thinks "binary minus"? Just > because the parser can disambiguate this use of it doesn't mean the > reader's brain can do so as easily. It's all a matter of practice. Since variables begin with sigils, and you should put whitespace a

Re: A new era for Temporal

2010-04-12 Thread Moritz Lenz
Am 12.04.2010 03:47, schrieb Dave Rolsky: On Sun, 11 Apr 2010, Moritz Lenz wrote: I've planned to add such a module to the Perl 6 spec, but some comments on #perl6 suggested it should be kept out of core to prevent bloat. Still if the overall opinion is that Perl 6 should have such a m

Re: A new era for Temporal

2010-04-11 Thread Moritz Lenz
Dave Rolsky wrote: > On Thu, 8 Apr 2010, Carl Mäsak wrote: > >> I do want to explicitly credit Dave Rolsky, whose work on the DateTime >> family of modules on CPAN has informed much of the current spec, >> sometimes to the point of verbatim copying. > > Thanks, but I'd hate to see you copy all my

Re: A new era for Temporal

2010-04-09 Thread Moritz Lenz
Am 09.04.2010 15:33, schrieb Dave Rolsky: On Thu, 8 Apr 2010, Carl Mäsak wrote: I do want to explicitly credit Dave Rolsky, whose work on the DateTime family of modules on CPAN has informed much of the current spec, sometimes to the point of verbatim copying. Thanks, but I'd hate to see you c

Re: Unchecked versions of the setters (Re: Temporal.pod truncate)

2010-04-09 Thread Moritz Lenz
Am 09.04.2010 13:34, schrieb Mark J. Reed: The date still corresponds to an actual day. If I set it to Feb 31, I should get back Mar 2 or 3 depending on the year. While I'm having trouble thinking of a good specific example, it's a capability I've taken advantage of many times, in holiday cal

Re: Good error messages: going the extra mile

2010-04-08 Thread Moritz Lenz
Am 07.04.2010 01:16, schrieb Aristotle Pagaltzis: Hi Larry (mostly) et al, this sounds like something STD could try to steal: * Okay, this may be going a bit far, but how else are you going to fall completely in love wi

Re: Good error messages: going the extra mile

2010-04-07 Thread Moritz Lenz
Aristotle Pagaltzis wrote: > Hi Larry (mostly) et al, > > this sounds like something STD could try to steal: > > * >> Okay, this may be going a bit far, but how else are you going >> to fall completely in love with a compil

Re: Perl6 Test Suite

2010-03-25 Thread Moritz Lenz
Hi, drakej wrote: > I am looking to work on the test suite as part of the GSoC program. I > have a couple of questions, though, if somebody could help me out: > > The ideas page > (http://www.perlfoundation.org/perl5/index.cgi?gsoc_2010_projects) spoke > of the IO section needing quite a bit mo

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Moritz Lenz
Daniel Ruoso wrote: > Em Ter, 2010-03-23 às 19:41 +0100, Carl Mäsak escreveu: >> um, so 'protected' is when the deriving classes can see the >> attribute? >> yup >> that's what 'private' means in Perl 6. >> what? so there's only really 'public' and 'protected', but no >> 'private'? >> basicall

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Moritz Lenz
Carl Mäsak wrote: > Carl (>>), Moritz (>): >>> um, so 'protected' is when the deriving classes can see the >>> attribute? >>> yup >>> that's what 'private' means in Perl 6. >> >> That's wrong. Perl 6's "private" is like Java's "private" - subclasses >> can't see it. >> It's just Rakudo being

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Moritz Lenz
Carl Mäsak wrote: > um, so 'protected' is when the deriving classes can see the attribute? > yup > that's what 'private' means in Perl 6. That's wrong. Perl 6's "private" is like Java's "private" - subclasses can't see it. It's just Rakudo being leaky at the moment, not a fallacy of the Perl 6

Re: Something about the cascade calling of sort() in rakudo.

2010-03-23 Thread Moritz Lenz
Hi, Hongwen Qiu wrote: > Hi, I'm new to Perl6. And just ran the first example in the perl6 book. > But, it refused to work. It complains as follows: > > Too many positional parameters passed; got 2 but expected between 0 and 1 > > I find out that the problem is in the line: > > my @sorted = @na

Re: Functional-style pattern matching

2010-03-11 Thread Moritz Lenz
Mark J. Reed wrote: > Oh, wow. I was just asking about the spec; didn't know this stuff > already worked. Rakudos to the team! :) Actually there's quite much that works in Rakudo, even if some corner cases are missing or error messages might benefit from more verbosity. Especially in the area o

Re: Functional-style pattern matching

2010-03-10 Thread Moritz Lenz
de_parameters>) multi traverse (Tree $t ( $left, $right) ) { traverse($left); traverse($right); } Since you don't actually access $t anywhere, there's no reason to give it a name, so you can write this actually as multi traverse (Tree $ ( $left, $right) ) { trav

Re: built-in roles/types routine boundary

2010-03-09 Thread Moritz Lenz
s "no" for the more common core numeric types. Cheers, Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

The silliness of max()

2010-03-07 Thread Moritz Lenz
rid of the sub form of max() entirely. Any objections? Cheers, Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

[perl #72972] [BUG] False ~~ True in Rakudo

2010-02-22 Thread Moritz Lenz via RT
On Sat Feb 20 13:31:33 2010, masak wrote: > rakudo: say False ~~ True > rakudo ec47f3: OUTPUT«1␤» > o.O > (which is Worng) > alpha: say False ~~ True > alpha 30e0ed: OUTPUT«1␤» > pugs: say False ~~ True > pugs: OUTPUT«␤» > * masak submits rakudobug > can't believe no-one caught this before

Re: One-pass parsing and forward type references

2010-02-01 Thread Moritz Lenz
Carl Mäsak wrote: > But on another level, the level of types, Perl 6 makes it fairly > *un*natural that the type C refers to the type C, which in > turn refers to the type C. True, and that has also been bothering me quite a bit. The "solution" is to always write ::Typename instead of Typename...

Re: r29558 - docs/Perl6/Spec/S32-setting-library t/spec/S32-array t/spec/S32-list

2010-01-20 Thread Moritz Lenz
pugs-comm...@feather.perl6.nl wrote: > Author: ash > Date: 2010-01-19 17:34:28 +0100 (Tue, 19 Jan 2010) > New Revision: 29558 > > Added: >t/spec/S32-array/create.t >t/spec/S32-list/create.t > Modified: >docs/Perl6/Spec/S32-setting-library/Containers.pod > Log: > Adding some tests for L

String to Regex

2010-01-04 Thread Moritz Lenz
Some Perl 5 programs take a regex (in string form) as input, and simply interpolate it into a regex. In Perl 6, you'd do that as my $re = rx/ <$input> /; But since $input can contain closures, arbitrary code can be executed. I'd like to propose a way to compile a string to a regex which doesn't

Re: [perl #71536] [BUG] Rakudo allows two multi variants with the exact same signature to be defined

2009-12-22 Thread Moritz Lenz
Carl MXXsak (via RT) wrote: > This be Rakudo 8dc189. > > $ perl6 -e 'multi sub f($a) {}; multi sub f($a) {}; f(42)' > Ambiguous dispatch to multi 'f'. Ambiguous candidates had signatures: > :(Any $a) > :(Any $a) > > The definition of two variants with equivalent signatures (i.e. > identical up to

Re: infinity literals - 'Inf' vs '+Inf'

2009-12-22 Thread Moritz Lenz
Darren Duncan wrote: > I was studying the synopsis today for how Perl 6 uses infinities, and among > the > 48 occurrences of "[|-|+]Inf" in the synopsis, I noticed that in some places > you > seemed to use "+Inf" to mean positive infinity and other places you just say > "Inf". > > So are th

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Moritz Lenz
Dave Whipp wrote: > The definition of the Complex type seems a little weak. A few things: > > To get the Cartesian components of the value there are two methods ("re" > and "im"). In contrast there is just one method "polar" to return the > polar components of the value Not quite, .abs returns

Re: Language status

2009-12-10 Thread Moritz Lenz
Hi, On Thu, Dec 10, 2009 at 12:56:46AM -0700, Sean Hunt wrote: > I'm looking forward to Perl 6, and I'm looking into the spec right now, > since that to me is the important bit of a language (I know, I'm > bizarre). I see at http://feather.perl6.nl/syn/ that a lot of the > language spec is s

Rat.perl (was: [pugs-commits] r29121 - docs/Perl6/Spec)

2009-11-18 Thread Moritz Lenz
At least I don't see the point of special-casing one trailing zero in the denominator. Cheers, Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

Re: r29111 - docs/Perl6/Spec

2009-11-18 Thread Moritz Lenz
On Wed, Nov 18, 2009 at 12:33:35AM -0800, Darren Duncan wrote: > Acknowledging that 'FatRat' is current name for above 'Ratio' ... > > pugs-comm...@feather.perl6.nl wrote: >> -For applications that really need arbitrary precision denominators >> -as well as numerators, C may be used, which is defin

Re: How does List.map: { .say } work?

2009-11-03 Thread Moritz Lenz
On Mon, Nov 02, 2009 at 10:16:39AM -0500, Solomon Foster wrote: > On Mon, Nov 2, 2009 at 9:53 AM, Moritz Lenz wrote: > > Hi, > > > > the current spec doesn't allow immutable containers to call .map with a > > block that implicitly uses $_ as an implicit parameter.

How does List.map: { .say } work?

2009-11-02 Thread Moritz Lenz
Hi, the current spec doesn't allow immutable containers to call .map with a block that implicitly uses $_ as an implicit parameter. Here's why: S06 says > The C<$_> variable functions as a placeholder in a block without any > other placeholders or signature. Any bare block without placeholders

Notes on Longest-Token Matching

2009-10-28 Thread Moritz Lenz
Hi all, I've written down some notes on Longest-Token Matching, nothing really new, just an attempt to be a bit more verbose than the spec: http://github.com/moritz/ltm/blob/master/ltm.pod If you find anything that's unclear or wrong, please let me know. If the feedback is positive I'll merge

Re: Parsing data

2009-10-07 Thread Moritz Lenz
Aaron Sherman wrote: > One of the first things that's becoming obvious to me in playing with > Rakudo's rules is that parsing strings isn't always what I'm going to > want to do. The most common example of wanting to parse data that's > not in string form is the YACC scenario where you want to have

Re: generality of Range

2009-10-04 Thread Moritz Lenz
Darren Duncan wrote: > However, I still don't see how one would retrieve the distinction between say > "1..10" and "1^..^10". I suggest that an extra 2 methods such as > .min_is_outside and .max_is_outside (each returns a Bool) could fit the bill, > and in fact since I have Pugs write access

Re: r28597 - docs/Perl6/Spec/S32-setting-library

2009-10-04 Thread Moritz Lenz
Jon Lang wrote: > Moritz Lenz wrote: >> Jon Lang wrote: >>> typos: s[Nuermic] = "Numeric" >> >> You do have a pugs commit bit, don't you? > > A what? AFAICT, I don't have any way of editing the Synopses; You have now (sorry for assuming

Re: r28597 - docs/Perl6/Spec/S32-setting-library

2009-10-04 Thread Moritz Lenz
Michael Zedeler wrote: > Moritz Lenz wrote: >> Jon Lang wrote: >> >>> How do pred and succ work when given Complex values? >>> >> By adding/substracting 1 from the real part, I'd say. Don't know if that >> actually makes sense. >&

Re: r28597 - docs/Perl6/Spec/S32-setting-library

2009-10-04 Thread Moritz Lenz
Jon Lang wrote: > How do pred and succ work when given Complex values? By adding/substracting 1 from the real part, I'd say. Don't know if that actually makes sense. > More generally: if Complex does Numeric, then Numeric doesn't include > Ordered (or whatever it's called), because Complex doesn'

Re: r28523 - docs/Perl6/Spec/S32-setting-library

2009-10-01 Thread Moritz Lenz
Jan Ingvoldstad wrote: > On Thu, Oct 1, 2009 at 10:15 PM, Moritz Lenz wrote: >> >> >> What's the 0th root of a number, then? >> It would be a number $y for which $y ** 0 == $x, which can only be >> fulfilled for $x == 1. So in the general cases the an

Re: r28523 - docs/Perl6/Spec/S32-setting-library

2009-10-01 Thread Moritz Lenz
Jon Lang wrote: > On Wed, Sep 30, 2009 at 11:58 PM, wrote: >> >> Author: moritz >> Date: 2009-10-01 08:58:00 +0200 (Thu, 01 Oct 2009) >> New Revision: 28523 >> >> Modified: >> docs/Perl6/Spec/S32-setting-library/Numeric.pod >> Log: >> [S32::Num] More thoughts on Inf/NaN Complex, and on comparing

Should .^methods be curried with the invocant?

2009-09-25 Thread Moritz Lenz
Consider this case: class A { method m { say 'OH HAI' } }; my $m = A.new.^methods(:local).[0]; How should I invoke $m? In current Rakudo this works: $m(A.new); # supply the invocant as first argument But shouldn't be just $m() (invocant magically curried) or may $m(A.new:) (invocant not cur

Re: Looking for help updating Perl 6 and Parrot part of Perl Myths talk

2009-09-25 Thread Moritz Lenz
Moritz Lenz wrote: > Carl Mäsak wrote: >> Tim (>): >>> Anything else I should add, change or remove? I'm especially interested >>> in verifyable metrics showing effort, progress, or use. Ideally graphical. >>> Any interesting nuggets that fit with t

Re: perl6.org (Was: Re: How can i contribute for perl 6 ?)

2009-09-19 Thread Moritz Lenz
Moritz Lenz wrote: > In other words, we need to scale. Please check perl6.org again, mostly the scaling is done now. Cheers, Moritz

Re: [perl #69194] rakudo 2009-08 and when with lists

2009-09-18 Thread Moritz Lenz
Aaron Sherman wrote: > Redirecting thread to language because I do agree that this is no longer a > matter of a bug. > > On Fri, Sep 18, 2009 at 9:28 AM, Moritz Lenz via RT < > perl6-bugs-follo...@perl.org> wrote: > >> On Thu Sep 17 08:53:59 2009, ajs wrote: >

Re: How can i contribute for perl 6 ?

2009-09-17 Thread Moritz Lenz
Timothy S. Nelson wrote: > On Wed, 16 Sep 2009, Geoffrey Broadwell wrote: > >> On Wed, 2009-09-16 at 19:49 +1000, Timothy S. Nelson wrote: >>> +1. I have a set of 7 bookmarks that load in tabs that I call my "Perl 6" >>> bookmarks. I load this group of tabs into a separate web browser window >>

Workaround for role stubs (Re: Looking for help updating Perl 6 and Parrot part of Perl Myths talk)

2009-09-16 Thread Moritz Lenz
Timothy S. Nelson wrote: > On Wed, 16 Sep 2009, Carl Mäsak wrote: > >> Tim (>), Raphael (>>): Some XML related stuff: XML parser: http://github.com/fperrad/xml/ Tree manipulation: http://github.com/wayland/Tree/tree/master >>> >>> Thanks. Any reason they're not k

Re: How can i contribute for perl 6 ?

2009-09-16 Thread Moritz Lenz
On Tue, Sep 15, 2009 at 09:30:13AM +0530, Saravanan Thiyagarajan wrote: > Would like to be a volunteer in working for perl-6. > Can some one help me to get into right direction ? I've written about various options on perlmonks [1], but I think the best thing you can do right now is to pick a simpl

perl6.org (Was: Re: How can i contribute for perl 6 ?)

2009-09-15 Thread Moritz Lenz
(Sorry if this gets a bit lengthy and hijacks the current thread, but there are some thoughts I want to share about perl6.org, and Patrick handed me the opportunity on a silver plate here ;-) Patrick R. Michaud wrote: > On Tue, Sep 15, 2009 at 11:16:56AM -0500, Kyle Hasselbacher wrote: >> On Mon,

Re: Looking for help updating Perl 6 and Parrot part of Perl Myths talk

2009-09-14 Thread Moritz Lenz
Carl Mäsak wrote: > Tim (>): >> Anything else I should add, change or remove? I'm especially interested >> in verifyable metrics showing effort, progress, or use. Ideally graphical. >> Any interesting nuggets that fit with the theme will be most welcome. > > Moritz++ and I were talking about makin

Re: Looking for help updating Perl 6 and Parrot part of Perl Myths talk

2009-09-14 Thread Moritz Lenz
On Mon, Sep 14, 2009 at 12:15:05PM +0100, Tim Bunce wrote: > page 73 - Perl 6 implementations > I've added Mildew, with links, to the SMOP line > anything I should add / change / remove? > What's the status of KindaPerl6? I think it's stalled or

Re: r28196 - docs/Perl6/Spec

2009-09-07 Thread Moritz Lenz
yary wrote: [ a lot of good things that make lot of sense ] Your complaints and review by TimToady and pmichaud on #perl6 convinced me that this is not a good idea after all, see http://irclog.perlgeek.de/perl6/2009-09-07#i_1475421 Cheers, Moritz

Re: Custom object constructors

2009-08-26 Thread Moritz Lenz
Kevan Benson wrote: > That said, I submit that it's a very confusing part of the language as > defined currently, and I haven't seen a very thorough explanation of the > purpose of each method in the chain the instantiates a new object. S12 > touches upon them slightly, but not in enough detail

Re: versioning same-auth forks/branches

2009-08-26 Thread Moritz Lenz
Darren Duncan wrote: > In regards to http://perlcabal.org/syn/S11.html#Versioning I have recently > considered that it may be deficient in addressing a possibly-common > situation, > and I'm looking for input on how to handle that situation, either for a best > practice that works within the cu

Re: Custom object constructors

2009-08-20 Thread Moritz Lenz
Kevan Benson wrote: > Should there not be a way to define object constructors with custom > signatures that can be usefully invoked like a normal constructor? > > Currently, defining a BUILD method for a class with a specific signature > doesn't seem to allow for the object to be invoked by new

[perl #64566] @a[1..*] adds trailing undef value

2009-08-19 Thread Moritz Lenz via RT
On Wed Apr 08 14:59:19 2009, moritz wrote: > 23:55 <@moritz_> rakudo: my @a = 1..4; say @a[1..*].perl > 23:56 < p6eval> rakudo 6b9755: OUTPUT«[2, 3, 4, undef]␤» > > It should just be [2, 3, 4]. Since the discussion came up on #perl6 if this is really the expected behaviour, S09 says: As the end-

Re: S26 - The Next Generation

2009-08-17 Thread Moritz Lenz
raiph mellor wrote: >> However it seems we have to pay a price: each act of rendering a Pod >> file actually means executing the program that's being documented (at >> least the BEGIN blocks and other stuff that happens at compile time), >> with all the security risks implied. So we'll need a *very

Re: S26 - The Next Generation

2009-08-17 Thread Moritz Lenz
Damian Conway wrote: > It's not yet committed, as there will (no doubt) be much discussion > first. I apologize in advance: I am still travelling on my annual world > tour, so my ability to participate in this discussion will be limited > and erratic. In the spirit of "ask for forgiveness rather t

Re: Embedded comments: two proposed solutions to the comment-whole-lines problem

2009-08-11 Thread Moritz Lenz
Ben Morrow wrote: > Quoth markjr...@gmail.com (Mark J. Reed): >> >> I still like the double-bracket idea. I don't much mind the extra >> character; 5 characters total still beats the 7 of HTML/XML. > > I much prefer double-bracket to double-#: double-# gets caught out when > you do s/^/# on code

Does a string remember all Unicode levels?

2009-08-08 Thread Moritz Lenz
t/spec/S02-builtin_data_types/unicode.t has tests like this: # LATIN CAPITAL LETTER A, COMBINING GRAVE ACCENT my Str $u = "\x[0041,0300]"; is $u.bytes, 3, 'combining À is three bytes as utf8'; is $u.codes, 2, 'combining À is two codes'; is $u.graphs, 1, 'combining À is one graph'; Which seems to

Re: r27888 - docs/Perl6/Spec

2009-08-06 Thread Moritz Lenz
pugs-comm...@feather.perl6.nl wrote: > Author: jimmy > Date: 2009-08-07 05:02:42 +0200 (Fri, 07 Aug 2009) > New Revision: 27888 > > Modified: >docs/Perl6/Spec/S01-overview.pod >docs/Perl6/Spec/S02-bits.pod >docs/Perl6/Spec/S03-operators.pod >docs/Perl6/Spec/S04-control.pod >doc

Re: Testing Perl 6 analog to Perl 5's tie.

2009-08-02 Thread Moritz Lenz
Let's pick up this old mail before it gets completely warnocked ;-) For the record, this discussion only applies to scalar implementation types. For example for Arrays I expect things to work by overriding the method postcircumfix:<[ ]>. Also I'm far from being an expert on this field, so feel fr

Re: confusing list assignment tests

2009-07-28 Thread Moritz Lenz
Jon Lang wrote: > Larry Wall wrote: >> Moritz Lenz wrote: >> : Either it's parsed as '@a[0] = (W, W)' (list assignment), then @a should >> : get both elements, and so should @z. >> >> Not according to S03, at least by one reading. @a[0] as a sca

Re: confusing list assignment tests

2009-07-28 Thread Moritz Lenz
Thanks for the quick reply. Larry Wall wrote: > On Tue, Jul 28, 2009 at 09:24:40PM +0200, Moritz Lenz wrote: > : sub W () { substr(eval('want'), 0, 1) } > : ... > : > : # line 560: > : { > : my @a; > : my @z = (@a[0] = W, W); > : #?rakudo 2 t

confusing list assignment tests

2009-07-28 Thread Moritz Lenz
I'm in the mood to question my sanity, so I'm seeking feedback for some test mangling: In t/spec/S03-operators/assign.t there are some tests that cause me a headache. I'm trying to re-write them to not use the now-gone want() function, but I'd have to understand them first ;-) A good example is t

Re: Clarification of S04 closure traits

2009-07-27 Thread Moritz Lenz
Ben Morrow wrote: > Moritz Lenz wrote: >> Ben Morrow wrote: >>> >>> - Presumably when an exception is thrown through a block, the LEAVE and >>> POST queues are called (in that order). >> >> POST was inspired from the Design By Contract departmen

Re: Clarification of S04 closure traits

2009-07-26 Thread Moritz Lenz
Ben Morrow wrote: > I'm iworking on a patch for Perl 5 that implements the Perl 6 closure > traits (ENTER/LEAVE/...) as special blocks. There are several details > that aren't clear to me from either S04 or the spec tests; I apologize > if these have been discussed before, as I haven't been followi

Re: indentation with multiple languages

2009-07-25 Thread Moritz Lenz
Mark J. Reed wrote: > On Sat, Jul 25, 2009 at 5:03 AM, Moritz Lenz wrote: >> Presumably you want here-docs, which can be indented in Perl 6: >> >>perl 6 code >>perl 6 code >>$script.say(Q:to); >> output code >> output cod

Re: indentation with multiple languages

2009-07-25 Thread Moritz Lenz
Richard Hainsworth wrote: > One of Masak's irritations with perl6 > (http://use.perl.org/~masak/journal/39334) concerns interspacing POD and > code. > > I ran into an analogous problem with a project I am trying to do with > perl6. Since perl6 doesnt yet link to the gd library, and I need > gr

Announce: Rakudo Perl 6 development release #19 ("Chicago")

2009-07-23 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm pleased to announce the July 2009 development release of Rakudo Perl #19 "Chicago". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the July 2009 release is available from http://github.com/rakudo/rakudo/download

Parameter binding

2009-07-22 Thread Moritz Lenz
Hi, I came to this 12:51 <@moritz_> rakudo: my $x = 3; say $x, ' ', ++$x; 12:51 < p6eval> rakudo 7b81c0: OUTPUT«4 4␤» 12:51 <@moritz_> rakudo: my $x = 3; say $x, ' ', $x++; 12:51 < p6eval> rakudo 7b81c0: OUTPUT«4 3␤» This looks very counter intuitive, because it looks like the arguments are ev

.match and .subst set outer $/?

2009-07-12 Thread Moritz Lenz
payload++ brought this up on #perl6: in current Rakudo, $string ~~ /re/ sets $/ in the scope in which the expression appears, ie 'a' ~~ /./; say $/; # ouput: a But $str.match(..) and $str.subst don't. The spec is rather silent, it says "There are also method forms of m// and s///: [...]

Re-thinking file test operations

2009-07-09 Thread Moritz Lenz
Hi, Somehow the current file test syntax, 'filename' ~~ :e, looks like a not well-though-out translation of Perl 5's syntax, -e 'filename'. Apart from totally feeling wrong to me, there are a few points I can put my finger on: 1) $file ~~ :s returns a number, although smartmatching usually retur

smart match questions/inconsistencies

2009-07-06 Thread Moritz Lenz
Hi, while writing some tests for the smartmatch operator, I noticed this item: Any * block signature match block successfully binds to |$_ which block is this talking about? the current &?BLOCK? Somehow this doesn't make much sense to me. I also noticed that the slice operation

Re: [pugs-commits] r27404 - t/syntax

2009-07-05 Thread Moritz Lenz
pugs-comm...@feather.perl6.nl wrote: > Author: kyle > Date: 2009-07-04 19:26:48 +0200 (Sat, 04 Jul 2009) > New Revision: 27404 > > Modified: >t/syntax/hyper_latin1.t > Log: > [t] Further mutated t/syntax/hyper_latin1.t > > Modified: t/syntax/hyper_latin1.t > ==

Signature for the series operator

2009-06-25 Thread Moritz Lenz
Hi, I had the pleasure to implement the series operator (&infix:<...>) in Rakudo(*), and came across the difficulty to come up with a signature for it. These are the use cases I want to cover: 1, 2 ... { $^a + $^b } 1 ... { $_ + 1 } The first one can clearly be written as sub infix:<...>(@value

[perl #66824] "argument doesn't array" with one-item ranges

2009-06-21 Thread Moritz Lenz via RT
On Sun Jun 21 12:05:11 2009, moritz wrote: > 21:03 <@moritz_> rakudo: my @a = 1, 2, 4; sub f($a) { say $a }; > f(|@a[*-1..*-1]) > 21:03 < p6eval> rakudo 1b06df: OUTPUT«argument doesn't array␤in sub f > (/tmp/2x4tmnOO68:1)␤called from Main (/tmp/2x4tmnOO68:2)␤» > I investigated a b

"is value" trait

2009-05-17 Thread Moritz Lenz
Hi, t/oo/value_types.t mentions the "is value" trait, which doesn't appear in the spec anywhere. According to the discussion in [1] there was speculation about 'is cow' and 'is value', but the former didn't seem to enter the spec either. So what should I do about that test? Simply delete it? Mor

each() comprehension

2009-05-17 Thread Moritz Lenz
Hi, (sorry for yet another p6l email mentioning junctions; if they annoy you just ignore this mail :-) while reviewing some tests I found the "each() comprehension" in S02 that evaded my attention so far. Do we really want to keep such a rather obscure syntactic transformation? I find an explici

Re: r26700 - docs/Perl6/Spec

2009-05-06 Thread Moritz Lenz
Jon Lang wrote: >> @@ -1836,6 +1836,12 @@ >> prototype objects, in which case stringification is not likely to >> produce something of interest to non-gurus.) >> >> +The C<.^parents> method by default returns a flattened list of all >> +parents sorted in MRO (dispatch) order. Other options are: >

Re: Call for review: traits, lift

2009-05-03 Thread Moritz Lenz
Moritz Lenz wrote: > sub f (lift $a + $b); I mean 'sub f() { lift $a + $b }', sorry.

Call for review: traits, lift

2009-05-03 Thread Moritz Lenz
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 s

Re: %ARGH

2009-04-19 Thread Moritz Lenz
Hi, Timothy S. Nelson wrote: > Hi all. Can we change %*OPTS to %*ARGH ? You can, in any program you like (at least very nearly): sub MAIN(*...@arga, *%ARGH) { ... } Cheers, Moritz

Re: some questions about S02(type)

2009-04-03 Thread Moritz Lenz
Moritz Lenz wrote: >> 2. set is unordered collection of values, subset is new type. People are >> apt to confuse the two concepts. > > Note that people never write "subset" in their code, the write things like > sub f($x where { ... } ) and the "where&

Re: some questions about S02(type)

2009-04-03 Thread Moritz Lenz
Xiao Yafeng wrote: > 1. Could I set multi-return type?like > sub test as (Int, Str) {...} "as" is coercion - so to what would it coerce? Int or Str? How could the compiler know? Or do you mean something like a tuple? > 2. set is unordered collection of values, subset is n

Re: S08 Draft questions (Captures and Signatures)

2009-04-01 Thread Moritz Lenz
I can't comment on most of your questions, but the few that I can answer are inline below... Jon Lang wrote: > Yes, I know that there is no S08. I'm working on writing one, ++ > * What types are you allowed to assign to an invocant? Whatever the type constraint says. When you write class Foo

Re: Getting rid of want()

2009-03-31 Thread Moritz Lenz
Brandon S. Allbery KF8NH wrote: > On 2009 Mar 31, at 17:04, Moritz Lenz wrote: >> We had a discussion on #perl6 tonight about how to implement want(), >> and >> basically came to no conclusion. Then I came up with the idea that any >> lazy implementor will come up with

<    1   2   3   4   >