»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
cpan-p6 New module released to CPAN! Async::Workers (0.0.5) by 03VRURG 00:32
Xliff m: my @a = ( [1, 2], [3, 4], [5, 6]); say @a.all.elems 01:01
camelia all(2, 2, 2)
Xliff m: my @a = ( [1, 2], [3, 4], [5, 6]); say @a.all.elems == 2
camelia all(True, True, True)
Xliff m: my @a = ( [1, 2], [3, 4], [5, 6]); say so @a.all.elems == 2 01:02
camelia True
Xliff m: my @a = ( [1, 2], [3, 4], [5, 6]); say so @a.all.elems == 2; sub a ( @a where *.all.elems == 2) { say 'Hi!' }; a(@a) 01:02
camelia True
Hi!
Xliff m: constant C = 10; say ^C; 01:03
camelia ^10
Xliff m: constant C = 10; say ^C.eager;
camelia ^1
Xliff m: constant C = 10; say (^C); 01:04
camelia ^10
Xliff m: constant C = 10; say (^10);
camelia ^10
Xliff m: say (^10);
camelia ^10
Xliff m: say ^10;
camelia ^10
Xliff m: say ^10.eager;
camelia Potential difficulties:
Precedence of ^ is looser than method call; please parenthesize
at <tmp>:1
------> 3say ^107⏏5.eager;
^1
Xliff m: say (^10).eager;
camelia (0 1 2 3 4 5 6 7 8 9)
Xliff m: say (^10);
camelia ^10
cpan-p6 New module released to CPAN! FindBin::Dirs (1.0.0) by 03LEMBARK 01:36
Xliff m: constant N = 10; .say for ^N; 02:29
camelia 0
1
2
3
4
5
6
7
8
9
holyghost . 05:37
yoleaux 14 May 2019 20:35Z <Xliff> holyghost: Please send me an email with that request. Thanks.
14 May 2019 21:17Z <Xliff> holyghost: scsh is not found via apt.
holyghost .tell Xliff, ok then the scsh package has been removed from ubuntu packages 05:38
yoleaux holyghost: What kind of a name is "Xliff,"?!
holyghost .tell Xliff ok then the scsh package has been removed from ubuntu packages
yoleaux holyghost: I'll pass your message to Xliff.
holyghost hi btw
.tell Xliff I'll try to hack it up locally (in my home dir) but it has shell and makefile problems as it's more or less a BSD system. I need it for my scsh MUD/MOO 05:43
yoleaux holyghost: I'll pass your message to Xliff.
holyghost .tell Xliff I have to keep my hand in other programming languages 05:44
yoleaux holyghost: I'll pass your message to Xliff.
holyghost hail! 06:04
masak I think I found a Unicode bug in perlcon.eu: if you go to perlcon.eu/talk/75 and click the "蝶" tag, you get "There are no talks submitted with this tag yet." 06:22
tadzik oh it's 1 month left to submit a talk! 06:23
holyghost I'd like to be at perlcon EU but I don't have the money or car to get there 06:30
I hope they all have a good time, especially a hack room :-) 06:31
It's about 200 euros to get a train ticket from here to Riga 06:33
elcaro .tell lizmat in Map::Agnostic lib, you need to bump version in the `use Hash::Agnostic` line 06:57
yoleaux elcaro: I'll pass your message to lizmat.
Geth ¦ doc: antoniogamiz self-assigned Spin off Pod::Convenience github.com/perl6/doc/issues/2696 08:58
cpan-p6 New module released to CPAN! Map::Agnostic (0.0.3) by 03ELIZABETH 09:25
lizmat elcaro++ # thanks 09:30
yoleaux 06:57Z <elcaro> lizmat: in Map::Agnostic lib, you need to bump version in the `use Hash::Agnostic` line
nadim_ Morning 09:50
m: dd a => (< a >, b => 2)
camelia block <unit>()
nadim_ founf another dd quirk I believe
lizmat: what do you think?
lizmat it's not a quirk, it's a side effect of it becoming a named parameter 09:51
and using the (|) signature 09:53
nadim_ ok but shouldn it be dump to something which shows the contents? 09:54
m: dd a => 2
camelia block <unit>()
nadim_ m: a => (< a >, b => 2).perl
camelia WARNINGS for <tmp>:
Useless use of "a => (< a >, b => 2).perl" in sink context (line 1)
nadim_ m: (a => (< a >, b => 2)).perl 09:55
camelia ( no output )
nadim_ m: (a => (< a >, b => 2)).gist
camelia ( no output )
lizmat I vaguely recall trying to do just that, and losing some type of info
m: dd (a => (< a >, b => 2))
camelia :a(("a", :b(2)))
lizmat ah yes, if I use |c, I cannot get at the name of a variable anymore
m: my $a = 42; dd $a 09:56
camelia Int $a = 42
lizmat would then not work anymore
I figured that was more useful than needing to do an extra set of params when trying to dd a Pair
lizmat weekly: www.khanate.co.uk/blog/2019/05/14/p...ge-part-8/ 09:59
notable6 lizmat, Noted!
lizmat afk for a few hours& 10:06
robertle is there some module to syntax-highlight perl6 code (including pod6) to html? we must use something for the docs... 11:19
moritz there are several options 12:05
pygments can do it
moritz vim can do it (for example using p5 Text::VimColor= 12:05
moritz I think the docs uses some hilighting that was built for the Atom editor 12:06
see the Makefile of perl6/doc for more details
robertle moritz: thanks, found it! 13:13
cpan-p6 New module released to CPAN! Term::Choose (1.5.5) by 03KUERBIS 13:25
New module released to CPAN! Term::TablePrint (1.4.6) by 03KUERBIS
Geth ¦ problem-solving: AlexDaniel assigned to jnthn Issue What are the intended semantics of <== and <<== github.com/perl6/problem-solving/issues/27 13:49
Xliff \o 15:16
yoleaux 05:38Z <holyghost> Xliff: ok then the scsh package has been removed from ubuntu packages
05:43Z <holyghost> Xliff: I'll try to hack it up locally (in my home dir) but it has shell and makefile problems as it's more or less a BSD system. I need it for my scsh MUD/MOO
05:44Z <holyghost> Xliff: I have to keep my hand in other programming languages
Xliff What's the best way to get const C data out of an object? 15:55
Xliff A library, rather. 15:55
I have array definitions, here: github.com/bytebrew/slope/blob/mas...ler.c#L159 15:56
Oops.... brb 15:57
Yeah. Still getting a SEGV. 15:58
I will gist. 15:59
tobs Xliff: independently of it being const, I believe cglobal() gets variables out of libraries.
Xliff tobs: That's what I am trying, however it SEGVs.
tobs I'd like to see the gist but I have to go right now 16:01
Xliff Still writing it, but thanks. 16:02
I will post the link when done.
tobs: Just out of curiosity before you leave. How would you extract data given a Pointer is an array of structs? 16:03
gist.github.com/Xliff/4d83cd0476d3...7884d7c6e3 16:06
cpan-p6 New module released to CPAN! FindBin (0.3.1) by 03LEMBARK 16:16
New module released to CPAN! FileSystem::Parent (0.1.0) by 03LEMBARK 16:18
ctilmes Xliff: I believe cglobal always gives you a pointer to the thing, so if the thing itself is a pointer, you get a pointer to a pointer to the array. 16:33
Xliff: I think... I've had trouble trying to do similar things before
Xliff ctilmes: Yikes.
Thanks for the tip! 16:34
m: class A is repr('CStruct') { has Str $!s; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a = A.new; $a.s = 'Hello'; $a.s.say 16:36
camelia Hello
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a = A.new; $a.s = 'Hello'; $a.s.say 16:37
camelia Hello
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; submethod BUILD (:$!coord, :$s) { self.s = 'Hi'}; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; 16:39
camelia ( no output )
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; submethod BUILD (:$!coord, :$s) { self.s = 'Hi'}; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a1 = A.new(1, 'b'); $a1.gist.say; 16:40
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; submethod BUILD (:$!coord, :$s) { self.s = 'Hi'}; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a1 = A.new( coord=>1, s=>'b'); $a1.gist.say;
camelia This type cannot unbox to a native number: P6opaque, Int
in submethod BUILD at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; submethod BUILD (:$!coord, :$s) { self.s = 'Hi'}; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a1 = A.new( coord=>1.Num, s=>'b'); $a1.gist.say;
camelia A.new(coord => 1e0)
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; submethod BUILD (:$!coord, :$s) { self.s = 'Hi'}; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a1 = A.new( coord=>1.Num, s=>'b'); $a1.gist.say; $a1.s.say 16:41
camelia A.new(coord => 1e0)
Hi
Xliff m: class A is repr('CStruct') { has num64 $.coord is rw; has Str $!s; submethod BUILD (:$!coord, :$s) { self.s = $s }; method s is rw { use nqp; Proxy.new: FETCH => -> $ {$!s}, STORE => -> $, $new { nqp::bindattr( nqp::decont(self), A, '$!s', nqp::unbox_s(~$new) ); }; }; }; my $a1 = A.new( coord=>1.Num, s=>'b'); $a1.gist.say; $a1.s.say
camelia A.new(coord => 1e0)
b
ctilmes Xliff: BTW -- post the cglobal question on StackOverflow if you get a chance -- you'll get better answers, and when I forget how it works I can search for cglobal on there and find the answer again
Xliff ctilmes: OK. Good thought. Thanks.
Xliff WTF? "Missing serialize REPR function for REPR CStruct (Slope::Raw::Types::SlopeSample)" 16:42
Xliff Can this when statement be rewritten as an expression? 'when 3|5|7|9|11|13|15|17|19 { "odd" }' 17:13
m: given 42 { when * %% 2 { say 'Odd' } default { say 'Even' } 17:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3given 42 { when * %% 2 { say 'Odd' }7⏏5 default { say 'Even' }
Xliff m: given 42 { when * %% 2 { say 'Odd' }; default { say 'Even' }; }; 17:15
camelia Odd
Xliff m: given 43 { when * %% 2 { say 'Odd' }; default { say 'Even' }; };
camelia Even
Xliff m: given 43 { when (* %% 2).so { say 'Odd' }; default { say 'Even' }; }; 17:16
camelia Even
Xliff m: given 42 { when (* %% 2).so { say 'Odd' }; default { say 'Even' }; };
camelia Odd
Xliff m: given 42 { when (* %% 2) == 1 { say 'Odd' }; default { say 'Even' }; };
camelia Odd
Xliff ?!?
m: given 42 { when ((* %% 2) == 1) { say 'Odd' }; default { say 'Even' }; }; 17:17
camelia Odd
Xliff m: given 42 { when (* %% 2 == 1) { say 'Odd' }; default { say 'Even' }; };
camelia Odd
Xliff say 42 %% 2
evalable6 True
Xliff m: given 42 { when * % 2 { say 'Odd' }; default { say 'Even' }; }; 17:18
camelia Even
Xliff I'm having one of those days...
El_Che sena_kun: I wrote a typical LDAP-admin script today (like we talked about), you want me to paste it somewhere? 17:24
sena_kun El_Che, sure
El_Che sena_kun: (a p5 script)
lizmat m: $_ = 5; if $_ ~~ 3..19 && $_ % 2 { say "odd" } # Xliff
camelia odd
sena_kun El_Che, well, I guessed that
El_Che, would be a bit more helpful to try to do a port and then create issues for everything that is missing or doesn't work, but I can as well look at it myself, probably 17:25
El_Che sena_kun: sure 17:26
sena_kun: it's short, so it should be even shorter in p6
El_Che sena_kun: it's always so impressive to see how much boilerplate can be dropped when converting p5 to p6 17:33
sena_kun El_Che, well, the API is not too refined yet, though, imo. are you trying to do a port right now? or can I look at the script?
from what I know immediately, StartTLS doesn't work(we have ldaps instead), also extensions are not supported yet, controls are supported 17:34
Xliff lizmat: Thanks. See above. I was using %% instead of % 17:35
m: given 42 { when * % 2 { say 'Odd' }; default { say 'Even' }; };
camelia Even
Xliff m: given 43 { when * % 2 { say 'Odd' }; default { say 'Even' }; }; 17:36
camelia Odd
Xliff As opposed to...
m: given 42 { when * %% 2 { say 'Odd' }; default { say 'Even' }; };
camelia Odd
Xliff ^^ Which is wrong.
I'm having a Day. 17:37
sena_kun 6c: my %m is Mix = a => -15, b => 15; say %m.Baggy; say %m.Setty; 17:38
committable6 sena_kun, gist.github.com/ac545a1c03b7475e91...6e741b7634 17:39
El_Che sena_kun: I was having a go while I was here waiting on my kid to get out of music class 17:41
let me gist it 17:42
sena_kun waits patiently
El_Che sena_kun: gist.github.com/nxadm/84ff14675e4d...4e627cf5eb 17:45
sena_kun oooooh, cool 17:46
El_Che++
El_Che, is SASL used?
El_Che sena_kun: the ldap_modify is the only thing calling ldap
no; simple auth
sena_kun El_Che, ldaps?
El_Che (on ssl)
yes, but the code is protocol agnostic
it expect an URI
s
sena_kun yup, seeing this 17:47
El_Che just ran it on out production db and haven't got any calls yet :)
sena_kun well, right now I don't see anything that cannot be written with Cro::LDAP
El_Che the ldap server is provisioned by an IAM system
sena_kun as all features are in place already
El_Che but it can not set pwdChangedTime
as it's an operational attribute 17:48
password resets are done through the IAM system
but the pwdChangeTime is useful for stuff using that to trigger password changes from users
like our Shibboleth SSO IDP
I wrote some code to keep it in sync, but it's in Go
this small script is just meant to rectify history mismatches and/or if something goed wrong with the service doing this 17:49
it would be extremely cool if it would be in native perl6 :)
so, does cro-ldap support operational aatributes? 17:50
(the Relax control in the sub)
sena_kun El_Che, Relax is supported
El_Che, github.com/Altai-man/cro-ldap/blob...d#controls <- github.com/Altai-man/cro-ldap/blob...ol.pm6#L26 17:51
El_Che nice
sena_kun once again, I don't see anything that cannot be done with cro-ldap right now, so
El_Che, I will try to rewrite ldap_modify sub part in Perl 6 and then post the code
El_Che thx, I'll post the rest 17:52
sena_kun s/post/port/ ? :)
El_Che I must say the Perl 5 code is single-threader but damn fast
yes, port
sena_kun ok
El_Che (depending on time of course)
sena_kun sure 17:53
anyway, got it, thanks a lot. I am having a rest day today, so cannot promise anything, but at least I plan to make some docs-related work along with cro-ldap related work
El_Che, I'll ping or .tell you when the results will be available
El_Che sena_kun: you see how slow I am to react, so don't feel any pressure what so ever 17:54
sena_kun: it was a fun little script (it's been a while), but I see how much I missed the p6 error messages 17:55
nine jnthn: mi.cro.services/ 18:01
DerHolzer rakudo: (1..*).pick(1) 18:05
camelia ( no output )
Xliff rakudo: (1..*).pick(1).say 18:06
DerHolzer rakudo: say (1..*).pick(1)
camelia ()
Xliff rakudo: (1..20).pick(1).say 18:06
camelia (5)
tobs m: (1..*).list.pick.say 18:07
camelia Cannot .pick from a lazy list
in block <unit> at <tmp> line 1
DerHolzer i know. the * kinda was the point :)
tobs this seems like a sensible exception or failure to have for (1..*).pick as well 18:08
tobs DerHolzer: have you seen R#1581 ? 18:10
synopsebot R#1581 [open]: github.com/rakudo/rakudo/issues/1581 [edge cases][ranges][rationals] range with large Rat as bound returns Nil for .pick()
hythm_ p6: class A { method TOP ($/) { make ~$<tail> }}; grammar G { token TOP { <tail> }; token tail { '.abc' }}.parse('.abc', actions => A); 18:13
camelia Cannot convert string to number: radix point must be followed by one or more valid digits in '3.⏏5abc' (indicated by ⏏)
in regex tail at <tmp> line 1
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
hythm_ ^ is this a bug or intended? if i used different token name other than 'tail' it works, possibly name conflict? 18:15
DerHolzer rakudo: Any.tail.WHAT.say 18:17
camelia (Any)
DerHolzer rakudo: tail.WHAT.say 18:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
tail used at line 1. Did you mean 'fail'?
Geth doc/mix-coercion-note: 8fc7432805 | Altai-man++ | doc/Type/QuantHash.pod6
Clarify Setty/Baggy and add examples
19:12
doc: Altai-man++ created pull request #2792:
Clarify Setty/Baggy and add examples
19:14
Geth doc: 8fc7432805 | Altai-man++ | doc/Type/QuantHash.pod6
Clarify Setty/Baggy and add examples
19:33
doc: 92ff8fd64b | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | doc/Type/QuantHash.pod6
Merge pull request #2792 from perl6/mix-coercion-note

Clarify Setty/Baggy and add examples
synopsebot Link: doc.perl6.org/type/QuantHash
kybr what is the simplest class of grammars that perl (6) cannot do? maybe that's a dumb question. i'm still new to the area. i remember reading about the limitations somewhere, but now i cannot remember where :/ 19:41
lizmat weekly: perl6.eu/perfect-indentation.html 19:52
notable6 lizmat, Noted!
moritz kybr: since you can call regular Perl 6 code from grammars, everything that can be parsed by a turing machine can be parsed by a Perl 6 grammar 20:20
kybr okay. i found the text that i mentioned.. it is Lenz 2017 Parsing with Perl 6 Regexes and Grammars. he describes a recursive descent parser and an operator-precedence parser. i don't know why i remembered these as limitations of perl 6. they are just specific examples. 20:24
moritz that sounds like something Lenz might write :D 20:26
lizmat kybr: moritz === Lenz :-) 20:27
kybr oh, cool. well, Thank You! :)
moritz my pleasure :D 20:28
cpan-p6 New module released to CPAN! Cro::HTTP::Session::Red (0.0.2) by 03FCO 21:00
New module released to CPAN! Cro::HTTP::Session::Red (0.0.1) by 03FCO
dolmen m: say given 43 { when * %% 2 { 'Odd' }; default { 'Even' }; }; 21:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun
at <tmp>:1…
timotimo dolmen: you want "say do" for this 21:58
m: say do given 43 { when * %% 2 { 'Odd' }; default { 'Even' }; }
camelia Even
timotimo it doesn't get far enough in the parsing to understand that you're not using post-statement given 21:59
but if it were to lookahead and see that there's a block there, it could probably point that out i guess
Xliff m: rand.say 22:43
camelia 0.5367149299797227
Xliff m: use NativeCall; my $x = CArray[num64].new; $x.REPR.say 23:14
camelia CArray
Xliff m: use NativeCall; my $x = CArray[num64].new; $x.REPR.say; $x[1] = 1; $x.REPR.say
camelia CArray
This type cannot unbox to a native number: P6opaque, Int
in block <unit> at <tmp> line 1
Xliff m: use NativeCall; my $x = CArray[num64].new; $x.REPR.say; $x[1] = 1e0; $x.REPR.say
camelia CArray
CArray
Xliff m: use NativeCall; my $x = CArray[num64].new; $x.REPR.say; $x[1] = rand; $x.REPR.say
camelia CArray
CArray
Xliff m: use NativeCall; my $x = CArray[num64].new; sub doPoints( for ^10 { $x[$_] = rand; }; $x.REPR.say; doPoints; $x.REPR.say 23:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'for' in parameter declaration.
at <tmp>:1
------> 3x = CArray[num64].new; sub doPoints( for7⏏5 ^10 { $x[$_] = rand; }; $x.REPR.say; do
Xliff m: use NativeCall; my $x = CArray[num64].new; sub doPoints { for ^10 { $x[$_] = rand; }; $x.REPR.say; doPoints; $x.REPR.say 23:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3d; }; $x.REPR.say; doPoints; $x.REPR.say7⏏5<EOL>
expecting any of:
statement end
statement modifier
statement modifier loo…
Xliff m: use NativeCall; my $x = CArray[num64].new; sub doPoints { for ^10 { $x[$_] = rand; }; }; $x.REPR.say; doPoints; $x.REPR.say
camelia CArray
CArray
Xliff m: $*PERL.compiler.version.say
camelia v2019.03.1.385.ga.643.b.8.be.1