[perl6/specs] e5b176: Fix typo

2019-02-09 Thread Carl Mäsak
Branch: refs/heads/master Home: https://github.com/perl6/specs Commit: e5b176cae67ba74035dd2be3518dca863f5e780e https://github.com/perl6/specs/commit/e5b176cae67ba74035dd2be3518dca863f5e780e Author: Carl Masak Date: 2019-02-09 (Sat, 09 Feb 2019) Changed paths: M S03-ope

Re: Grammars and biological data formats

2014-08-14 Thread Carl Mäsak
I was going to pipe in and say that I wouldn't wait around for Cat, I'd write something that reads chunks and then parses that. It'll be a bit more code, but it'll work today. But I see you reached that conclusion already. :) Lately I've found myself writing more and more grammars that parse just

Re: some thing odd in macro

2014-01-04 Thread Carl Mäsak
I understand what's happening. See . I'm not convinced it's a bug. Explaining again here just in case I was too vague in the bug report. 1. Variables lead double lives. There's the "ghost world" static version of a variable, that existed since th

Re: Unexpected expansion of string with xx

2013-12-20 Thread Carl Mäsak
My mnemonic is "x (one thing) is for scalars, xx (many things) is for lists". Using that, there's seldom any confusion. The reason Perl 6 makes the distinction is that (unlike Perl 5) it *has to*. Perl 5 does context-based dispatch, whereas Perl 6 does argument-based dispatch. We greatly prefer th

Re: Class attribute introspection

2013-10-28 Thread Carl Mäsak
The MOP is an API to the object-oriented system. With it, you can query classes and their attributes and methods about their properties. It can also be used to create whole new classes (or other types) programatically. Languages that have a MOP have a great advantage because, even though the objec

Re: ADT and GADT

2013-03-21 Thread Carl Mäsak
Philippe (>): > I like solution 2, but am going to have to delve into the Perl 6 > Documentation to > understand its esoteric syntax: S12 will be a big help here. You may have found it already. I include a few quick pointers below, which also may help. > -

Re: ADT and GADT

2013-03-21 Thread Carl Mäsak
Hi Philippe, Philippe (>): > will Abstract Data Types and Generalized Abstract Data Types be available in > Perl6 anytime soon? Algebraic Data Types -- this is a topic that has come up before on #perl6 on IRC. Often enough I've been the one mentioning it. Let's just stop briefly to define a few

Re: state statements versus state expressions

2012-09-11 Thread Carl Mäsak
Nicholas (>): > Where in the synopses (or other documents) does it explain why these two > are different? > > $ ./perl6 -e 'sub foo {state @a = (3, 4); say ++@a[0];}; foo; foo;' > 4 > 5 > $ ./perl6 -e 'sub foo {(state @a) = (3, 4); say ++@a[0];}; foo; foo;' > 4 > 4 S03:4912. "Each declarator can t

Re: The .trans method and Least Surprise

2012-07-20 Thread Carl Mäsak
yary (>): > Speaking as a non-p6-coder "proposal sounds good to me" though the > spec raises some other questions. > >>The tr/// quote-like operator now also has a method form called >> trans(). Its argument is a list of pairs. You can use anything >> that produces a pair list: >> >> $str.trans

The .trans method and Least Surprise

2012-07-13 Thread Carl Mäsak
Something's bothering me about the .trans method. This email lists a proposal to split its semantics into two methods. I'm not yet convinced myself about this proposal. It's quite late in the game to make spec changes of established methods, and the change will break some downstream application co

Re: N-dimensional arrays and compiler support

2012-03-23 Thread Carl Mäsak
Daniel (>>), Stefan (>): >> 1. The semicolon operator would allow Perl 6 to support N-dimensional >> arrays... How would one iterate over that type of array? >> >> my num @matrix[ 10 ; 10 ; 10 ]; >> >> I ask because a natural extension is to add arithmetic operators and >> you have the beginnings o

Re: How to make a new operator.

2012-03-22 Thread Carl Mäsak
Daniel (>): > Related questions:  What types of sequences can Perl 6 recognize? As covered by Jonathan Lang earlier in this thread (though it was perhaps easy to miss), Perl 6 auto-detects arithmetic sequences (same additive difference each time) and geometric sequences (same multiplicative factor

Re: How to make a new operator.

2012-03-22 Thread Carl Mäsak
Jonathan Lang (>>), Daniel (>): >> So: >> >>    1, 3 ... 13 # same as 1,3,5,7,9,11,13 >>    1 ... 10 # same as 1,2,3,4,5,6,7,8,9,10 >>    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

Re: How to make a new operator.

2012-03-21 Thread Carl Mäsak
Damian (>>), Daniel (>): >> Perl 6 already has:  0,$c...* >> >> e.g. 0,3...* > 0, 3, 6, 9, 12 > > Interesting... but it doesn't seem to work in Rakudo Star (2012.02): > >> @(2,5..10) > 2 5 6 7 8 9 10 > > :-( Keep in mind that infix:<..> will listify to the kind of one-step-at-a-time range

Re: How to make a new operator.

2012-03-21 Thread Carl Mäsak
Daniel (>>), Damian (>): >> : is the same as 0..Inf > > Perl 6 already has: ^Inf > 0,1,2,3,4,5, Hah, Damian made an off-by-one error! Oh wait... // Carl

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

2012-03-11 Thread Carl Mäsak
Carl (>>), Damian (>): >>    class A { >>        method foo($x) { >>            PRE { $x < 10 } >>            # ... >>        } >>    } >> >>    class B is A { >>        method foo($a, $b, $c) { >>            PRE { [>] $a, $b, $c } >>            # ... >>        } >>    } >> >> When C is called, are

DBC-ish PRE and POST phasers, spec clarifications

2012-03-10 Thread Carl Mäsak
We've made great leaps in phaser technology from S04 in Rakudo in the past week. We used to have C, C, C, and C. Now we also have C, C, C, C, and (for C loops) C, C, and C. In his latest blog post [1] jnthn++ says he'll move on to C and C but that he'll "need some spec clarifications first". This

Re: Setting private attributes during object build

2012-02-01 Thread Carl Mäsak
Jonathan Lang (>>), yary (>): >> Why must we use 'submethod BUILD' instead of 'method BUILD'? >> Is it some sort of chicken-and-egg dilemma? > > from S12: > "Submethods are for declaring infrastructural methods that shouldn't > be inherited by subclasses, such as initializers ... only the methods >

Re: Setting private attributes during object build

2012-02-01 Thread Carl Mäsak
Jonathan Lang (>): > Why must we use 'submethod BUILD' instead of 'method BUILD'?  Is it some > sort of chicken-and-egg dilemma? Philosophically, BUILD submethods are submethods because they do infrastructural stuff that is very tied to the internals of the class. Submethods are "internal" methods

Re: [perl6/specs] ff11f1: define %%; clarify that % is not quantmod

2011-09-29 Thread Carl Mäsak
Martin (>): > 5. And pretty please could we have infix:<%>(Str,Capture) as an alias for > sprintf? (Not that I'm normally a Python fan, but that feature has a > particularly wholesome appeal about it.) There's no problem adding this to either your user code or to CORE today. All the prerequisites

Re: Encapsulating the contents of container types

2011-09-09 Thread Carl Mäsak
Moritz (>): > I think we should consider the implications of immutability-all-the-way-down > before we jump to any conclusions. In particular list cases where typical > Perl 5 code fails when ported to Perl 6. Indeed. Clearly I'm missing at least one piece of the puzzle here. Back to the drawing-

Re: Encapsulating the contents of container types

2011-09-09 Thread Carl Mäsak
Thanks to everyone for your replies. I've been wanting to write a summary + further thoughts for a while, but have been a bit time-constrained. The central tension in this issue is nicely captured by what Damian wrote contrasted with what Stefan wrote: Damian (>): > Doing nothing should result in

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

2011-08-24 Thread 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 identifier zapeth_clunk itself

Encapsulating the contents of container types

2011-08-18 Thread Carl Mäsak
I was working on the Little Animal Farm game yesterday, and wanted to make it totally safe against tampering from the outside. (See .) I ended up implementing a custom accessor method and a sub to deep-clone hashes, just to make sure

Re: STDOUT = WWW

2011-07-08 Thread Carl Mäsak
Rakudo (the compiler) will be packaged in various distributions. The one distribution we have so far is Rakudo Star. There's sometimes been talk on conferences and on IRC about putting together a Net/Web-targeted distribution of Rakudo, one with all the appropriate modules pre-packaged. The idea i

Re: eval and try should be separate

2011-06-30 Thread Carl Mäsak
+1 It's been up for discussion before in #perl6 (with a quick search, I find and ), but so far no-one has acted on the idea. Kudos for picking it up. // Carl On Wed, Jun 29, 2011 at 10:44

Base conversion: not enough rope

2011-05-06 Thread Carl Mäsak
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 number 10 -- what's the way to go in the other direct

Help us recover a nice nopaste about setting signatures

2011-03-31 Thread Carl Mäsak
On #perl6, we're trying to figure out who it was that made a fairly large investigation into the naming of parameters of the functions and methods in S28/S32 a couple of years ago. We seem to recall that someone made a nopaste on the channel, but that it subsequently timed out. So... (a) Does anyo

Re: sql idea

2010-11-27 Thread Carl Mäsak
Darren (>): > (I apologize if > this isn't correct Perl 6, and I'm not sure how to specify a hash slice that > returns pairs rather than just values): Ask, and it shall be given you (by S02): %hash = (:a, :b); %hash; # returns 'A', 'B', Nil %hash :p;# returns a => 'A', b =>

Re: exponentiation of Duration's

2010-11-19 Thread Carl Mäsak
Darren (>>>), Carl (>>), Darren (>): >>> Specific units, even "seconds" should not be mentioned at all in the >>> definition of "Instant" or "Duration"; instead, any particular units or >>> calendars or whatever would just be a property of the composing class. >> >> No disrespect, but it was the ab

Re: dimensionality in Perl 6

2010-11-18 Thread Carl Mäsak
Jon (>>>), Carl (>>), 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 basically waiting >> for someone to write su

Re: exponentiation of Duration's

2010-11-18 Thread Carl Mäsak
Darren (>): > Specific units, even "seconds" should not be mentioned at all in the > definition of "Instant" or "Duration"; instead, any particular units or > calendars or whatever would just be a property of the composing class. No disrespect, but it was the abandonment of abstracty stuff like th

Re: dimensionality in Perl 6

2010-11-18 Thread Carl Mäsak
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 basically waiting for someone to write such a module. Incidentally, your phrase "a c

Re: exponentiation of Duration's

2010-11-17 Thread Carl Mäsak
Mark (>): > I'm not convinced that the type system shouldn't be helping with > dimensional analysis, but at least it shouldn't hurt.  By all means, > let the programmer raise a Duration to a power - but the type of the > result should not also be Duration.  In the absence of automatic > dimension t

Re: base-4 literals

2010-11-16 Thread Carl Mäsak
Larry (>>), Dan (>): >> The lack of base 4 numbers in Real Life seems to me to justify the >> convention.  Do you have a use case? > > Real Life on Earth is base-4 coded :-p Heh. :) > hey, do we have tr/// equivalent already? In S05? Yes, since the get-go. In Rakudo? You do know that it's freel

Re: base-4 literals

2010-11-16 Thread Carl Mäsak
Darren (>): > While I haven't seen any prior art on this, I'm thinking that it would be > nice for a sense of completeness or parity to have an 0a syntax specific to > base-4 that complements the 4 that we have now for bases 2,8,16,10. You're joking, right? // Carl

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

2010-11-13 Thread Carl Mäsak
Jonathan Lang (>): > As well, my first impression upon seeing [! ... !] was to think > "you're negating everything inside?"  That said, I could get behind > doubled brackets: > >    [[1, 2, 3]] # same as Bag(1, 2, 3) >    {{1, 2, 3}} # same as Set(1, 2, 3) > > AFAIK, this would cause no conflicts w

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Carl Mäsak
Jonathan (>): > Per S09, we can write in Perl 6: > > my int @x; > > And the idea is that we get a packed array - conceptually, a single lump of > memory allocated and and storing a bunch of ints contiguously. Contrast this > to: > > my Int @x; > > Where we get an array of scalar containers, each of

Re: Methodicals: A better way to monkey type

2010-10-16 Thread Carl Mäsak
Stefan (>): > A methodical is an operator which syntactically behaves as a method but is > subject to scoping rules.  Methodicals are defined using the ordinary method > keyword, qualified with my or our.  (TODO: This seems the most natural syntax > to me, but it conflicts with existing usage.  Whi

Re: threads?

2010-10-16 Thread Carl Mäsak
Damian (>>), Matt (>): >> Perhaps we need to think more Perlishly and reframe the entire question. >> Not: "What threading model do we need?", but: "What kinds of non-sequential >> programming tasks do we want to make easy...and how would we like to be >> able to specify those tasks?" > > I watched

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

2010-10-12 Thread Carl Mäsak
Carl (>): > == About C<.perl> > > The choice here was between letting C<.perl> display only public > attributes, or keeping it the way it is, displaying public as well as > private attributes. The former is potentially a great help for > debugging; the latter respects the normal-OO level of privacy

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

2010-10-12 Thread Carl Mäsak
Logbot (>): > [S12] spec setting and getting values of attributes by means of introspection > > 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 f

Re: threads?

2010-10-12 Thread Carl Mäsak
Ben (>): > If perl6 can statically (at compile time) analyse subroutines and > methods and determine if they're reentrant, then it could > automatically use the lightest weight threads when it knows that the > entry sub won't have side effects or alter global data. I'm often at the receiving end o

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

2010-09-30 Thread 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, that's the first time I've ever been

Re: Buf.pm: FIFO and grammar

2010-08-12 Thread Carl Mäsak
Carl (>>), Aaron (>): >> * Grammars define a hierarchical structure that seems to be perfect >> for encoding the packing of larger pieces of data, for example when >> serializing an object structure. Could one use grammars, or something >> very much like it, as a "modern" &pack template? > > A whil

Re: Buf.pm: FIFO and grammar

2010-08-12 Thread Carl Mäsak
Oha (>): > after speaking with masak, i come up with some ideas about Buf > i would like to share with you, maybe you can find them usefull > > http://register.oha.it/buf.pod Just thought I'd weigh in here a bit. Oha's proposal consists of two parts, each of which is interesting in its own right:

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

2010-08-05 Thread Carl Mäsak
Darren (), Carl (>>>), Darren (>>), Patrick (>): >> >>Read what I said again.  I was proposing that the namespace comprised of >> >>names matching a pattern like this: >> >> >> >> /^ <[A..Z]>+ | <[a..z]>+ $/ >> > >> >/^ [<[A..Z]>+ | <[a..z]>+] $/ >> >> Are the square brackets necessary when the

Re: How are unrecognized options to built-in pod block types treated?

2010-08-05 Thread Carl Mäsak
Darren (>): > Read what I said again.  I was proposing that the namespace comprised of > names matching a pattern like this: > >  /^ <[A..Z]>+ | <[a..z]>+ $/ /^ [<[A..Z]>+ | <[a..z]>+] $/ // Carl

How are unrecognized options to built-in pod block types treated?

2010-08-04 Thread Carl Mäsak
Straight to an example: =for head1 :image Steaming hot C loops As far as parsing goes, that's valid Perl 6 Pod. You're perhaps more used to seeing it as '=head1', but S26 asserts the equivalence of these two forms. The reason I'm using the paragraph block form here is that the abbrevi

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

2010-08-03 Thread Carl Mäsak
jnthn++ points out in meatspace that the invocant parameter has a constraint (by spec but not in Rakudo), which will carry over to the new class. Which means that only objects of child classes will signature-bind anyway. // Carl

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

2010-08-02 Thread Carl Mäsak
Carl (>>), Moritz (>): >> * If it isn't allowed, which of the two steps is disallowed? >> *Detaching* a method containing references to private accessor slots >> (thereby extending the syntactic restriction of "no private accessors >> outside of the class block"), or *attaching* an anonymous method

Re: Natural Language and Perl 6

2010-08-02 Thread Carl Mäsak
Jason (>): > No specific tool is best suited for natural language processing. There was > apparently a time in which everyone thought that a formal grammar could > clearly define any natural language, but I don't think anyone succeeded at > creating a complete formal grammar for any language other

Re: Smart match isn't on Bool

2010-07-31 Thread Carl Mäsak
Darren (>): > All this being said, I really do *not* like the idea of saying Bool is just > a subset of Int as it seems to be.  Bool should be disjoint from every other > common type like Int/Str/etc instead. I don't know whence you got the impression that Bool is a subtype. Bool is an enumeration

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

2010-07-31 Thread Carl Mäsak
Carl (>>), sorear (>): >> * It has been decided that attribute slots of the type $!foo are only >> allowed *syntactically* within the class block that declares them. >> (The exception to this, I guess, is the 'trusts' directive.) But this >> means that something like this anonymous method >> >>    

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

2010-07-31 Thread Carl Mäsak
Here's a case where a bug report stumped me and made me feel I'm missing something: I'll give a somewhat summarized version of the above page, which gradually turns into a set of questions and not enough answers: * It has been decided that a

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

2010-07-16 Thread Carl Mäsak
Aaron (>): > [...] > > Many useful results from this suggested change: > > "C" .. "A" = (Rakudo: <>) Regardless of the other traits of your proposed semantics, I think permitting reversed ranges such as the one above would be a mistake. Rakudo gives the empty list for ranges whose lhs exceeds (f

Re: r31627 -[S32/Temporal] Changed to use a different way of specifying time zones, which is hopefully saner than my last proposal.

2010-07-12 Thread Carl Mäsak
Scott (>): > Perhaps it's just me, but a boolean value to specify the direction of > conversion seems wrong-ish. It's not just you. :) // Carl

Re: [perl #76442] [BUG} say ?1..2 # prints ones indefinitively

2010-07-12 Thread Carl Mäsak
cognominal stef (>): > Currently the Range creator method does not coerce its parameters. > I think Range should be a role so as to impose some constraint. > I think  Bool..2  should fail. For what it's worth, I disagree. I think Bool..2 should be equivalent to 0..2 (since Bool is a type object, w

Announce: Rakudo Perl 6 development release #30 ("Kiev")

2010-06-17 Thread Carl Mäsak
Moritz Lenz, Jonathan Worthington, Solomon Foster, Patrick Abi Salloum, Carl Mäsak, Martin Berends, Will "Coke" Coleda, Vyacheslav Matjukhin, snarkyboojum, sorear, smashz, Jimmy Zhuo, Jonathan "Duke" Leto, Maxim Yemelyanov, Stéphane Payrard, Gerd Pokorra, cognominal, Bruce Keele

Re: r31082 -[S32/Str] rethinking of tab characters

2010-06-03 Thread Carl Mäsak
sorear (>): > I request that: > > 1. Blank lines should not be interpreted as having 0 indentation.  Instead, >   lines consisting entirely of horizontal whitespace should be ignored in >   indent(*) considerations, and can be unindented by any amount.  Unindenting >   a truly blank line has no eff

Re: Ideas for a "Object-Belongs-to-Thread" threading model

2010-05-14 Thread Carl Mäsak
Ruud (>): > (Do Perl_6 hyper-operators need pthreads?) No. The ability to thread over list elements in a hyper operator is more of a possibility than a requirement, if I understand things correctly. // Carl

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

2010-04-10 Thread Carl Mäsak
Mark (>>), John (>): >> I'd much rather see a single consistent style throughout > > Yeah, that's was my main point/question.  I wanted to know if it was > it some intentional convention (e.g., "all methods that change the > object state use hyphens, and all others use underscores") or if it > was

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

2010-04-10 Thread Carl Mäsak
John (>): > Forgive me if this is a question the reveals how poorly I've been > following Perl 6 development, but what's the deal with some methods > using hyphen-separated words (e.g., day-of-week) while others use > "normal" Perl method names (e.g., set_second)? I'd just like to point out that t

Re: A new era for Temporal

2010-04-08 Thread Carl Mäsak
Mark (>): > This looks much better.  Thank you.  When can we expect to see the new > version implemented in Rakudo?  Need any help on that front? A preliminary version is already checked in, and works. It's not full-featured yet, but work is underway. Commits are appreciated, as always.

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

2010-04-08 Thread Carl Mäsak
Mark (>): > I do think that an "unchecked" version of the setters is called for, one > that silently converts out-of-range values rather than throwing an > exception.  That's not an easy thing to implement outside of the library > without duplicating all the range-checking code. Hm, true (it's not

Re: Temporal.pod truncate

2010-04-08 Thread Carl Mäsak
John (>): > Small feature request: > >  $dt.truncate( :to ); > is somewhat ambiguous, since some people start their week on Sunday, while > the module truncates to Monday. > > Would you consider a less ambiguous week truncation? > >  $dt.truncate( :to ); >  $dt.truncate( :to ); I had the same thou

A new era for Temporal

2010-04-08 Thread Carl Mäsak
We (mberends and masak) just pushed a commit to S32::Temporal which completely replaces what we had before. The changes are rooted in hours of discussion on #perl6, and we feel rather more confident with what we have now than with what we had before. That said, discussion is very welcome. I do wa

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

2010-03-26 Thread Carl Mäsak
Carl (>), Darren (>>): >> I didn't get it to trust me, though: >> >> pugs: class A { has $!foo }; class B { trusts A; method bar(A >> $a) { say $a!foo } }; B.new.bar(A.new(:bar(42))) >> pugs: OUTPUT«␤» >> >> Either it bitrotted or I'm using it wrong. > > You're using it wrong.  You need to put 't

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

2010-03-25 Thread Carl Mäsak
Carl (>>), Darren (>): >> [...] and the >> 'trusts' keyword hasn't been realized in any Perl 6 implementation so >> far. > > I seem to recall that Pugs did support 'trusts' a few years ago, and that I > used it.  But I could be wrong. -- Darren Duncan I stand corrected. A quick search through the

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

2010-03-25 Thread Carl Mäsak
Carl (), Moritz (>>>), 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

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

2010-03-23 Thread Carl Mäsak
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 leaky at the moment, not a fal

You never have privacy from your children in Perl 6

2010-03-23 Thread Carl Mäsak
Wanting to run the recent class-attribute discussion[0] through the neural net of my friend, I described to him in detail how the current system with attributes works. He's kind of a Java guy, and though he liked the twigil distinction between private and public, he asked how to produce a 'protecte

Re: Functional-style pattern matching

2010-03-10 Thread Carl Mäsak
Mark (>): > Does the unpacking participate in dispatch?  If a Hash comes in as $t > with no 'left' key, will it fail to match? Yes. $ perl6 -e 'sub foo(%h($left)) { say $left }; foo({ left => "OH HAI" })' OH HAI $ perl6 -e 'sub foo(%h($left)) {}; foo({ no => "left key" })' Not enough positional

Re: r29976 - docs/Perl6/Spec

2010-03-08 Thread Carl Mäsak
commitbot (), Brandon (>>>), Mark (>>), Carl (>): +    has $!age is ref;   # BUILD will automatically use ref binding, not copy >>> >>> Perl6 isn't done until it has reinvented Algol 68? >> >> [...] >> >> I'm not sure what exactly the repercussions of doing attribute >> initializatio

Re: r29976 - docs/Perl6/Spec

2010-03-08 Thread Carl Mäsak
commitbot (>), Brandon (>>): >> +    has $!age is ref;   # BUILD will automatically use ref binding, not copy > > Perl6 isn't done until it has reinvented Algol 68? Unaware of what Algol 68 represents in programming language history, I perused Wikipedia's article on Algol 68:

Re: Gripes about Pod6 (S26)

2010-02-12 Thread Carl Mäsak
Damian (>), Carl (>>): >> Partly that is because documentation isn't at the forefront of things >> that need to be implemented for Perl 6 to be useful, so it's kind of >> lagging behind the rest. >> >> Partly it's because Damian is the "owner" of that synopsis, and he >> practices a kind of "drive-

Re: Gripes about Pod6 (S26)

2010-02-10 Thread Carl Mäsak
Austin (>): > I've been doing a bunch of NQP and PIR coding, where Pmichaud++ has been > trying to support some kind of POD syntax. With the release of the S26 > draft, he has tightened the parsing to follow more of the rules laid out in > the spec, and after a few months, I've noticed that the tre

Re: One-pass parsing and forward type references

2010-02-01 Thread Carl Mäsak
Larry (>): > [Long exposition on the philosophy of predeclaration] > > Hope this helps, or I just wasted a lot of time.  :-) It did help. Thanks. A comment on one part, though: > But I also think that type recursion is likelier to indicate a design > error than function recursion [...] I do too

Re: One-pass parsing and forward type references

2010-02-01 Thread Carl Mäsak
Patrick (>), Carl (>>): >> I found two ways. Either one uses C (the language construct >> formerly known as C): >> >>   class B {} >>   class A { sub foo { B::bar } } >>   augment class B { sub bar { A::foo } } >> >> ...or one may use the C<::> notation to index a type using a string value: >> >>  

Re: One-pass parsing and forward type references

2010-02-01 Thread Carl Mäsak
Moritz (>), Carl (>>): >> 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

One-pass parsing and forward type references

2010-01-31 Thread Carl Mäsak
There's one thing that bugs me ever so slightly. I'll just air it and happily accept whatever feedback it produces. This email is somewhat of a third-strike thing: looking back, I've been muttering over this itch both on IRC and on Twitter during the past year. sometimes one-pass parsing annoys

Fwd: Counting characters

2010-01-27 Thread Carl Mäsak
Hm, lost p6l along the way. Forwarding. -- Forwarded message -- From: Carl Mäsak Date: Wed, Jan 27, 2010 at 2:31 PM Subject: Re: Counting characters To: Moritz Lenz Moritz (>), Carl (>>): >> How is "character counting" done in Perl 6? >> >>

Re: Counting characters

2010-01-27 Thread Carl Mäsak
Mark (>), Carl (>>): >> S05 describes tr/// in terms of the .trans function, a handsome but >> very different beast. Specifically, it doesn't seem to have a "scalar >> context", with which one could count things. > > What does trans return in numeric (+) context? As spec'd, it returns the numifica

Counting characters

2010-01-27 Thread Carl Mäsak
How is "character counting" done in Perl 6? In Perl 5, it is `scalar tr/CG//` if I want to count the number of Cs plus the number of Gs in a string. S05 describes tr/// in terms of the .trans function, a handsome but very different beast. Specifically, it doesn't seem to have a "scalar context",

Are there assignment forms of the indexing postcircumfix operators?

2010-01-27 Thread Carl Mäsak
I was going to submit this as a Rakudo bug report, but I'm not sure it's (a natural consequence of) spec, so I'll ask here on p6l instead. I already know I can do all of the following: $a[42]; $a.postcircumfix:<[ ]>(42); $a = $a.postcircumfix:<[ ]>(42); $a.=postcircumfix:<[ ]>(42); But can I

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

2010-01-20 Thread Carl Mäsak
Moritz (>), commitbot channeling ash (>): >> +=item new >> + >> + our List multi method new(*...@args) >> + >> +Constructs a C containing the arguments passed to the C method. > > Since the argument list is already a List (or very nearly), I don't see > much sense in this constructor. I respectful

Is it 'anon role' but not 'anon enum'? (Re: r29250 - in docs/Perl6/Spec: . S32-setting-library)

2010-01-08 Thread Carl Mäsak
pugscommitbot, channeling Larry (>): > [...] > +    $x = "Today" but Tue;       # $x.Day is read-only > +    $x = "Today" but Day;       # $x.Day is read-write > + > +Mixing in a specific enum object implies only the readonly accessor. > + >     $x = "Today" but Tue; > > -really means something mor

Re: Debugging Grammars

2009-12-29 Thread Carl Mäsak
Carl (>), Ovid (>>): >> As a follow-up to this, I have my code posted at >> http://blogs.perl.org/users/ovid/2009/12/configini-in-perl-6.html >> >> While my admittedly clumsy grammar matches, transforming it into an AST has >> failed miserably. >> >> Aside from the advent calendar or the online d

Re: Debugging Grammars

2009-12-29 Thread Carl Mäsak
Ovid (>): > As a follow-up to this, I have my code posted at > http://blogs.perl.org/users/ovid/2009/12/configini-in-perl-6.html > > While my admittedly clumsy grammar matches, transforming it into an AST has > failed miserably. > > Aside from the advent calendar or the online docs at > http://p

Re: Interactive Perl 6 shell

2009-12-29 Thread Carl Mäsak
Jason (>), Juan (>>): >> Does Perl6/Rakudo have an interactive perl shell like ruby does with irb? >> >> http://en.wikipedia.org/wiki/Interactive_Ruby_Shell >> >> Would be great for trying out the new syntax quickly. > > My phone accidentally sent an empty reply to this. What I was supposed to > re

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

2009-12-22 Thread Carl Mäsak
Darren (>): > 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 there just 2 canonical

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

2009-12-17 Thread Carl Mäsak
Larry , through S-ro commitbot: > +Since a C, unlike a C, is mutable, C<.pick> works > +directly on the C, modifying it in place.  You must copy > +the C first if you don't want it modified in place. This violates Least Surprise for me. An Array is also mutable, but it doesn't get modified in plac

Rakudo Perl 6 development release #23 ("Lisbon")

2009-11-19 Thread Carl Mäsak
Announce: Rakudo Perl 6 development release #23 ("Lisbon") On behalf of the Rakudo development team, I'm pleased to announce the November 2009 development release of Rakudo Perl #23 "Lisbon". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarb

Re: error installing Perl6

2009-11-12 Thread Carl Mäsak
Matthew (>), Richard (>>): > On Thu, Nov 12, 2009 at 2:30 PM, Richard Hainsworth > wrote: > >> Can't exec "svn": No such file or directory at build/gen_parrot.pl line 47. > > You need to install Subversion in order to allow the build script to > obtain Parrot. That said, perhaps one could fail ea

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

2009-11-03 Thread Carl Mäsak
Moritz (>), Solomon (>>), Moritz (>>>): >> > 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

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

2009-11-02 Thread Carl Mäsak
Solomon (>), Moritz (>>): >> 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 sign

Re: r28768 - docs/Perl6/Spec

2009-10-11 Thread Carl Mäsak
commitbot, channeling Carlin (>): >  =item die > > + multi die (@LIST) > + > +Prints each element to $*ERR (STDERR) and throws an exception. Well, no. If that were true, &die calls within (the dynamic scope of) a try block would also print things, which they don't. It's the thing that catches the

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

2009-09-19 Thread Carl Mäsak
David (>), Moritz (>>), Aaron (>>>): >>> 2,3 constructs a list. 2..3 also constructs a list, unless it's in a >>> given/when condition in which case it's just a range. >> >> No. 2..3 is always a range. It's just list context that turns it into a >> list. >> >>> That seems confusing. > > It sounds l

Web.pm (Re: Cobra & Ioke Programming Languages)

2009-09-18 Thread Carl Mäsak
Juan (>): > I'll take a look at web.pm and see  I can get involved. You're very welcome to help. We definitely need more contributors, and I'm currently thinking about ways to delegate work. Grab me on #perl6, or by email. There's also sporadic discussion of Web.pm going on at #november-wiki. >

Re: How can i contribute for perl 6 ?

2009-09-17 Thread Carl Mäsak
Timothy (>): >        I'd actually be in favour of Masak's post being copied to the site > (with attribution) and expanded, rather than just linked, if Carl is happy > with the idea. [...] I'd be honoured. In general, consider anything I write on use.perl to be cc-attr-licenced.

  1   2   >