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
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
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
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote:
On Fri, Jun 12, 2009 at 10:02 AM, yarynot@gmail.com 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
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
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 can
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
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
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
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 ⇐ lArr; LEFTWARDS DOUBLE ARROW
== is also ⇒ rArr; RIGHTWARDS DOUBLE ARROW
I
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 ⇐ lArr; LEFTWARDS DOUBLE ARROW
== is also ⇒ rArr; RIGHTWARDS DOUBLE ARROW
I
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. :)
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
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 chain. (2
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:
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
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
yary not.com-at-gmail.com |Perl 6| wrote:
http://www.dlugosz.com/Perl6/web/APL.html
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 xx (1,2,3) gives
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
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
=head1 Runtime Importation
Importing via Crequire 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
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
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
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
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!
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.
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, John M
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
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
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 Unicode
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
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote:
On Fri, May 29, 2009 at 6:52 AM, John Macdonald j...@perlwolf.com 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
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, and once that's
Please see part 2 of my comprehensive explaination of the Perl 6
Information Model, at http://www.dlugosz.com/Perl6/web/lvalues.html.
This isn't linked up to my main page yet. I'm taking comments and
further discussion here before I make it public.
--John
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
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 of:
@a[0
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
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
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 of:
@a[0
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
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
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-model-1
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
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
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:
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
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
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. Common
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 /. As in:
+/1 2 3
6
Please see http://www.dlugosz.com/Perl6/web/info-model-1.html
and talk to me about it.
--John
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
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
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
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
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
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 TO
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
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
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
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 object
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, they
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 sub
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
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
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 when
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 news
Please take a look at
http://www.dlugosz.com/Perl6/web/passing_examples.html.
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
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. (emphasis mine
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 different
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
different
Can someone post a link?
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
http://www.dlugosz.com/Perl6/web/med-loop.html. I spent a couple days on
this, and besides needing it checked for
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
If you would be so kind, please take a look at
http://www.dlugosz.com/Perl6/web/med-loop.html. 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.
Mark J. Reed markjreed-at-gmail.com |Perl 6| wrote:
On Mon, May 18, 2009 at 9:11 AM, Austin Hastings
austin_hasti...@yahoo.com wrote:
If you haven't read the PDD, it's a good start.
snip useful summary
I get all that, really. I still question the necessity of mapping
each grapheme
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
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
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 whole
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
separate?
Generally discussion
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
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 must be a
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
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 parameters are read-only by default
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,
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;
my $b
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
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
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
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
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.
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
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 keyed to
This is just a reminder that I have files posted at
http://www.dlugosz.com/Perl6/offerings/ waiting for someone in
authority to inspect and merge.
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote:
Taking only the lhs into account doesn't work in Patrick's
code because he has untyped variables. The Dog is only on
the rhs. This is why I think we need a binary dispatch. I
don't see much use for the type of the LHS, though. C++
dispatches
Darren Duncan darren-at-darrenduncan.net |Perl 6| wrote:
So, how does one get an object to pretend to be a value type for
purposes of assignment?
Currently if I do the following
class Dog { ... }
my $a = Dog.new;
my $b = $a;
then $a and $b both refer to the same Dog object. How
TSa (Thomas Sandlaß) thomas-at-sandlass.de |Perl 6| wrote:
I think a straight forward approach is to overload the
assignment operator on the actual types of the lhs and
rhs. The dispatch target than clones the value to be stored
in the lhs container after being checked against the
container's
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,
the
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.
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
TSa (Thomas Sandlaß) thomas-at-sandlass.de |Perl 6| wrote:
a() proceed: orelse b();
CATCH
{
... # make $! into return value
goto proceed;
}
This kind of needs to know the variable the return value of a()
is stored into. This is easy if orelse is checking $! anyway.
But
1 - 100 of 335 matches
Mail list logo