Re: variable as subroutine?

2020-02-10 Thread Marc Chantreux
hello ToddAndMargo, > Can I declare a subroutine as a variable? just use the callable sigil (https://docs.perl6.org/type/Callable). those are 3 ways to write the same sub: sub foo ($x) { $x * $x } my = -> $x { $x * $x } my = * * *; regards, marc

How do I contact the moderator?

2020-02-10 Thread ToddAndMargo via perl6-users
Hi All, I have been getting a strange eMail on this group. How do I contact the moderator to check and see if it is a scam? Many thanks, -T

variable as subroutine?

2020-02-10 Thread ToddAndMargo via perl6-users
Hi All, Is Larry using his magic powder again? Can I declare a subroutine as a variable? my $abc = my sub (UInt $u, Str $s, Int $I) { How would I use it? And why would do such a thing? -T

Re: printf question

2020-02-10 Thread ToddAndMargo via perl6-users
On 2020-02-10 03:18, Timo Paulssen wrote: Hope that's interesting Very! :-)

Re: Substr behaviour with CRLF

2020-02-10 Thread David Santiago
Thanks for the help. I do agree with Paul that something should be mentioned in the substr documentation. David Santiago -- Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: Substr behaviour with CRLF

2020-02-10 Thread Patrick R. Michaud
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

Re: Substr behaviour with CRLF

2020-02-10 Thread Paul Procacci
Unicode conformance requires "\r\n" to be interpreted as \n alone. With that said; no, I don't not know how to turn this off. I personally think I'd consider this a bug. If not a bug, greater documentation efforts that explain this. The display routines (say / print) don't modify the string on

Re: printf question

2020-02-10 Thread Paul Procacci
Thanks Timo, I was, in part, aware of this, but didn't have the full knowledge/details as you've explained it. Thanks! On Mon, Feb 10, 2020 at 6:18 AM Timo Paulssen wrote: > Hi Paul and Todd, > > just a little extra info: the limitation for nameds to come after > positionals is only for

Re: Substr behaviour with CRLF

2020-02-10 Thread David Santiago
A 10 de fevereiro de 2020 16:57:55 CET, David Santiago escreveu: > > >Hi! > >Is there a way to change the the following behaviour, so it considers \r\n as >two characters when using substr, instead of one? > >On raku version 2019.11 > >> "1234\r\n". substr(*-4) >4 >78 >> "1234\r\n".

Substr behaviour with CRLF

2020-02-10 Thread David Santiago
Hi! Is there a way to change the the following behaviour, so it considers \r\n as two characters when using substr, instead of one? On raku version 2019.11 > "1234\r\n". substr(*-4) 4 78 > "1234\r\n". substr(*-4).ords() (52 13 10 55 56) Best regards, David Santiago -- Sent from my

Re: printf question

2020-02-10 Thread Timo Paulssen
Hi Paul and Todd, just a little extra info: the limitation for nameds to come after positionals is only for declarations of signatures. Usage of subs/methods as well as capture literals (which you don't use often, i imagine, so feel free to disregard) allow you to mix nameds and positionals

Re: printf question

2020-02-10 Thread ToddAndMargo via perl6-users
On 2020-02-09 22:48, Paul Procacci wrote: Named parameters must come after all positional parameters. Your example subroutine is invalid for this reason, while the following would be fine: sub abcdefg( $b, $f, $g, :$a, :$c, :$e) abcdefg("position1", "position2", "position3", :e("named_e"),