Re: Unwanted failure and FAILGOAL

2016-05-11 Thread Moritz Lenz
Hi, On 05/11/2016 07:45 AM, Richard Hainsworth wrote: I have the following in a grammar rule TOP{ ^ + $ }; rule statement { '=' | { { self.panic($/, "Declaration syntax incorrect") } } }; rule endvalue { '(' ~ ')'

Re: Rationale for $!

2016-01-28 Thread Moritz Lenz
Hi, On 01/28/2016 04:06 PM, Todd C. Olson wrote: > Is there a way to make the exception be thrown eagerly, at the devision > statement rather than waiting until use, at the say statement? Yes, 'use fatal;' Cheers, Moritz

Re: Rationale for $!

2016-01-27 Thread Moritz Lenz
On 01/27/2016 04:32 PM, Felipe Gasper wrote: On 27 Jan 2016 10:15 AM, Moritz Lenz wrote: On 01/27/2016 03:15 PM, Felipe Gasper wrote: So, what *is* the scoping of $!? Scoped to a routine, iirc (sub, method, regex) Interesting. JavaScript programmers that I’ve known bemoan that their

Re: Rationale for $!

2016-01-27 Thread Moritz Lenz
On 01/27/2016 03:15 PM, Felipe Gasper wrote: So, what *is* the scoping of $!? Scoped to a routine, iirc (sub, method, regex)

Re: Rationale for $!

2016-01-27 Thread Moritz Lenz
Hi, On 01/27/2016 07:17 AM, Felipe Gasper wrote: Hello, What is the purpose of having $! in Perl 6? The global variables in Perl 5 are a constant headache, prompting us to need to local()ize variables like $@, $!, and $? to avoid unforeseen consequences like RT #127386 and those docu

Announce: Rakudo Star Release 2015.11

2015-11-28 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the November 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the November 2015 release is available from . This Rakudo Star release comes with s

Re: confused about 'try'

2015-11-24 Thread Moritz Lenz
Hi, On 11/24/2015 06:39 AM, brad clawsie wrote: > Been playing with perl6 and it is truly amazing. > > I'm somewhat confused as to when I should should wrap subroutine > invocations with `try`. My `CATCH` clauses seem to be able to catch > thrown Exception instances if I use `try` or not. That's

Re: Backwards compatibility and release 1.0

2015-10-15 Thread Moritz Lenz
On 10/15/2015 10:47 AM, Smylers wrote: Moritz Lenz writes: On 10/13/2015 10:52 AM, Richard Hainsworth wrote: Following on the :D not :D thread, something odd stuck out. On 10/13/2015 03:17 PM, Moritz Lenz wrote: We have 390+ modules, and hand-waving away all trouble of maintaining them

Re: Backwards compatibility and release 1.0

2015-10-14 Thread Moritz Lenz
On 10/13/2015 10:52 AM, Richard Hainsworth wrote: Following on the :D not :D thread, something odd stuck out. On 10/13/2015 03:17 PM, Moritz Lenz wrote: But hopefully none of them breaking backwards compatibility on such a large scale. The last few backwards incompatible changes still cause

Re: To :D or not to :D

2015-10-13 Thread Moritz Lenz
On 10/12/2015 09:51 PM, Mark Overmeer wrote: * Moritz Lenz (mor...@faui2k3.org) [151012 15:32]: . are they using :D correctly? Yes, though not everybody uses :D as much as they do. Do you check that all the parameters that your Perl 5 methods/subs receive are defined? If not, you

Re: To :D or not to :D

2015-10-12 Thread Moritz Lenz
Hi, On 10/12/2015 03:41 PM, Mark Overmeer wrote: > > Hi all, > > Liz and Tux demonstrate powerful Perl6 code at each monthly meeting of > our Mongers in Amsterdam. Looking at their examples, I collected a few > questions of which I want to discuss the first one in this thread. > > > When I lo

Announce: Rakudo Star Release 2015.09

2015-09-26 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm excited to announce the September 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the September 2015 release is available from . This Rakudo Star release comes wi

Announce: Rakudo Star Release 2015.07

2015-07-27 Thread Moritz Lenz
A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the July 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the July 2015 release is available from

Announce: Rakudo Star Release 2015.03

2015-03-21 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ## A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the March 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the March 2015

Announce: Rakudo Star Release 2015.02

2015-02-21 Thread Moritz Lenz
## A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the February 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the February 2015 release is available from

Re: S02 mistake re Blob?

2015-02-21 Thread Moritz Lenz
Hi Darren, On 21.02.2015 08:51, Darren Duncan wrote: > I notice from looking at http://design.perl6.org/S02.html that Blob is listed > both as being a role and as a type. See > http://design.perl6.org/S02.html#Roles > for an example of the former, and > http://design.perl6.org/S02.html#Immuta

Re: [perl #121454] Can't inline complex constraints in multisub signatures

2014-03-28 Thread Moritz Lenz
On 03/28/2014 02:28 PM, Parrot Raiser wrote: > On 3/27/14, Moritz Lenz wrote: > >> Agreed. We "just" need to come up with a consistent, intuitive way to >> handle the rest of the cases. And implement it. >> > > Whenever somebody offers a solution to a

Re: [perl #121454] Can't inline complex constraints in multisub signatures

2014-03-27 Thread Moritz Lenz
On 03/19/2014 11:06 AM, Damian Conway wrote: > To me, the issue is: how does Perl 6 actually carry out the > type inference we're doing here? > > And I believe it's an important question to get right, as we > may eventually see Perl 6 doing more type inference...either > in core, or else through

Re: [perl #121454] Can't inline complex constraints in multisub signatures

2014-03-19 Thread Moritz Lenz
f'up to p6l, because the ticket doesn't need the rest of the discussion. On 03/19/2014 10:21 PM, Darren Duncan wrote: > On 2014-03-19, 1:20 AM, Moritz Lenz wrote: >> On 03/19/2014 12:45 AM, Darren Duncan wrote: >>> Damian, Moritz, etc, >>> >>> It s

Re: Unexpected expansion of string with xx

2013-12-21 Thread Moritz Lenz
On 12/20/2013 04:52 AM, Richard Hainsworth wrote: OK x not xx. The doubling of operators is confusing. OTOH having a single operator which two different meanings is also confusing (and very un-perlish). Cheers, Moritz

Re: Licensing: Perl 6 specification and test suite

2013-11-05 Thread Moritz Lenz
Hi, On 11/05/2013 03:16 PM, Jan Ingvoldstad wrote: On Tue, Nov 5, 2013 at 3:09 PM, Kalinni Gorzkis mailto:musicdenotat...@gmail.com>> wrote: Can I distribute and modify the Perl 6 specification documents and test suite under which conditions? If not, I propose that they should be di

Re: Class attribute introspection

2013-10-28 Thread Moritz Lenz
Hi Richard, On 10/28/2013 08:07 AM, Richard Hainsworth wrote: Perhaps I am using class incorrectly, but I set up a class, then change some of the parameters in an instance of the class. Next I would like to discover what the current state of the instance is. There is a way to introspect throug

Re: Introduction to Synopses

2013-09-29 Thread Moritz Lenz
Hi Richard, On 09/29/2013 07:28 AM, Richard Hainsworth wrote: > Some suggestions about documentation. > > Originally the Synopses were implementation oriented sumaries of the > previous description base Apocalypses. That meant that the Synopses were > derivative and secondary to the Apocalypses

Announce: Rakudo Star Release 2013.09

2013-09-26 Thread Moritz Lenz
## A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the September 2013 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the September 2013 release is available from

Rakudo Star 2013.08 released

2013-08-24 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the August 2013 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the August 2013 release is available from . A Windows .MSI version of Rakudo star will

Re: Commensurability as Key

2013-08-20 Thread Moritz Lenz
Hello, some clarifications below On 08/21/2013 05:19 AM, Doug McNutt wrote: >> * a "function" is a subroutine returning a scalar ( see below) fwiw we don't make that distinction in the specification; we just talk about subroutines. We can return nothing, a scalar or a non-scalar. >>, a "pr

Re: Are set operations needed?

2013-07-18 Thread Moritz Lenz
On 07/18/2013 01:07 PM, Richard Hainsworth wrote: Are set operations needed in Perl6? No implementation of the perl6 set specification yet exists (AFAIK). You are wrong. Both rakudo and niecza implement significant subsets of the set specification. Cheers, Moritz

Announce: Rakudo Star 2013.02 released

2013-02-24 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the February 2013 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the February 2013 release is available from . A Windows .MSI version of Rakudo st

Rakudo Star 2013.01 released

2013-01-30 Thread Moritz Lenz
Announce: Rakudo Star - a useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the January 2013 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the January 2013 release is availabl

Announce: Rakudo Star 2012.12 release

2012-12-27 Thread Moritz Lenz
Announce: Rakudo Star - a useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the December 2012 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the December 2012 release is availa

Rakudo Star 2012.11 released

2012-11-28 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the November 2012 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the November 2012 release is available from . A Windows .MSI version of Rakud

Re: Perl 6 in Perl 6?

2012-10-18 Thread Moritz Lenz
On 10/18/2012 09:02 AM, Darren Duncan wrote: Something (PyPy et al) got me wondering, is it a goal in the Perl community before too long to have a (compiling) implementation of Perl 6 written entirely in Perl 6? A fair amount of the two major Perl 6 compilers, Rakudo and Niecza, are already w

Re: [perl #113930] Lexical subs

2012-07-08 Thread Moritz Lenz
On 07/08/2012 09:57 PM, Father Chrysostomos via RT wrote: > my $x; > my sub f { say $x } > for 1..10 -> $x { f(); } It prints Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() (because Any is the default value in uninitialized variables). As an aside, you can run short Per

Re: When do named subs bind to their variables? [perl #113930]

2012-07-08 Thread Moritz Lenz
On 07/08/2012 11:12 AM, Damian Conway wrote: > Father Chrysostomos pointed out: > >> I said when, not whether. :-) > > Isn't that just typical of me: confusing ontology with chronology. ;-) > > I'm afraid don't know the implementation details for Rakudo. It may be > bound as the surrounding block i

Re: When do named subs bind to their variables? [perl #113930]

2012-07-08 Thread Moritz Lenz
On 07/08/2012 11:12 AM, Damian Conway wrote: > Father Chrysostomos pointed out: > >> I said when, not whether. :-) > > Isn't that just typical of me: confusing ontology with chronology. ;-) > > I'm afraid don't know the implementation details for Rakudo. It may be > bound as the surrounding bloc

Re: [perl6/specs] 34fddf: [S32::Str] substr is not rw anymore, but substr-rw...

2012-06-09 Thread Moritz Lenz
On 06/09/2012 12:32 PM, Richard Hainsworth wrote: > I noticed that subst-rw does not have "is export" in the definition. > > Does this mean that subst-rw is not available outside the module? No. All routines from the setting are available to user space code, because they are simply in an outer s

Re: The trouble with awesome

2012-05-30 Thread Moritz Lenz
Am 26.05.2012 21:12, schrieb Parrot Raiser: There are a lot of programmers who know several programming languages already, and who don't want to read a whole page on how to print 'Hello World', 5 pages on if-statements and while-loops and another 10 pages explaining lists and iteration. How

Re: The trouble with awesome

2012-05-25 Thread Moritz Lenz
> My point is that while it > started out as a way to improve/formalize Perl 5, it's developed > sufficiently to the point where it is its own language and not the > "next" version of 'perl'. But it is still a version of Perl. It might not be the "next" version of Perl, but it certainly the sixth

Re: The trouble with awesome

2012-05-25 Thread Moritz Lenz
Hallo Parrot, we are well aware that the documentation for Perl 6 is quite lacking. Any contributions in that area are greatly appreciated. Am 23.05.2012 01:35, schrieb Parrot Raiser: The problem we have is to provide a path for learning 6, that presents a comprehensible but useful subset of

Re: allow .re and .im to be l-values

2012-05-18 Thread Moritz Lenz
On 05/19/2012 06:05 AM, Siddhant Saraf wrote: > r: my $x = 4 + 2i; $x.re = 5; > rakudo 45679a: OUTPUT«Cannot assign to a non-container␤ in > block at /tmp/PeeJaa8bWJ:1␤␤» > > I think $x.re (Real part of $x) and $x.im (Imaginary part of $x) > should be allowed to be l-values. > What do you sa

Re: The "=" operator and context

2012-04-03 Thread Moritz Lenz
On 04/03/2012 08:24 PM, Daniel Carrera wrote: > On 3 April 2012 17:24, Moritz Lenz wrote: >> You can, very nearly. You just need to write >> >> my @vec is Vector; >> >> because you really want to change the type of the container, not just of the >> con

Re: The "=" operator and context

2012-04-03 Thread Moritz Lenz
Am 03.04.2012 17:10, schrieb Daniel Carrera: (1..10).WHAT # => Range() @foo = 1..10; @foo.WHAT # => Array() When you assign a range to @foo, the result is an array. Something similar happens, for example, if you assign a scalar to @foo... The context of the assignment causes Perl 6 to

Re: Not Quite Perl

2012-04-03 Thread Moritz Lenz
(follow-up to perl6-compil...@perl.org) Am 03.04.2012 10:02, schrieb Daniel Carrera: I've been reading a little about NQP (Not Quite Perl). I was wondering if NQP is part of the Parrot project, or if it is an independent spec. NQP exists in several versions. The earliest version lived in the p

Re: Floating-point equality (was Re: How to make a new operator.)

2012-03-25 Thread Moritz Lenz
On 03/25/2012 06:55 AM, Moritz Lenz wrote: > I don't know if the majority of the perl6-language posters have realized > it yet, but both Perl 6 and the its implementations are quite mature > these days. Mature enough that such proposals should be prototyped as > modules, and tho

Re: Floating-point equality (was Re: How to make a new operator.)

2012-03-24 Thread Moritz Lenz
On 03/25/2012 05:59 AM, David Green wrote: > On 2012-March-23, at 12:01 am, Damian Conway wrote: >> [...] we ought to allow for the inevitable loss of significant digits within >> the two preliminary division ops, and therefore compare the results with an >> suitably larger epsilon. >> That wou

Re: How to make a new operator.

2012-03-24 Thread Moritz Lenz
On 03/23/2012 09:14 AM, Damian Conway wrote: >> it means we cannot do the same fuzziness for the endpoint, > > Except that we will be encouraging people to use: * >= $END > as their standard endpoint pattern, which will provide > most of the necessary fuzz. and which will still surprise those p

Re: How to make a new operator.

2012-03-22 Thread Moritz Lenz
On 03/23/2012 05:30 AM, Patrick R. Michaud wrote: > On Fri, Mar 23, 2012 at 03:03:09PM +1300, Martin D Kealey wrote: >> Question: do we support >> >> 1, 2i, -4 ... 256 > > I think this ought to work, but for some reason Rakudo on my system > hangs whenever I try it. The problem was that inf

Re: How to make a new operator.

2012-03-22 Thread Moritz Lenz
On 03/23/2012 07:01 AM, Damian Conway wrote: > Patrick correctly observed: > >> On Rakudo on my system, sqrt(2) indeed produces a Num, >> but since floating point arithmetic doesn't result in >> sqrt(2) / 1 == 2 / sqrt(2), no geometric sequence is deduced >> and the sequence fails with "unable to

Re: How to make a new operator.

2012-03-22 Thread Moritz Lenz
Am 22.03.2012 17:07, schrieb Bruce Gray: I have run into the same need for something like :index, while playing with RosettaCode tasks like "Continued_fraction". If you want the index, don't use series. It's easy enough to access the array elements yourself. You can do something like my @a :

Re: How to make a new operator.

2012-03-22 Thread Moritz Lenz
On 03/22/2012 11:51 AM, Daniel Carrera wrote: > On 22 March 2012 11:02, Carl Mäsak wrote: 1, 2, 4 ... 100 # same as 1,2,4,8,16,32,64 >>> >>> That last one doesn't work on Rakudo :-( >> >> And it never will. Note that 100 is not a power of 2, and that the >> goal needs to match exactly. T

Re: How to make a new operator.

2012-03-21 Thread Moritz Lenz
On 03/21/2012 09:07 PM, Daniel Carrera wrote: > Hello, > > Is it possible to create a new range operator ':' such that: > > a:b is the same as a..b (this is the easy part) > > a:b:c is a range from 'a' to 'b' by steps of 'c'. For example, 2:15:3 > == 2,5,8,11,14 That can be done by giving th

Re: DBC-ish PRE and POST phasers, spec clarifications

2012-03-11 Thread Moritz Lenz
On 03/11/2012 02:11 PM, Moritz Lenz wrote: > Just a small syntax nit: I think your example of 'will require BLOCK' is > a violation of the rule that we shouldn't have two terms in a row. Never mind, trait_mod:will is special-cased to allow that: token trait_mod:will {

Re: DBC-ish PRE and POST phasers, spec clarifications

2012-03-11 Thread Moritz Lenz
On 03/11/2012 03:21 AM, Damian Conway wrote: > Carl asked: > >>class A { >>method foo($x) { >>PRE { $x < 10 } >># ... >>} >>} >> >>class B is A { >>method foo($a, $b, $c) { >>PRE { [>] $a, $b, $c } >># ... >>

Re: Setting private attributes during object build

2012-02-01 Thread Moritz Lenz
On 02/02/2012 07:40 AM, Damian Conway wrote: > My point was that I don't want the named arguments that BUILD can take > to be restricted to only the names of public attributes...which was, I > thought, yary's complaint when writing: No, the complaint was that when you write self.bless(*, |%named)

Re: Setting private attributes during object build

2012-02-01 Thread Moritz Lenz
On 02/02/2012 06:42 AM, Damian Conway wrote: > S12 has an example that explicitly contradicts this constraint that > constructor > args have to be public attribute names: > > submethod BUILD ($arg) { > $.attr = $arg; > } That example is certainly a fossil. In BUILD, the object i

Re: Setting private attributes during object build

2012-02-01 Thread Moritz Lenz
On 02/01/2012 11:41 PM, Carl Mäsak wrote: > Getting back to the topic of the original post: I think "blessall" is > a bad name for what's proposed, and I don't see a fantastically large > need for that functionality. What's wrong with just defining a BUILD > submethod in the class? The current app

Re: Encapsulating the contents of container types

2011-09-09 Thread Moritz Lenz
Am 09.09.2011 12:44, schrieb Carl Mäsak: Non-rw attributes, non-rw parameters, and non-rw return values all share the same mechanism. Fine. Makes sense. [...] Non-rw-ness in this case should be "all the way", not one level down. (I hope I didn't change the meaning by stripping parts of your q

Re: More bugs or PEBKAC

2011-09-05 Thread Moritz Lenz
On 09/05/2011 09:03 PM, Carl Mäsak wrote: > 1parrota (>): >> 1. Should there be a way to make "die" behave like the Perl 5 version, >> reporting the place of death unless the message is terminated by \n ? >> The \n no longer suppresses the location indormation. I can't find a >> definition either w

Re: Underscores v Hyphens (Was: [perl6/specs] a7cfe0: [S32] backtraces overhaul)

2011-08-24 Thread Moritz Lenz
Am 24.08.2011 11:33, schrieb Carl Mäsak: Damian (>>>), Moritz (>>), Smylers (>): ... why hidden_from_backtrace instead of hidden-from-backtrace? ... low-level things are spelled with underscores, while we reserve the minus character for user-space code. So the idea is that if Perl 6 has an i

Re: [perl6/specs] a7cfe0: [S32] backtraces overhaul

2011-08-23 Thread Moritz Lenz
Am 23.08.2011 10:56, schrieb Moritz Lenz: And why is this entire message written in questions? Is it? I'm afraid I don't understand what you mean. Never mind?

Re: [perl6/specs] a7cfe0: [S32] backtraces overhaul

2011-08-23 Thread Moritz Lenz
Am 23.08.2011 10:46, schrieb Damian Conway: It's a trivial point, but why hidden_from_backtrace instead of hidden-from-backtrace? Especially given that the associated method is is-hidden, not is_hidden? The current stance seems to be that low-level things are spelled with underscores, while we

Re: Encapsulating the contents of container types

2011-08-21 Thread Moritz Lenz
On 08/21/2011 06:00 AM, Darren Duncan wrote: > Patrick R. Michaud wrote: >> On Sat, Aug 20, 2011 at 04:41:08PM -0700, Darren Duncan wrote: >>> I believe the general solution to this problem is to make all >>> objects immutable, with the only exception being explicit >>> references, and so mutating

Re: Bug?

2011-07-17 Thread Moritz Lenz
On 07/14/2011 11:47 PM, Parrot Raiser wrote: > When a subroutine is invoked with an empty parameter list, as follows: > > run_stuff(); > > sub run_stuff { > my ($parm) = @_; > say "Parameter is $parm"; > } > > @_[0] contains "Any()". Not "Any()", but Any (which say() prints as "Any()"

Re: Close($file) required in Perl 6, unlike Perl 5

2011-07-17 Thread Moritz Lenz
On 07/13/2011 10:00 PM, Parrot Raiser wrote: > The following program: > > my $skeleton = "bones\n"; > my $new_file = "grave"; > my $handle = open($new_file, :w); > $handle.print($skeleton); > > opens the "grave" file, but leaves it empty. A last line: > > close($handle);# "close()" generat

Re: eval should throw an exception on compile error

2011-05-07 Thread Moritz Lenz
On 05/07/2011 07:45 AM, Michael G Schwern wrote: > I was just playing around with eval, trying to figure out if you can define an > operator overload at runtime (seems you can't, good) and noticed this in the > spec... [1] > > "Returns whatever $code returns, or fails." > > How does one get t

Re: Base conversion: not enough rope

2011-05-07 Thread Moritz Lenz
On 05/06/2011 10:25 PM, Carl Mäsak wrote: > S02:3185-3280 does a nice job of explaining what can and cannot be > done with the radix syntax (i.e. :2<1010> etc). I'm left with two > questions, however: > > * If :2<1010> is the way to way to "interpret" a string as a number in > base two, giving the

Re: lol context and X

2011-03-31 Thread Moritz Lenz
On 03/31/2011 11:16 PM, Aaron Sherman wrote: > # parens on the arglist causes flattening? > $ ../rakudo/perl6 -e 'for 1 .. 2 X 4 .. 5 -> ($a, $b) { say $a.perl, $b.perl > }' > Not enough positional parameters passed; got 0 but expected 2 in sub-signature The error message already tells you that y

Re: spell check in code

2011-03-17 Thread Moritz Lenz
On 03/17/2011 09:55 PM, Darren Duncan wrote: > It occurs to me, both from my own experience in writing code as well as seeing > some production code by others, that spell-checking may be useful in > programming > languages. > > To be specific, often user-defined entities such as variable or rou

[perl #81548] [BUG] Can't do 'handles' on a type in Rakudo

2011-01-06 Thread Moritz Lenz via RT
FWIW 'has $!a handles TypeObject' is now implemented, and works fine for roles. It doesn't work for classes, because they have a .new method. So the standard .new is overridden, trying to call the .new on an attribute, but since there's no instance yet, the access to the attribute fails. That's a

Re: dimensionality in Perl 6

2010-11-19 Thread Moritz Lenz
Am 19.11.2010 05:45, schrieb Jon Lang: On Thu, Nov 18, 2010 at 8:25 PM, Carl Mäsak wrote: Jon (>): Here's my proposal for how to handle dimensionality in Perl 6: [...] Thoughts? The idea has come up before, everyone thinks that Perl 6 and unit handling are a good fit for each other, and we

Re: exponentiation of Duration's

2010-11-17 Thread Moritz Lenz
Am 17.11.2010 17:50, schrieb Jon Lang: If I'm following this correctly, shouldn't we just say that Duration does Num? Num is a class (think floating point number). The role you're looking for is probably either Numeric or Real. If we say that Duration inherits from Rat or FatRat, it automatica

Re: exponentiation of Duration's

2010-11-17 Thread Moritz Lenz
Am 17.11.2010 15:20, schrieb Oha: On 11/17/2010 02:56 PM, Carl Mäsak wrote: Or, by Ockham, since Duration is now deprived of its only task -- making life harder for the programmer -- remove it altogether from the language and just put a number type in its place, representing number of seconds.

Re: exponentiation of Duration's

2010-11-17 Thread Moritz Lenz
Am 17.11.2010 14:02, schrieb Oha: On 11/17/2010 01:46 PM, Moritz Lenz wrote: Just as a data point, in physics duration squared does exist. On the other hand, i can see why an Instant can't be used as a linear value: it does not have a clear origin (or zero value). That's correc

Re: exponentiation of Duration's

2010-11-17 Thread Moritz Lenz
Am 17.11.2010 12:55, schrieb Richard Hainsworth: On 11/17/10 14:03, Moritz Lenz wrote: Am 17.11.2010 10:31, schrieb Kris Shannon: $duration * $duration # WRONG, durations aren't geometric $duration * 2 # ok, a duration twice as long 2 * $duration # same What are your thoughts?

Re: exponentiation of Duration's

2010-11-17 Thread Moritz Lenz
Am 17.11.2010 10:31, schrieb Kris Shannon: A recent rakudo commit [1] is a quick fix for #78896 [2] to allow exponentiation of Duration's. And it did so with a real world use case in mind. I'm uneasy with allowing this and I think the spec probably meant not to but is badly worded [3]: Dur

Re: base-4 literals

2010-11-16 Thread Moritz Lenz
On 11/16/2010 08:46 PM, Darren Duncan wrote: > So, any thoughts on this? A wonderful application for a module. And don't we already have :4<1230> for base 4 literals? With a simple scheme that can be used up to base 36? Cheers, Moritz How thinks that Perl 6 should really become smaller over ti

Re: Packed arrays and assignment vs binding

2010-11-14 Thread Moritz Lenz
On 11/14/2010 03:46 AM, Mason Kramer wrote: > I understand everything you've written except the following: > > On Nov 13, 2010, at 12:09 PM, Jonathan Worthington wrote: > >> Hi, >> ... >> >> my Int @x; >> >> Where we get an array of scalar containers, each of which is only allowed to >> conta

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Moritz Lenz
On 11/13/2010 06:09 PM, Jonathan Worthington wrote: > With packed arrays, however, I'm less clear what they mean. Since the > point of a packed array is compact storage, there's no chance to > actually have containers. Thus does assignment to a slot in a compact > array ever make sense? There's

Re: IO Multiplexing

2010-11-12 Thread Moritz Lenz
Hi, Am 12.11.2010 02:47, schrieb Ben Goldberg: I would like to know, is perl6 going to have something like select (with arguments created by fileno/vec), or something like IO::Select (with which the user doesn't need to know about the implementation, which happens to be done with fileno/vec/sele

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-09 Thread Moritz Lenz
On 11/09/2010 09:26 PM, TSa (Thomas Sandlaß) wrote: > But doesn't > >my $x = (1,2,3); >my $y = map {$^x * $^x}, $x; > > result in $y containing the list (1,4,9)? Not at all. The $ sigil implies a scalar, so what you get is roughly my $y = (1, 2, 3).item * (1, 2, 3).item; so $y ends

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-07 Thread Moritz Lenz
On 11/08/2010 01:51 AM, Darren Duncan wrote: > Mason Kramer wrote: > >> I want to propose one major change to the Bag spec: When a Bag is used as an >> Iterable, you get an Iterator that has each key in proportion to the number >> of times it appears in the Bag. > > > You present some interest

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
Food for thought, a few non-junction solutions: On 10/22/2010 06:16 AM, Damian Conway wrote: > # Find the list of common elements in two lists... > sub intersection (@list1, @list2) { > (any(@list1) & any(@list2).eigenstates; > } sub intersection(@list1, @list2) { uniq gat

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
On 11/01/2010 12:41 PM, Damian Conway wrote: > Moritz wrote: > >>> $value !~~ Junction && $value ~~ $junction >> >> In general this definition makes it impossible to return a list of >> eigenstates from the junction. Just think of junctions containing Code >> objects. > > Well, that's a d

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
On 10/22/2010 06:16 AM, Damian Conway wrote: > That is, a C<$value> is an eigenstate of a C<$junction> if-and-only-if: > > $value !~~ Junction && $value ~~ $junction In general this definition makes it impossible to return a list of eigenstates from the junction. Just think of junctions con

Re: Lazy Strings and Regexes

2010-10-31 Thread Moritz Lenz
On 10/24/2010 07:07 PM, Ben Goldberg wrote: > I know that perl6 has / will have lazy strings, since (in > S32::Containers) the List role defines a cat method, which returns a > Cat object, which "does the Str interface, but generates the string > lazily." > > First, are Cat objects documented anyw

Re: [perl6/specs] 58fe2d: [S12] spec setting and getting values of attribute...

2010-09-30 Thread Moritz Lenz
Darren Duncan wrote: > Carl Mäsak wrote: >> To summarize, I consider myself having lost that debate. I even >> demonstrate the complete unviability of my views (that privacy has any >> kind of footing in Perl 6) with the below one-liner. >> >> rakudo: class X { has $!foo; has $!bar; has $!baz };

Re: [perl6/specs] 58fe2d: [S12] spec setting and getting values of attribute...

2010-09-30 Thread Moritz Lenz
Am 30.09.2010 10:32, schrieb Carl Mäsak: Moritz in the spec (>>), Damian (>): After lengthy IRC discussion, we concluded that it's a good idea to provide some form of introspection that doesn't bother about perceived privacy borders, provided that the implementation makes it feasible. Wow, tha

Re: [perl6/specs] 761178: remove some some duplicate words words

2010-09-08 Thread Moritz Lenz
Patrick R. Michaud wrote: > On Wed, Sep 08, 2010 at 04:02:10PM +0400, Richard Hainsworth wrote: >> I do want the diffs back: its the only way I have to keep at least >> some idea of what is changing any why. > > We know that a lot of people would like to see the diffs available > through the commi

Re: [perl6/specs] 761178: remove some some duplicate words words

2010-09-07 Thread Moritz Lenz
Brandon S Allbery KF8NH wrote: > On 9/7/10 08:17 , nore...@github.com wrote: >> Commit: 7611788411e5aff5f3ae150e2da9929ee546d6d8 >> >> http://github.com/perl6/specs/commit/7611788411e5aff5f3ae150e2da9929ee546d6d8 > > It was nicer when these contained the actual diffs like they used to, > inst

Announce: Pugs repository move

2010-09-04 Thread Moritz Lenz
After years of neglected maintenance, we had to shut down the pugs svn repository. It caused undue strain on the server that hosted it, and made it nearly unusable. Therefore we needed an alternative; since many active Perl 6 developers prefer git to svn anyway, we[1] decided to go with github. S

Re: regex and

2010-08-10 Thread Moritz Lenz
philippe.beauch...@bell.ca wrote: > On the & operator... are you saying that it would operate basically as > expected... > allowing sets of rules and'ed rather than or's with the | ? Yes, with the limitation that both parts separated by & have to match the same length of string, so that for exam

Re: regex and

2010-08-10 Thread Moritz Lenz
Hi, philippe.beauch...@bell.ca wrote: > rule TOP > { > ^ > [ > & * > & > ] > $ > } The & syntax is specced, but it's not yet implemented in Rakudo. But note that is a zero-width assertion, so your e

Re: pattern alternation (was Re: How are ...)

2010-08-06 Thread Moritz Lenz
Darren Duncan wrote: > David Green wrote: >> On 2010-08-05, at 8:27 am, Aaron Sherman wrote: >>> On Thu, Aug 5, 2010 at 7:55 AM, Carl Mäsak wrote: I see this particular thinko a lot, though. Maybe some Perl 6 lint tool or another will detect when you have a regex containing ^ at its st

Re: Perl 6 User Documentation

2010-08-02 Thread Moritz Lenz
not to have too much fragmentation, so if you do, just hand out commit bits liberally, and copy the u4x stuff over to the new repo. masak, is that OK for you?). Cheers, Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

Re: S26 broken link

2010-08-02 Thread Moritz Lenz
remove the link for now, if it's a concern to you. > My apologies if this is the wrong place to ask this question. For infrastructural discussions, the perl6-compiler might be better suited, but we're not picky in here (I hope :-) Cheers, Moritz -- Moritz Lenz http://perlgeek

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-08-02 Thread Moritz Lenz
what)? There's a third possiblity - $!foo being bound to the $!foo attribute of the lexically enclosing class at compile-time. So that re-attaching methods make them still refer to the old attribute. Not sure if it's a good idea, just food for thought. Cheeers, Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

Smart-matching and m//

2010-08-01 Thread Moritz Lenz
o 'ABC and return False. I guess that's not what we want, so there might be a need for a rule preventing the .ACCEPTS call when $_ is used on the RHS. (The previous spec with syntactic forms kinda solved the problem, the $_ topicalization re-introduced it). Cheers, Moritz -- Moritz Le

Re: Smart match isn't on Bool

2010-07-31 Thread Moritz Lenz
Aaron Sherman wrote: > In this code: > > given False { > when True { say "True" } > when False { Say "False" } > default { say "Dairy" } > } > > I don't think it's unreasonable to expect the output to be "False". In this code: sub test() { True }; given 0 { when test() { say "OH NOEZ

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

2010-07-28 Thread Moritz Lenz
Dave Whipp wrote: > Moritz Lenz wrote: >> Dave Whipp wrote: >>>for 0..10 -> $x { ... } >>> is treated as >>>for (0...10).pick(*) -> $x { ... } >> >> Sorry, I have to ask. Are you serious? Really? > > Ah, to reply, or not to repl

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

2010-07-28 Thread Moritz Lenz
yary wrote: > though would a parallel batch of an anonymous block be more naturally written > as > all(0...10) -> $x { ... } # Spawn 11 threads No, hyper for 0..10 -> $x { ... } # spawn as many threads # as the compiler thinks are reasonable I think one (already specced) syntax for the

  1   2   3   4   >