On 10/2/2014 16:03, Elizabeth Mattijsen wrote:
On 01 Oct 2014, at 07:48, Father Chrysostomos spr...@cpan.org wrote:
Does ‘state’ govern ‘:=’ the way it governs ‘=’? In other words, just as this:
state $x = 1;
only assigns to $x once (per closure), does the same apply to this?
state
On 12/19/2013 3:47, Richard Hainsworth wrote:
Initially I though the following was a bug, but now I'm not sure.
I got these results
perl6 -v
This is perl6 version 2013.09 built on parrot 5.5.0 revision 0
$ perl6
say '0' xx 4
0 0 0 0
Are you sure you didn't want the x (string repetition)
On behalf of the Rakudo and Perl 6 development teams, I'm happy to
announce the October 2012 release of Rakudo Star, a useful and
usable distribution of Perl 6. The tarball for the October 2012
release is available from http://github.com/rakudo/star/downloads.
A Windows .MSI version of Rakudo
On 26/11/2010 17:17, gvim wrote:
I'm new to the Perl 6 lists so can someone tell me if the
implementations of Perl 6 will eventually transition to a Perl 6.0.0
standard or will TIMTOWTDI apply to the language itself indefinitely?
The implementations are aiming towards passing a common test
On 27/11/2010 18:37, Jonathan Worthington wrote:
On 26/11/2010 17:17, gvim wrote:
I'm new to the Perl 6 lists so can someone tell me if the
implementations of Perl 6 will eventually transition to a Perl
6.0.0 standard or will TIMTOWTDI apply to the language itself
indefinitely
Hi,
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 which is only
On 30/09/2010 21:38, Darren Duncan wrote:
Mark J. Reed wrote:
Of alternatives you didn't mention, I like put - as pithy as get
and set, with plenty of corresponding history (SmallTalk, POSIX,
HTTP,...).
Actually, *yes*. I didn't think of this one at the time but when you
mentioned the
On 30/09/2010 10:49, Damian Conway wrote:
As long as C.perl works the way it does, there can be no real
privacy.
Sigh. That is indeed badly broken. Surely it ought to default to Cdie,
and require class architects to override .perl explicitly if they wish to
break encapsulation.
I see/use
Nicholas Clark wrote:
On Thu, Aug 12, 2010 at 03:38:31PM +0200, Carl Mäsak wrote:
In fact, jnthn++ had a talk at YAPC::EU the other week where he showed
how nested signatures can be used to make hierarchical matches. A
proof-of-concept module could simply be some sugar around this already
Darren Duncan wrote:
TSa (Thomas Sandlaß) wrote:
... unless you want Cwhen True to do a value-and-type check,
in which case it doesn't exactly follow the pattern for smartmatching
of the other builtin types (which only check value equivalence,
not type equivalence).
This is true only if you
Mark J. Reed wrote:
Possibly a FAQ, but is there a simple way of asking if an item is
contained in an array? I know of $x ~~ any(@array) and @array.grep({
$_ ~~ $x}), but those both seem a bit complicated for a conceptually
simple test, so I'm wondering if I'm missing something.
Note that grep
Aaron Sherman wrote:
See below for the S06 section I'm referring to.
I'm wondering how we should be reading the description of user-defined
operators. For example, sub infix:(c) doesn't describe
the precedence level of this new op, so how is it parsed? Is there a
default?
The default is
Aaron Sherman wrote:
The spec says, and NQP seems to implement (Rakudo, I think, picks up
integer from NQP as defined in HLL-s0.pir, is this right?) that a
single underscore is ignored between any two digits in a number, not
between the radix and the number. However, it seems to me that this
Darren Duncan wrote:
Dave Rolsky wrote:
On a smaller point, I think second vs whole_second is the wrong
Huffman coding. I'd think most people want the integer value.
Well, whatever you call things, the most important thing is to keep
the seconds count as a single number which can do
Hi,
TSa (Thomas Sandlaß) wrote:
There is no formally defined subtype relation or rules for subsumption.
A type is called narrower without details what that means.
A is a subtype of B if A ~~ B, where ~~ is the smart-match
operator..It's up to the type object on the RHS how it responds to
Giuseppe Castagna wrote:
Yes I saw that inheritance is not subtyping. I would not share this
decision since as an outsider, it seems to me that Perl6 has redundant
syntax (too many different ways to express the same thing), so it is
astonishing that in that case the choice was to use the same
Giuseppe Castagna wrote:
On 02/05/2010 11:29 PM, Jonathan Worthington wrote:
And the odering in dispatch is not a type lattice as in Cecil but a
topological ordering. Again I've no clue what that means.
and all objects that do A are also B doers. So one could infer that we
have A : B. But note
On 22/12/2009 10:22, Moritz Lenz wrote:
Carl MXXsak (via RT) wrote:
This be Rakudo 8dc189.
$ perl6 -e 'multi sub f($a) {}; multi sub f($a) {}; f(42)'
Ambiguous dispatch to multi 'f'. Ambiguous candidates had signatures:
:(Any $a)
:(Any $a)
The definition of two variants with equivalent
Jon Lang wrote:
Concerning that last one: would it be reasonable to have a Discrete role
that provides a .succ method, and then overload the Range role? E.g.:
role Range[Ordered ::T] { ... }
role Range[Ordered Discrete ::T] {
...
method iterator ( - RangeIterator ) {
Nicholas Clark wrote:
My understanding is that this makes Perl 5 hash tables amortised O(1).
Hopefully someone else will answer the Perl 6 side properly.
My understanding is that the point of a hash table data structure was
that lookups are amortised O(1). However, doing it right - and
Aaron Sherman wrote:
On Sun, Aug 2, 2009 at 1:10 PM, Moritz Lenz mor...@faui2k3.org wrote:
Let's pick up this old mail before it gets completely warnocked ;-)
For the record, this discussion only applies to scalar implementation
types. For example for Arrays I expect things to work by
Ovid wrote:
- Original Message
From: Timothy S. Nelson wayl...@wayland.id.au
class PracticalJoke {
has Bomb $bomb handles ;
has Spouse $spouse handles ;
}
Note that I have no idea where (if anywhere) the type goes in this.
Hopefully someone will correct me here. Note
Jon Lang wrote:
Jonathan Worthingtonjonat...@jnthn.net wrote:
Ovid wrote:
Though I have issues with Jonathan's approach (I don't like classes
silently discarding role methods as this has caused us many bugs at the
BBC), it's much cleaner that what I see here.
s/Jonathan's
Hi,
Going back to the original question...
Ovid wrote:
It needs the timed fuse() from a Bomb role and a non-lethal explode() from a
Spouse role, though each role provides both methods.
I'm curious...
1) How often do you in real life find yourself needing to do things like
this in real
Hi all,
It's been interesting to participate in the roles discussion so far, and
I'm happy to see there's a lot of interest in getting the right options
and the right defaults. I'm leaving tomorrow morning on vacation, and
will be mostly offline for a week or so (the alps are quite a
Ovid wrote:
Giving a talk about roles at YAPC::EU in Lisbon
Hey, me too! :-)
and I'm a bit stuck on how to translate a Perl 5 example into Perl 6. Basically, Imagine
a PracticalJoke class which has fuse() and explode methods(). It needs the
timed fuse() from a Bomb role and a non-lethal
Jon Lang wrote:
I believe that the official word is to say:
class PracticalJoke does Bomb does Spouse {
method fuse () { Bomb::fuse }
method explode () { Spouse::explode }
}
This way won't work, because:
* It's doing a sub call to something that's a method
* The lookup won't
Brandon S. Allbery KF8NH wrote:
On Jul 7, 2009, at 07:34 , Jonathan Worthington wrote:
Jon Lang wrote:
I believe that the official word is to say:
class PracticalJoke does Bomb does Spouse {
method fuse () { Bomb::fuse }
method explode () { Spouse::explode }
}
This way won't work
Brandon S. Allbery KF8NH wrote:
On Jul 7, 2009, at 08:13 , Jonathan Worthington wrote:
Brandon S. Allbery KF8NH wrote:
I was trying to figure out how to do it with nextsame, but that's
not looking very simple.
On the other hand, if they were multis then they get added to the
multi candidate
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 f2($x is Array) {...}
In other words, they both take a
Daniel Ruoso wrote:
Em Sex, 2009-05-22 às 01:25 -0500, John M. Dlugosz escreveu:
@primes = do $_ if prime($_) for 1..100;
becomes
@primes = $_ when prime($_) for 1..100;
you gained one stroke, it's certainly better... I think it's time to
play golf with Perl 6 already ;)
Moritz Lenz wrote:
Jon Lang wrote:
@@ -1836,6 +1836,12 @@
prototype objects, in which case stringification is not likely to
produce something of interest to non-gurus.)
+The C.^parents method by default returns a flattened list of all
+parents sorted in MRO (dispatch) order. Other options
Jon Lang wrote:
Invocants:
* Is it illegal to specify an invocant in a sub, or is it merely
nonsensical? That is, should the compiler complain, or should it
silently treat the invocant as the first positional parameter? (The
latter has the advantage that you don't have to worry about what the
Daniel Ruoso wrote:
Em Qua, 2009-03-18 às 18:50 -0700, Larry Wall escreveu:
On Wed, Mar 18, 2009 at 06:32:18PM -0700, Jon Lang wrote:
: +method !eigenstates (Junction $j: -- List)
:
: Shouldn't that be lowercase-j junction?
Maybe, though there might be a Junction role involved for
Daniel Ruoso wrote:
Em Sex, 2009-03-20 às 14:08 +0100, Jonathan Worthington escreveu:
It's probably a minor issue, but part of me wants Junction to be OK too
for explaining stuff. Telling people the default parameter type is Any,
to accept anything they can write Object and to accept just
Moritz Lenz wrote:
pugs-comm...@feather.perl6.nl wrote:
+You can leave out the block when matching against a literal value of some
+kind:
+
+multi sub fib ($n where 0|1) { return $n }
+multi sub fib (Int $n) { return fib($n-1) + fib($n-2) }
+
+In fact, you can leave out the 'where'
Jonathan Worthington wrote:
Moritz Lenz wrote:
pugs-comm...@feather.perl6.nl wrote:
+You can leave out the block when matching against a literal value
of some
+kind:
+
+multi sub fib ($n where 0|1) { return $n }
+multi sub fib (Int $n) { return fib($n-1) + fib($n-2) }
+
+In fact
Mark J. Reed wrote:
Shouldn't that desugar to (Int $ where 0)? After all, 0.WHAT is Int...
Yes, I proposed that in my second reply too, after realizing .WHAT gave
us that too. :-)
Of course, then someone will expect multi sub fib (0|1) { return @_[0]
} to DTRT here...
That's fine,
Ovid wrote:
Having a problem with the following role in Perl 5:
package PIPs::ResultSource::Role::HasTags;
use Moose::Role;
requires 'do_setup';
after 'do_setup' = sub { ... };
So far this has worked really well, aside from that one class which didn't call
'do_setup'. Oops.
Richard Hainsworth wrote:
The following (the n: is to mark the lines) are legal:
1: my @x = 1,2,3,4; ([+] @x).say; # output 10
2: my @x = 1|11,2,3,4; ([+] @a).perl.say; # output any(10,20)
3: my @x = 1|11,2,3,4; ([+] @a).eigenstates.min.say; # output 10
However, the next line isnt
4: my @x =
Daniel Ruoso wrote:
Em Qui, 2009-03-12 às 10:28 -0700, Larry Wall escreveu:
On Thu, Mar 12, 2009 at 08:51:45AM -0700, Ovid wrote:
: From: David Green david.gr...@telus.net
: I suppose, but is there a reason why you want to apply roles instead of coercing
: the results?
: Because I am
Hi,
If we declared, for example:
role A::B {};
Then what should a reference to A be here? At the moment, Rakudo treats
it as a post-declared listop, however I suspect we should be doing
something a bit smarter? If so, what should the answer to ~A.WHAT be?
Thanks,
Jonathan
Aristotle Pagaltzis wrote:
* Ovid publiustemp-perl6langua...@yahoo.com [2009-01-12 16:05]:
Or all could be allowed and $string.trim(:leading0) could all
$string.rtrim internally.
++
Note you can write it :!leading too. :-)
Jonathan
Ovid wrote:
- Original Message
In the pir, doesn't the s = self line copy self, thus ensuring that I'm changing s and not self?
No, it's binding.
Or do I need s = clone self (or however it's written).
Yeah, but also note that substr would return a copy...
Can't say I
[EMAIL PROTECTED] wrote:
I am trying to understand the following small portion from S12, and it
seems slightly ambiguous to me:
=== from S12:
You may wish to declare an attribute that is hidden even from the
class; a completely private role attribute may be declared like this:
Cmy
Jon Lang wrote:
Daniel Ruoso wrote:
TSa 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.
Yes
2. The object has to carry $!A::bar and
Moritz Lenz wrote:
Yes, I know that $.stuff actually translates to $( self.stuff ), so
without 'is rw' there is no rw accessor generated - but couldn't we just fake
assignment to '$.foo' to actually affect '$!foo'?
Why not just assign to $!foo, which is always read/write (since the rw
Hi,
Answers as I understand things...
John M. Dlugosz wrote:
1) How do you declare a private method? I see how you call one, but
not how to define one.
my method foo { ... }
1b) Is the intent that $!foo without an explicit invocant refers to
self, as opposed to $.bar or .bar which refers
Larry Wall wrote:
On Tue, Aug 05, 2008 at 06:17:30PM +0200, Jonathan Worthington wrote:
Hi,
I am currently reviewing bits of the spec surrounding multiple dispatch
and, of course, have a question or two (I'll probably have some more
later, as the dust settles in my head).
1) The spec
Hi,
I found in one of the spec tests for Ranges:
my $r = 1..5;
ok(($r).ACCEPTS($r), 'accepts self');
ok(($r).ACCEPTS(1..5), 'accepts same');
ok($r ~~ $r, 'accepts self');
ok($r ~~ 1..5, 'accepts same');
And implemented this, but then Pm pointed out that it's not actually
Hi,
Is there an introspection interface for signatures defined anywhere?
I've looked through the synopses and don't see one. I'm thinking things
like:
* Can you do .arity and .count of a signature?
* Can you iterate over a signature to get each element in there?
* If so, what sort thing
Ovid wrote:
Specifically, I was looking for the documentation on how subsets work
See S12:
http://dev.perl.org/perl6/doc/design/syn/S12.html#Types_and_Subtypes
as it looks like we can get declarative style constraint programming
for free:
subset Crosshair of Point where {
Ovid wrote:
Well, looking at the examples that you and Jonathan listed, I see I
should refine my question. For example:
subset Crosshair of Point where {
$_.inside_of($target_area)
||
$target_area.has_moved
?? $_.move_inside($target_area)
::
Hi,
I'm looking for answers/clarification on what (if taken as individual
programs) $x is in each case.
my Int $x; # $x is Int protoobject
say $x; # Int
say $x.WHAT; # Int
class Foo { }
my Foo $x; # $x is Foo protoobject
say $x; # Foo
say $x.WHAT; # Foo
# This
John M. Dlugosz wrote:
Perl 6 doesn't have references anymore, it has captures. So, what
does the following mean:
@x = foo bar;
$a = [1, 2, [EMAIL PROTECTED];
I imagine that the 3rd element of the Array is itself an Array, and is
the same object that is bound to @x. But captures are lazy
John M. Dlugosz wrote:
Andy_Bach-at-wiwb.uscourts.gov |Perl 6| wrote:
in. Er, so would:
my CGI::Simple $x .= new;
my $y = CGI::Simple.new;
mean that:
$x whatever the compare class operater is $y
is not true? Or would there be a way to tell them apart, on a class
(?) level.
The actual
TSa wrote:
Jonathan Worthington wrote:
Miller, Hugh wrote:
Was that private communication or on another mailing list?
It was also sent to perl6-language, through I was on the To or Cc line
too, so I guess that's how I got it but the list, somehow, didn't. Not
sure why the original message I
Miller, Hugh wrote:
What about the type support (system) one sees in ML ? (e.g., the way it
assigns automatically types can be assigned, does not require specific
types when they are not needed, flags incompatibilities, etc.) Do those
things not fit well with Perl's approaches and aims ?
Mark J. Reed wrote:
I don't care for the use of * there, but it would be nice to have some
way to declare the variable to have the type implied by its
initializer, where the complier can tell what that is, so you could
remove the redundancy in this:
my Dog $fido = new Dog();
while still
Richard Hainsworth wrote:
Given a function implemented in parrot, how can it be called from a
perl6 program?
To use functions from a class or module in a different language, you
will be able to use use to include the module, but with the language
name out the front. So:
use
--
Lebennin
Silver flow the streams from Colos to Erui
In the green fields of Lebennin!
Tall grows the grass there. In the wind from the Sea
The white lilies sway,
And the golden bells are shaken of mallos and alfirin
In the green fields of Lebennin,
In the wind from the Sea!
--
On
Sage La Torra [EMAIL PROTECTED] wrote:
I've got a design document detailing the first few translations I'll be
handling, and I'd greatly appreciate feedback and advice.
I may be off base here, or in the alternate pointing out a corner case
that's of little significance, but:
-Compound
Jonathan Scott Duff [EMAIL PROTECTED] wrote:
On Thu, Jun 01, 2006 at 02:22:12PM -0700, Jonathan Lang wrote:
Forgive this ignorant soul; but what is STM?
Software Transaction Memory
Well, Software Transactional Memory if I'm being picky. :-) Some info and
an interesting paper here:-
Matt Fowles [EMAIL PROTECTED] wrote:
=head3 Obsolete Win32 Exports
Michael Walter found and removed some obsolete Win32 Exports.
Jonathan Worthington applied the patch. Weren't we planning on auto
generating these?
The Plan is to mark functions that are to be exported with something
Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] wrote:
Like the decision about which side of the road cars should drive on,
it really doesn't matter *which* choice is taken, as long as
*something* is decided.
The only thing is, there already is a decided way to do it so far as I can
see...
I've seen
Juerd [EMAIL PROTECTED] wrote:
You both use iff. What does that mean?
I believe it's to be read if and only if.
Jonathan
Luke Palmer [EMAIL PROTECTED] wrote:
Hans Ginzel writes:
On Thu, Jul 08, 2004 at 09:12:16PM +1000, Gautam Gopalakrishnan wrote:
about string subscripting. Since $a[0] cannot be mistaken for array
subscripting
anymore, could this now be used to peep into scalars? Looks easier
than using
Honestly you guys, I'm not trolling. I'm just getting a lot of ideas
recently. :-)
Honestly, I'm not an expert on Perl 6 syntax. (And I actually am being
honest... ;-) But I'll throw in my 2 cents anyway. :-)
snipah
This word: Cthen.
So, from a recent script of mine:
my $n;
At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote:
Well, I don't think it's possible, actually. There's a flattening
list context at the beginning (implying a sugary drink from 7 eleven),
followed by a code block. But, as we know, slurpy arrays can only
come at the end of positional
69 matches
Mail list logo