Perhaps not really what you're intending, but here's how I'd start:
$ raku -e 'my $x="1.2.3.4"; $x ~~ s!\d+$!0/24!; say $x;'
1.2.3.0/24
The pattern part of the substitution matches all of the digits at the end of
the string (\d+$), then replaces them with the string "0/24". Everything p
This is a place where .comb() is likely much better than .split() -- .comb()
allows you to specify what you're wanting instead of what you're wanting to
avoid:
$ raku -e "say sqrt(2).comb(/\d/).join(', ');"
1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 1
If you want only the first 10 di
On Sat, Aug 21, 2021 at 12:50:21PM -0700, Joseph Brenner wrote:
> But then, in a case like this one, how would you know in advance
> that it would work, without Just Trying It:
>
> my @monsters = < godzilla grendel wormface blob >;
> my $cool_monsters = < godzilla ghidra mothera >.Set;
>
On Mon, Aug 09, 2021 at 01:00:52PM -0700, Joseph Brenner wrote:
> There's this much:
>
> https://docs.raku.org/language/variables#index-entry-$$CIRCUMFLEX_ACCENT
>
> > If you have self-declared a parameter using $^a once, you may refer to it
> > using only $a thereafter.
>
> But it doesn't go a
On Wed, Jul 14, 2021 at 07:41:14PM +, Daniel Sockwell wrote:
> (Also, you may already know this, but when the keys of your hash are
> strings, you can write %a instead of %a{'column1'} )
A minor nit: this only works if the string keys don't contain whitespace.
(The single angle bracket postf
On Sat, Jan 30, 2021 at 05:52:54PM -0800, Joseph Brenner wrote:
> Which means there's some potential confusion if you really need
> to match quotes:
>
> my $str = 'string_632="The chicken says--", voice="high"';
>
> say
> $str ~~ m:g{ ( " .*? " ) }; # False
> say
> $str
On Fri, Jan 01, 2021 at 05:41:04PM -0800, ToddAndMargo via perl6-users wrote:
> On 1/1/21 6:32 AM, David Santiago wrote:
> > say $_ for {0.1+$_}...^5
>
> Is there a way to do this without the finger wagging?
>
> say $_ for {0.1+$_}...^2
If you're going to a sequence operator ("...") instead of a
The difference is between the result of "Nil.c" and "Any.c".
On my current version of Rakudo, "Nil.c" returns Nil, while Any.c throws the
"No such method" exception. In fact, Nil.any_non_existent method always seems
to return Nil. I'm not sure where this is documented, but it's likely the
re
On Mon, Oct 26, 2020 at 08:04:21PM +0100, Elizabeth Mattijsen wrote:
> > On 26 Oct 2020, at 18:40, Sean McAfee wrote:
> > Is this the intended behavior? The doc page on quoting constructs
> > just says that values can be interpolated with braces, but (at least
> > to my eyes) doesn't suggest th
On Fri, Sep 25, 2020 at 12:37:49PM +0200, Elizabeth Mattijsen wrote:
> > On 25 Sep 2020, at 04:25, Brad Gilbert wrote:
> > Rakudo does not use ICU
> >
> > It used to though.
> >
> > Rakudo used to run on Parrot.
> > Parrot used ICU for its Unicode features.
>
> I do remember that in the Parrot
The "any" function is just like any other function taking an arbitrary list of
arguments (including user-defined functions). As such it parses with lower
precedence than comparison operators -- so "eq" binds more tightly than "any".
Thus
say so any eq any ;
parses like
say(so(any( eq
On Mon, May 25, 2020 at 12:07:22AM +0200, Tobias Boege wrote:
> @things.sort: {
> .comb(/ \d+ | \D+ /)
> .map({ .Int // .self })
> }
Or how about even somethig like
@things.sort: *.Version;
which does handle a reasonable set of version semantics...?
(The .Version method was
On Thu, May 21, 2020 at 08:40:08PM +, David Santiago wrote:
> Can someone explain me why my grammar isn't working? Unfortunately i
> can't figure it out :-(
>
> | headers
> | | header
> | | * MATCH "Proxy-Connection"
> | | header-value
> | | * MATCH "keep-alive\n"
> | | crlf
> | |
"say $x" is essentially equivalent to "put $x.gist".
Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a
string value of "Nil" and can be printed. However, attempting to convert Nil
directly into a Str throws an error because that's attempting to stringify an
undefined
On Wed, Feb 12, 2020 at 10:27:20AM -0300, Aureliano Guedes wrote:
> So, I'd like to find a way to test if two variables are bound or not,
> especially concerning their memory address.
>
> If the address is not fixed for a lifetime, I must be able to test it in
> just one cycle.
> > $a.WHERE == $b.
Because Str is treated as a set of graphemes, and "\r\n" is treated as a single
character, .substr() is doing the right thing here.
If you really want to treat it as a series of codepoints, you may want to go
through Blob/Buf to get there:
> "1234\r\n78".encode.subbuf(*-4)
utf8:0x<0D 0A
FWIW, at one time there was discussion that "" and ""
are actually keywords and not typical method calls that can be overridden,
precisely so optimizations can be made. They're that important to
efficient running of the regexes.
I'm not sure that a formal decision was ever made on this, however
My guesses at Perl 6 versions of the Perl 5 example:
say .split(':')[0, 2, 1, 5].join("\t") for lines;
-or-
for lines { say .split(':')[0, 2, 1, 5].join("\t") }
Pm
On Mon, Jul 29, 2019 at 12:49:51PM -0700, William Michels via perl6-users wrote:
> Hello, Just a short backgrounder to say
The (.*?) pattern will match an empty string.
Thus $0 gets the dollar sign, $1 is "", and "$" ~ "" (i.e., "$") gets replaced
by "" ~ "USD" (i.e., "USD").
So the net result is to replace the single dollar sign by "USD", resulting in
"USD1.23".
You might want to remove the ? modifier from .*?
On Wed, Feb 06, 2019 at 12:38:01PM -0800, ToddAndMargo via perl6-users wrote:
> $ p6 'my Str $x="abcd"; for $x.comb.kv -> $i, $j {say "Index <$i> = <$j> =
> ord <" ~ ord($j) ~ ">";}'
>
> Index <0> = = ord <97>
> Index <1> = = ord <98>
> Index <2> = = ord <99>
> Index <3> = = ord <100>
>
> Cer
The issue doesn't seem to be the underscore, because I get the same result even
when converting the underscore into a letter ('b'):
$ cat gentb.p6
grammar G0 {
token TOP {|.*}
regex rport { }
rule ruport { }
#token type {+}
token type {+}
}
grammar G1 {
The issue doesn't seem to be the underscore, because I get the same result even
when converting the underscore into a letter ('b'):
$ cat gentb.p6
grammar G0 {
token TOP {|.*}
regex rport { }
rule ruport { }
#token type {+}
token type {+}
}
grammar G1 {
I suspect the rule:
rule other { . }
means that in
$input = '~i << to
match (although will also end up matching the space after the "i" in
the text string, since white spaces are no longer significant). Or try just
changing the rule to be a token and leave the others as rules.
Ph
we could use Thunk as a type:
>
> sub infix:(Thunk:D $block, $otherwise) { }
>
> which would then allow you to do:
>
> my $sixdivzero = divide(6,0) rescue -1; # note absence of curlies
>
>
>
> One can wish, can’t one?
>
>
> Liz
>
> > On 3 Aug 2
Maybe something like...?
$ cat t.p6
sub infix:(Callable $block, $otherwise) {
CATCH { return $otherwise; }
$block();
}
sub divide($a, $b) { die "Zero denominator" if $b == 0; $a / $b }
my $sixdivzero = { divide(6,0) } rescue -1;
say "6/0 = ", $sixdivzero;
my $sixdivtwo = { divide(6,2) }
The + essentially indicates that this is a character-class match. It's to
distinguish things from <.alpha>, , , <-alpha>, and
(among others).
Pm
On Fri, Aug 03, 2018 at 08:48:24PM +0200, Timo Paulssen wrote:
> The + is required, perhaps because the first character after the opening
> < is sup
On Tue, Jul 31, 2018 at 09:28:08PM +0200, Marc Chantreux wrote:
> @*ARGS.map: {
> gather {
> my @lines;
> for .IO.lines -> $l {
>if /'›'/ {
>@lines and take @lines;
>@lines = $l;
>}
>else {
>@lin
On Wed, Jul 25, 2018 at 11:48:30AM -0700, ToddAndMargo wrote:
> Maybe I am trying to get "-c" to do too many things.
>
> What I would like it to do is to check everything right up to but not
> actually run the program.
Part of the challenge here is that unlike many other programming languages,
P
On Sun, May 20, 2018 at 03:02:34PM -0700, ToddAndMargo wrote:
> On 05/20/2018 10:40 AM, Patrick R. Michaud wrote:
> > On Fri, May 18, 2018 at 03:28:20PM +0200, Timo Paulssen wrote:
> > > On 18/05/18 13:30, The Sidhekin wrote:
> > > >
> > > > / ^ &l
On Fri, May 18, 2018 at 03:28:20PM +0200, Timo Paulssen wrote:
> On 18/05/18 13:30, The Sidhekin wrote:
> >
> > / ^ <[d..z]>* $/
>
> That's pretty good! Putting the beginning-of-string anchor ^ anywhere
> but the very start is surely an advanced move :)
FWIW, sometimes I think it's worth invert
On Wed, Feb 14, 2018 at 05:55:54PM +, raiph mellor wrote:
> (Perl) Rakudo
> ===
>
> If jnthn and pmichaud and larry can warm to this idea, then:
> [...]
> The 'Perl' could be dropped from Rakudo specific propaganda,
> calling the language just Rakudo instead, to reinforce that it refer
On Fri, Sep 15, 2017 at 04:54:33PM -0400, Brandon Allbery wrote:
> On Fri, Sep 15, 2017 at 4:51 PM, ToddAndMargo wrote:
> > On 09/15/2017 01:29 PM, Brandon Allbery wrote:
> >> Everyone does at one time :) It's really useful for debugging, but you
> >> generally strip it out of production code.
> >
On Mon, Sep 11, 2017 at 09:48:01AM -0700, Dan Zwell wrote:
>
> `|` matches the longest input:
> > 'ab' ~~ / ^:ratchet [ . | .. ] $ /
> 「ab」
>
> If the regex contains empty code blocks, backtracking fails:
> > 'ab' ~~ / ^:ratchet [ {}. | {}.. ] $ /
> Nil
Isn't the whole point of :ratchet to turn
On Mon, Sep 11, 2017 at 09:48:01AM -0700, Dan Zwell wrote:
>
> `|` matches the longest input:
> > 'ab' ~~ / ^:ratchet [ . | .. ] $ /
> 「ab」
>
> If the regex contains empty code blocks, backtracking fails:
> > 'ab' ~~ / ^:ratchet [ {}. | {}.. ] $ /
> Nil
Isn't the whole point of :ratchet to turn
How about...
$ echo "a b c d" | ./perl6 -n -e '.words[1].say'
b
Pm
On Fri, Aug 04, 2017 at 01:00:52PM -0700, ToddAndMargo wrote:
> Hi All,
>
> How do I do this with a perl one liner?
>
> $ echo "a b c d" | awk '{print $2}'
> b
>
> Many thanks,
> -T
The details of how to use the star GitHub repository are in
tools/star/release_guide.pod .
You're entirely welcome to create a bundling that has a better build system
than what Rakudo Star uses -- indeed, Rakudo Star has always been intended to
be just one of many possible bundlings of Rakudo a
On Wed, Jul 05, 2017 at 06:10:42PM -0700, Will Coleda via RT wrote:
> On Wed, 05 Jul 2017 09:16:44 -0700, tbrowder wrote:
> > Given this invocation for a new installation of rakudo:
> >
> > perl Configure.pl --backend=moar --gen-moar --prefix=/some/dir
> >
> > /some/dir needs to exist and belo
On Wed, Jul 05, 2017 at 06:10:42PM -0700, Will Coleda via RT wrote:
> On Wed, 05 Jul 2017 09:16:44 -0700, tbrowder wrote:
> > Given this invocation for a new installation of rakudo:
> >
> > perl Configure.pl --backend=moar --gen-moar --prefix=/some/dir
> >
> > /some/dir needs to exist and belo
On Wed, Jun 14, 2017 at 04:00:05PM +0300, Gabor Szabo wrote:
> In the python interactive shell one can write dir(object) and it
> lists the attributes and methods of the object. One can write
> help(object) and get the documentation of the object.
> Is there anything similar in Perl 6?
I think th
On Wed, May 31, 2017 at 09:33:59AM -0400, Brock Wilcox wrote:
> One of my dreams is to adopt a client/server + middleware model from nREPL
> (clojure) which I think works really well, and likely to do that in
> userspace as a regular module. Moving everything into REPL.pm (perl6
> instead of nqp) l
On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote:
> given an object $o and the name of a method in $method = "run"
> how can I invoke the $o.run() ?
>
> Something like $o.call($method)
At one point it was done as $o."$method"() .
> my $method = 'say'; 123."$method"();
123
Pm
Since we went to a lot of trouble to get lexical and closures to work correctly
in Perl 6, it seems fair to use it here:
$ cat rxstr
sub rxstr($s) { rx/<$s>/ }
my $str = 'foo';
my $foorx = rxstr($str); # create /foo/ regex
say 'foo' ~~ $foorx; # matches
$
On Tue, Mar 21, 2017 at 02:46:43PM -0400, Brandon Allbery wrote:
> On Tue, Mar 21, 2017 at 2:37 PM, Patrick R. Michaud
> wrote:
> > > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo
> > wrote:
> > > > $Name.IO.f or $Name.IO.open(:w).close;
> > >
> >
On Tue, Mar 21, 2017 at 02:25:02PM -0400, Brandon Allbery wrote:
> On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo wrote:
> > $Name.IO.f or $Name.IO.open(:w).close;
>
> fwiw I consider this a perl3_to_5-ism; it's an optimization, and a fairly
> poor one for readability and maintainability, but one
On Mon, Mar 20, 2017 at 02:36:49PM +0100, Francesco Rivetti wrote:
> On 18. mars 2017 11:54, Elizabeth Mattijsen wrote:
>
> > if (my $x = frobnicate(42)) {
> > say $x
> > }
> [...]
> > if frobnicate(42) -> $x {
> > say $x
> > }
>
> which is way more elegant. Should this make it wise to ha
I think the canonical Perl 6 answer is:
for @array.kv -> $index, $value { do something }
Pm
On Tue, Feb 28, 2017 at 01:20:47PM -0800, ToddAndMargo wrote:
> Hi All,
>
> There are times when I want to know th4e index of an array
> when I am in a "for @array" loop. I can do it with a
> variab
On Fri, Oct 07, 2016 at 12:18:43PM -0700, Aaron Sherman wrote:
> [15:12] m: say ((2**80) ..^ (2**81)).pick.base(2)
> [15:12] <+camelia> rakudo-moar 605f27:
> OUTPUT«100011101100100110010001010110101101010011001»
>
> The middle part is always a large number of
On Mon, Oct 03, 2016 at 04:26:10PM +0200, Elizabeth Mattijsen wrote:
> > On 02 Oct 2016, at 11:00, Thor Michael Støre wrote:
> > Is this normal startup performance?
>
> https://www.promptworks.com/blog/public-keys-in-perl-6
>
> I wonder what would be needed to run this in Perl 5, module wise, an
On Sun, Oct 02, 2016 at 11:00:38AM +0200, Thor Michael Støre wrote:
> Thormicks-MacBook-Pro-3:~ thormick$ time perl6 -e "say 'foo'"
> foo
>
> real 0m0.205s
> user 0m0.150s
> sys 0m0.045s
>
> [...]
>
> Foo indeed! ~200ms for this seems awfully slow to me.
On another hand, my machine shows:
$
On Thu, Sep 29, 2016 at 01:30:29PM +0200, Joachim Durchholz wrote:
> Can you tell me where the sources for the regex engine live? At the
> detailed-technical-spec level, I found S05, and I can find the NQP spec, but
> I don't know my way around the interpreter sources yet.
The regex engine lives i
A simpler approach might be to build an NQP that runs on the JVM, and
find a way to call into it. (The Perl 6 regular expression engine is
written in NQP.)
Pm
On Wed, Sep 28, 2016 at 09:21:50AM -0400, Will Coleda wrote:
> To start with, there isn't a PCRE6.
>
> If you want, more generically, to
On Sat, Sep 24, 2016 at 07:37:52AM +, Lloyd Fournier wrote:
> I think this is because .WHAT is a special case. It's not really a method
> which is what you need to make *.method work. *.WHAT will always return
> (Whatever) immediately.
You're correct that .WHAT is a special case. From S12, "I
On Sat, Sep 24, 2016 at 07:37:52AM +, Lloyd Fournier wrote:
> I think this is because .WHAT is a special case. It's not really a method
> which is what you need to make *.method work. *.WHAT will always return
> (Whatever) immediately.
You're correct that .WHAT is a special case. From S12, "I
On Wed, Sep 14, 2016 at 05:10:55PM -0700, Zoffix Znet wrote:
> m: my $input = '(\d\d\d)'; my $m = 'a 123' ~~ /<$input>/; dd
> [$m.list];
> rakudo-moar 2c95f7: OUTPUT«[]»
>
>
> Expected results: output is the same, as the $input contains a capture that
> should capture stuff when interpolated
I don't have an example handy, but I can categorically say that
Perl 6 grammars are designed to support exactly this form of parsing.
It's almost exactly what I did in "pynie" -- a Python implementation
on top of Perl 6. The parsing was done using a Perl 6 grammar.
If I remember correctly, Pynie
On Tue, Sep 13, 2016 at 10:35:01AM -0400, Bennett Todd wrote:
> Having the minutia of the programmatic run-time state of the parse then
> influence the parse itself, is at the heart of the perl5 phenomenon "only
> Perl can parse perl", which I rather hope isn't going to be preserved in
> perl6.
On Tue, Aug 30, 2016 at 07:00:43PM -0700, Zoffix Znet via RT wrote:
> So far I think the original RFC to make .. a numeric operator is out.
> There's still an issue with .. not using .succ on strings. Does anyone
> know why that is the case? The templating example I presented is still
> valid wi
On Thu, Aug 25, 2016 at 10:37:45AM -0700, Dipesh Sharma wrote:
> Dependency on perl5 for building perl6 looks like a concern. It means that
> we can't have and environment with perl6, without perl5.
I disagree. Just because perl5 is currently required to *build* Rakudo
doesn't mean that perl5 h
On Tue, Aug 23, 2016 at 10:28:26AM -0700, Will Coleda via RT wrote:
> > Where the expectation is that the first call to the foo will return an
> > undefined value; in nom, it returns 0.
>
> This behavior has been in place for years now, since before Christmas.
>
> Tagging [@LARRY] to get a ruling
On Thu, Aug 18, 2016 at 10:38:57AM -0400, Brandon Allbery wrote:
> On Thu, Aug 18, 2016 at 9:13 AM, Claudio
> wrote:
>
> > Tools like vim-syntastic and atom use 'perl6-c' (the only valid linter for
> > now) to report syntax errors. Because "perl6 -c" executes code (BEGIN and
> > CHECK blocks as d
On Thu, Aug 04, 2016 at 09:54:54PM +0100, Zefram wrote:
> Patrick R. Michaud wrote:
> >So are you looking for...?
>
> No. I want a writable reference that I can pass around as a value,
> store in a data structure, and so on. The Scalar object obtained by
> "$a.VAR&quo
On Thu, Aug 04, 2016 at 09:36:18PM +0100, Zefram wrote:
> Yeah. Let me try to make it clearer. In the above situation, with
> a reference to $a's Scalar container in $b, I'd like to achieve what
> the assignment "$a = 5" would, but by an operation using $b and not
> directly mentioning $a. The r
On Tue, Aug 02, 2016 at 07:46:20PM +0100, Zefram wrote:
> > sprintf("%f", 2e0**70)
> 118059162071741000.00
>
> >In particular, the true value is *not* always available,
>
> By "true value" I meant the value represented in floating point.
My apologies, I did not catch this meaning of "tru
On Tue, Aug 02, 2016 at 07:32:56PM +0100, Zefram wrote:
> Patrick R. Michaud via RT wrote:
> >I don't know that we should expect .perl or any other operation on Num
> >values to be preserving more precision than that.
>
> I'd expect .perl to preserve whatever
On Tue, Aug 02, 2016 at 10:55:34AM -0700, Zefram wrote:
> These literals work fine in other contexts:
>
> > my $a = 1180591620717411303424e0
> 1.18059162071741e+21
> > my $b = 1180591620717409992704e0
> 1.18059162071741e+21
> > $a.Int
> 1180591620717411303424
> > $b.Int
> 1180591620717409992704
>
On Tue, Aug 02, 2016 at 09:56:38AM -0700, Zefram wrote:
> > (1180591620717411303424.0e0).Int
> 1180591620717411303424
> > sprintf("%f", 1180591620717411303424.0e0)
> 118059162071741000.00
>
> sprintf %f is not showing the true value of this Num, which it should.
> The .Int coercion is corr
My short answer would be that there's not a shortcut way in NQP
to avoid the fully-qualified sub names. I'm doubtful that we want
to duplicate Perl 6's import mechanism into NQP.
Pm
On Fri, Jul 22, 2016 at 07:48:55AM -0500, Tom Browder wrote:
> ping
>
> On Thu, Jul 7, 2016 at 7:49 AM, Tom Browd
On Tue, Jul 12, 2016 at 08:48:59AM -0500, Tom Browder wrote:
> > If --help mentions a man page, it's probably sufficient to ship Rakudo
> > with an already-translated man page, rather than shipping the translator.
>
>Very true--the voice of reason!
>
>But shouldn't all the pod6-to-X trans
I think any pod2man translator program should be separate from Rakudo itself.
If --help mentions a man page, it's probably sufficient to ship Rakudo
with an already-translated man page, rather than shipping the translator.
Pm
On Tue, Jul 12, 2016 at 04:34:00AM -0500, Tom Browder wrote:
>On M
On Sat, Jul 09, 2016 at 05:19:49AM -0700, Itsuki Toyota wrote:
> See the following results
>
> $ perl6 -e 'say -1 ** -0.1'
> -1
> $ perl6 -e 'say reduce * ** *, -1, (-0.1)'
> NaN
This is not a bug in "reduce" itself. Exponentiation has higher
precedence than unary minus, so the first expression
On Sat, Jul 09, 2016 at 05:19:49AM -0700, Itsuki Toyota wrote:
> See the following results
>
> $ perl6 -e 'say -1 ** -0.1'
> -1
> $ perl6 -e 'say reduce * ** *, -1, (-0.1)'
> NaN
This is not a bug in "reduce" itself. Exponentiation has higher
precedence than unary minus, so the first expression
Dynamic subregexes such as <$top> are non-capturing by default. You can easily
capture the result by using something like instead:
$ cat xyz.p6
my $match;
my $top = rx/ \( $ = [ \w* ] \) /;
given "(abc)" {
$match = m/^ /;
}
if $match {
say
On Thu, Jan 21, 2016 at 01:39:15PM -0600, Aaron Baugher wrote:
> Tom Browder writes:
>
> > Thanks, Aaron, good explanation. But can you find a description of
> > '<->' in the Perl 6 docs?
>
> It's mentioned here: https://doc.perl6.org/language/control#for
>
> And here, where it's called the "d
While I recall that we've often discussed building command history into
Rakudo's REPL directly, the workaround suggested to me was to use 'rlwrap':
$ rlwrap ./perl6
Then the arrow keys work, as well as CTRL-P and other bash-like history
commands. I've never used CTRL-K for history, but rlw
On Thu, Dec 31, 2015 at 04:13:40PM +0900, Dan Kogai wrote:
> Anyway, is there a plan to support hexadecimal floating point support?
> % perl6 -e 'say 0x1.921fb54442d18p+1'
> ===SORRY!=== Error while compiling -e
> Malformed postfix call
> at -e:1
> --> say 0x1.⏏921fb54442d18p+1
$ ./perl6 -e 's
On Tue, Dec 29, 2015 at 01:57:57AM -0800, Darren Duncan wrote:
> On that note, are there going to be Perl 6 versions 6.x.y where {x,y} are
> integers? Will 6.0.0 be the first such one? -- Darren Duncan
This was the topic of my FOSDEM talk last year, and then again at YAPC::NA.
"Perl 6" is a lang
The standard meaning of ".roll" is to randomly select elements
from a list. So I'd expect .roll on a Range to first convert the
Range to a list of values and then select from those.
If the intent is to select from the values 0.1, 0.2, 0.3, I'd expect
the programmer to write:
(0.1, 0.2, 0.3).
I suspect that http://doc.perl6.org/language/5to6 should at
least have be a redirect to somewhere useful, if not an index
of the available 5to6 pages.
Pm
On Wed, Oct 28, 2015 at 09:22:55PM +0100, Kaare Rasmussen wrote:
> On 10/28/2015 08:31 PM, Parrot Raiser wrote:
> >This Perl 5 to 6 Translatio
On Wed, Oct 28, 2015 at 03:31:09AM +, TS xx wrote:
>
> Can I call the Person's constructor (in non static context),
> pass the required parameter and do more things before returning?
There are two answers to this question, both of which likely deserve
a few lines in doc.perl6.org/language/fa
On Tue, Oct 13, 2015 at 12:32:01AM +0200, Mark Overmeer wrote:
> Yes, that what I started realizing when I saw all the pain Perl6 goes to
> ignore the existence of a real "undef" in the language. (I follow Perl6
> from a short distance since its start, read all original designs, but
> this penny d
On Mon, Oct 12, 2015 at 09:51:13PM +0200, Mark Overmeer wrote:
> > method new(MyClassHere:U: *@args) { ... }
> >
> > in the constructor, which would be quite hostile to newbies. It's still
> > not clear to me how to avoid that.
>
> It is also unclear to me what this means. It is a method whi
On Thu, Jul 02, 2015 at 03:21:11PM -0500, Tom Browder wrote:
> Okay, a second look shows me that's not quite as bad as I first though.
Another possibility is to let MAIN unpack the args for you, but then check
the exclusivity directly instead of using multisubs to do it:
sub MAIN(:$need, :$h
On Thu, Jul 02, 2015 at 03:22:17PM -0400, Brandon Allbery wrote:
> On Thu, Jul 2, 2015 at 3:08 PM, Tom Browder wrote:
>
> > 1. Write the 'main' program as another subroutine and call it from
> > each of the appropriate multi
> > subs--aarghh!
> >
>
> This seems like the right one to me; it also
On Sat, Jun 27, 2015 at 05:39:32PM -0500, Tom Browder wrote:
> I'm trying to take advantage of the MAIN suroutine to handle most all of my
> routine command line arg handling. One idiom I use a lot is for the user
> to choose only one of two args, but one must be chosen.
Perhaps you want that the
On Wed, Jun 17, 2015 at 12:24:04AM -0500, Patrick R. Michaud wrote:
> In Rakudo unary | is a syntactic construct that can't be overloaded.
>
> So, notabug. :)
More directly to the comment about unary | possibly working outside of
argument lists, I'm not sure we want to en
On Tue, Jun 16, 2015 at 09:28:28PM -0700, Brent Laabs wrote:
> 07:02 labster m: multi sub prefix:<|> (\a) { a.flat }; say
> (|[1,2,3]).perl
> 07:02 camelia rakudo-moar d6430c: OUTPUT«5===SORRY!5=== Error while
> compiling /tmp/jvrQI4RBsSArg-flattening | is only valid in an argument
Let's not forget the raptors. (Both "Veloci" and "Utah" are candidates. :)
Pm
On Thu, Jun 11, 2015 at 07:45:06PM -0700, Darren Duncan wrote:
> Or a pumpkin for that matter, since Perl 5 is Pumpkin Perl. -- Darren Duncan
>
> On 2015-06-11 7:42 PM, Darren Duncan wrote:
> >I was going to say that
On Thu, Jun 11, 2015 at 02:53:15PM -0700, Alex Jakimenko wrote:
> say grammar Gram { regex TOP { ('XX')+ %% $=<[a..z]>* };
> }.parse('XX');
>
> Output:
> 「XX」
> 0 => 「XX」
> 0 => 「XX」
> delim => 「」
> 0 => 「XX」
> delim => 「」
> delim => 「」
>
> The order is wrong.
I'm not entirely cer
On Mon, Jun 08, 2015 at 06:08:33AM -0700, Will Coleda via RT wrote:
> I agree that this should be throwing the same conversion error.
I disagree to the extent that making min() throw the conversion error seems
to go against the purpose of designing soft/lazy Failure types into Perl 6
in the first
On Tue, Apr 14, 2015 at 08:58:27PM -0400, Nathan Gray wrote:
> I've run into a snag, in that my strptime processing in Perl 5
> relies on building a string that looks like a regex with named
> captures, and then interpolating that into a real regex.
>[...]
> my $pattern = Q/$=[hello]/;
> my
On Wed, Feb 11, 2015 at 04:21:32PM -0500, Parrot Raiser wrote:
> Not replicating the original file permissions on a copy would be a
> huge security hole. Anybody could copy a root-read-only file, examine
> the contents, modify them, and, if they had write access to the
> directory, replace it with
If you're running Rakudo on MoarVM, try the --profile option. It will create
an HTML file that shows a lot of useful information, including time spent in
each routine, call graphs, GC allocations, etc.
Pm
On Wed, Dec 31, 2014 at 09:35:33AM +0200, Gabor Szabo wrote:
> The Perl 6 Maven site is a
4 at 09:29:39AM +0200, Gabor Szabo wrote:
> No. If I remove the leading m from the regex, then the bug is gone.
> Gabor
>
> On Tue, Dec 30, 2014 at 9:19 AM, Patrick R. Michaud
> wrote:
>
> > Out of curiosity, is the bug still present if you use /\.txt$/ instead of
> &
Out of curiosity, is the bug still present if you use /\.txt$/ instead of
m/\.txt$/ ?
At the moment it looks like a Rakudo bug to me, but I haven't been able to golf
it further to be certain.
Pm
On Tue, Dec 30, 2014 at 09:11:52AM +0200, Gabor Szabo wrote:
> Just to follow-up:
> The problem a
On Fri, Oct 03, 2014 at 06:48:50AM -0700, Carl Mäsak wrote:
> m: class C { has $.sep = "|"; method foo { .say for
> "foo|bar".split(/$!sep/).map(~*) } }; C.new.foo
> rakudo-moar da3aae: OUTPUT«foo|bar»
> TuxCM: interesting.
> * masak submits rakudobug
14:09 m: class C { has $.rx = 'bc'; meth
Added tests in roast/S03-operators/set.t, marking ticket resolved.
Pm
On Wed, Oct 01, 2014 at 09:00:08PM -0700, Carl Mäsak wrote:
> m: say (^) (^)
>
> It's an interesting question in itself where the error message "Too
> many positionals passed; expected 2 arguments but got 3" comes from.
> Does the (^) operator somehow declare itself as chaining, but then has
>
On Tue, Sep 09, 2014 at 10:07:46PM +0200, Alex Becker wrote:
> Hitting the download button for Perl 6 leads to this page:
> http://rakudo.org/downloads/star/
> There is a set of undocumented files. For 2014.08, there is one msi file
> with the Suffix moar, and one with the Suffix parrot.
To avoid
On Fri, May 23, 2014 at 03:08:38PM -0400, Peter Schwenn wrote:
> Still it would be more straightforward to have something like
> $layn ~~ s:g/ (\W) [[RMA\.]? OpenNURBS\.]? I? On (<[2..4]>) dPoint
> /$0Rhino.Geometry.Point$1d/;
> and have a more perl6-built-in way of getting hold of the /replac
On Thu, Dec 19, 2013 at 11:27:32AM +0800, Richard Hainsworth wrote:
> I've been running a perl6 program that runs through a loop, dumps
> intermediate results and starts again with new initialisation
> values.
> [...]
> Looking at system resources, the program chews up memory resources
> continuall
1 - 100 of 2045 matches
Mail list logo