»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:08 gfldex left 00:09 cdg left 00:11 leont left
buggable New CPAN upload: Serialise-Map-0.1.1.tar.gz by SAMGWISE cpan.metacpan.org/authors/id/S/SA/...1.1.tar.gz 00:22
00:28 startinginperl joined 00:30 startinginperl left 00:42 markong left 00:53 nekomune left 01:14 aborazmeh joined, aborazmeh left, aborazmeh joined 01:44 softmoth left, softmoth joined 01:52 noganex left
buggable New CPAN upload: ScaleVec-0.0.1.tar.gz by SAMGWISE cpan.metacpan.org/authors/id/S/SA/...0.1.tar.gz 01:52
01:53 cdg joined 01:57 Manifest0 left 01:58 cdg left 02:00 statisfiable6 left, statisfiable6 joined 02:07 ufobat left, colomon_ joined 02:08 colomon left, colomon_ is now known as colomon 02:27 cdg joined 02:32 cdg left 02:45 ilbot3 left 02:51 mcmillhj joined 02:56 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:58 mcmillhj left 03:04 mcmillhj joined 03:07 ufobat joined 03:08 mcmillhj left 03:10 TEttinger joined 03:13 cdg joined 03:15 mcmillhj joined 03:17 aindilis joined 03:20 mcmillhj left 03:25 mcmillhj joined 03:30 mcmillhj left
buggable New CPAN upload: ScaleVec-0.0.2.tar.gz by SAMGWISE cpan.metacpan.org/authors/id/S/SA/...0.2.tar.gz 03:42
04:11 reportable6 left, coverable6 left, bloatable6 left, bisectable6 left, notable6 left, quotable6 left, greppable6 left, reportable6 joined, ChanServ sets mode: +v reportable6, coverable6 joined 04:12 bloatable6 joined, ChanServ sets mode: +v bloatable6, bisectable6 joined, notable6 joined, quotable6 joined, greppable6 joined
buggable New CPAN upload: ScaleVec-0.0.3.tar.gz by SAMGWISE cpan.metacpan.org/authors/id/S/SA/...0.3.tar.gz 04:12
04:20 skids left 04:34 epony joined 04:37 Cabanossi left 04:38 Cabanossi joined 04:39 cdg left, aborazmeh left, cdg joined 04:43 shinobi-cl joined 04:44 cdg left 04:51 AlexDaniel left 04:52 wamba joined, cdg joined 04:55 Thrush joined
lucs m: use MONKEY-TYPING; class Foo { } ; class Bar is Foo { } ; augment class Foo { method aug { say 'Aug' } ; } ; my Bar $b .= new.aug; 04:56
camelia No such method 'aug' for invocant of type 'Bar'. Did you mean 'aug'?
in block <unit> at <tmp> line 1
04:57
lucs :(
04:57 cdg left
Thrush Hi! When I create a function that takes "Numeric @a" as input, it won't take a regular array of numbers. Why is this? ( bit.ly/2EObYa9 ) 04:58
05:01 cpage_ joined, cpage left, cpage_ is now known as cpage 05:02 shinobicl joined
buggable New CPAN upload: ScaleVec-0.0.4.tar.gz by SAMGWISE cpan.metacpan.org/authors/id/S/SA/...0.4.tar.gz 05:02
05:03 shinobi-cl left 05:04 nekomune joined, Zoffix joined
Zoffix Thrush: because "Numeric @a" means "Array parametarized with type Numeric". You wanted `sub average(@a where { .so and .all ~~ Numeric})` 05:06
Thrush: what did you mean by `where @a > 0`? That means "array must have at least one element". Did you mean to test all of the elements are positive numerics? 05:07
Thrush Zoffix: A common mistake in creating an average function is to not check for the special case of zero elements to average (which results in a divide-by-zero error). So I put in the declaration itself that the array must have at least one element. 05:08
Zoffix Ah, then `sub average(@a where { .so and .all ~~ Numeric})` will do the trick 05:09
eco: WhereList 05:10
buggable Zoffix, WhereList 'Simpler `where` constraints for items of lists': github.com/zoffixznet/perl6-WhereList
Zoffix there's also this module
`sub average (@a where .so && .&all-items: Numeric)` (not much better, in this case, I guess) 05:11
Thrush Thanks, Zoffix! How would I make this work for an array of Strings, where each Str is a number? Like: @a = ['1', '2', '3', '4']; 05:12
Zoffix `(@a where {.so and .all ~~ Numeric and +«$_ }) 05:13
`
err, s/Numeric/Str/
ZzZombo can I augment something by reference and not by name? 05:14
Zoffix What's a "reference"?
ZzZombo m: use MONKEY;class A {};augment A.new.HOW {method m{'works'}};say A.m 05:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed augment
at <tmp>:1
------> 3use MONKEY;class A {};augment A7⏏5.new.HOW {method m{'works'}};say A.m
Zoffix m: use MONKEY;class A {};augment ::(BEGIN A.new.HOW) {method m{'works'}};say A.m
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed augment
at <tmp>:1
------> 3Y;class A {};augment ::(BEGIN A.new.HOW)7⏏5 {method m{'works'}};say A.m
Zoffix m: use MONKEY;class A {}; augment class ::(BEGIN A.new.HOW) {method m{'works'}};say A.m 05:16
camelia 5===SORRY!5=== Error while compiling <tmp>
You tried to augment class ::(BEGIN A.new.HOW), but it does not exist
at <tmp>:1
------> 3 A {}; augment class ::(BEGIN A.new.HOW)7⏏5 {method m{'works'}};say A.m
expecting any of:
Zoffix :/
m: dd A.new.HOW
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
A used at line 1
Zoffix m: dd class {}.new.HOW
camelia Perl6::Metamodel::ClassHOW.new
Zoffix m: use MONKEY;class A {}; augment class ::(BEGIN A.new.HOW.^name.subst: 'Perl6::', '') {method m{'works'}};say A.m
camelia ===SORRY!===
Cannot find method 'augmentable' on object of type Archetypes
Zoffix m: use MONKEY; augment class Metamodel::ClassHOW {} 05:17
camelia ===SORRY!===
Cannot find method 'augmentable' on object of type Archetypes
Zoffix Doesn't look like it's augmentable ATM
05:17 xtreak joined
Zoffix m: class Foo {}.HOW.^mixin: role { method meows { say "meow " } }; Foo.^meows 05:17
camelia Too many positionals passed; expected 1 argument but got 2
in method meows at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: class Foo {}.HOW.^mixin: role { method meows (|) { say "meow " } }; Foo.^meows
camelia meow
Zoffix ZzZombo: could run-time mixing tho 05:18
ZzZombo Hm
Thrush Zoffix: Thanks, but I don't understand the "+«$_" part. Also, I want the function to handle an array that has a mix of numbers and strings, provided that the strings can all be converted to numbers. 05:20
Zoffix 1 sec 05:26
Thrush: `(@a where {0 < $_ == .grep: Str|Numeric and +«$_ })`. The `0 < $_` part means "more than zero elements", then we just chain these ops and the "$_ == .grep: Str|Numeric" part means "all elements are either Str or Numeric types"; the `Str|Numeric` is a Junction that means "Str or Numeric" and .grep: Str|Numeric` goes over each element and checks each one is either of them, if ALL of them match that, 05:28
then .grep will return the same number of elements as the entire array, so `$_ == .grep` would be True. The `+«$_` part is a shorter way to write the equivalent of `$_.map({.Numeric})` which returns a Failure for any element that could not be converted to number
05:28 softmoth left
Zoffix The +«$_ works here, but I don't get why :S 05:28
05:28 softmoth joined
Zoffix Ohhh 05:28
noo
m: dd +«[1, 2, 'a'] 05:29
camelia [1, 2, Failure.new(exception => X::Str::Numeric.new(source => "a", pos => 0, reason => "base-10 number must begin with valid digits or '.'"), backtrace => Backtrace.new)]
Zoffix m: say [1, 2, 'a'] ~~ { +«$_ }
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏)
in block <unit> at <tmp> line 1
Zoffix What makes it explode?
s: { +«$_ }, 'ACCEPTS', \([1, 2, 'a']) 05:30
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/de2d...Code.pm#L7
Zoffix m: dd [1, 2, 'a'] ~~ { +«$_ } 05:31
camelia [1, 2, Failure.new(exception => X::Str::Numeric.new(source => "a", pos => 0, reason => "base-10 number must begin with valid digits or '.'"), backtrace => Backtrace.new)]
Zoffix m: sub (@a where .so && +«$_) { dd @a }([1 ,2, 'a']) 05:32
camelia Constraint type check failed in binding to parameter '@a'; expected anonymous constraint to be met but got Array ($[1, 2, "a"])
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: sub (@a where {.so && +«$_}) { dd @a }([1 ,2, 'a'])
camelia [1, 2, "a"]
Zoffix k, mistery solved :) It was "working" only 'cause I was using a thunk and the array with a failure inside was being smartmatched with the original :) 05:33
Thrush: so, the correct version is `(@a where {0 < $_ == .grep: Str|Numeric and try +«$_ })`. The explanation is the same. I added `try` so that the Failure made by conversion to Numeric explodes right away
m: say .sum/$_ with [1 ,2, 'a'] 05:34
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏)
in block <unit> at <tmp> line 1
Zoffix m: say .sum/$_ with [1 ,2, 4"]
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say .sum/$_ with [1 ,2, 47⏏5"]
expecting any of:
infix
infix stopper
statement end
statement modifier
Zoffix m: say .sum/$_ with [1 ,2, 4]
camelia 2.333333
Zoffix or `(@a where .so && .&all-items: Str|Numeric, (+*).defined)` with the WhereList module 05:36
Zoffix is disappointed `+* .defined` doesn't curry right :)
The `«` in +«$_ is a hyper btw: docs.perl6.org/language/operators#..._Operators 05:39
it hypers prefix:<+> over the $_
Can also write +<<$_
Thrush Zoffix: So +«$_ is using a hyperoperator! 05:44
Zoffix yeah 05:45
Thrush Thanks for your help, Zoffix. I gotta go now. Thanks again. 05:47
Zoffix \o
lucs Derived class doesn't pick up augmented method in parent?: 05:48
m: use MONKEY; class Foo { } ; class Bar is Foo { } ; augment class Foo { method aug { say 'Aug' } ; } ; my Bar $b .= new.aug;
camelia No such method 'aug' for invocant of type 'Bar'. Did you mean 'aug'?
in block <unit> at <tmp> line 1
05:48 Thrush left, curan joined
Zoffix lucs: no, need to re-compose it 05:49
m: use MONKEY; class Foo { } ; class Bar is Foo { } ; augment class Foo { method aug { say 'Aug' } ; } ; Bar.^compose; my Bar $b .= new.aug;
camelia Aug
lucs Ah, thanks.
05:53 cdg joined 05:54 khw left 05:55 Kyo91 left 05:58 cdg left 06:01 softmoth left 06:07 troys left 06:18 pierre__ joined 06:21 shinobicl left 06:32 lowbro joined, lowbro left, lowbro joined
ZzZombo Zoffix, doesn't seem to work: 06:33
m: class A {};A.new.WHAT.^mixin: role {method m{'works'}};say A.m
camelia No such method 'm' for invocant of type 'A'
in block <unit> at <tmp> line 1
ZzZombo m: class A {};A.new.WHAT does role {method m{'works'}};say A.m 06:34
camelia Cannot use 'does' operator on a type object A.
in block <unit> at <tmp> line 1
06:36 darutoko joined
Zoffix ZzZombo: 'cause you're mixing into the type object. 06:36
m: class A {}; (A.new.WHAT.^mixin: role {method m{'works'}}).m 06:37
camelia ( no output )
Zoffix m: class A {}; (A.new.WHAT.^mixin: role {method m{'works'}}).m.say
camelia works
Zoffix m: use MONKEY; class A {}; augment class ::(BEGIN A.new.^name) { method m {'works'} }; A.new.m.say
camelia works
Zoffix .^mixin on objects mixes into them; .^mixin on type objects returns a new type object with role mixed into it 06:38
06:39 wamba left 06:43 domidumont joined 06:49 domidumont left, domidumont joined 06:54 cdg joined 06:57 pierre__ left 07:00 cdg left 07:03 domidumont left 07:08 wamba joined 07:11 pierre__ joined 07:12 Zoffix left 07:23 domidumont joined 07:34 noganex joined
moritz good morning 07:37
the DBIish travis build fails with a segfault: travis-ci.org/perl6/DBIish/jobs/338860755
07:37 Manifest0 joined 07:38 xtreak left, Manifest0 left 07:39 espadrine_ left 07:40 someuser joined 07:41 xtreak joined 07:46 pierre__ left
abraxxa i had a segfault yesterday too when bulding moar-2018.1 with rakudobrew at home 07:52
but worked after multiple tries 07:53
update submodules took forever
07:55 cdg joined 07:57 pierre__ joined
abraxxa ah, no, I'm mixing things up, zef install Cro segfaulted on the first try 07:57
07:57 pierre__ left 08:00 cdg left 08:02 pierre__ joined, epony left
rightfold What is zef a reference to? 08:04
08:05 pierre__ left 08:15 zeddy_k joined 08:17 jnap_ left, mithaldu_ left, zostay left, mithaldu_ joined, zostay joined 08:18 jnap_ joined 08:22 xtreak left, xtreak joined 08:26 xtreak left, epony joined 08:29 pierre__ joined 08:31 zeddy_k left 08:33 pierre__ left
tyil is there a list of dependencies for moarvm? I'm trying to create ebuilds for Funtoo (since the current ones are stuck at 2017.09), but moarvm compile fails due to a missing dynload.h 08:36
08:38 TEttinger left 08:41 leont joined 08:56 scimon joined, cdg joined 08:57 dakkar joined 09:01 cdg left, xtreak joined 09:16 zakharyas joined 09:19 zakharyas left 09:20 zakharyas joined 09:22 pierre__ joined 09:24 Ven`` joined 09:28 Ven`` left
lookatme tyil, the header is in moarvm 3rdparty directory, did you update your sub-module of rakudo source code ? 09:29
s/rakudo/moarvm/
tyil lookatme: I've already gotten help from samcv, moar and nqp ebuilds seem to be working now, I'm now writing the rakudo ebuild 09:30
lookatme okay, great ! 09:31
stmuk_ abraxxa: I think the advice is still to install Cro without running tests 09:33
09:33 stmuk_ is now known as stmuk 09:34 wamba left, rindolf joined 09:42 wamba joined 09:48 zakharyas1 joined
El_Che stmuk: cro tests passed fine the day before yesterday, but they run for quite some time 09:50
09:53 a3f_ joined 09:54 AlexDaniel joined 09:55 a3f left 09:57 cdg joined 09:58 markong joined
stmuk El_Che: yes I think I only saw one hang and mostly passing a few months back so things are definitely better 10:00
10:01 a3f_ left 10:02 cdg left 10:08 a3f joined 10:21 xtreak left
jnthn As of 0.7.3 (released a couple of days ago), I believe the various Cro test instabilities are gone. 10:25
But yes, it comes with a sizable test suite.
jkramer Is there a shorter way of getting all odd elements of an array than @foo[1, 3, ... *] ?
El_Che jnthn: I find it very weird to suggest to skip test in the doc
I prefer to have fails at install time, than at runtime 10:26
hype the extensive tests as a feature
jnthn Then run them
El_Che jnthn: I did
I am talking about the doc
ZzZombo Why does docs.perl6.org/language/packages have distinct paragraphs for direct lookup and package lookup if they look all the same? 10:27
jkramer El_Che: Last time I installed Cro w/ tests I aborted after several hours. :) I think something got stuck, idk
Seems to work now though 10:28
El_Che jkramer: wouldn't you be afrad that failing test would mean failing crashes when deployed?
stmuk El_Che: with perl 5 yes but I'd cut a perl 6 module under active development more slack 10:29
10:29 wamba left
El_Che stmuk: that's a fair point 10:29
stmuk El_Che: especially if phase of moon failures and threads were involved
10:30 xtreak joined
jkramer El_Che: Well yes but I wasn't going to use Cro in production anyway and it just wouldn't install w/ tests enabled, so I'd prefer a crashing Cro to play with over not being able to install at all :) 10:30
10:31 ZzZombo left, ZzZombo joined
jnthn El_Che: Documentation exists to increase people's chances of success in using something. Thus it's better that it documents what works now, and is then updated when that changes, than docs something that is hoped to work in the future. 10:31
El_Che jnthn: Passing tests skewed my expectation, I guess
that's what I call a luxury problem :) 10:32
jnthn: it's impressive how easy to get started, by the way 10:33
jnthn Anyway, I'll see if I get any reports of issues with 0.7.3 and probably toss the --/test shortly
El_Che I only need to make sure my app does more than showing me hardcoded json. Looking at the DB stuff
jnthn: I am actually not complaining, I was kind of puzzled. 10:34
stmuk El_Che: do the tests pass 100% if you run in a loop for a bit .. I'm going to try it 10:36
jnthn stmuk: Would be very interested to hear the results of that.
Need to focus on $dayjob a bit, bbl :)
10:38 zakharyas left 10:39 zakharyas joined 10:52 wamba joined 10:53 wamba left 10:58 cdg joined
ZzZombo m: module A {role R is export {method m{$::('OUR')::x}}};import A;class C does R {our $x='asd'};C.m.say 10:59
camelia No such symbol '$x'
in method m at <tmp> line 1
in block <unit> at <tmp> line 1
ZzZombo m: module A {role R is export {method m{$::OUR::x}}};import A;class C does R {our $x='asd'};C.m.say
camelia (Any)
ZzZombo m: module A {role R is export {method m{$::(self.WHAT.^name)::x}}};import A;class C does R {our $x='asd'};C.m.say
camelia asd
ZzZombo What's going on?
11:00 wamba joined 11:03 cdg left 11:10 ZzZombo left, ZzZombo joined
timotimo jkramer: i think you can use rotor to get all odd elements 11:12
11:16 Dinesh joined, Dinesh left 11:17 zakharyas left
jkramer m: (^10)[1..*].rotor(1 => 1) 11:17
camelia ( no output )
jkramer m: dd (^10)[1..*].rotor(1 => 1)
camelia ((1,), (3,), (5,), (7,), (9,)).Seq
jkramer Yeah but it's not really shorter :)
11:17 zakharyas joined
jkramer m: dd |(^10)[1..*].rotor(1 => 1) 11:18
camelia (1,)
(3,)
(5,)
(7,)
(9,)
jkramer Also I have to deal with sub-lists then :) 11:19
m: dd |(^10)[1..*].rotor(1 => 1).flat
camelia 1
3
5
7
9
11:20 xtreak left 11:22 xtreak joined 11:25 Ven`` joined 11:29 Ven`` left 11:30 someuser left
timotimo m: .say for (^10).skip(1).rotor(1=>1) 11:32
camelia (1)
(3)
(5)
(7)
(9)
timotimo m: .say for (^10).skip(1).rotor(1=>1)>>.head
camelia (1)
(3)
(5)
(7)
(9)
timotimo ah, yes, hypers preserve structure or something
m: .say for (^10).skip(1).rotor(1=>1)>>.[0]
camelia 1
3
5
7
9
jkramer Not getting shorter though :) 11:33
Something like @foo[!* %% 2] would be nice 11:34
timotimo m: .say for (^10).grep({ $++ !%% 2 }) 11:38
camelia 1
3
5
7
9
timotimo m: say (^10).classify(* %% 2) 11:40
camelia {False => [1 3 5 7 9], True => [0 2 4 6 8]}
timotimo m: say (^10).classify(* %% 2){False}
camelia [1 3 5 7 9]
jnthn m: my @foo = 1..10; say @foo[1,3...*]
camelia (2 4 6 8 10)
jnthn Is that really too long? :)
timotimo m: say :{False => 1, True => 2}.perl
camelia :{:False(1), :True(2)}
timotimo that's not correct, is it? 11:41
that .perl would rountrip into a hash with string keys
jnthn Hm, indeed
timotimo at least it puts the : in front :)
11:45 zakharyas1 left
timotimo no time to file bug 11:46
11:49 zakharyas left 11:59 cdg joined 12:04 cdg left
jkramer jnthn: No, I was just wondering if it's possible to make it even shorter :) 12:18
12:23 Alikzus left 12:26 mcmillhj joined 12:27 someuser joined 12:31 mcmillhj left 12:42 gregf_ left 12:44 mcmillhj joined, someuser left 12:48 xtreak left 12:51 mcmillhj left 12:53 mcmillhj joined 12:57 mtsd joined 12:58 Zoffix joined, mcmillhj left
jnthn jkramer: If you're doing it a lot, then constant ODD = 1, 3 ... *; and then just @a[ODD] or so would work I guess :) 12:59
Zoffix rightfold: to en.wikipedia.org/wiki/Zef hense "It's like [cpanm] wearing high heels with a tracksuit" in its meta description
ufobat i've got the posibility to use perl6 in production :-) something where threads are requried. unfortunatelly the openssl capabilities of openssl or io::socket::async::ssl are not advanced enough :-( 13:00
Zoffix jnthn: that has a bug in that the iterator will keep inching forward by one on each lookup 13:02
m: my @a = <a b c>; constant ODD = (1, 3 ... *).cache; say @a[ODD]; say @a[ODD];
camelia (b)
(b (Any))
ufobat i would need stuff with session_tickets and verify_cb and client certificates and stuff.. is there anyone working on that module, because there are not many commits so far
13:02 pierre__ left 13:03 pierre__ joined
Zoffix R#1320 but I don't see a way around it 13:03
synopsebot R#1320 [open]: github.com/rakudo/rakudo/issues/1320 [LTA] Unwanted "drift" when re-using the same lazy iterable to index another iterable
13:04 mcmillhj joined
jnthn Zoffix: huh, why does it do that... 13:04
If it's cached it could be a List
13:04 konsolebox left
jnthn ufobat: What is it missing, specifically? 13:05
Oh, you just said and I didn't ready
*read
ufobat: I'm working on it to the degree I need it for Cro. 13:06
And contributions for usecases beyond that are very welcome
But I'm a) short on time, and b) not an ideal person to work on it anyway, due to lack of experience in that area
Zoffix: Um, I meant *should* be a List. And iterating the same List twice starts from the start. 13:07
ufobat it would be a reimplementation of stuff i am doing with perl5 right now, i use Net::SSLeay and AnyEvent::TLS. i am afraid my knowledge of ssl is to superficial to say what i need from the "c binding" point of view 13:08
13:08 pierre__ left
jnthn Yeah. Somebody has been contributing a bit recently who seems to be far more clueful than I am on those things :) 13:08
Zoffix jnthn: It is a List (a lazy one). But each iteration we pull-one an extra element to see if we got more indices
ufobat i am probably not allowed to show what i am doing in perl5 because its not propritary code :( 13:09
13:09 mcmillhj left
jnthn ufobat: Even if you could, my todo list is huge already, so I'd not be likely to have chance to do it in a hurry 13:10
ufobat jap! no problem :-) i was just a bit frustrated yesterday because i'd love to put perl6 in prodoction at my job :) 13:11
13:11 konsolebox joined 13:12 mcmillhj joined, mtsd left
Zoffix gives up 13:19
13:19 pnu__ joined
Zoffix Too sleep deprived to read the code to verify the "It makes sense" claim in R#1320 is true 13:20
synopsebot R#1320 [open]: github.com/rakudo/rakudo/issues/1320 [LTA] Unwanted "drift" when re-using the same lazy iterable to index another iterable
13:20 mcmillhj left 13:21 mcmillhj joined 13:27 Alikzus joined 13:28 amalia___ joined 13:29 mcmillhj left 13:31 bdmatatu joined
Zoffix Hm, here's the extra 1 el reificiation each time it reifies-until-lazy github.com/rakudo/rakudo/blob/8ba3...st.pm#L117 which is done by push-until-lazy github.com/rakudo/rakudo/blob/8ba3...st.pm#L623 which is called by &POSITIONS github.com/rakudo/rakudo/blob/8ba3...ice.pm#L71 which is called by postcircumfix:<[ ]> 13:32
github.com/rakudo/rakudo/blob/8ba3...ce.pm#L224
13:32 wamba left
Zoffix I guess it can be fixed if we say the up-to-first-non-existent thing with lazy indices applies to all indices from the lazy iterable, rather than just the lazy portion of it and instead of `pos-iter.push-until-lazy(target)` we should map them all from scratch 13:33
13:33 someuser joined 13:35 mcmillhj joined
Zoffix m: my @l := 0, 1, 2, |lazy 3, 4, 5; my @a := 1,; say @a[@l] 13:37
camelia (1 Nil Nil)
Zoffix so that'd return (1,)
13:38 wamba joined 13:39 mcmillhj left 13:40 someuser left, mcmillhj joined, ZzZombo left, ZzZombo joined 13:44 zakharyas joined 13:45 mcmillhj left 13:51 mcmillhj joined 13:54 cdg joined
tbrowder hi, #perl6 13:55
13:56 mcmillhj left
tbrowder i’m trying to install Grammar::ErrorReporting and zef throws an error about .gitignore not being a valid json file in the Grammar* directory. 13:57
13:58 Zoffix left
tbrowder i’ve tried manually removing that file but it’s just added back with the same error. i haven’t tried manual installation yet. 13:58
13:59 cdg left, cdg joined 14:00 someuser joined 14:02 mcmillhj joined
tbrowder using the —force option doesn’t help 14:03
14:06 mcmillhj left 14:10 ash__ joined
ash__ hi. I wanted to fix rt.perl.org/Public/Bug/Display.html?id=126097 (at least partially). What do you think of github.com/ash/rakudo/commit/77fef...079dcf5043 ? I could use multi sub or play with $?CLASS but this seems to be the simplest and at solves the problem for at least the simplest cases such as (0 but True).perl 14:12
14:12 mcmillhj joined 14:18 someuser left 14:20 mcmillhj left 14:27 mcmillhj joined 14:31 jeromelanteri left 14:32 mcmillhj left 14:36 sena_kun joined 14:38 mcmillhj joined
ZzZombo m: module A {role R is export {method m{$::?CLASS::x}}};import A;class C does R {our $x='asd'};C.m.say 14:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$' is not declared
at <tmp>:1
------> 3module A {role R is export {method m{7⏏5$::?CLASS::x}}};import A;class C does R
ZzZombo what gives
m: module A {role R is export {method m{?CLASS::x}}};import A;class C does R {our $x='asd'};C.m.say 14:42
camelia Could not find symbol '&x'
in method m at <tmp> line 1
in block <unit> at <tmp> line 1
jnthn I don't think that's legal syntax
I think it'd need to be ::?CLASS::<$x> or so
14:42 zakharyas left
ZzZombo m: module A {role R is export {method m{?CLASS::<$x>}}};import A;class C does R {our $x='asd'};C.m.say 14:43
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
CLASS used at line 1
14:43 zakharyas joined
ZzZombo m: module A {role R is export {method m{::?CLASS::<$x>}}};import A;class C does R {our $x='asd'};C.m.say 14:43
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3 A {role R is export {method m{::?CLASS:7⏏5:<$x>}}};import A;class C does R {our $x
expecting any of:
colon pair
jnthn Hmm
ZzZombo m: module A {role R is export {method m{?CLASS}}};import A;class C does R {our $x='asd'};C.m.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
CLASS used at line 1
ZzZombo m: module A {role R is export {method m{$?CLASS}}};import A;class C does R {our $x='asd'};C.m.say
14:43 mcmillhj left
camelia (C) 14:43
ZzZombo m: module A {role R is export {method m{$?CLASS<$x>}}};import A;class C does R {our $x='asd'};C.m.say
camelia (Any) 14:44
jnthn module A {role R is export {method m{::?CLASS.WHO<$x>}}};import A;class C does R {our $x='asd'};C.m.say
evalable6 asd
jnthn ::?FOO is parsed somewhat specially, rather than by as a longname
14:44 mcmillhj joined
jnthn So I guess it trips up somewhere 14:44
But .WHO instead of the :: works 14:45
ZzZombo `WHO`?
jnthn module A {role R is export {method m{(::?CLASS)::<$x>}}};import A;class C does R {our $x='asd'};C.m.say
m: module A {role R is export {method m{(::?CLASS)::<$x>}}};import A;class C does R {our $x='asd'};C.m.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3 {role R is export {method m{(::?CLASS):7⏏5:<$x>}}};import A;class C does R {our $x
expecting any of:
colon pair
jnthn ah, that won't work
ZzZombo: Foo::Bar::<$baz> actually compiles into Foo.WHO<Bar>.WHO<$baz>
It just means "give me the stash associated with this type object" 14:46
ZzZombo So, what's the difference between `::?CLASS` and `$?CLASS`, I'm confused. Also, what is `WHO`?
jnthn There's none, they're both bound to the same thing
But ::?CLASS can be used in type-y contexts 14:47
And $?CLASS cannot
(for syntactic reasons)
14:47 Zoffix joined
jnthn WHO is a primitive like WHAT and HOW 14:47
14:49 mcmillhj left
ZzZombo m: module A {role R is export {method m{$?CLASS.WHO<$x>}}};import A;class C does R {our $x='asd'};C.m.say 14:49
camelia asd
14:51 zakharyas left 14:52 zakharyas joined, ZzZombo left, ZzZombo joined 14:54 skids joined, wamba left
ZzZombo m: class {our method m{1}}.m.say 14:54
camelia No such method 'm' for invocant of type '<anon|53478240>'
in block <unit> at <tmp> line 1
ZzZombo m: class {our method m{1}}::m.say 14:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3class {our method m{1}}:7⏏5:m.say
expecting any of:
colon pair
14:55 mcmillhj joined
ZzZombo m: class C {our method m{1}};C.m.say 14:55
camelia No such method 'm' for invocant of type 'C'
in block <unit> at <tmp> line 1
ZzZombo wtf
Why do we even have `our` methods then?
jnthn m: class C {our method m{1}}; dd C.WHO 14:57
camelia {"\&m" => method m (C $: *%_) { #`(Method|52426984) ... }}
jnthn m: class C {our method m{1}}; dd C::<&m>(C)
camelia 1
ZzZombo Yeah, but that's not really useful, I think. 14:58
14:58 wamba joined
jnthn Then don't use it. 14:59
It's just falls out of what my/our usually mean
Zoffix ash__: I see a few problems with that fix: (1) the generated .perl string is lacking parentheses, so I think there might be cases where if that value is part of .perl of another construct, there'd be precedence problems. The generated .perl simply stringifies value, so .perl for something like `True but class { method Str { '42' } }.new` would be entirely wrong. Lastly, it assumes whatever $val.perl'ifies to 15:00
will be available in the scope it's evaled, so even if everything is fixed up, `sub foo { 42 but my class Foo {}.new }; foo.perl.EVAL` would fail. Perhaps instead of trying to create a hack that would work in some cases, we should just make it use .Mu::perl? It won't make it round-trippable on eval, but lots of things aren't.
m: my $l = (True but role { method Int { 0 }; method perl { self.Mu::perl } }; put $l.perl
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3od perl { self.Mu::perl } }; put $l.perl7⏏5<EOL>
Zoffix m: my $l = (True but role { method Int { 0 }; method perl { self.Mu::perl } }); put $l.perl
camelia Bool+{<anon|78763488>}.new
Zoffix m: role Mixer[$thing] { method ::(BEGIN $thing.^name) { $thing }; method perl { "({self.perl} but {$thing.perl})" } }; my $l = True.^mixin: Mixer[42]; put $l.perl 15:04
camelia (timeout)
15:05 mcmillhj left
Zoffix m: role Mixer[$thing] { method ::(BEGIN $thing.^name) { $thing }; method perl { "({callsame} but {$thing.perl})" } }; my $l = True.^mixin: Mixer[42]; put $l.perl 15:06
camelia (Bool::True but 42)
Zoffix m: role Mixer[$thing] { method ::(BEGIN $thing.^name) { $thing }; method perl { "({callsame} but {$thing.perl})" } }; my $l = do { True.^mixin: Mixer[my class Foo {}.new] }; put $l.perl
camelia (Bool::True but Foo.new)
Zoffix m: role Mixer[$thing] { method ::(BEGIN $thing.^name) { $thing }; method perl { "({callsame} but {$thing.perl})" } }; my $l = do { True.^mixin: Mixer[my class Foo {}.new] }; put $l.perl.EVAL
camelia 5===SORRY!5=== Error while compiling /home/camelia/EVAL_0
Undeclared name:
Foo used at line 1
Zoffix ash__: or maybe it's fine *shrug*. Whatever the fix, if you look a few lines higher in that source file, you'll see one of infix:<does> candidates that'd need the same fix applied to it. 15:07
Zoffix &
(p.s.: I used callsame above; don't use it in your fix if you can as it's slow AF) 15:08
15:08 Zoffix left 15:11 gregf_ joined 15:13 Zoffix joined
Zoffix ash__: oh, and maybe use core `but` so if the user defines their own, the .perl.EVAL won't get affected. Solves the precedence thing too 15:14
m: sub infix:<but> (|) { die "no but for you!" }; dd &CORE::infix:<but>(True, 0)
camelia Bool::True
15:14 Zoffix left 15:15 bdmatatu left
tbrowder .tell moritz I'm getting more into your Perl 6 grammar book and it's really helpful! (I can't get zef to install Grammar::ErrorReporting but will attempt to install it manually later today.) 15:17
yoleaux tbrowder: I'll pass your message to moritz.
15:18 Sgeo_ joined
moritz tbrowder: thanks! If you have Docker, you can use the moritzlenz/perl6-regex-alpine image which has it installed 15:19
yoleaux 15:17Z <tbrowder> moritz: I'm getting more into your Perl 6 grammar book and it's really helpful! (I can't get zef to install Grammar::ErrorReporting but will attempt to install it manually later today.)
ZzZombo m: module A {role R is export {method m{$?CLASS.WHO}}};import A;class C does R {our $x='asd'};dd C.m 15:20
camelia {"\$x" => "asd"}
ZzZombo m: module A {role R is export {method m{$?CLASS.WHO}}};import A;class C does R {our $x='asd'};C.m.^name.say
camelia Stash
15:20 curan left, Sgeo left
tbrowder moritz: thanks, but i'll try manual first. to me it looks like a zef problem but that's just a guess at the moment. 15:22
15:26 Ven`` joined 15:29 ash__ left 15:31 mcmillhj joined 15:35 eliasr joined
ZzZombo Last question for today regarding packages and dynamic access I've ben tinkering with, can I declare a symbol in given package dynamically? 15:35
15:36 mcmillhj left 15:37 colomon_ joined 15:38 colomon left, colomon_ is now known as colomon
moritz yes, package symbols are basically just hash entries 15:38
ZzZombo Cool. 15:39
moritz my: my $name = '$x'; class Foo { }; Foo::{$name} = 42; say $Foo::x'
m: my $name = '$x'; class Foo { }; Foo::{$name} = 42; say $Foo::x
camelia 42
ZzZombo And, say, I could even, hell, change entries including deleting them? 15:40
m: package A {our $a='a'};A::<$a>:delete;say A::<$a> 15:41
camelia (Any)
15:41 mcmillhj joined
ZzZombo m: package A {our $a='a'};say A::<$a>;A::<$a>:delete;say A::<$a> 15:42
camelia a
(Any)
15:42 colomon_ joined, colomon left, colomon_ is now known as colomon 15:45 Ven`` left
SmokeMachine m: proto MAIN(:$v = 42, |) {my $*v = $v; {*}}; multi MAIN("cmd1") {say "cmd1: $*v"}; multi MAIN("cmd2") {say "cmd2: $*v"} 15:45
camelia Usage:
<tmp> cmd1
<tmp> cmd2
SmokeMachine shouldn't --v be shown on the usage? 15:46
15:46 mcmillhj left 15:47 mcmillhj joined
ZzZombo m: supersede 15:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed supersede
at <tmp>:1
------> 3supersede7⏏5<EOL>
ZzZombo So this is a thing, but undocumented.
jnthn Also unimplemented 15:51
It's just in the grammar to reserve the keyword
For a future Perl 6 version
[Coke] m: sub MAIN("cmd", :$v) { 1} } 15:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3sub MAIN("cmd", :$v) { 1} 7⏏5}
[Coke] m: sub MAIN("cmd", :$v) { 1}
camelia Usage:
<tmp> [-v=<Any>] cmd
[Coke] ^^ I think the named params have to come second in the declaration.
ZzZombo m: module A {role R is export {method m{$?CLASS.WHO<$x>}}};import A;class C does R {};C.m.say 15:53
camelia (Any)
SmokeMachine [Coke]: but that code works...
[Coke] for the USAGE specifically, I mean.
SmokeMachine m: proto bla(:$v = 42, |) {my $*v = $v; {*}}; multi bla("cmd1") {say "cmd1: $*v"}; multi bla("cmd2") {say "cmd2: $*v"}; bla :13v, "cmd1"
camelia Cannot resolve caller bla(cmd1, :v(13)); none of these signatures match:
(Str $ where { ... })
(Str $ where { ... })
in sub bla at <tmp> line 1
in block <unit> at <tmp> line 1
[Coke] m: multi MAIN("cmd1", :$v = 42) {say "cmd1: $*v"}; multi MAIN("cmd2", :$v = 42) {say "cmd2: $*v"}
camelia Usage:
<tmp> [-v=<Any>] cmd1
<tmp> [-v=<Any>] cmd2
[Coke] and or maybe it's a proto interaction. 15:54
SmokeMachine isnt is a problem with proto?
m: proto MAIN($bla = 42, |) {my $*v = $v; {*}}; multi MAIN("cmd1") {say "cmd1: $*v"}; multi MAIN("cmd2") {say "cmd2: $*v"} 15:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$v' is not declared
at <tmp>:1
------> 3proto MAIN($bla = 42, |) {my $*v = 7⏏5$v; {*}}; multi MAIN("cmd1") {say "cmd1:
jnthn I suspect the USAGE generator just doesn't consider the proto at all
SmokeMachine m: proto MAIN($bla = 42, |) {my $*v = $bla; {*}}; multi MAIN("cmd1") {say "cmd1: $*v"}; multi MAIN("cmd2") {say "cmd2: $*v"}
camelia Usage:
<tmp> cmd1
<tmp> cmd2
jnthn But only the candidates
Though I guess it maybe impacts on the args parser too
SmokeMachine jnthn: that was my guess...
15:56 mcmillhj left
jnthn You're the first person I can remember trying to factor out common args into a proto and using a dynamic to convey them :) 15:56
15:56 bwisti joined
jnthn I never thought to do it. :) 15:56
It's a cute idea.
[Coke] m: multi MAIN(:$v= 33, "cmd1") {say "cmd1: $*v"}; multi MAIN("cmd2", :$v = 42) {say "cmd2: $*v"} 15:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot put required parameter after variadic parameters
at <tmp>:1
------> 3multi MAIN(:$v= 33, "cmd1"7⏏5) {say "cmd1: $*v"}; multi MAIN("cmd2",
expecting any of:
constraint…
rightfold Zoffix: thanks
SmokeMachine www.irccloud.com/pastebin/NZD7iDlu/
rightfold Nice
SmokeMachine jnthn: :)
jnthn: this is what Im trying to do... www.irccloud.com/pastebin/Z3VyMUSj/ 15:58
jnthn: doing that made me wish for a "tree of protos"... 16:00
jnthn: in my example would be great if I could do the common part of the "search" and the "set" commands only once... 16:02
ZzZombo Is there a reason why does the Perl 6 code uses a raw parameter for invocant in signatures, like so: `sub x(\SELF,|){...}`? Does that matter, and what for? 16:04
moritz it's useful for when you need to write to SELF, or when you need to preserve containerization 16:06
I also think it's fast 16:07
16:08 domidumont left 16:09 ZzZombo left
SmokeMachine should the USAGE generator read search for parameters on the proto main? 16:11
16:12 sjoshi joined 16:13 ZzZombo joined
ZzZombo My goddamned connection keeps failing. Did I miss anything? 16:13
16:21 mcmillhj joined 16:22 troys joined
[Coke] you can check irc logs for that. 16:23
16:23 ash___ joined
[Coke] irclog.perlgeek.de/perl6/2018-02-08#i_15794054 (doesn't look like it) 16:23
ZzZombo Thanks. 16:25
16:26 mcmillhj left
ash___ Zoffix: looks too difficult :-D 16:30
16:32 mcmillhj joined 16:37 mcmillhj left, wamba left 16:43 mcmillhj joined 16:46 khw joined 16:48 sjoshi left, mcmillhj left 16:54 mcmillhj joined 16:59 mcmillhj left 17:05 mcmillhj joined 17:10 mcmillhj left 17:11 Ulti joined 17:13 ash___ left 17:16 mcmillhj joined 17:17 wamba joined 17:18 scimon left 17:20 bwisti left 17:21 mcmillhj left
buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.0.1.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...0.1.tar.gz 17:22
tyil hype 17:23
17:23 natrys joined 17:27 mcmillhj joined, dakkar left 17:31 mcmillhj left
TimToady P5 has code to notice when an array is being used like a queue, with shifts off the left and pushes on the right; when the waste at the front gets to big, it shifts the whole thing down 17:34
do we attempt to do anything like this?
*too
17:38 mcmillhj joined 17:42 brrt joined, mcmillhj left
jnthn TimToady: Yes, pretty certain the "expand" code first checks if there's space recoverable by moving things to the left 17:45
well, or the start :)
17:46 s0me0ne-unkn0wn joined 17:48 mcmillhj joined 17:49 s0me0n3-unkn0wn left 17:53 zeddy_k joined 17:56 mcmillhj left 17:57 domidumont joined 18:03 pierre__ joined 18:06 zakharyas left 18:08 mcmillhj joined, pierre__ left
[Coke] docs.perl6.org/links.txt - that probably should not get pushed out. 18:10
18:13 mcmillhj left 18:15 zakharyas joined 18:19 mcmillhj joined 18:22 Kaiepi left 18:24 mcmillhj left 18:29 eroux joined 18:30 mcmillhj joined 18:35 mcmillhj left 18:38 ash__ joined 18:41 mcmillhj joined 18:42 ash__ left 18:45 pierre_ joined, mcmillhj left 18:48 mcmillhj joined 18:49 darutoko left, pierre_ left 18:53 mcmillhj left, Rawriful joined 18:57 amalia___ left 18:58 mcmillhj joined 19:04 mcmillhj left 19:10 mcmillhj joined 19:12 cdg left 19:15 mcmillhj left
TimToady m: use NativeCall; my $buf = CArray[uint8].new(0 xx 5); $buf[0] = 255; say $buf[0] 19:18
camelia -1
TimToady my proggie just blew up from that 19:19
19:21 mcmillhj joined 19:25 peteretep left 19:26 mcmillhj left 19:27 peteretep joined
skids Yeah... several of my endeavors have ended at a similar sticking point. 19:28
19:32 mcmillhj joined 19:36 domidumont left 19:38 mcmillhj left 19:44 mcmillhj joined 19:49 mcmillhj left 19:51 mcmillhj joined 19:53 zakharyas left, squashable6 left, bloatable6 left 19:54 quotable6 left, bloatable6 joined, ChanServ sets mode: +v bloatable6, squashable6 joined, ChanServ sets mode: +v squashable6, quotable6 joined, ChanServ sets mode: +v quotable6, zakharyas joined 19:55 someuser joined 19:56 mcmillhj left 20:02 mcmillhj joined 20:03 natrys left 20:04 brrt left 20:07 zakharyas left 20:10 mcmillhj left 20:16 ash__ joined 20:23 Kaiepi joined 20:24 someuser left 20:29 pecastro joined 20:33 dalek left 20:39 p6lert left 20:44 mcmillhj joined 20:47 stmuk_ joined 20:49 stmuk left, mcmillhj left 20:53 rindolf left 20:54 bdmatatu joined 20:55 mcmillhj joined
bdmatatu Hi folks -- I'm getting consistent travis build errors about being unable to "update p6c mirror" or cpan mirror -- travis-ci.org/bduggan/p6-jupyter-k.../338971633 20:56
Anyone have any idea what might be wrong? 20:57
20:58 ash__ left 21:03 AlexDaniel left 21:05 mcmillhj left 21:06 gfldex joined, cdg joined
stmuk_ bdmatatu: I've been getting exactly the same errors today. Initially I thought network connectivity but I now suspect zef or rakudo bug 21:06
the urls have always worked directly from the browser AFAIK 21:07
21:08 stmuk_ is now known as stmu, stmu is now known as stmuk 21:11 mcmillhj joined, cdg_ joined 21:14 Geth left, cdg left 21:19 mcmillhj left 21:33 rindolf joined 21:38 espadrine_ joined 21:45 sena_kun left 21:59 TEttinger joined
bdmatatu stmuk: Looks like your first thought was right -- I added "travis_retry" before "zef install --depsonly ." and that seems to have made it work. 21:59
stmuk I'm still surprised both p6c.org and github domains would be down at once 22:03
geekosaur <butt> overloaded proxy travis-side </butt>
stmuk geekosaur: I saw the same outside travis from another ISP 1000s of miles away 22:04
geekosaur huh. then I'd be checking routing
(I'm somewhat used to travis throwing phantom network failures) 22:05
22:05 leont left
stmuk I reproduced outside travis and saw no network issues outside zef 22:05
22:05 bdmatatu left
stmuk if there is a problem it won't be usually seen due to zef caching .. I had rm -rf .zef and a travis build would also have no caching 22:07
22:08 synopsebot left
stmuk I can reproduce now as well 22:11
22:13 skids left 22:14 brrt joined 22:17 aindilis left 22:18 dalek joined, ChanServ sets mode: +v dalek, SourceBaby left, sergot left, psch left, Util left, Geth joined, ChanServ sets mode: +v Geth, p6lert joined, synopsebot joined, ChanServ sets mode: +v synopsebot, SourceBaby joined, ChanServ sets mode: +v SourceBaby 22:23 Zoffix joined 22:27 epony left
Zoffix SmokeMachine: you can use dynamic vars as parameters. This way you get the benefit of optimized "only star" proto too: 22:27
m: proto MAIN(:$*v = 42, |) {*}; multi MAIN("cmd1") {say "cmd1: $*v"}; multi MAIN("cmd2") {say "cmd2: $*v"}
camelia Usage:
<tmp> cmd1
<tmp> cmd2
Zoffix SmokeMachine: and missing $*v in usage is a bug and should be filed github.com/rakudo/rakudo/issues/new 22:28
.tell ash__ well, out of all the people here, you should be most familiar with the saying "Glaza boyatca a ruki delayut" :)
yoleaux Zoffix: I'll pass your message to ash__.
jnthn Zoffix: uhhh...given that the optimization is centered around not actually bothering to invoke the proto and jumping straight to the candidate once it's cached...either you don't get the opt in this case, or do get the opt and it's arguably a bug 22:32
Zoffix ohh right 22:33
jnthn: for the array thing TimToady asked... We do the shift thing for VMArray: github.com/MoarVM/MoarVM/blob/mast...#L311-L322 but TimToady is using a CArray and there it looks like it just expands stuff: github.com/MoarVM/MoarVM/blob/mast...#L182-L211 dunno if that's the way it's meant to be 22:34
jnthn It is, we can't do that in CArray really 22:35
Zoffix Ah ok.
jnthn Because the point of it is that we organize the memory just as C does
So we have O(1) marshalling cost
jnthn bbiab
Zoffix m: proto z(:$*v = 42, |) {*}; multi z("cmd1") {say "$*v"}; z 'cmd1'; z 'cmd1', :100v 22:36
camelia 42
Cannot resolve caller z(cmd1, :v(100)); none of these signatures match:
(Str $ where { ... })
in block <unit> at <tmp> line 1
Zoffix m: proto z(:$*v = 42, |) {Nil; {*}}; multi z("cmd1") {say "$*v"}; z 'cmd1'; z 'cmd1', :100v
camelia 42
Cannot resolve caller z(cmd1, :v(100)); none of these signatures match:
(Str $ where { ... })
in sub z at <tmp> line 1
in block <unit> at <tmp> line 1
22:37 Jimav joined
Zoffix m: proto z(:$*v = 40, |) { * }; multi z(:$z, :$v) {say "$*v"}; z :40z; z :40z, :100v 22:39
camelia 40
100
Zoffix so I guess you don't get the benefit of proto opt :) but that's better than a bug 22:40
22:45 evalable6 left, evalable6 joined
Jimav Hi, I'm new to IRC, learing P6, and confused by an example in docs.perl6.org/language/typesystem ... 22:46
Docs say to test if obj is a type, test definedness and identity between obj and its .WHAT p method Example in docs: my $a = Int; say so $a // $a === $a.WHAT; # OUTPUT: «True␤» 22:47
Zoffix eww
Jimav I don't get how "$a // $a === $a.WHAT" won't be true for lots of things other than type objects
22:48 caasihuang joined
Zoffix Jimav: `$a.DEFINITE` is a way to test. If it's true, it's an instance, if it isn't, then it's a type object 22:48
Jimav true for _any_ truthy thing, not just type objects!
Sounds like docs have a bug. Are they maintained? Should I report it? 22:49
Geth doc: 9eb0a16b03 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/typesystem.pod6
Fix example of "To test if an object is a type object"
22:51
synopsebot Link: doc.perl6.org/language/typesystem
Zoffix Jimav: yeah, they're maintained and you can open Issues for any problems you find here: github.com/perl6/doc/issues/new
I fixed this one just now tho
ugh.. sorta. docs.perl6.org/routine/DEFINITE doesn't lead to DEFINITE docs :| 22:52
gfldex Jimav: can you give an example where this breaks?
Zoffix: if DEFINITE specced?
Geth doc: c878e2c018 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/typesystem.pod6
Fix URL for .DEFINITE
22:54
Zoffix gfldex: looks like it: 2018.01.121 zoffix@VirtualBox~/R/rakudo/t/spec (master)$ G '.DEFINITE' | wc -l
25
G == grep
gfldex I'm pretty sure I asked jnthn before adding that example.
Jimav gfldex: $a // $a === $a.WHAT break (gives wrong answer) for any truthy $y which isn't a type, e.g. 42
I meant $a
gfldex m: my $a = 42; say so $a // $a === $a.WHAT; 22:55
camelia True
Zoffix m: my $a = 42; say so ($a notandthen $a === $a.WHAT) 22:56
camelia False
Zoffix m: my $a = Int; say so ($a notandthen $a === $a.WHAT)
camelia True
Zoffix m: my $a = Int; say $a ~~ Mu:U; # another way
22:56 teatime joined
camelia True 22:56
Zoffix The :U being a type smiley: docs.perl6.org/type/Signature#Cons...ned_Values 22:57
Zoffix &
22:57 Zoffix left 22:58 setty1 joined
gfldex I like `~~ Mu:U` best 22:58
m: my $a = Int:D; say $a ~~ Mu:U;
camelia True
gfldex that one is amusing :)
teatime If anyone here has at least a passing familiarity with Gulp.JS, and wishes to participate in some open-ended brainstorming with me (Perl6-related), /msg me 22:59
23:01 Jimav left 23:02 sacomo joined
SmokeMachine .tell Zoffix thanks! 23:07
yoleaux SmokeMachine: I'll pass your message to Zoffix.
23:08 leah2 left
Geth doc: gfldex++ created pull request #1762:
add type smiley example
23:08
23:10 jnthn left 23:11 jnthn joined 23:12 leah2 joined 23:13 vike left 23:15 vike joined, travis-ci joined
travis-ci Doc build errored. Zoffix Znet 'Fix URL for .DEFINITE' 23:15
travis-ci.org/perl6/doc/builds/339221432 github.com/perl6/doc/compare/9eb0a...78e2c018b3
23:15 travis-ci left
buggable [travis build above] ✓ All failures are due to: timeout (1 failure). 23:15
23:20 brrt left 23:28 Rawriful left
SmokeMachine m: sub MAIN($*a){} # is this a bug too? I mean the “*a” 23:31
camelia Usage:
<tmp> <*a>
SmokeMachine m: sub bla($*a){}; say &bla.signature.params.head.usage-name 23:32
camelia *a
gfldex SmokeMachine: It's just a dynamic variable that is declared in a signature. 23:38
jnthn Yeah, but it's name should be a, not *a 23:39
So looks bug to me
SmokeMachine gfldex: That’s not the problem... the problem is the *on the name... 23:40
jnthn: thanks! I’ll try to fix that...
That and the usage not getting the params of the proto 23:41
is the dynamic variable the only problem? I tried with $^a and $:a and those was ok... $!a doesn’t make sense inside the MAIN()... or does it? 23:45
jnthn No, doesn't
But $^a and $:a install into the signature as $a 23:46
That is, they bind to the $a lexical
Whereas $*a binds to a lexical of that name
SmokeMachine What to do about: sub MAIN($a, $*a)? 23:47
jnthn No idea
If you do that, you get whatever bad behavior occurs :P
SmokeMachine m: class C {method bla($!a){}}; say C.^find_method(“bla”).signature.params.head.usage-name 23:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Attribute $!a not declared in class C
at <tmp>:1
------> 3class C {method bla($!a){}}7⏏5; say C.^find_method(“bla”).signature.pa
expecting any of:
horizontal whitespace
SmokeMachine m: class C {has $!a; method bla($!a){}}; say C.^find_method(“bla”).signature.params.head.usage-name
camelia substring requires a concrete string, but got null
in block <unit> at <tmp> line 1
SmokeMachine Should it work?👆 23:50
jnthn It's kinda meaningless, but I guess if it is fixed to give a it's nice
SmokeMachine should it return “a” or “!a”? 23:51
jnthn a
SmokeMachine Ok! I’ll try that! I’ll try to fix that on carnival 23:52
jnthn SmokeMachine++ 23:56
23:57 Zoffix joined
Zoffix I recall there was a bug with `.=` in attribute initialization. There first was one that crashed if the type contains `::` in the name and then another one was opened, but I can't find a ticket. 23:58
Anyone know what it was? I'm fairly sure I know how to fix it now. 23:59
(and yes, I know it's ironic that I know a fix for a bug I don't remember :P)