Re: Why pass by reference?

2009-06-17 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: HaloO, Matthew Walton wrote: If a user of your API contrives to make it change while you're running, that's their own foot they've just shot, because they can look at the signature and know the semantics of the parameter passing being used a

Re: Why pass by reference?

2009-06-14 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Actually, it only looks complicated while you think only on the callee side. No, in general it requires introducing a read-only proxy in front of the container. This may be optimized away when it can be tracked at compile-time, but that's certa

Why pass by reference?

2009-06-14 Thread John M. Dlugosz
In Perl 6, the default parameter passing is to make a read-only alias for the caller's lvalue. This means that the function may not change the caller's variable, but must track changes to it made by other means. What is the point? It is a contrivance to illustrate how the variable can be chan

Re: Multi-d array transforms (was Re: Array rotate)

2009-06-13 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Sat, Jun 13, 2009 at 02:49:10PM -0500, John M. Dlugosz wrote: Wow. The overarching logic for list assignment would have to compare the containers and the arguments in the capture before doing the list assignment to each container, in order

Re: Multi-d array transforms (was Re: Array rotate)

2009-06-13 Thread John M. Dlugosz
Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: In addition, the current @a.shift is useful because it returns the element that was removed from the array, so you can do something with it: The change to the library synopses was checked in before you posted that, if I recall the

Re: Array Dimensionality (Was: Re: Multi-d array transforms (was Re: Array rotate))

2009-06-13 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: So, how do I deal with a multidim array? Well, TIMTOWTDI... my @a = 1,[2,[3,4]]; say @a[1][1][1]; say @a[1;1;1]; # I'm not sure this is correct I think that it should be. That is, multi-dim subscript is always the same as chained subscrip

Re: Array Dimensionality (Was: Re: Multi-d array transforms (was Re: Array rotate))

2009-06-13 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: Alternately, we leave @@ (or @%) meaning ¢ and instead let some other syntax take over the "pay attention to the capture's structure" semantics from @@. Maybe it's another use for the zen slice: "pay attention to the capture's structure" is a c

Re: Multi-d array transforms (was Re: Array rotate)

2009-06-13 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: We also need to consider the "dimension" of referentiality. I can see three levels here. Given @a.mung the .mung could return A) a modified @a (treat @a as mutable) B) a new array (treat @a as immutable) C) a remapped array whose e

Re: Array rotate

2009-06-13 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: On Fri, Jun 12, 2009 at 10:02 AM, yary wrote: I am tickled pink to see an Array "rotate" method in the settings spec S032, as I was thinking of writing up a little discussion on the very topic. Has there been discussion on using array rotate o

Re: S03- Unicode feed operator, no prefix:<=>

2009-06-10 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: I'm about halfway through reading Synopsis 3 and have a couple comments/questions. Is there, should there be unicode synonyms for the feed operators? eg <== is also ⇐ ⇐ LEFTWARDS DOUBLE ARROW ==> is also ⇒ ⇒ RIGHTWARDS DOUBLE ARROW I don't see a

Re: S03- Unicode feed operator, no prefix:<=>

2009-06-10 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: I'm about halfway through reading Synopsis 3 and have a couple comments/questions. Is there, should there be unicode synonyms for the feed operators? eg <== is also ⇐ ⇐ LEFTWARDS DOUBLE ARROW ==> is also ⇒ ⇒ RIGHTWARDS DOUBLE ARROW I don't see a

LValues, types, mutability

2009-06-08 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: I like your idea to call the class that handles container access LValue. I have proposed the name AssignmentProxy elsewhere. Thanks. I'll quote that so it gets more exposure and hopefully will build a consensus or other feedback. :) Bu

Re: Grammar Q: does result polymorphism make sense?

2009-06-07 Thread John M. Dlugosz
Austin Hastings Austin_Hastings-at-Yahoo.com |Perl 6| wrote: Anyway, I'm not proposing anything so much as wondering out loud. Surely there's a bunch of smarter bears than me who have given this some thought. Any wisdom? =Austin The short answer is that the Perl 6 pattern matching capabi

Re: Module naming conventions

2009-06-02 Thread John M. Dlugosz
Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: John M. Dlugosz wrote: So CPAN6 is basically only going to be for Parrot? What are you talking about? Did you even read my email? I said that a module might be implemented in multiple languages (see Digest::SHA VS Digest::SHA

Re: Anonymous multidimensional array

2009-06-02 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Tue, Jun 02, 2009 at 08:21:29AM -0700, yary wrote: : I do see a problem if there's more than one unspecified dimension. : Though I suppose an array of shape(*;*) as an lvalue might be a : constraint allowing assignment only of another 2D array? I d

Re: Module naming conventions

2009-06-02 Thread John M. Dlugosz
Sounds like you are on the right track. Separation of concerns, standardization of some of these solutions without regard to platform or Perl implementation, and learning from prior art. Richard Hainsworth richard-at-rusrating.ru |Perl 6| wrote: Daniel Carrera wrote: Mark Overmeer wrote: C

Re: Module naming conventions

2009-06-02 Thread John M. Dlugosz
Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: John M. Dlugosz wrote: The front-end should figure out which binary is proper for your platform. I don't like that idea in the slightest. (1) It is not Perl's job to know if you have a C compiler, C libraries and tool

Re: Anonymous multidimensional array

2009-06-01 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Mon, Jun 01, 2009 at 08:23:41PM -0700, yary wrote: : How does one create an anonymous multidimensional array in p6? Not an : array of arrays or a capture of captures... But I would expect a shaped array to be able to coerce either of those into its

Re: Module naming conventions

2009-06-01 Thread John M. Dlugosz
Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: Naming issues are likely to become worse in Perl 6 when we also have modules that use Parrot. You might have three implementations of Digest::SHA, one in Perl 6, one that uses Parrot, and one that uses C. Worse, you might even find

Re: The game of life

2009-06-01 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: The rho example is interesting, though it doesn't compile in current Rakudo. "1 2 3 ⍴¨ 10 would natively be written in Perl 6 as 10 »xx« (1,2,3)." perl6 complains about non-dwimmyness. 10 <> (1,2,3) gi

Re: renaming or adding some operators

2009-05-31 Thread John M. Dlugosz
Brandon S. Allbery KF8NH allbery-at-ece.cmu.edu |Perl 6| wrote: ⨷ perhaps? It only makes sense that a Unicode operator be used to pull in all of Unicode. Bravo. If you can't type that, you won't find it useful!

Re: Module Library - aka CPAN

2009-05-31 Thread John M. Dlugosz
Richard Hainsworth richard-at-rusrating.ru |Perl 6| wrote: Once a module has been decided on, you look to see if there is a binary that matches your internal environment. If not, you have to roll your own from source. Why not have it generate the binary for you, and safe it for future use

Re: The game of life

2009-05-31 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: Though I'm not quite sure that S03 covers some of the different-dimension cases. my @table= (1,2,3; 4,5,6); # is this the syntax to create 2d array? No, the Capture on the right, although a Capture of Captures, will be flattened in the list contex

Re: The game of life

2009-05-30 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: That was a big part of it... I'm glad Mark posted the APL snippet because it got me to finally read up on the language that's been at the back of my mind. Plus it's useful for p6 language discussion. APL (and a successor, J) may still have a few tricks to

Re: r26976 - docs/Perl6/Spec

2009-05-30 Thread John M. Dlugosz
=head1 Runtime Importation Importing via C also installs names into the current lexical scope by @@ -188,16 +234,13 @@ You may also import symbols from the various pseudo-packages listed in S02. They behave as if all their symbols are in the C<:ALL> export list: -use CONTEXT <$IN $O

Re: renaming or adding some operators

2009-05-30 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: Indeed, getting "close enough" is one of the underlying design themes of Perl 6. As to whether we're close to do the operator aliasing in a mostly digraphic fashion, I'm not sure. Currently a macro for an infix would be given the AST of the left argu

Re: renaming or adding some operators

2009-05-30 Thread John M. Dlugosz
David Green david.green-at-telus.net |Perl 6| wrote: On 2009-May-29, at 7:53 pm, Darren Duncan wrote: Thirdly, there are I'm sure a number of other aliases that could be added to other ops, such as ≤ and ≥ for <= and >=, and ≠ for one of the inequality operators, although that last one would pr

Re: Amazing Perl 6

2009-05-30 Thread John M. Dlugosz
The same tradition has variations in Windows. I recall the leading zero means ANSI code page. I thought I recall a way to give more digits and specify Unicode, but I can't find it on Google. --John Timothy S. Nelson wayland-at-wayland.id.au |Perl 6| wrote: On Fri, 29 May 2009, J

Re: renaming or adding some operators

2009-05-30 Thread John M. Dlugosz
Thoughts: Your nomenclature makes me think you are coming from an APL background. !=== is already generated from ===, and compares the identity of any two objects. It works on binary values since they are value types, but that's not the "proper" usage, and Perl separates out the concerns. S

Re: Amazing Perl 6

2009-05-29 Thread John M. Dlugosz
Ah yes, on the PC historically you hold down the ALT key and type the code with the numpad keys. There's some standard that says this is how to generate unicode: 1.Hold down Ctrl+Shift 2.Press U 3.Type the hexadecimal for the unicode character 4.Release Ctrl+Shift I'

Information Model manuscript, pt.2

2009-05-29 Thread John M. Dlugosz
Please see part 2 of my comprehensive explaination of the Perl 6 Information Model, at . This isn't linked up to my main page yet. I'm taking comments and further discussion here before I make it public. --John

Re: Amazing Perl 6

2009-05-29 Thread John M. Dlugosz
Buddha Buck blaisepascal-at-gmail.com |Perl 6| wrote: On Fri, May 29, 2009 at 3:43 PM, John M. Dlugosz <2nb81l...@sneakemail.com> wrote: Buddha Buck blaisepascal-at-gmail.com |Perl 6| wrote: In response to this thread, I activated the "US International" keyboard layout,

Re: Amazing Perl 6

2009-05-29 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: On Fri, May 29, 2009 at 6:52 AM, John Macdonald wrote: Yep, I've done that. But comparing the difference in effort between: - press a key - Google for a web page that has the right character set, cut, refocus, paste means that I don't bothe

Re: Amazing Perl 6

2009-05-29 Thread John M. Dlugosz
Buddha Buck blaisepascal-at-gmail.com |Perl 6| wrote: In response to this thread, I activated the "US International" keyboard layout, and once that's done theoretically one can get "Spanish style quote mark" with RightAlt+[ and RightAlt+] like so: « and ». The questions which remain (for me, at

Re: Amazing Perl 6

2009-05-29 Thread John M. Dlugosz
John Macdonald john-at-perlwolf.com |Perl 6| wrote: On Thu, May 28, 2009 at 08:10:41PM -0500, John M. Dlugosz wrote: John Macdonald john-at-perlwolf.com |Perl 6| wrote: However, the assumption fails if "process" is supposed to mean that everyone is capable of generating Unic

Re: Illustration of stuff we've been discussing

2009-05-28 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Em Qui, 2009-05-28 às 09:27 -0500, John M. Dlugosz escreveu: Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Em Qui, 2009-05-28 às 00:24 -0500, John M. Dlugosz escreveu: Please see <http://www.dlugosz.com/Perl6/web/info-mode

Re: Amazing Perl 6

2009-05-28 Thread John M. Dlugosz
John Macdonald john-at-perlwolf.com |Perl 6| wrote: However, the assumption fails if "process" is supposed to mean that everyone is capable of generating Unicode in the messages that they are writing. I don't create non-English text often enough to have it yet be useful to learn how. (I'd just

Re: Amazing Perl 6

2009-05-28 Thread John M. Dlugosz
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote: So that much makes sense. But I still think the two different meanings of square brackets in operators are going to confuse people. I agree. The previously quoted passages in the synopses are confusing, too, since it doesn't make the

Re: Illustration of stuff we've been discussing

2009-05-28 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Em Qui, 2009-05-28 às 00:24 -0500, John M. Dlugosz escreveu: Please see <http://www.dlugosz.com/Perl6/web/info-model-1.html> and talk to me about it. The illustratino is cool, but it doesn't take into account the possibility

Re: Illustration of stuff we've been discussing

2009-05-28 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: Basically, (ignoring STD's definition of name) I view @a[0] as a name, in the sense of identifying a unique object. It just happens to contain navigational elements like a URL. OK, that that might be what was meant in the synopses when it was penne

Re: The game of life

2009-05-28 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: If anyone wants to try tackling this, a longer APL one-liner is referenced on the APL wikipedia page and discussed in length here: http://catpad.net/michael/apl/ As an aside, APL was the first computer language I was exposed to. When I was around 7 year

Re: Illustration of stuff we've been discussing

2009-05-28 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Em Qui, 2009-05-28 às 00:24 -0500, John M. Dlugosz escreveu: Please see <http://www.dlugosz.com/Perl6/web/info-model-1.html> and talk to me about it. The illustratino is cool, but it doesn't take into account the possibility

The game of life

2009-05-27 Thread John M. Dlugosz
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote: Perhaps Perl 6 should not aspire to the expressiveness of APL. :) As nice as it is that you can write Conway's Life in a one-liner(*), I think that a little verbosity now and then is a good thing for legibility (*) life ←{↑1 ω⌵.^3 4=+/,‾1

Illustration of stuff we've been discussing

2009-05-27 Thread John M. Dlugosz
Please see and talk to me about it. --John

Re: Amazing Perl 6

2009-05-27 Thread John M. Dlugosz
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote: On Wed, May 27, 2009 at 6:05 PM, John M. Dlugosz <2nb81l...@sneakemail.com> wrote: And APL calls it "|¨" (two little dots high up) Mr. MacDonald just said upthread that the APL reduce metaoperator was spelled "/&

Re: Amazing Perl 6

2009-05-27 Thread John M. Dlugosz
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote: In Haskell it may be called fold (well, foldl and foldr), but the concept has has a variety of names. Two of the more common ones are "reduce" and "inject"; I believe Perl6 chose "reduce" for consistency with the Perl5 List::Util module. Comm

Re: Amazing Perl 6

2009-05-27 Thread John M. Dlugosz
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote: Well, you really made me realize that I'm looking for things that make me impressed, and probably I don't get impressed that easy nowadays ;) Well, maybe you should relax your expectations. People who haven't been following P6 developmen

Re: Unexpected behaviour with @foo.elems

2009-05-27 Thread John M. Dlugosz
You're assuming he's using an instance of the built-in Array class. I would think one reason for implementing your own class that "does Positional" is to do something out of the ordinary. So what exactly does Positional promise? I think it should be as general as possible, and avoid thinking

Re: How to write this "properly" in Perl 6?

2009-05-27 Thread John M. Dlugosz
Cosimo Streppone cosimo-at-streppone.it |Perl 6| wrote: Hi cool people, the "Amazing Perl 6" thread was amazing. It reminded me how Perl 6 looks interesting and fun. So... how can I write "properly", for some meaning of properly, the Perl 6 equivalent of this: http://search.cpan.org/dist/Gam

Re: RFC: Implicit threading and Implicit event-loop (Was: Re: Continuations)

2009-05-27 Thread John M. Dlugosz
Sounds like "threads" to me. What I see that's different from common threads in other languages is that they are all the same, rather than one master and many new threads that have no context history above them. In Perl 6, every thread sees the same dynamic scope as the original. It doesn't

Re: Amazing Perl 6

2009-05-27 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Please post impressive Perl 6 code snippets, we all know there are several, and I really would like to give people some idea of why Perl 6 is so cool. Of late, new languages have been created that are going backwards. That is, they are re

Re: Continuations

2009-05-26 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: >From S09, under Junctions: "The exact semantics of autothreading with respect to control structures are subject to change over time; it is therefore erroneous to pass junctions to any control construct that is not implemented via as a normal sing

Re: r26938 - docs/Perl6/Spec

2009-05-26 Thread John M. Dlugosz
I fixed that today... will check in in a few hours. It's harder to come up with a new example than to update syntax. :) --John Eirik Berg Hanssen Eirik-Berg.Hanssen-at-allverden.no |Perl 6| wrote: pugs-comm...@feather.perl6.nl writes: statement, or if you want to attach multiple stateme

Re: Meditations on a Loop

2009-05-26 Thread John M. Dlugosz
yary not.com-at-gmail.com |Perl 6| wrote: I was wondering why the perl5 example didn't work in p6- $_ is a contextual variable, so why doesn't the body of "odd" get its $_ value from grep in something like this: sub odd_a { $_ % 2} If you make it a formally declared "sub", then you have to

Re: Unexpected behaviour with @foo.elems

2009-05-26 Thread John M. Dlugosz
Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: Hello, The following construction doesn't do what a user might expect: for 0...@foo.elems -> $k { do_something($k,@foo[$k]) } Obviously, the intention is to step through every key/value in @foo. Buf @f...@foo.elems] does not exis

Re: Idea: Literate programing

2009-05-25 Thread John M. Dlugosz
I think the equivalent of tangle/weave would take docs designed for literate reading and produce the runable file. Perl doesn't have to execute it directly. But that can be automated using a source filter. Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: Hello, I really like P

Re: Question for Larry

2009-05-25 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: A few facts: * A Scalar in item context returns its value; * The dotty operator implies item context; * A list in item context returns itself; Thanks. Exactly. but it would probably be more clear to state that "the name '$x' in the lexpad

Question for Larry

2009-05-25 Thread John M. Dlugosz
Can you tell me if I'm missing something fundamental here? Regarding "item containers" ... my @A = (1, 2, 3); my $x; # default to "is Scalar" $x = @A; Now $x is BOUND TO an item container of type Scalar, which CONTAINS an Array which itself CONTAINS 3 items of type Int. @A is BOUND

Re: Array variables as formal parameters ???

2009-05-24 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: On May 23, 2009 11:26:16 pm John M. Dlugosz wrote: > From whence did it get its Item container? OK, my brain made a wrong turn some time on Tuesday. Let me review the basics. From S02: |$x| may be bound to any obj

Re: Array variables as formal parameters ???

2009-05-24 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: Good question, since Nil does Positional, as evidenced by rakudo: > say Nil ~~ Positional 1 Should report this as a bug? Henry At the very least, it is the most simple test case for Nil. Should be in the tes

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: > sub f2 (@y) {say @y.WHAT; say +...@y}; f2(Nil); Array() 1 Why doesn't +...@y produce 0, not 1? It's an empty list. From rakudo: > sub f2 (@y) {say @y[0]}; f2(Nil); Nil() Henry

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
> From whence did it get its Item container? OK, my brain made a wrong turn some time on Tuesday. Let me review the basics. From S02: |$x| may be bound to any object, including any object that can be bound to any other sigil. Perl variables have two associated types: their "value type" and

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
Jonathan Worthington jonathan-at-jnthn.net |Perl 6| wrote: Hi, Little clarification... Henry Baragar wrote: I think that in your "Example 1", that you may be making too making too much of a distinction between "$a" and "@a". That is: sub f2(@y) {...} has exactly the same signature as

Re: Array variables as formal parameters ???

2009-05-23 Thread John M. Dlugosz
Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: I think that in your "Example 1", that you may be making too making too much of a distinction between "$a" and "@a". That is: sub f2(@y) {...} has exactly the same signature as sub f2($x is Array) {...} In other words, the

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Sartak sartak-at-gmail.com |Perl 6| wrote: On Fri, May 22, 2009 at 7:52 PM, John M. Dlugosz <2nb81l...@sneakemail.com> wrote: That sounds like a circular reference problem. If the dot is a simple multi sub and is expected to dispatch based on type (different types may have dif

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Em Sex, 2009-05-22 às 18:27 -0500, John M. Dlugosz escreveu: Daniel Ruoso wrote: That's because dot is an operator as well and might be subject to be overriden... but don't tell anyone that... You mean by installing a

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Daniel Ruoso wrote: Em Qui, 2009-05-21 às 20:21 -0500, John M. Dlugosz escreveu: but it was crudly inserted, so just before it the text still reads, "The "dot" form and the indirect object form DEFAULT to method calls. All other prefix calls DEFAULT to subroutine calls.&

Array variables as formal parameters ???

2009-05-22 Thread John M. Dlugosz
Please take a look at . I started working through how the detailed behavior of the Capture and passing rules need to work, and I ran into something that startled me. There's no examples in S06 of formal parameters, other than the special

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Patrick R. Michaud pmichaud-at-pobox.com |Perl 6| wrote: The page currently says: "The reason this [.prime] works is because the method-call syntax will call an ordinary non-member sub also." I think this is no longer the case (and hasn't been for some time). Pm Wow, that's new

Re: Meditations on a Loop

2009-05-21 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: And since the "when" modifier counts as a conditional, you can rewrite grep Dog, @mammals as $_ when Dog for @mammals; So perhaps will see a lot of subtypes used this way: subset Odd if Int where { $_ % 2 }; @evens = ($_ * 2 whe

Re: Meditations on a Loop

2009-05-21 Thread John M. Dlugosz
What is "Userdocs for Christmas"? Someone have a link? Carl Mäsak cmasak-at-gmail.com |Perl 6| wrote: Timothy (>), John (>>): If you would be so kind, please take a look at . I spent a couple days on this, and besides needing it checked for

What is "U4X"?

2009-05-21 Thread John M. Dlugosz
Can someone post a link?

Meditations on a Loop

2009-05-20 Thread John M. Dlugosz
If you would be so kind, please take a look at . I spent a couple days on this, and besides needing it checked for correctness, found a few issues as well as more food for thought. --John P.S. contains some humor.

Re: "Unicode in 'NFG' formation" ?

2009-05-20 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Mon, May 18, 2009 at 11:11:32AM +0200, Helmut Wollmersdorfer wrote: [1] Open questions: 1) Will graphemes have an unique charname? e.g. GRAPHEME LATIN SMALL LETTER A WITH DOT BELOW AND DOT ABOVE Yes, presumably that comes with the "no

Re: "Unicode in 'NFG' formation" ?

2009-05-18 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: into *uint16 as long as they don't synthesize codepoints. And we can always resort to *uint32 and *int32 knowing that the Unicode consortium isn't going to use the top bit any time in the foreseeable future. (Unless, of course, they endorse something

Re: "Unicode in 'NFG' formation" ?

2009-05-18 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: Sure, but this is a weak argument, since you can already write complete ord/chr nonsense at the codepoint level (even in ASCII), and all we're doing here is making graphemes work more like codepoints in terms of storage and indexing. If people abuse i

Re: "Unicode in 'NFG' formation" ?

2009-05-18 Thread John M. Dlugosz
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote: On Mon, May 18, 2009 at 9:11 AM, Austin Hastings wrote: If you haven't read the PDD, it's a good start. I get all that, really. I still question the necessity of mapping each grapheme to a single integer. A single *value*, sure.

"Unicode in 'NFG' formation" ?

2009-05-16 Thread John M. Dlugosz
I was going over S02, and found it opens with, "By default Perl presents Unicode in "NFG" formation, where each grapheme counts as one character." I looked up NFG, and found it to be an invention of this group, but didn't find any details when I tried to chase down the links. This opens a who

Re: Contextual Variables

2009-05-15 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Fri, May 15, 2009 at 07:16:45PM -0500, John M. Dlugosz wrote: Reading through S02, I see that contextual variables has changed in the last year. It appears that contextual and global variables have been unified. So, the + twigil is no more

Re: Right place for discussions?

2009-05-15 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Fri, May 15, 2009 at 07:21:38PM -0500, John M. Dlugosz wrote: Looking at recent traffic, there is more on tickets and checkins, so any actual "forum" messages are lost among them. Should "discussion" be separat

Right place for discussions?

2009-05-15 Thread John M. Dlugosz
Looking at recent traffic, there is more on tickets and checkins, so any actual "forum" messages are lost among them. Should "discussion" be separate?

Contextual Variables

2009-05-15 Thread John M. Dlugosz
Reading through S02, I see that contextual variables has changed in the last year. It appears that contextual and global variables have been unified. So, the + twigil is no more? I assume the point is that any supposed "global" can be overridden in dynamic context, rather than having to know

Re: Why no "is ro"? (Re: Subroutine parameter with trait and default.)

2008-09-23 Thread John M. Dlugosz
Michael G Schwern schwern-at-pobox.com |Perl 6| wrote: John M. Dlugosz wrote: I'm not opposed to having it be "ro", but wonder why he didn't call it that in the first place, so there must be a reason. Nobody's perfect? My other thought is that since pa

Re: Why no "is ro"? (Re: Subroutine parameter with trait and default.)

2008-09-23 Thread John M. Dlugosz
Michael G Schwern schwern-at-pobox.com |Perl 6| wrote: It should be possible to alias it in your own scope easily. Every time someone replies to a Perl 6 language design nit with "but you can change the grammar" *I* kill a kitten. *meowmmmf* That would not be a change in the gramma

Re: Subroutine parameter with trait and default.

2008-09-23 Thread John M. Dlugosz
PS Incidentally, it seems silly to have "is rw" but not "is ro". I keep writing "is ro". The synopses says "readonly". But now that it is possible, I nominate changing a hyphen. I'm not opposed to having it be "ro", but wonder why he didn't call it that in the first place, so there mu

Re: Should $.foo attributes without "is rw" be writable from within the class

2008-09-19 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: May I pose three more questions? 1. I guess that even using $!A::bar in methods of B is an access violation, right? I.e. A needs to trust B for that to be allowed. Correct. 2. The object has to carry $!A::bar and $!B::bar separate

Re: Should $.foo attributes without "is rw" be writable from within the class

2008-09-19 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: class A { has $.foo = "A"; has $!bar = "A"; method blahh() { say $.foo ~ $!foo ~ $!bar; } } class B is A { has $.foo = "B"; has $!bar = "B"; } my $a = A.new;

Re: How to define a new value type?

2008-09-19 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: So again the question: are back refs from the value to the containers required to implement Perl 6? I guess not. If I understand what you are saying, I agree. You can only go from some container to a value, not the opposite direction, and

Re: How to define a new value type?

2008-09-17 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: Sorry, I don't understand why you say 'no' and then explain that the resulting new string is stored in the container. The only container that could be affected by this is $string in the example. The way for a method to get access to the contai

Re: How to define a new value type?

2008-09-17 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: Reading the description there I wonder how this is supposed to work. I don't think S29 is in any shape as a serious design specification. Maybe you should not design it that way. Maybe the left-hand-side is "as ref" so it can change the id

Re: Should $.foo attributes without "is rw" be writable from within the class

2008-09-17 Thread John M. Dlugosz
Carl Mäsak cmasak-at-gmail.com |Perl 6| wrote: I have come to understand that this is an available possibility, yes. That doesn't mean I like it. :) My complaint could be pithily summarized as "those are _my_, attributes, why can't I write to them?" // Carl If the accessor were implemented

Re: How to define a new value type?

2008-09-16 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: For an Object to be a value, it means that if you build an object with the same "value", it will be seen as the same "value" that some other object with this value. Perl 6 formalizes this by defining a "value type" as one whose identity is key

Re: How to define a new value type?

2008-09-16 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: I think that mutating methods of immutable value types just have to modify the identity. The problem is how that relates to references. Take e.g. the Str type my $s = 'abc'; # $s points to 'abc' $s.reverse; where the reverse method re

Re: How to define a new value type?

2008-09-16 Thread John M. Dlugosz
Stéphane Payrard cognominal-at-gmail.com |Perl 6| wrote: I don't understand how = differs with that semantic from := I would expect that = would make a copy (clone?) of the object. For a mutable object, I don't know if that copy should be immediate or deffered by a mechanism of copy on write. Pro

Re: Iterator semantics

2008-09-10 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: The second example actually modifies the object stored in the variable '@a'. And that is a different issue. I disagree. The assignment operator, as opposed to the binding operator (:=) is an operator called on the Array object. It is the

Re: Iterator semantics

2008-09-09 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: Since Larry said that single assignment semantics is the ideal we should strive for, I would opt for the iterator being unaffected by the assignment to @a. When this happens the singly assigned former content of @a is snaphot by the iterator.

Re: Iterator semantics

2008-09-09 Thread John M. Dlugosz
My take on it: The 'for' loop does bind $_ to alias each item of the list in turn. But, "the list" is not synonymous with the variable named @a. However, the = operator operates on "the list" itself, not the container, replacing the elements in the existing Array (or whatever) object. So,

insight into laziness, background processing, etc.

2008-09-08 Thread John M. Dlugosz
While pondering whether or not the 'map' function is lazy, I had a flash of insight. Let's assume that it is, and go with an example of @results = map { process_item($_) } @files; Now ponder the questions of how independent are the iterations of the block. Must it compute

Re: How do you do a lazy map?

2008-09-07 Thread John M. Dlugosz
Moritz Lenz moritz-at-casella.verplant.org |Perl 6| wrote: map *is* lazy, as are all list builtins that can be lazy (which doesn't include stuff like sort, which has to look at all items anyway). Are you sure that it doesn't imply order of evaluation by default? I'm all for it (to be diff

How do you do a lazy map?

2008-09-07 Thread John M. Dlugosz
Consider something like a 'map' call, only I want it to be lazy. I know that a list can contain internally iterators that generate elements as needed or perhaps in the background. But how do you create such a thing? Something like: @lazy_list := parallel-map { get_info($_) } @filenames;

  1   2   3   4   >