»ö« 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.
SmokeMachine m: CX::Next.throw; CONTROL { default { say “ok” } } 01:06
camelia Invocant of method 'throw' must be an object instance of type 'Exception', not a type object of type 'CX::Next'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
SmokeMachine m: CX::Next.new.throw; CONTROL { default { say “ok” } }
camelia ok
SmokeMachine m: class :: is X::Control {}.new.throw; CONTROL { default { say “ok” } } 01:10
camelia ok
SmokeMachine jnthn: thank you for telling me to use CATCH and CONTROL on my control exceptions! :) 01:15
Xliff timotimo: Able to get data out of a failed grammar, now. 03:42
hythm_ p6: enum C ( A => 1, B => 2); multi s(A) {}; say 1 ~~ A; s 1 # Why this doesn't work although 1 ~~ A ? 07:32
camelia True
Cannot resolve caller s(1); none of these signatures match:
(C $ where { ... })
in block <unit> at <tmp> line 1
hythm_ p6: multi i(Int) {}; i(1) 07:58
camelia ( no output )
Geth doc: 6e390bd27d | (JJ Merelo)++ | 2 files
Fixes description of archname

Thanks for the report. Closes #2557
11:02
pony m: my $ls = (1 ... *).map({ sleep 1; $_ }); my $tap = $ls.Supply.tap: {;}; say 'hello' 11:11
camelia (timeout)
pony why doesn't it get to hello?
timotimo i'm not sure if this is the right explanation, but i've heard multiple times that supplies don't introduce concurrency by themselves. rather, they exist to tame existing concurrency (like asynchronous events) 11:12
so i guess without an explicit "start" or implicit scheduling action, this won't have multiple threads 11:13
pony ah 11:14
timotimo try this:
m: my $ls = (1 ... *).map({ sleep 1; $_ }); my $tap = $ls.Supply.Channel.Supply.tap: {;}; say 'hello' 11:15
ah, hm. no. not like this.
that'll still eagerly send all the values to the channel
camelia (timeout)
timotimo well, there'll just have to be a "start" somewhere i guess :) 11:17
pony yeah, what i was thinking :)
m: my $ls = (1 ... *).map({ sleep 1; $_ }); start my $tap = $ls.Supply.tap: { .put 11:19
}; put "Hello"; sleep 3;
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3; start my $tap = $ls.Supply.tap: { .put7⏏5<EOL>
expecting any of:
statement end
statement modifier
statement modifier loo…
pony blah
m: my $ls = (1 ... *).map({ sleep 1; $_ }); start my $tap = $ls.Supply.tap: { .put }; put "Hello"; sleep 3; 11:20
camelia Hello
1
2
timotimo put put
jmerelo timotimo: as long as we're talking threads, can you have a look at this? stackoverflow.com/questions/540885...gram-hangs 11:46
timotimo: or this: stackoverflow.com/q/52082308/891440 11:47
timotimo oh, i somehow thought the first one had been solved but not marked 11:50
now i re-read the comment it says it still has the same problem, eh? 11:51
it's probably just setting max_threads too low
perhaps that causes the TPS to not engage its deadlock detection mode
i'm not sure how the precomp store or precomp repository will do its precompilation stuff, exactly 12:00
if it does out-of-process precomp, i'd expect it to also use at least one thread to handle output from the child process? 12:01
jmerelo timotimo: I really don't know the first thing about precomp. Everything in that area is cloudy and mysterious (and so far undocumented) 12:04
Geth doc/ufobat-patch-1: 24babc1404 | (Martin Barth)++ (committed using GitHub Web editor) | doc/Language/list.pod6
Fixed array slice with [0..^*]

  ```
  $ perl6 -e 'my @a = 1..5; say @a[0..^*]'
  (1 2 3 4)
  ```
12:28
doc: ufobat++ created pull request #2561:
Fixed array slice with [0..^*]
timotimo m: my @a = 1..5; say @a[0..^*] 12:29
camelia (1 2 3 4)
timotimo ah, it's example output that's wrong 12:30
ufobat m: my @a = 1..5; say @a[0..^3] ~~ @a[0..3-1] 12:33
camelia True
ufobat m: my @a = 1..5; say @a[0..^*] ~~ @a[0..*-1] 12:34
camelia False
ufobat if 0..^3 is the same as 0..3-1 why isn't 0..^* the same as 0..*-1 in a array slice
Geth doc: 24babc1404 | (Martin Barth)++ (committed using GitHub Web editor) | doc/Language/list.pod6
Fixed array slice with [0..^*]

  ```
  $ perl6 -e 'my @a = 1..5; say @a[0..^*]'
  (1 2 3 4)
  ```
12:36
synopsebot Link: doc.perl6.org/language/list
doc: 69e7e3a57c | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/list.pod6
Merge pull request #2561 from perl6/ufobat-patch-1

Fixed array slice with [0..^*]
timotimo ufobat: 0..^* is an infinite range, whereas 0..^*-1 will create a WhateverCode that the postcircumfix:<[ ]> operator will pass the length of the array to 12:37
and 0..^* is actually equivalent to 0..* AFAIK
m: dd 0..^*; dd 0..* 12:38
camelia (0, 1, 2, 3, 4, 5, 6, 7, 8, 9... lazy list)
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9... lazy list)
timotimo well...
m: (0..^*).DUMP.say; (0..*).DUMP.say
camelia Range<1>(
:min(0),
:max(Inf),
:$!excludes-min(=Int<2>),
:$!excludes-max(1),
:$!infinite(=Int<4>),
:$!is-int(=Int<2>)
)
Range<1>(
:min(0),
:max(Inf),
:$!excludes-min(=Int<2>),
:$!excludes-…
timotimo not terribly helpful, i suppose
ufobat timotimo, no i dont get it from your explanation because 0..^* is actually all but the last element whereas 0..*-1 are all elements 13:03
timotimo m: my @a = 1, 2, 3, 4, 5; say @a[0..^*] 13:04
camelia (1 2 3 4)
timotimo oh, huh, so it is
m: my @a = 1, 2, 3, 4, 5; say @a[0..^Inf]
camelia (1 2 3 4 5)
timotimo m: say (0..^*).WHAT
camelia (Range)
timotimo so that's a thing, OK!
ufobat m: my @a = 1..5; say @a[0..*-1] 13:05
camelia (1 2 3 4 5)
ufobat so the * isnt a "fixed number" if you will
if * woud be 3, the slice with 0..^3 means the same as 0..3-1
with * in the slice, it isn't 13:06
m: my @a = 1..5; say @a[0..Inf-1]
camelia (1 2 3 4 5)
ufobat m: my @a = 1..5; say @a[0..^Inf]
camelia (1 2 3 4 5)
ufobat m: my @a = 1..5; say @a[0..^*]
camelia (1 2 3 4)
ufobat ja 13:07
m: my @a = 1..5; say @a[0..*-1]
camelia (1 2 3 4 5)
ufobat m: my @a = 1..5; say @a[0..Inf-2]
camelia (1 2 3 4 5)
ufobat m: my @a = 1..5; say @a[0..*-2]
camelia (1 2 3 4)
ufobat :D
timotimo : my @a = 1..5; say @a[0..^*-1] 13:08
m: my @a = 1..5; say @a[0..^*-1]
camelia (1 2 3 4)
ufobat the -1 doesnt have an effect on it, now?
huh
jmerelo *ping* 13:09
if that makes sense to someone, it isnt documented or i didnt find it :( 13:10
timotimo i'm headachy and having a hard time concentrating, but i suggest writing down a matrix (or two) for .. vs ..^, * vs *-1, maybe something else? 13:11
kensanata AlexDaniel: tons of issues... :) 13:27
sena_kun m: class A { has Positional[Int] $.a; }; A.new(a => (1,2,3)); 14:03
camelia Type check failed in assignment to $!a; expected Positional[Int] but got List ($(1, 2, 3))
in block <unit> at <tmp> line 1
sena_kun this is a golfed example, how can I fix that? Of course, I can `has Int @.a`, but let's say I cannot afford it for some reason and have to dance around typed `Positional`. 14:05
jnthn m: class A { has Positional[Int] $.a; }; A.new(a => Array[Int](1,2,3))
camelia ( no output )
jnthn sena_kun: type checking is nominal, not structural, so the incoming type needs to match up if just storing the thing into a Scalar. The `has Int @.a` works because it copies, and so can check each element as it goes. 14:06
sena_kun thanks, will go with it! 14:07
m: say Array[Int](1,2,3); say Array[Int].new(1,2,3);
camelia [1 2 3]
[1 2 3]
sena_kun that's interesting to remember too. :) 14:08
ufobat i've running into the same lateley, sena_kun 14:34
and i ended up removing the types for @arrays because if the original Arrays came from a different module/api you have to write a lot of code to glue them together :( 14:35
sena_kun well, I am having a "better" one here: `Type check failed in assignment to ; expected Control but got Control.new(control-type => ...`. :)
Xliff \o 15:08
Morning from snowedinland! ;)
MasterDuke Xliff: likewise
Xliff MasterDuke: East Coast US? 15:11
MasterDuke yep, about 4-6" so far, still falling 15:12
Xliff Same here. 15:13
guifa We're just getting the frigid air here in Tennessee. No snow to go with =\ 15:14
Xliff guifa: Snow is overrated.
guifa Snow = no classes = I don't have to teach 15:15
:-)
So I think I may be doing something wrong (I hope) or stumbled across something weird. I've tried manually adding an attribute using ^add.attribute, but the .get_value on the attribute bombs with P6Opaque error saying the attribute doesn't exist (even though the setting goes with no problem) 15:17
Xliff guifa: Example code? 15:19
guifa: Also, it's Sunday. Maybe there's still time? ;) 15:20
guifa Yeah, let me try to get a MWE here
b2gills guifa: Here in Iowa we don't call off classes for less than 6 inches of snow on the roads. 15:25
Xliff b2gills: LOL 15:26
Who is the doc person here? I can't get perl6-doc to make due to an error in pod2onepage 15:27
guifa Since we have lots of mountain roads and only 3-4 snow days a year it's just cheaper for us to close rather than salt every road. Snow at 31-32 inevitably just turns into ice with folks driving, sadly.
b2gills I remember traveling home on the highway at near highway speeds where we could only tell where the road was by the shape of the ditches. 15:28
guifa And here's a MWE: tio.run/##pVNNS8NAED03v2KMgSQlbG8e...3pMAFAtmuU
holyghost lol 15:31
holyghost We don;t have snow here in Belgium, Brussels 15:32
holyghost Rain yes 15:32
Xliff m: my $a = 'abcdefg'; given $a { when .starts-with( any('a'..'z') ) { say 1; }; }; 15:37
camelia 1
Xliff m: say $*PERL.compiler.version
camelia v2018.12.206.g.7.be.075.eb.5
Xliff m: my $a = 'abcdefg'; given $a { when .starts-with( any(<a b c d>) ) { say 1; }; }; 15:53
camelia 1
daxim my lists are evaporating: paste.scsys.co.uk/582758?ln=on 16:04
Xliff m: 5.max(6).say 16:12
camelia Cannot resolve caller max(Int:D: Int:D); none of these signatures match:
($: *%_)
($: &by, *%_)
in block <unit> at <tmp> line 1
tyil what constitutes an "alphabetic" method? just a method that only contains alphabetic characters (including the leading &, if needed)? 16:15
for context: tio.run/#perl6 16:16
err
tio.run/##K0gtyjH7/7@4NEkhLT9fQUMl...vKLiv//BwA
should at least link it with some code 16:17
Skarsnik Hello there 16:17
tyil hi Skarsnik 16:17
Skarsnik almost done with my advent calandar post! just in time xD 16:19
sucks, I got some computer issue on december x)
tyil there'll be another advent calendar later this year
or so I heard
holyghost hail to jmerelo and Skarsnik ! 16:28
holyghost is drunk
jmerelo hi!
lizmat daxim: no idea what's going on there
holyghost the gobilins !
lol 16:29
daxim List(List(x)) works, which makes 1 List. List(x) is the same as plain x, which makes an x.
I find this surprising
Skarsnik why do i always hit weird bug when working on perl 6 stuff xD
lizmat m: dd List(42)
camelia (42,)
lizmat daxim: not that simple ^^^
jmerelo daxim: it's a single-element list. Might print out in the same way as that single element, but it's still a list. 16:30
daxim jmerelo, ^name doesn't lie
lizmat jmerelo: it's not that simple :-( 16:31
sena_kun how can two type objects have the same .WHICH value but fail smartmatch and type check? `===` is True, `==` is True, `~~` is False and type check fails too.
lizmat daxim: ^name *can* lie, but isn't in this case :-)
m: BEGIN Int.^set_name("Foo"); say 42.^name 16:32
camelia Foo
moritz sena_kun: sounds like a bug. If === is True, smart-match should as well
m: my $a = { my class A { } }; my $b = { my class A { } }; say $a === $b 16:33
camelia False
sena_kun ouch... that is unfortunate.
moritz do you have an easy way to reproduce it?
sena_kun I'll try to make a short gist, yes. 16:34
my situation is: 1)create a class using MOP(say "Inner"); 2)assign it as a type of an attribute in another created class(say "Outer"); 3)when I try to create instance of Outer with Inner.new type check fails. 4)but if I manually get ^attributes of Outer to get type of this attr, I will get Inner -> it's .WHICH is the same to Inner that I have globally, it passes ===, but fails ~~ and fails type check. 16:36
I'll try to make a gist now...
Skarsnik hm, I have a grammar that does not stop properly on current rakudo vs 2018.03
sena_kun s/it's/its/ 16:37
Skarsnik 6.d have nothing new for grammar?
guifa daxim: it is returning a list, but I think the catch is, in your second loop, your loop is just returning a single list rather than a list of lists. So when you -> $x, it's passing the inner value. 16:38
daxim hmm 16:40
holyghost Skarsnik, there's 2018.12 now
Skarsnik I am trying the current one (git version) 16:41
guifa daxim: add these lines and you'll see what I mean a bit better I think 16:43
say (span-slices 3, 0 => 4).WHAT; say (span-slices 3, 0 => 4).perl; say (span-slices 1, 0 => 4).WHAT; say (span-slices 1, 0 => 4).perl;
Skarsnik m: enum Foo(A => 0, B => 1); say Foo(0); say Foo(42) 16:44
camelia A
(Foo)
Skarsnik Should it produce an error and tell you are creating an invalid instance of the enum?
sena_kun golfed it down... 16:45
daxim that explanation was helpful, guifa++ that fits the intuition I need to return List(List(x)) for the `??` case of the ternary op expression
sena_kun gist.github.com/Altai-man/225947b7...33e1d76490 <- moritz 16:46
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ s/'{' ~ '}' ./; say $m
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use variable $m in declaration to initialize itself
at <tmp>:1
------> 3 }'; my $m = $t ~~ s/'{' ~ '}' ./; say $7⏏5m
expecting any of:
infix stopper
term
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ /'{' ~ '}' ./; say $m
camelia 「{ }」
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ /'o' \s+ {' ~ '}' ./; say $m 16:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3 $m = $t ~~ /'o' \s+ {' ~ '}' ./; say $m7⏏5<EOL>
expecting …
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ /'o' \s+ '{' ~ '}' ./; say $m
camelia (Any)
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ /'o' \s+ ' {' ~ '}' ./; say $m
camelia (Any)
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ /^ 'o' \s+ '{' ~ '}' ./; say $m
camelia (Any)
Xliff m: my $t = 'o { { } }'; my $m = $t ~~ /'{' ~ '}' ./; say $m 16:48
camelia 「{ }」
sena_kun I am ready to try to debug this bug,(if that's a bug) as I need a workaround or a fix as soon as possible, but some help from experienced hackers is likely needed for it. :)
Xliff m: my $t = 'o { { asdlkjasd[ {}} }'; my $m = $t ~~ /'{' ~ '}' ./; say $m
camelia 「{}}」
Xliff m: my $t = 'o { { asdlkjas }'; my $m = $t ~~ /'{' ~ '}' ./; say $m 16:49
camelia (Any)
holyghost is an experienced hacker :-)
Xliff m: my $t = 'o { sdlkjas }'; my $m = $t ~~ /'{' ~ '}' ./; say $m
camelia (Any)
Xliff m: my $t = 'o { sdlkjas }'; my $m = $t ~~ /'{' ~~ '}' ./; say $m
camelia 5===SORRY!5===
Unrecognized regex metacharacter ~ (must be quoted to match literally)
at <tmp>:1
------> 3 sdlkjas }'; my $m = $t ~~ /'{' ~~ '}' .7⏏5/; say $m
Unable to parse regex; couldn't find final '/'
at <tmp>:1
------> 3 s…
Xliff m: my $t = 'o { sdlkjas }'; my $m = $t ~~ /'{' ~ '}' \w+/; say $m
camelia (Any)
Xliff OK. I think I am forgetting something. 16:50
guifa daxim: I've found whenever I get weird stuff, the .WHAT is the quickest thing to solving a lot of my hidden-in-plain-site mistakes.
Xliff m: my $t = 'o { { asdlkjasd[ { }'; my $m = $t ~~ /'{' ~ '}' <[\w [}{\s]>+ /; say $m 17:19
camelia 「{ { asdlkjasd[ { }」
Xliff \o/
jmerelo Hi, Xliff 17:25
Working on your issue now
m: "/this/link".starts-with( any(<http:// https:// irc://>) ) 17:26
camelia ( no output )
Xliff jmerelo: \o
jmerelo: Yeah. I tried working on it, but I couldn't reproduce it on camelia. 17:27
Geth doc: Kaiepi++ created pull request #2563:
Document trap on (cont) subroutine on Map/Hash
17:32
jmerelo m: say any(<http:// https:// irc://>)
camelia any(, , irc://)
jmerelo m: say "whatever".starts-with( any(<http:// https:// irc://>) ) 17:33
camelia any(False, False, False)
jmerelo Ah, rithg
right.
Xliff Yeah.
m: say "whatever".starts-with( any(<http:// https:// irc://>) ).so
camelia False
Kaiepi m: my %a is Bag = (a => 0); %a (cont) 'a'
camelia WARNINGS for <tmp>:
Useless use of "(cont)" in expression "%a (cont) 'a'" in sink context (line 1)
Xliff So was it as simple as that? I thought "when" handled junctions. 17:34
Kaiepi m: my %a is Bag = (a => 0); say %a (cont) 'a'
camelia False
Skarsnik hm anyone managed to use markdown (copy/paste from a file) on blog.perl.org? 17:35
Xliff m: my %a is Bag = (a => 0); say %a ⊃ 'a'
camelia False
sena_kun don't want to be annoying, but is gist.github.com/Altai-man/225947b7...33e1d76490 a bug? if yes, what can I help with besides filling an issue? 17:36
Xliff m: '⊃'.uniname.say 17:37
camelia SUPERSET OF
Xliff m: '⊃'.uniname 17:37
camelia ( no output )
Xliff m: '⊃'.unicode 17:38
camelia No such method 'unicode' for invocant of type 'Str'. Did you mean 'encode'?
in block <unit> at <tmp> line 1
Xliff m: '⊃'.ord.say
camelia 8835
Xliff m: '⊃'.ord.fmt("%x").say
camelia 2283
Xliff m: my %a is Bag = (a => 0); say %a ∋ 'a' 17:39
camelia False
Xliff m: my %a is Bag = (a => 0); say 'a' ∋ %a
camelia False
Skarsnik blogs.perl.org/users/sylvain_coline...3-gfx.html x) 17:55
Xliff sssss 18:05
Oh wow! Wincompose is nice! 18:06
Xliff s 18:07
moritz my IRC client renders lines as <+nick> message, and Xliff just composed something onto the > character :-) 18:29
jmerelo Xliff: weechat composed it on the | right after the name
Geth perl6-pod-to-bigpage: d05cb3dfce | (JJ Merelo)++ | t/render.t
Suppress debugging prints
18:32
perl6-pod-to-bigpage: a509c00c9f | (JJ Merelo)++ | 2 files
Fixing error perl6/doc#2562 #34. WIP
perl6-pod-to-bigpage: 92f2e4ef9f | (JJ Merelo)++ | 4 files
Fixes the problem of links-as-arrays

Which I don't really understand, but that's the way it is. Fixes #34.
Also WIP for perl6/doc#2562, will have to be tested.
Adds a ChangeLog for registering changes in every new version. Writes tests also for new feature.
synopsebot DOC#2562 [open]: github.com/perl6/doc/issues/2562 [bug][external][⚠ Blocker ⚠] make Error Encountered When Building Docs
Xliff moritz: LOL! 18:33
Combining unicode chars.
It was supposed to go over the 's' 18:34
Geth doc: 2f8a1c1d8b | (Ben Davies)++ | doc/Language/traps.pod6
Document trap on set subroutines on Associative

Fixes github.com/rakudo/rakudo/issues/2604
synopsebot Link: doc.perl6.org/language/traps
Geth doc: ca3067e5e7 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
Merge pull request #2563 from Kaiepi/traps

Document trap on set subroutines on Associative
timotimo Skarsnik: length or lenght? :) 18:36
lizmat weekly: trendsfocus.net/mis-using-perl-6-g...da-3-gfx-2 18:54
notable6 lizmat, Noted!
lizmat I wonder if someone can make a summary of that article... It's all Chinese to me :-( 18:55
Geth doc: edf550628a | (JJ Merelo)++ | META6.json
Bumps up to use new version of p2obp refs #2562
doc: 8c23b6ddba | (JJ Merelo)++ | doc/404.pod6
Adds more info to 404.

Meanwhile, the change to p2obp has tested OK, so the previous commit closes #2562
yoleaux AlexDaniel: get huggable back on its feet 18:57
AlexDaniel .in 7d get huggable back on its feet 18:59
yoleaux AlexDaniel: I'll remind you on 20 Jan 2019 18:59Z
AlexDaniel busy…
timotimo m: multi sub data($cmd where 1 | 2, $length) { say "one or two: $length" }; multi sub data($cmd where 4 | 7, $length) { say "four or seven: $length" }; data(1, 1); data(2, 1); data(4, 99); data(7, 1000)
camelia one or two: 1
one or two: 1
four or seven: 99
four or seven: 1000
timotimo Skarsnik: you can make the signatures much shorter!
lizmat looks like the Camelia plushy has been cloned: twitter.com/hythm_hythm/status/108...3959030786 19:00
El_Che The first Raku butterfly at that 19:01
lizmat yeah... I just realize that myself :-)
El_Che I was waiting for the penny to drop :)
lizmat wonder who hythm_hythm is
it's their first tweet 19:02
Skarsnik timotimo, witch one? x)
timotimo length is correct afaik 19:03
oh, you mean the signatures?
that's from "multi token data" in the "Validate commands" section of the post
El_Che the account doesn't follow regular people
timotimo sneshacking? you misspelt shaking there :) :)
snek shaking
El_Che only famous ones and institutions like Nasa en MegaDeath
timotimo i've seen hythm as a nickname on irc at least 19:04
ooooh, i see what you mean with raku butterfly
.seen hythm
yoleaux I saw hythm 19 Jul 2018 18:36Z in #perl6: <hythm> great, thanks
El_Che 08:25 -!- hythm_ [4a495925@gateway/web/freenode/ip.74.73.89.37] has joined #perl6 19:05
Skarsnik timotimo, hooo, I did not think of that form, my first idea what just foo(1 | 2)
but it does not work
timotimo true ,you need the value itself
Skarsnik lenght or length I always get it wrong xD 19:06
timotimo i had issues with width for the longest time when i was a kid 19:06
probably also height 19:07
guifa Okay, I feel a bit stupid. i should have been using augment all along. 19:20
But it does still make e wonder why after using add_attribute things bomb when using set_value and get_value on the newly created attribute (stuff added via add_method work no problem) 19:21
sena_kun lizmat++ is just awesome. \o/ 19:52
lizmat *blush*
sena_kun: I just recognized the failure pattern from a similar issue a few days ago
sena_kun for me it is a life-saving fix. :) 19:53
lizmat glad to hear! 19:54
Skarsnik I should do a small camelia image to use as twitch emote x)
jmerelo sena_kun: I don't know what's the ocassion, but lizmat++ always applies
lizmat jmerelo: github.com/rakudo/rakudo/issues/2607 19:55
guifa Actually grrr... even using augment new attributes are seemingly invisible. Did I stumble upon a bug or is there special syntax for that? 20:08
sena_kun guifa, I guess you already provided a gist? Maybe github.com/rakudo/rakudo/issues/2607 is at fault? 20:09
guifa sena_kun: possibly? I've been whittling things down and trying a couple of things to make sure it's not just me. add_method() definitely works no problem, but add_attribute() doesn't, same for methods added via augment class Foo {} (work) vs attributes added via augment (don't work) 20:12
I just wanted to verify it's not me before I went and did a bug report
tyil is it ok if I join a bot here that notifies of new perl 6 modules on cpan, now that buggable is gone?
source of bot is git.tyil.nl/perl6/app-cpan-uploadn...erBot.pm6, if that matters 20:13
sena_kun m: my $a = Metamodel::ClassHOW.new_type(name => 'A'); $a.^add_attribute(Attribute.new(name => '$!a', type => Int, package => $a, :has_accessor)); $a.^compose; say $a.^attributes; 20:15
camelia (Int $!a)
sena_kun guifa, ^?
sena_kun m: my $a = Metamodel::ClassHOW.new_type(name => 'A'); $a.^add_attribute(Attribute.new(name => '$!a', type => Int, package => $a, :has_accessor)); my $aa = $a.new; $aa.^attributes[0].set_value($aa, 5); say $aa; 20:16
camelia No such method 'new' for invocant of type 'A'
in block <unit> at <tmp> line 1
sena_kun m: my $a = Metamodel::ClassHOW.new_type(name => 'A'); $a.^add_attribute(Attribute.new(name => '$!a', type => Int, package => $a, :has_accessor)); $a.^compose; my $aa = $a.new; $aa.^attributes[0].set_value($aa, 5); say $aa;
camelia A.new(a => 5)
sena_kun guifa, ^?
Xliff github.com/Xliff/p6-VisualGrammar/ 20:17
\o/
tyil Xliff: now that's hot
sena_kun tyil, I don't see why you can't add the bot.
tyil Xliff: I recently got my hands on a book on regexes and grammars, I can play around with that application while learning more about grammars 20:18
Xliff tyil: Ah! That's cool. Please share any issues or suggestions when you do! :)
tyil: Sorry about all of the work required to install. I have so many projects in the pipe. 20:19
tyil I know that feeling
guifa sena_kun: this is what's bombing
tio.run/##VZBLa4NAEIDv/orBBLSw8dZe...nv4IaHT9/8
Xliff tyil: Would be interested to know how long it takes for you to compile GtkPlus
tyil I'm running low on time for all my projects ;(
Xliff: not that long 20:20
I already have it compiled
sena_kun guifa, at the very least, I think you have to use a name with a sigil and twigil, like `$!bar`, not just `bar`.
tyil x11-libs/gtk+, versions 2.24.32-r1 and 3.24.1
guifa I've tried that too, sans success. The add_attribute doesn't have much documentation so I've not been clear whether those get added based on has_accessor or not 20:21
Xliff tyil: No. p6-GtkPlus will take a while. 20:24
That's my upcoming perl6 binding for GTK. ;)
tyil oh
nice 20:25
lizmat add_attribute is relatively straightforward: it's probably an issue with the Attribute object that you created
Xliff It's designed to cover the areas that GTK::Simple hasn't. 20:25
tyil I don't fear the compiler, so no worries for me
Xliff That makes it an order of magnitude larger.
guifa lizmat: the same thing happens when using augment, though
Xliff Wonder if I should be tongue-in-cheek and call it GTK::Complex
guifa tio.run/##ZY4xC8IwFIT3/IpDOuhg6SAO...RfFWLGrX0D
tyil hehe
sena_kun guifa, well, with `$!bar` as a name and `$x.^attributes.grep(*.name eq '$!bar')[0].set_value($x, 'Foo');` exploding I would call it a bug. 20:26
guifa, though, maybe still related to the issue I have pointed to. I don't have fresh rakudo right now to check if it explodes after the fix or not.
Skarsnik You should patch GPTrixie to genrate good OO binding x) 20:27
guifa sena_kun: Okay, I'll go ahead and write up an issue. Like I said, it was more of a "I know I'm working in the here-be-dragons part of the less documented forest, so I'd better check I'm not just a fool first" 20:28
sena_kun guifa, can you build latest rakudo && check?
El_Che Xliff: great! Learning Vala seems such a waste of time and not too fond of JS of Python for desktop apps. Rust seems be getting popular (as it has sane threading), but I reckon perl 6 will be easier to write! 20:33
guifa sena_kun: I can possibly tonight or tomorrow. I've not done a from-source build before but I suppose I should probably get that set up 20:36
sena_kun guifa, after about 12-14 hours I'll do it myself, so if you can wait a bit, then you don't need to. I'll also ping you on the results. 20:37
guifa sena_kun: I mean, go for it but I still need to get a build set up done anyways, this just incentivizes it ;-) 20:39
sena_kun guifa, that's fair. 20:40
guifa In the meantime, I've gotten a set up that works with only add_method + Roles but it fails === Type comparisons 20:41
Skarsnik timotimo, no way to use Perl 6 from C/C++ yet? (by using libmoar maybe?) 20:42
guifa (doing a freezable regex. So if you do $a = /$b/, you can $a.freeze to lock in place the value of $b at the time. $a.thaw has been where all the trouble is because I needed to store the original somewhere)
Xliff Is there a way to close all taps on a single supply? 21:01
lizmat .close for $supply.taps ? 21:04
Xliff lizmat: Did I miss that, here? 21:13
docs.perl6.org/type/Supply
Xliff m: use v6.c; my $s = Supply.new; $s.tap({ "Hi!".say }); .say for $s.taps; 21:13
camelia Cannot directly create a Supply. You might want:
- To use a Supplier in order to get a live supply
- To use Supply.on-demand to create an on-demand supply
- To create a Supply using a supply block
in block <unit> at <tmp> line 1
lizmat I misremembered: in a previous Supply implementation, there used to be a .taps method, I seem to recall
Xliff m: use v6.c; my $s = Supplier.new.Supply; $s.tap({ "Hi!".say }); .say for $s.taps;
camelia No such method 'taps' for invocant of type 'Supply'. Did you mean any of these?
Map
map
tail
take

in block <unit> at <tmp> line 1
Xliff m: my $s = Supplier.new.Supply; $s.tap({ "Hi!".say }); .say for $s.taps; 21:14
camelia No such method 'taps' for invocant of type 'Supply'. Did you mean any of these?
Map
map
tail
take

in block <unit> at <tmp> line 1
Xliff lizmat: No worries.
lizmat: Any reason it's not in current Rakudo?
lizmat I guess jnthn removed it because it was a race condition
Xliff Ah! 21:15
So just track all taps on a supply in user code and basically do what you just suggested.
lizmat or perhaps jnthn has a better idea ?
timotimo Skarsnik: you can use Perl 6 from C/C++ with libmoar, but i haven't built much code with it. if you use sockets or something for the IPC, it should be trivial to set up an interface between host and client 21:21
Skarsnik is there an example somewhere? 21:22
Xliff m: class WrappedSupply is Supply { has @!taps; submethod BUILD { self.^find_method('tap').wrap(-> | { @!taps.push: callsame }); }; } 21:26
camelia ( no output )
Xliff OK. So how do I get supplier to return a WrappedSupply?
m: class WrappedSupply is Supply { has @!taps; submethod BUILD { self.^find_method('tap').wrap(-> | { @!taps.push: callsame }); }; }; constant Supply = WrappedSupply; Supplier.new.Supply.^name.say 21:27
camelia Supply
lizmat Xliff: good question, I'm afraid I lost the plot after the last Supply refactor 21:28
Xliff lizmat: OK. Thanks.
Xliff .tell jnthn What is the best way to close all taps on a Supply? 21:42
yoleaux Xliff: I'll pass your message to jnthn.
cpan-p6 New module released to CPAN! CheckSocket (0.0.5) by 03JSTOWE 21:46
Kaiepi is there a difference between for and eager for? 21:54
Xliff m: DateTime.now.say 22:16
camelia 2019-01-13T23:16:52.832712+01:00
Xliff m: say "{ DateTime.now }" 22:17
camelia 2019-01-13T23:17:03.642693+01:00
Xliff m: use DateTime::Format; 22:19
camelia ===SORRY!===
Could not find DateTime::Format at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6
C…
jnthn Xliff: Just do .done on the sending end :) 22:31
yoleaux 21:42Z <Xliff> jnthn: What is the best way to close all taps on a Supply?
Xliff jnthn: Can't. That supplier is lost 22:32
jnthn Don't lose it? ;-)
Xliff This code should look familier: github.com/Xliff/p6-GtkPlus/blob/m...ic.pm6#L19 22:33
*blush*
jnthn But otherwise, you can build a mechanism like `my $cancel = Promise.new; sub cancellable(Supply $s) { supply { whenever $s { .emit }; whenever $cancel { done } } }`
Xliff s/familier/familiar/
jnthn Then call cancellable on every Supply before tapping it, and then .keep the Promise to terminate the lot 22:34
Xliff But I do understand your point. It makes for a LOT of code refactoring, and I was hoping there was a way to cheat.
jnthn What I suggested is probably the best cheat
Xliff Yes. It probably is. :(
Well! Fair dinkum! ;) 22:35
jnthn++
Oh, and while I have you... I mangled another piece of your code.
github.com/Xliff/p6-VisualGrammar/...therer.pm6
Allows data collection of hit grammar rules, based on Grammar::Tracer.
Do you think it would be useful, if it was cleaned up? 22:36
jnthn Xliff: Well, it's not safe for concurrent uses of the same grammar 22:39
But maybe that's an acceptable limitation?
Xliff Is there a way to achieve that, and could you give me a hint? 22:40
jnthn Hmm.
Xliff But I wouldn't expect this to be used concurrently. At least not as-is.
jnthn Yeah, I'd probably just document it
If you find it useful, probably somebody else would; I'd just include an example of the kind of output it makes, to try and communicate better why it might be useful 22:41
Xliff Yes. I'm currently using it for github.com/Xliff/p6-VisualGrammar 22:43
Without it, I couldn't cover the FAIL case.
jnthn ah, I see
TreyHarris Kaiepi: Could I ask you a module design question? Why did you decide to implement Digest::BubbleBabble as a unit class with all "static methods"? Wouldn't a module with exported functions have been cleaner? 23:18
TreyHarris Since AFAICT the class has no instance state at all 23:19
Xliff Those are catch-alls.
And rather than export the functions, it keeps everything in it's own "space"
So as not to clutter MAIN
That would at least be my reason for doing that.
m: my $a = $*SCHEDULER.cue({ 1.say }, in => 2); $a.cancel; 23:21
camelia ( no output )
Xliff m: my $a = $*SCHEDULER.cue({ 1.say }, in => 2);
camelia ( no output )
Xliff m: my $a = $*SCHEDULER.cue({ 1.say }, in => 2); await $a
camelia An operation first awaited:
in block <unit> at <tmp> line 1

Died with the exception:
Can only specify Awaitable objects to await (got a Cancellation)
in block <unit> at <tmp> line 1
Xliff m: my $a; await start $a = $*SCHEDULER.cue({ 1.say }, in => 2); 23:22
camelia ( no output )
Xliff m: my $a; await start { $a = $*SCHEDULER.cue({ 1.say }, in => 2); }
camelia ( no output )
Xliff m: my $a = $*SCHEDULER.cue({ 1.say }, in => 2); $a.cancel; sleep 3
camelia ( no output )
Xliff m: my $a = $*SCHEDULER.cue({ 1.say }, in => 2); sleep 3 23:23
camelia 1
TreyHarris Xliff: How do you pass a "static method" like that as a value? That's why I noticed this; I wanted to set a variable to Digest::BubbleBabble.encode(), but I can't figure out the syntax. The way you'd do it for a function, it complains about the number of positionals no matter what syntax I've tried to use
Kaiepi TreyHarris, i don't like exporting subs in case of namespace conflicts 23:24
TreyHarris (set a variable like `my $func = ...` so that I could later do `$func($data)`)
Kaiepi check t/01-basic.t for examples on how to use it
TreyHarris Kaiepi: I don't see in 01-basic.t any case of the method being assigned to a variable; it seems to be used literally there. Which line are you talking about? 23:25
Kaiepi wait what are you trying to do? 23:26
oh
TreyHarris Let the encoding function be set to different things, one of which being Digest::BubbleBabble.encode
Kaiepi do something like sub bubblebabble-encode(Blob $data --> Blob) { Digest::BubbleBabble.encode: $data } 23:27
actually there's a way you can do it like my &bubblebabble-encode = ... 23:33
gimme a sec
Kaiepi TreyHarris, my &bubblebabble-encode = Digest::BubbleBabble.^lookup('encode').assuming(Digest::BubbleBabble) 23:36
TreyHarris Sorry... I'm not making myself clear, apologies... let me try another way: if it were `unit module Digest::BubbleBabble; our sub encode(Blob $digest --> Blob)`, you could just do `my $encoder = &Digest::BubbleBabble::encode; ... $encoder($data)...` and it wouldn't pollute any namespace, would it? 23:48
TreyHarris I shouldn't have used the word "export" like that since it's also a keyword 23:48
Kaiepi: I meant that I didn't understand why it was using a class rather than a module, not methods rather than exported subs. Sorry for writing the question so confusingly 23:51
Kaiepi i guess 23:53
i'll make it a module instead of a class
TreyHarris The "normal" calling pattern doesn't change but for "use" -> "need" and "BubbleBabble." -> "BubbleBabble::" 23:54
TreyHarris It's really easy to turn a sub or multi into a method, but the reverse requires ugly MOP stuff like ^lookup. But that's just my impression; I'm probably missing an important wrinkle here 23:57