Tom (>):
> In creating some new Perl 6 programs I've run across several instances
> I'm confused about, to wit:
>
> Example 1
> ---
>
>> my %h; say 'false' if !%h:exists;
> Unexpected named parameter 'exists' passed
I can explain this one. But it's the kind of explanation that makes a
the "signatures, multi and named arguments" email on p6u, is
that a case of the querent forgetting to ! their nameds?
masak: Sounds like; named args serve as a tie-break but you
actually have to demand them be present in methods for that to help,
given methods accept all named args.
* masak
Moritz (), Tux ():
I could continue with other Perl 5 deficiencies (no strict by default,
Using strict *STILL* is not enabled by default for perl6
one-liners either:
$ perl6 -e'my Int $this = 1; $thıs++; say $this;'
1
$ perl6 -Mstrict -e'my Int $this = 1; $thıs++; say $this;'
===SORRY!===
It's worth noting that PERL6LIB is at most a developer convenience,
shouldn't be encouraged or used by module consumers, and will possibly
be deprecated in the future. This is because Perl 6 has a slightly
more ambitious view of module loading which isn't directly compatible
with OS paths.
I use
This feels like the same conversation we had earlier this week about
accessing private methods. :) But maybe there are still a few new
points that can be made.
Tom (), Moritz ():
I need to test some private routines, so is there a way to do that?
The easiest way to do that is when the class
(resending to p6u)
Tom (), Henk ():
That doesn't seem to work with private methods. Any trick to accomplish
that?
What part of 'private' did you mis?
Henk, that's an unnecessarily harsh way to say Private methods are
private and not visible or testable outside of the class.
In my
Yes, this is why phasers are awesome. They allow you to write code in
a natural order, but the phasers will basically time-travel the code
around to where you send it. The two `now` calls execute in two
completely different environments; the first one in the runtime, the
second one during the
...It could also be taken as a subtle suggestion to write unit tests,
in which case you would discover such logical bugs within one
red/green/refactor iteration. ;-)
// Carl
On Sat, Jan 10, 2015 at 10:12 PM, Gabor Szabo ga...@szabgab.com wrote:
On Sat, Jan 10, 2015 at 11:02 PM, Moritz Lenz
Theo van den Heuvel ():
Perl6 considers all entries as new, and the hash has 3 separate entries. Do
I actually have to project my objects to strings to accomplish this?
You're putting arrays into a hash. When you put something into a hash,
it matters whether the object in question has
Yes, the WHICH method controls how the hashing happens.
But the more fundamental principle is that the method always return
the same value for the same objects. This tends to be implemented by
returning either (a representation of) the reference, or the value
itself (which must then not be
Richard ():
What am I doing wrong?
Passing constant strings into the macro, instead of code.
masak r: macro m($code) { quasi { {{{$code}}} } }; class A { m(has
$.x is rw) }; say A.new(:x('OH HAI')).x
camelia rakudo-parrot e32249, rakudo-jvm e32249: OUTPUT«OH HAI»
* masak replies to the p6u
No, both programs are wrong, not correct. The bug is that Rakudo
accepts the first one, not that it rejects the second one. The error
message to the second one looks correct to me. (It tries to hash-index
the list of stuff the .map generated.)
masak r: .say for (1, 2, 3) ~ !; .say for (1, 2, 3)
Frank (), Moritz ():
Hi, I am new to Perl6 and I'm interested in the feature that allows you to
add roles to classes. From what I understand you can add a role to an
object using the does keyword. Is there any way you can remove a role or
No, you cannot remove roles.
However, if you want
Ted ():
Are state variables available now, or is the every(N) functionality
possible in some other way now?
Why not try it by writing a small program? :)
Rakudo is available at a discount right now -- download it before it's
too late! -- and the syntax for state variables is the same as it's
Marc ():
hello perl6 people,
On
This is perl6 version 2012.09.1
built on parrot 4.6.0 revision 0
When i try to run
use v6;
use Test;
for 'GATGGAACTTGACTACGTAAATT' {
s:g/T/U/;
is $_
, 'GAUGGAACUUGACUACGUAAAUU'
, 'RNA';
}
I
1parrota (), Carl ():
$ perl6 -e 'say Yo; if !{...} { say Bye} '
Yo
$ perl6 -e 'say Yo; if {...} { say Bye} '
Yo
Bye
# The opposite to what I'd expect, if ... returns failure
Same base cause as your first example above. Similarly wrong.
Oops, I jumped the gun on this one, and
gvim ():
Does there currently exist a set of criteria by which Perl6, or an
implementation thereof, can be defined as production-ready?
Not just one set of criteria, but lots of sets of criteria.
Some of these sets have already gone from showing a no flag to
showing a yes flag in the past few
Richard ():
I came across the idiom
print P4\n$w $h\n;
for my $y (0..$h-1) {
print pack 'B*', pack 'C*', map dot($_, $y), 0..$w-1;
}
in a perl5 program for outputting dots in a graphical format. dot() produces
a 0 or -1.
I found the 'pack' function in perl6, but it does not seem to
Guy ():
I may have asked them why they did not map (A,C,G,T) - (0,1,2,3) but
since then, I've learned more about what GC-content implies in terms of
chemistry -- it also seems to have evolutionary implications, about
which I know nothing.
With this I can help at least, being schooled in
contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
parrot, the Perl 6 test suite and the specification.
The following people contributed to this release:
Patrick R. Michaud, Moritz Lenz, Jonathan Worthington, Solomon Foster,
Patrick Abi Salloum, Carl
Victor ():
Why it asks for Opendir.pir instead of Opendir.pm ?
Any clue ?
Short answer: Rakudo has regressed and doesn't support loading .pm
modules at the moment. You're probably on the Amsterdam (February)
release. I suggest using the Minneapolis (January) release until
Rakudo regains this
Paul ():
I try building rakudo from git clone git://github.com/rakudo/rakudo.git but
during make it hangs forever (12+ hours) at
/usr/local/bin/parrot perl6_s1.pbc --target=pir src/gen_setting.pm
src/gen_setting.pir
While it hangs at that line the linux (Debian 5.0 Lenny) box starts
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 tarball
Steffen (), Fagyal ():
However, performance is an issue. I would not mind running into
bugs, writing some extra code to work around missing stuff, etc.,
but right now it is just hard to find any projects (for me - YMMV)
where performance would not be a blocker.
I suggest to start using it as
Daniel (), Leon (), Daniel ():
Then why is it that .get works fine for $*IN?
while $*IN.get - $line {
say $line
}
Because you're using a while loop instead of a for loop ;-)
Worse. The code I wrote has a subtle but horrible error. The condition will
fail as soon as you hit a blank
I'd like to take this opportunity to announce Form[1], a Perl 6
project by Matthew Walton. It's a port to Perl 6 of Damian Conway's
Perl6::Form[2], and is meant to replace the Cformat built-in in Perl
5.[3][4]
Form is still in its early stages, but is already showing great
promise. Consider
Hej Lars,
Lars ():
I do not know Perl at all, but I'm very interested in perl6.
My problem is I do not find a good tutorial how to do real perl6
development, all I find seems to assume you know perl5 and the perl
community. And I do not.
That's an interesting question! I guess most of the
Jeremiah ():
OHAI!
I have just built Parrot and perl6 and am just getting started. I'm gonna
lurk a little. :)
Welcome! Enjoy Perl 6, and let us know if you need clarification or
think you've found a bug. There's plenty of people here (and on #perl6
at irc.freenode.net) who can help in
Илья ():
I use role to mix in some functionality for testing:
my $s = November::Storage::File.new does Testing;
And I have Role definition _after_ this:
role Testing { ... }
Now this is fall with:
Null PMC access in isa()
current instr.: 'infix:does' pc 20660 (src/builtins/op.pir:403)
Richard ():
S12 defines enums and rakudo impliments them, so
perl6
enum wkend Sat Sun; my $x = Sun; say $x
1
But suppose I want to get the face value of $x, viz., 'Sun'?
How do I get it?
say $x.key doesnt work.
Far as I know, the answer to your question is unspecced.
(Yes, that sucks.
Richard ():
use v6;
my %players;
my $scores = open('./skaters.txt', :r) or die $!;
for =$scores {
my ($name,@list) = .split /\,/;
%players{$name} = ([+] @list.sort[2..6]) / 5;
};
my @ranking = %players.sort: { .value };
for Gold Silver Bronze - $m {
given pop @ranking {
say $m
Guy (), Carl (), Moritz ():
for @($ar) { ... }
This would arguably be the nicest variant.
Well, actually, by this I meant all three variants that Moritz suggested. :)
for @$ar { ... }
or even
for @ $ar { ... }
or
for @($ar) { ... }
Guy ():
for ( @$ar ) { ... }
?
That's Moritz'
Chris ():
How safe is it today to pre-compile Rakudo code to PIR and expect that to
behave identically to as if I compiled from .pm at runtime? I believe PCT
is just generating PIR anyway, so my initial guess is that there should be
no differences. Are there any gotchas, like compile-time
Chris ():
I can't assign $/ to a variable or
pass it to a method. Is this a bug, or am I just confused?
I think it's a bug. I sent your message along to [EMAIL PROTECTED]
// Carl
Conrad ():
Is there something more up-to-date concerning Perl 6 best practices that
are presently-recommended (by p6l or @Larry) than the following item on the
Perl 6 wiki?
If you ask me, best practices evolve as a countering force to enough
people using less-than-ideal practices to create
.
To learn more, please browse the slides from the YAPC:EU 2008 lightning
talk:
http://viklund.pp.se/november.pdf
November is free, released under the Artistic License 2.0, and available
online:
http://github.com/viklund/novmber/
Enjoy!
// Carl Mäsak Johan Viklund
Wim ():
The following program works fine in pugs r17041 (which is the rev of
/usr/bin/pugs on feather):
my $r=\{say $x+1};
my $x=2;
$r();
With r17041, this gives 3;
However, on the latest pugs (r17615 or later), it gives an error:
***
Unexpected $r
expecting =, ::, context, :
Juerd (), Michael Snoyman ():
sub mysub($foo, @foo, %foo) {
I hope this is a compile time failure. If not, I'd expect a warning, at
least.
Why? It looks reasonable IMHO.
// Carl
38 matches
Mail list logo