use multi subs, and use a catch-all candidate which
produces the error message.
multi thingy($x) { $x + 42 }
multi thingy(|c) { die Must call thingy with exactly one argument }
Multis? I guess my mind went elsewhere:
sidhekin@purplehat[00:25:02]~$ cat tom.p6
sub foo($x = (warn foo called
On Sat, Jun 13, 2015 at 12:25 PM, mt1957 mt1...@gmail.com wrote:
Can't push/unshift onto an array of pairs!
Below a repl session with pushes
my @p = a = 1, b = 2;
a = 1 b = 2
@p.push(x=1);
a = 1 b = 2
That's not pushing a pair – that's pushing nothing (no positionals) with
a named
On Tue, Sep 1, 2015 at 5:41 PM, Matija Papec wrote:
> Scoping of lexical looks interesting
>
> perl6 -ne 'my %d; %d{ .words[1] }++; END { %d.sort.perl.say }'
>
> as this could not work in perl5
>
> perl -nE 'my $d =1; END { say $d//"default!" }' # gives default
>
It's
On Wed, Sep 2, 2015 at 7:49 AM, Matija Papec wrote:
>
> I've picked a wrong example,
>
> seq 3 | perl -nE 'my %d; $d{$_}++; END { say keys %d }'
>
> vs
>
> seq 3 | perl6 -ne 'my %d; %d{$_}++; END { say keys %d }'
>
> So it seems that perl6 handles lexicals inside while
On Tue, Mar 21, 2017 at 7:28 PM, Brandon Allbery
wrote:
> On Tue, Mar 21, 2017 at 7:50 AM, Elizabeth Mattijsen
> wrote:
>
>> $PathAndName.IO.open(:w).close unless $PathAndName.IO.f;
>
>
> This has a readability issue, though: you've buried the lede.
On Wed, Jun 21, 2017 at 1:35 PM, Luca Ferrari wrote:
> > I like Geany, but it does not support the "Secondary Selection"
> > clipboard. This clipboard would save me a bunch of time as
> > I would not lose my cursor hot spot.
>
> Emacs
On Mon, Sep 11, 2017 at 10:01 PM, Marc Chantreux wrote:
> hello,
>
> doing maths with my kid, i just translated his spreadsheet with those
> lines of haskell:
>
> rebonds height loss = height : rebonds (height - height * loss)
> loss
> main = print $ takeWhile
On Thu, May 17, 2018 at 12:51 PM, Timo Paulssen wrote:
> character classes are fundamentally the wrong thing for "phrases", since
> they describe only a character.
>
You were right the first time.
> Your current regex (before changing [gm] to ["gm"]) was expressing "from
>
On Thu, Jun 14, 2018 at 8:01 AM, Todd Chester wrote:
>
>
> On 06/13/2018 12:27 PM, Brandon Allbery wrote:
>
>> use MONKEY-SEE-NO-EVAL;
>>
>
> Thank you. Someone had fun with that name!
>
> Do I presume there is not other way around the issue?
>
That depends on your use case. EVAL/eval is
On Sat, Jun 16, 2018 at 5:19 PM, Brandon Allbery
wrote:
> Something's wrong with the data file you are reading. Perl 6 is expecting
> UTF-8 encoding and getting something else (usually an ISO-8859 encoding).
>
Are you sure it's a data file? I thought I recognized that code, and it
was
On Tue, Jun 12, 2018 at 9:18 PM, Brad Gilbert wrote:
> On Tue, Jun 12, 2018 at 1:19 PM, Joseph Brenner wrote:
> > Attention conservation: it's unlikely I'm going to say something
> > interesting you haven't thought of already.
> >
> > A side-discussion that came up here: should you ask
On Thu, Jun 14, 2018 at 7:57 PM, Brandon Allbery
wrote:
> You can never be certain in *any* case. Check if you're not sure what it
> means. Because sometimes languages use some term in a way you don't expect,
> whether because they drew it from some specific discipline (Haskell uses a
> lot of
On Thu, Jun 14, 2018 at 7:21 PM, ToddAndMargo wrote:
> 2) what the heck is a "pragma"? Way to obscure.
>
I thought you knew. From the Perl 5 documentation: "A pragma is a module
which influences some aspect of the compile time or run time behaviour of
Perl, such as strict or warnings."
On Thu, Jun 14, 2018 at 7:46 PM, ToddAndMargo wrote:
> On 06/14/2018 10:43 AM, The Sidhekin wrote:
>
>>
>>More relevant, Perl 6 documentation: https://docs.perl6.org/languag
>> e/pragmas
>>
>
> You are presuming I knew the word was a Perl word.
> I
On Thu, Jun 14, 2018 at 6:11 PM, Timo Paulssen wrote:
> If it's literally just the name of a sub that you'll immediately invoke,
> you can side-step EVAL completely
>
> ::('&' ~ $RunSpecific)()
>
> should do the trick.
>
I haven't been much into Perl 6 lately, but isn't this just the same
On Mon, Sep 3, 2018 at 10:50 PM Curt Tilmes wrote:
> On Mon, Sep 3, 2018 at 4:28 PM Parrot Raiser <1parr...@gmail.com> wrote:
>
>> If I understand that correctly, "die" needs to be documented as always
>> outputting the line number, and that for user-oriented messages, one
>> of the other
On Wed, Sep 26, 2018 at 8:58 AM Todd Chester wrote:
> Hi All,
>
> Over on
> https://docs.perl6.org/routine/words
> I see
>
> multi method words(Str:D $input: $limit = Inf --> Positional)
>
> HOW IN THE WORLD did they convert `$limit = Inf` into an
> array index!?!?!
>
It's not. It's
On Wed, Sep 26, 2018 at 11:40 PM ToddAndMargo wrote:
> What I don't understand is:
>
> multi method words(Str:D $input: $limit = Inf --> Positional)
>
> Specifically "$limit = Inf". Why are we using "$limit" instead
> of "$selection"
>
Perhaps this would be easier if you explain where
On Thu, Sep 27, 2018 at 3:03 AM ToddAndMargo wrote:
> On 9/26/18 5:55 PM, Curt Tilmes wrote:
> > You are calling [] on the thing that the methods return.
>
> Yes, I know. And it is human readable too. It is one of the
> many reasons I adore Perl 6.
>
> Where in
> multi method words(Str:D
On Thu, Sep 27, 2018 at 2:49 AM ToddAndMargo wrote:
> On 9/26/18 4:33 PM, The Sidhekin wrote:
> > On Wed, Sep 26, 2018 at 11:40 PM ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote:
>
> > And where is it stated wha
On Thu, Sep 27, 2018 at 3:14 AM Peter Scott wrote:
> On 9/26/2018 3:21 PM, ToddAndMargo wrote:
> > Do your really think any beginner would be able to figure out
> > "words" from the above?
>
> If the beginner had studied the metasyntax of function prototypes,
> probably.
Yeah, that's where a
On Sun, Sep 16, 2018 at 3:45 PM Parrot Raiser <1parr...@gmail.com> wrote:
> -- Forwarded message --
> From: Parrot Raiser <1parr...@gmail.com>
> Date: Sun, 16 Sep 2018 09:41:44 -0400
> Subject: Re: escape codes
> To: ToddAndMargo
>
> Those (\t & \n) aren't "escape characters",
On Fri, Feb 8, 2019 at 7:36 AM Todd Chester via perl6-users <
perl6-users@perl.org> wrote:
> I am dealing with a Buf what includes 32 bit integers, but
> they are entered somewhat backwards as view with hexedit:
>
> AE 5D 5C 72 represents the number 725C5DAE
>
> This is what I have come up with
On Tue, Sep 3, 2019 at 8:37 AM yary wrote:
> I see. And that's discussed here (had to really look for it):
>> https://docs.perl6.org/language/regexes#Quoted_lists_are_LTM_matches
>> At first I was looking further down in the "Regex interpolation"
>> section, where it's also touched on, though I
On Tue, Sep 3, 2019 at 8:18 PM William Michels
wrote:
> PS Eirik, I think people might be referring to <{...}> as "pointy
> blocks", but I'm really not sure... .
>
I'm pretty sure Perl6 pointy blocks still refer to block constructors
with signatures, like: C<< my $add = -> $a, $b = 2 { $a +
On Mon, Sep 2, 2019 at 1:12 AM Joseph Brenner wrote:
> I was just trying to run Simon Proctor's solution, and I see it
> working for Yary's first case, but not his more complex one with
> problem characters like brackets included in the list of characters.
>
> I don't really see how to fix it,
On Mon, Dec 2, 2019 at 11:07 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
>
> What is the world is the Q doing in Q'\'?
>
https://docs.perl6.org/language/quoting
It would be clearer to write it as Q[\], I guess.
Eirik
On Thu, Nov 28, 2019 at 2:53 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> Is there a way I can tell words that I want "fg hi" to
> be considered one word? A way to make the separator
> two or more spaces?
>
I don't think you can pass a separator to words. But you can
On Mon, Jan 13, 2020 at 8:51 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> On 2020-01-13 11:10, ToddAndMargo via perl6-users wrote:
> >
> > https://docs.raku.org/type/UInt
> > Subset UInt
> > Unsigned integer (arbitrary-precision)
> > The UInt is defined as a subset
On Mon, Jan 13, 2020 at 10:46 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> On 2020-01-13 12:43, The Sidhekin wrote:
>
> On Mon, Jan 13, 2020 at 8:51 PM ToddAndMargo via perl6-users <
> perl6-users@perl.org> wrote:
>
>> In https://docs.rak
On Tue, Jan 14, 2020 at 1:25 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> On 2020-01-13 15:16, Laurent Rosenfeld via perl6-users wrote:
> > The way you consistently mixed up uint and Uint in the last hours,
> > despite having been warned about this mistake, also shows a lack
On Sat, Nov 20, 2021 at 9:03 PM Marc Chantreux wrote:
> > > method col:sym ($/) { .make ~S:g/'""'/"/ }
> > That's not working for me. I'm on Moar (2021.06).
>
> works for me with:
>
method col:sym ($_) { .make: ~S:g/'""'/"/ }
>
Yeah, you got it wrong the first time. To explicate, the
On Wed, Sep 7, 2022 at 6:27 PM Parrot Raiser <1parr...@gmail.com> wrote:
> >
> > That said, right now gmail is claiming whipupitude is misspelled...
> >
> An alternative is "whipitupitude" (the difference being the first "it".
>
> Given the examples I've seen over the years, there's a need for an
On Fri, Dec 30, 2022 at 8:51 PM Vadim Belman wrote:
> It is not "untrue". The sequence you produced goes nowhere. Thus the sink
> context.
>
"Sink context" is true.
"Useless use" is debatable, at least.
Eirik
34 matches
Mail list logo