»ö« 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.
jnthn You can .^lookup the method and, iirc, .cando passed a Capture will give all of the canidates that could match. Then iterate over them and call them. Alternatively, could just put nextsame or callsame at the end of each candidate. 00:00
jnthn sleep time; 'night 00:00
Kaiepi night 00:01
SmokeMachine m: class C { multi method bla(% (:$a, |)) {"a"}; multi method bla(% (:$b, |)) {"b"} }; my $c = C.new; say C.^lookup("bla").candidates.map: {.($c, {a => 1, b => 2})} 00:02
camelia (a b)
SmokeMachine jnthn: great! thanks! 00:03
Kaiepi ok this documentation is great
SmokeMachine m: multi bla(% (:$a!, |)) {"a"}; multi bla(% (:$b!, |)) {"b"}; say &bla.candidates.grep(*.cando: \({:1a, :2b}))>>.({:1a, :2b}) # :) 00:11
camelia (a b)
Voldenet I'd force my way with slightly more javascriptish solution 00:12
m: class C { method bla(Hash $c) { $c.map({ %!x{.key}(.value) }) }; has %!x = { a => {"A: $^a"}, b => {"B: $^b" } }}; say C.new.bla: {a => 1, b => 2}
camelia (A: 1 B: 2)
Voldenet not that it's very elegant 00:13
and doesn't support multiple args, sadly 00:16
Geth doc: 9a718ea10e | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Str.pod6
Make linkable things links in subst-mutate desc
01:12
synopsebot Link: doc.perl6.org/type/Str
SmokeMachine m: my $c = class C {has Int $.a handles * = 3}.new; say $c.is-prime; $c does role :: {}; $c.is-prime 02:15
camelia True
No such method 'is-prime' for invocant of type 'C+{<anon|75388240>}'
in block <unit> at <tmp> line 1
SmokeMachine handles is being lost on "does"
Geth doc: e79d237af6 | (Zoffix Znet)++ | doc/Type/Str.pod6
Clarify return of Str.subst-mutate with multi-match options

Rakudo fix: github.com/rakudo/rakudo/commit/77794a28aa
   github.com/rakudo/rakudo/commit/e0d39321e1
Spec: github.com/perl6/roast/commit/c537763529
   github.com/perl6/roast/commit/8c358cfc87
02:20
synopsebot Link: doc.perl6.org/type/Str
Geth doc: 653a7994d3 | (JJ Merelo)++ | doc/Type/Signature.pod6
Un-confusing Signature example

Inverting the order by using $sig in the `given` clause, I expect to make it a bit less confusing. Also inclusing the `default` clause, just in case. Moved `mismatch` to the first, to show that it's checked against. Hope this closes #1777, if it does not, just let me know.
07:06
synopsebot Link: doc.perl6.org/type/Signature
Guest8794 ls 09:15
El_Che Desktop Documents Downloads Music Pr0n 09:16
moritz lsb_release -a 09:18
Guest16234 ls 09:21
help
tiny911 ls 09:22
clear
ls
El_Che try this -> /quit
pmurias harc.github.io/seymour-live2017/ - fairly cool live programming work/hopefully we can hook it up to Perl 6 once it's language agnostic 09:46
pmurias it's interesting if the slow parsing price Perl 6 pays for it's complex and pluggable grammar is worth the increased barrier to tooling in the long run 09:48
moritz that is a quetion I've asked myself multiple times, with no clear answer yet 09:55
DrForr Well, I'm hoping to be able to give a more definitive answer in the near future. 10:22
pmurias DrForr: how so? 10:48
DrForr I'm waiting to hear if the Apache Foundation is able to sponsor me to do syntax highlighting for Perl 6/Eclipse. 10:50
pmurias DrForr: using the builtin Perl 6 grammar or the usuall approach of having something adhoc that kind of works? 10:51
DrForr pmurias: That's a good question actually. I haven't decided, although I suspect the usual suspects (too little time and its friends) will force hte latter. 10:54
tbrowder hi, #perl 11:03
tbrowder can anyone running debian 8 please describe the base java packages they are running? i have been using the sun/oracle ones for years and need to get to version 1.8 (however that translates into the obscure java naming system). thanks. 11:07
Kaiepi openjdk? 11:10
moritz openjdk-7-jre-headless 11:13
but that's version 7
openjdk-8-jre-headless is available in Stretch
dunno if there are jessie backports for it 11:14
Kaiepi would you be able to build it from source?
moritz according to serverfault.com/questions/830636/c...ian-jessie it works from backports
tbrowder moritz: thanks for the link! 11:18
|Sno| jnthn: Hi 11:37
|Sno| jnthn: We would like to provide space and coffee etc. around GPW2018 for a Perl6 Hackathon (act.yapc.eu/gpw2018/) 11:39
If you're interested ...
|Sno| Or anyone else here ... but I have sth. special in mind asking jnthn direktly ... 11:41
DrForr Just prodded him elsewhere. 11:43
tbrowder moritz: jvm link directions worked flawlessly, thanks! 11:50
moritz tbrowder: that's great, yw
Zoffix e: temp.perl6.party/temp.txt 12:21
evalable6 Zoffix, Successfully fetched the code from the provided URL.
Str $!unit = "K"
(36.6 degrees ...K unit => C)
6
Zoffix I'm so baffled by these results: why is $!unit K? Why is the string that follows wrapped in parens. Why does it show "K unit => C" instead of just 6. Why is Bridge not called. Why is the final answer 6? 12:22
I bet it's something dumb like a missing semicolon somewhere :| 12:26
ah, I see it 12:27
missing colon on bless
timotimo oooh, indeed
Zoffix e: temp.perl6.party/temp.txt 12:28
evalable6 Zoffix, Successfully fetched the code from the provided URL.
Str $!unit = "C"
36.6 degrees ...C
7726.956
"Unit is C"
"Unit is F"
"Unit is K"
Zoffix \o/
SmokeMachine m: my $c = class C {has Int $.a handles * = 3}.new; say $c.is-prime; $c does role :: {}; $c.is-prime # "does" loses the "handles" 12:31
camelia True
No such method 'is-prime' for invocant of type 'C+{<anon|53096992>}'
in block <unit> at <tmp> line 1
Zoffix SmokeMachine: just file tickets for anything you think is a bug: github.com/rakudo/rakudo/issues/new 12:34
jnthn |Sno|: Originally I wasn't sure I could make GPW. Think maybe I can make some of it (the last conf day and hang around for Hackathon on the Saturday after), however. 13:10
|Sno| jnthn: do you have a few minutes for a more private chat? 13:11
jnthn |Sno|: Kinda, /msg me 13:12
Geth doc: 7060b488eb | (Zoffix Znet)++ | doc/Type/Real.pod6
Document Real.Bridge

A bit long-winded, but includes a real-ish example of use.
Closes github.com/perl6/doc/issues/1690 D#1690 Part of github.com/rakudo/rakudo/pull/1522 R#1522
13:23
synopsebot Link: doc.perl6.org/type/Real
synopsebot D#1690 [closed]: github.com/perl6/doc/issues/1690 [docs] Method `Bridge` is undocumented
R#1522 [open]: github.com/rakudo/rakudo/pull/1522 Remove the Bridge method from the numeric classes
Voldenet wow, it's the first time i've used big font (more than 8) on perl6 and I can finally see all the symbols :D 13:29
Geth doc: eebfb35b3d | (Zoffix Znet)++ | doc/Type/Real.pod6
Point out code example has a limitation
13:30
Voldenet I really could use a tool, that'd translate utf-8 perl into ascii 13:31
moritz write it :-) 13:47
El_Che utf8 perl could be one of the few uses of the bar on macbook pros 13:49
Ulti ctrl+cmd+space does the same job FYI 14:29
Ulti even without the fancy bar 14:29
buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.1.0.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...1.0.tar.gz 14:32
leonzhou hej 14:45
i just started to learn perl 14:46
tadzik hey 14:47
leonzhou hey man 14:49
tadzik
are u talking with me ?
i am new leaener , need help 14:50
tadzik I guess I am now, yes
sure what's the problem?
leonzhou cool , where are u
tadzik I'm right here, on the internet :) 14:51
leonzhou just need some advices 14:51
[Coke] note that this is Perl 6, not Perl 5, just in case.
leonzhou i am your country
leonzhou i use perl 6 , 14:52
by the way , what is dig difference between 5 and 6
Geth doc: 51904c9281 | (Will "Coke" Coleda)++ | doc/Type/Signature.pod6
remove trailing whitespace
14:53
doc: e40b02a299 | (Will "Coke" Coleda)++ | doc/Type/Str.pod6
fix typo
synopsebot Link: doc.perl6.org/type/Signature
Link: doc.perl6.org/type/Str
Zoffix leonzhou: there're separate, wildly different language these days. The names are similar only because ~16 years ago Perl 6 was meant to be the next version of Perl 5, but eventually those goals diverged and we got a separate language, with Perl 5 making its own set of improvements. 15:04
m: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n" 15:06
camelia I am a Perl 6 program
Zoffix Even as something as basic as ^ that prints differnt output if run with `perl` interpreter.
ilmari perlbot: eval: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n" 15:07
perlbot ilmari: I am a Perl 6 program
ilmari perlbot: eval5: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
perlbot ilmari: Stored eval5: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
ilmari perlbot: eval5.26: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
perlbot ilmari: I am a Perl 5 program 1
leonzhou hej camelia , it seems i use same as u 15:08
Zoffix m: print "I am a Perl ", 5+(!!"0"), " program\n" 15:09
camelia I am a Perl 6 program
Zoffix A bit shorter
ilmari perlbot: eval5.26: print "I am a Perl ", 5+(!!"0"), " program\n" 15:11
perlbot ilmari: I am a Perl 5 program 1
ilmari (the 1 is the return value from print)
buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.1.1.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...1.1.tar.gz 15:12
moritz lots of Perl 6 discussion on twitter right now: twitter.com/andrewshitov/status/96...9716774913 15:16
Zoffix m: sub love {return}; print "I love Perl ", 5+!!(love(),), "\n" 15:19
camelia I love Perl 6
Zoffix perlbot: eval5.26: sub love {return}; print "I love Perl ", 5+!!(love(),), "\n"
perlbot Zoffix: I love Perl 5 1 15:19
Zoffix Another diff :)
Oh wait, I'm overthinking it. 15:20
m: print "I love Perl ", 5+((),), "\n"
camelia I love Perl 6
Zoffix perlbot: eval5.26: print "I love Perl ", 5+((),), "\n"
perlbot Zoffix: I love Perl 5 1 💑
moritz I'm sure you can do fun things with 5 & 6 == 6 or so 15:23
Zoffix m: print "I love Perl ", (5, 6)[~1], "\n" 15:25
camelia I love Perl 6
Zoffix perlbot: eval5.26: print "I love Perl ", (5, 6)[~1], "\n"
perlbot Zoffix: I love Perl 5 1
Zoffix :)
caasih So is it unwise to learn Perl 6 and then Perl 5? If my final goal is to understand pugs and the diverged moment in my next 5 or 10 years. 15:37
moritz I don't see why you have to learn Perl 5 at all to understand Pugs 15:39
El_Che caasih: do you understand haskell? 15:40
caasih El_Che: I know some haskell. I know some basic type classes like functor and monad. But I can’t understand advanced topics like lenses. 15:42
El_Che pretty much the only thing I remember from pugs was that it was written in haskell
caasih moritz: Ok. So I just learn to program in Perl 6 first. And I can forget about Perl 5 for now. 15:43
caasih El_Che: I read some dev logs about pugs but I can’t understand junctions at that moment. 15:43
Does Perl 5 have junctions? Why we need them? I didn’t notice them in other languages like C or JS. 15:45
moritz caasih: maybe docs.perl6.org/type/Junction.html helps?
El_Che clarify it a little for me. Are you a haskell afficionado, an Computer Science historian that want to figure how pugs worked? Or do you want to know how Junctions work in Perl 6?
moritz no, Perl 5 doesn't have them
El_Che if the latter, the Runtime of Perl 6 is Rakudo now. Pugs was abandoned
moritz and they are mostly a convience
caasih El_Che: I think I am the historian in this case. 15:47
El_Che caasih: ok, thx for clarifying 15:48
there are people around here that worked on pugs and may have some answers
caasih I may not use high level languages like Perl 6 or Haskell in my career. But I’d like to know stories about them in my free time. 15:49
El_Che++ cool, thanks for the advice. 15:50
moritz++ for the link
Voldenet It isn't unwise to learn perl6 and then perl5, they are different languages 15:59
perl6 is a fun toy language
I believe perl5 to be used more in real world environments 16:02
El_Che Voldenet: of course is Perl 5 more widely used being a popular lang with 30y history. No need to call perl6 a "toy language" though 16:05
Voldenet I call that every language that is fun to use 16:08
El_Che a 'it's not you, it's me" thing? 16:09
Voldenet Yeah, 't was meant to be complimentary :P 16:10
El_Che :)
lucasb Any type object can be coerced to Numeric and they will return integer zero (and emit a warning). Method .Numeric is inherited from Mu. 16:32
But what about the actual numeric types, can't they overload the .Numeric method to return a value of their type?
m: quietly say (.WHAT for +Num, +Rat, +Complex)
camelia ((Int) (Int) (Int))
lucasb wouldn't you like if this ^^ returned ((Num) (Rat) (Complex)) ? 16:33
the actual values returned would then be (0e0, 0.0, 0+0i) or (NaN, 0.0, 0+0i) 16:36
any opinions?
Zoffix lucasb: I recall chasing down the "undefined numerics are zero" thing a year or so ago and I recall rage-quitting and wishing we never carried over that feature from Perl 5. I forget the exact details tho. 16:46
m: Rat + 1 16:47
camelia WARNINGS for <tmp>:
Useless use of "+" in expression "Rat + 1" in sink context (line 1)
Cannot look up attributes in a Rat type object
in block <unit> at <tmp> line 1
Zoffix That probably was one of them. i.e., sure, you can make Rat.Numeric return <0/1>, but, Numeric isn't always used in operations
m: Int² 16:49
camelia Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
Zoffix And many operations don't work with type objects, so why do we even have "undef is zero" thing in some random places.
When is it useful? 16:50
m: class { method z (Rat $x) { say "Numerator is {.nude.head}" } }.new.z: Rat 16:52
camelia No such method 'nude' for invocant of type 'Any'. Did you mean any of these?
none
note

in method z at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: class { method z (Rat $x) { say "Numerator is {$x.nude.head}" } }.new.z: Rat
camelia Cannot look up attributes in a Rat type object
in method z at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix And there are plenty of custom places where type Numeric objects would explode instead of being coerced to 0. So really, I wish we'd remove this whole idea entirely. 16:53
pmurias Zoffix: do we have a lot of tests depend on that? 16:55
Zoffix I'm about to test it. 16:56
timotimo it looks like state variables in `perl6 -ne` don't behave right 16:57
Zoffix There's also RT#130383
synopsebot RT#130383 [new]: rt.perl.org/Ticket/Display.html?id=130383 [BUG] perl6 -n does not set $_ when it's interpolated via a block
Zoffix timotimo: what's the code that doesn't work? perl6 -ne 'say $++' and perl6 -ne 'state $x; say $x++' seem to work OK 16:59
And RT#130383 is just a mis-scoped QAST::Block 17:00
lucasb Zoffix: I guess I'm not surprised by "undef is zero" in the language. That's a behavior to be expected from a Perl language. I wouldn't mind if it goes away. I was just trying to make the already existent behavior a little more convenient. 17:02
Zoffix lucasb: is it really expected though? I imagine modern practices fatalize those warnings 17:03
(`use strictures 2;` doesn't tho) 17:04
jnthn I've had production code survive (desirably) in the case of missing data thanks to that
Rather than crash and burn
(Which wouldn't have been useful) 17:05
ZzZombo m: say Int+Str
camelia Use of uninitialized value of type Int in numeric context
0
in block <unit> at <tmp> line 1
Use of uninitialized value of type Str in numeric context
in block <unit> at <tmp> line 1
jnthn Certainly I prefer to handle such things explicitly, but sometimes things are unexpectedly missing.
Zoffix jnthn: I'd say that's pure luck. Had you used any of the ops that expect a :D value on that value, then it'd crash and burn.
jnthn Zoffix: I was thinking as much about Perl 5 as Perl 6 17:06
Zoffix pmurias: making Mu.Real and Mu.Numeric return 42 instead of 0 makes these stresstests fail: gist.github.com/zoffixznet/310e04b...0ff09cbbc6
jnthn Zoffix: Just saying that I'd lean towards "try to consistently warn and behave well" than "rip it out"
Zoffix Based on those tests results, it's probably too deeply ingraned to rip out by now 17:07
jnthn Yeah, I consider it a part of the forviging Perl-ish nature, so on that count I'd be hesitant to see it go 17:08
Zoffix Weird a bunch of S32-io/lock.t tests fail too :S
ZzZombo m: say Str++~Int.Bool 17:13
camelia Cannot resolve caller postfix:<++>(Str); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a is rw --> Bool::False)…
ZzZombo m: say Str++ 17:13
camelia Cannot resolve caller postfix:<++>(Str); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a is rw --> Bool::False)…
ZzZombo m: say False++~Int.Bool
camelia Cannot resolve caller postfix:<++>(Bool); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)
(Bool:D $a is rw)

The following do not match for other reasons:
(Bool:U $a…
ZzZombo m: say Int++~Int.Bool 17:14
camelia Cannot resolve caller postfix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a is rw --> Bool::False)…
ZzZombo m: say ($=Int)++~Int.Bool
camelia 5===SORRY!5=== Error while compiling <tmp>
Pod variable $=Int not yet implemented. Sorry.
at <tmp>:1
------> 3say ($=Int7⏏5)++~Int.Bool
ZzZombo m: say ($= Int)++~Int.Bool
camelia 0False
ZzZombo m: say ($= Str)++~Int.Bool 17:15
camelia 0False
ZzZombo m: say ++$--
camelia 5===SORRY!5=== Error while compiling <tmp>
Operators '++' and '--' are non-associative and require parentheses
at <tmp>:1
------> 3say ++$--7⏏5<EOL>
expecting any of:
postfix
ZzZombo m: say ++($--) 17:16
camelia Cannot resolve caller prefix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool $a is rw)
(Mu:U $a is rw…
ZzZombo m: say ++(my $--)
camelia Cannot resolve caller prefix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool $a is rw)
(Mu:U $a is rw…
ZzZombo m: say ++(my $)--
camelia 5===SORRY!5=== Error while compiling <tmp>
Operators '++' and '--' are non-associative and require parentheses
at <tmp>:1
------> 3say ++(my $)--7⏏5<EOL>
expecting any of:
postfix
lucasb Zoffix, jnthn and others: I wish I could express my ideas a little better in english, but since I'm not a native speaker, it's difficult for me to continue the conversation. I'll try to put some effort in my writing skills... Just wanted to say that I appreciate all your comments. I learn a lot from you :)
ZzZombo m: say ++$ 17:17
camelia 1
ZzZombo m: say (++$)--
camelia Cannot resolve caller postfix:<-->(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a …
Zoffix ZzZombo: `$` is a anon state var. `my $` is an anon lexical var. ++ or -- on them return an Int. It's not in a writeable container, so you can't call another ++ or -- on it again. 17:20
Zoffix lucasb: I'm stresstesting your proposal ATM FWIW 17:21
ZzZombo Ye, I got it, I just didn't read the messages right and thought they still complained about the parentheses.
lucasb Zoffix: which one? the "my num $x" defaulting to 0e0 or the overload .Numeric for number classes? 17:22
Zoffix: BTW, I appreciate your comment on that issue. I'll try to reply later. 17:23
Zoffix lucasb: the .Numeric for Numeric type objects. I'm against `num` defaulting to 0e0
Well, I'm -½ on it. No real strong feelings.
lucasb I found a new argument for my proposal. NaN is true! and I don't like that :) 17:24
m: say so my num $
camelia True
lucasb if it defaults to 0e0, then the uninitialized variable would false, which is more convenient, no?
m: say so my num $ = 0e0 17:25
camelia False
Zoffix hehe
OK, I'm -¼ on it then :)
lucasb just 0.25 to go :)
Zoffix m: dd <1.0>.Real 17:30
camelia RatStr.new(1.0, "1.0")
Zoffix Found a bug while I was at it :) lucasb++
Geth doc: fcd0359369 | (Zoffix Znet)++ | doc/Type/Numeric.pod6
Numeric does not provide .Real
18:00
synopsebot Link: doc.perl6.org/type/Numeric
Zoffix ^ a second example for the Twitter convo moritz++ mentioned. Complex.Real throws X::Numeric::Real; Numeric.Real is not implemented. but the documentation doesn't document Complex.Real and erroneously claims Numeric.Real is both implemented and throws X::Numeric::Real if the coerced value does not equal to numeric :S 18:09
Zoffix And the Rakudo impl has Complex.coerce-to-real public method. It's not documented or specced... So, was it ever meant to be public? The implementor knew. 18:12
moritz m: say (2+0i).Real
camelia 2
Zoffix m: say (2+1i).Real
camelia Cannot convert 2+1i to Real: imaginary part not zero
in block <unit> at <tmp> line 1
moritz m: try (2+1i).Real; say $!.^name
camelia X::Numeric::Real
SmokeMachine where's stored the default value of a attribute? 18:14
moritz in the Attribute object, I believe 18:15
moritz m: say class { has $.x = 42 }.^attributes[0].default 18:15
camelia No such method 'default' for invocant of type 'Attribute'
in block <unit> at <tmp> line 1
moritz m: say class { has $.x = 42 }.^attributes[0].perl
camelia Attribute.new
Zoffix P.S.: I'm about to commit a fix to docs for that (not just complaining :))
moritz ++Zoffix 18:16
SmokeMachine: I can't find it right now :(
maybe it's in $!build_closure 18:17
jnthn build_closure iirc
SmokeMachine m: say class C {has $.a = 42}.^attributes.head.^methods
camelia (<anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> compose apply_handles get_value set_value container readonly package inlined WHY set_why Str gist)
SmokeMachine m: say class C {has $.a = 42}.^attributes.head.^attributes
camelia (str $!name int $!rw int $!ro Mu $!required int $!has_accessor Mu $!type Mu $!container_descriptor Mu $!auto_viv_container Mu $!build_closure Mu $!package int $!inlined int $!box_target int $!positional_delegate int $!associative_delegate Mu $!why Mu …
jnthn Yup, there it is 18:18
moritz m: my $attr := class { has $.x = 42 }.^attributes[0]; my $bc := $attr.^attributes.grep(*.name eq '$!build_closure); say $bc.get_value($attr)
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
------> 3build_closure); say $bc.get_value($attr)7⏏5<EOL>
expecting …
moritz m: my $attr := class { has $.x = 42 }.^attributes[0]; my $bc := $attr.^attributes.grep(*.name eq '$!build_closure'); say $bc.get_value($attr)
camelia No such method 'get_value' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
jnthn I think there's a method to fetch it though
moritz m: my $attr := class { has $.x = 42 }.^attributes[0]; my $bc := $attr.^attributes.grep(*.name eq '$!build_closure')[0]; say $bc.get_value($attr)
camelia No such method 'get_value' for invocant of type 'BOOTSTRAPATTR'
in block <unit> at <tmp> line 1
jnthn Oh, the method is just called .build
moritz m: say class { has $.x = 42 }.^attributes[0].build 18:19
camelia 42
SmokeMachine m: say class C {has $.a = 42}.^attributes.head.build
camelia 42
SmokeMachine thank you all!!
thanks jnthn !
moritz m: say class { has $.y = 4; has $.x = 42 * $.y }.^attributes[1].build 18:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Virtual method call $.y may not be used on partially constructed object (maybe you mean $!y for direct attribute access here?)
at <tmp>:1
------> 3 class { has $.y = 4; has $.x = 42 * $.y7⏏5 }.…
moritz m: say class { has $.y = 4; has $.x = 42 * $!y }.^attributes[1].build
camelia
moritz m: say class { has $.y = 4; has $.x = 42 * $!y }.^attributes[1].build.perl
camelia method (<anon|51721056> $: ;; Mu $_) { #`(Method|35573464) ... }
Geth doc: d291c495df | (Zoffix Znet)++ | 7 files
Document/Fix docs for .Real/.Numeric on Numerics

  - Fix up some inaccuracies about .Real on Complex/Numeric
  - Remove prose on allomorphs about coercions and smartmatch
   for Numeric. The method itself is not concerned with those concepts.
  - Document behaviour of methods on :U Numerics:
   - Impl: github.com/rakudo/rakudo/commit/1dc1f038f1
   - Spec: github.com/perl6/roast/commit/f2d745f1a8
Zoffix $ ./perl6 -e 'quietly say (.WHAT for +Int, +Num, +Rat, +FatRat, +Complex, +NumStr, +RatStr, +ComplexStr, +IntStr)' 18:23
((Int) (Num) (Rat) (FatRat) (Complex) (Num) (Rat) (Complex) (Int))
lucasb: ^ works now
lucasb: and I changed my mind on `num` defaulting to NaN. The fact that unitialized value is true is kinda bad. I think that's the single case of that being so in all of our types. 18:25
So +1 on changing it. You now need to convince others :)
Zoffix &
lucasb awesome, thanks Zoffix! 18:28
Geth doc: 6e3763b89e | (JJ Merelo)++ | doc/Language/operators.pod6
Changed some examples to a case that feels a bit more real

And shows intent refs #1748. Also separates code in different examples, leaving the text as text, so it addresses 4 and 5. It closes
Still it should also show an example where the method chaining does not work by using some data structure that can be used as the last argument to something, but does not have that something as a method.
18:43
synopsebot Link: doc.perl6.org/language/operators
doc: 3d76648f29 | (JJ Merelo)++ | 7 files
Merge branch 'master' of github.com:perl6/doc
Geth doc: c15d37a876 | (JJ Merelo)++ | doc/Language/operators.pod6
Remove trailing whitespaces.

This really closes #1739 and tip'o'the hat to @coke who usually takes care of this.
18:49
Xliff If I want a grammar token to match the name, ala: "token DEFAULT { 'DEFAULT' }" is there a shortcut way to do this? 18:56
Xliff Because I have to do it.... a lot. 18:57
Defining this as <sym>, maybe?
moritz you can use the sym mechanism, yes 19:01
at least in proto tokens
Xliff What's the difference between proto tokens and normal ones? 19:06
In the case of something like DDL, would you use that mechanism for things like NULL, SELECT, DEFAULT, and so forth? 19:07
SmokeMachine m: my $a = class C {has $.a}.^attributes.first: { .name ~~ q[$!a] }; $a.^attributes.first: { .name ~~ q[$!build_closure] } # what's wrong with this?
camelia Type check failed in binding to parameter 'value'; expected Any but got BOOTSTRAPATTR (BOOTSTRAPATTR.new)
in block <unit> at <tmp> line 1
travis-ci Doc build errored. JJ Merelo 'Remove trailing whitespaces. 19:08
travis-ci.org/perl6/doc/builds/341572957 github.com/perl6/doc/compare/3d766...5d37a87675
buggable [travis build above] ✓ All failures are due to: timeout (1 failure). 19:08
SmokeMachine m: my $a = class C {has $.a}.^attributes.first: { .name ~~ q[$!a] }; $a.^attributes.grep: { .name ~~ q[$!build_closure] }
camelia ( no output )
Xliff SmokeMachine: Why ".name ~~ q[$!build_closure]"?
SmokeMachine grep works but first doesn't...
Xliff: I looking for the attribute called $!build_closure 19:09
von_cheam Using this <<subset Char of Str where (*.chars == 1);>> to create a subtype for single-character strings gives me the warning <<Useless use of "==" in expression ".chars == 1" in sink context>> 21:46
Is there maybe a better/more perlish way to do this? If not, any ideas as to what I'm doing/thinking wrong?
Is it maybe interpreting "== 1" as "== True"?
moritz m: subset Char of Str where { .chars == 1 }; for '', 'a', 'aa' { say $_ ~~ Char } 21:48
camelia False
True
False
moritz von_cheam: ^^ this seems to be what you want
m: subset Char of Str where .chars == 1; for '', 'a', 'aa' { say $_ ~~ Char }
camelia False
True
False
moritz or even without braces
von_cheam Okay, thanks! It works with braces; I'll go with that! 21:50
skids Do you really want 1 char, or 1 byte?
geekosaur or codepoint 21:57
Zoffix m: subset Char of Str where (*.chars == 1); 22:03
camelia WARNINGS for <tmp>:
Useless use of "==" in expression ".chars == 1" in sink context (line 1)
Zoffix That's a bug innit?
skids m: sub a ($f where (*.chars == 1)) { $f.say }; a("4") 22:06
camelia WARNINGS for <tmp>:
4
Useless use of "==" in expression ".chars == 1" in sink context (line 1)
Zoffix m: dd (*.chars == 1); 22:08
camelia { ... }
timotimo m: my num $foo = 1;
camelia This type cannot unbox to a native number: P6opaque, Int
in block <unit> at <tmp> line 1
timotimo m: my Num $foo = 1;
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot assign a literal of type Int (1) to a variable of type Num. You can declare the variable to be of type Real, or try to coerce the value with 1.Num or Num(1), or just write the value as 1e0
at <…
Zoffix goes with yes :)
timotimo ^- someone want to port this to native variables?
Zoffix R#1525 22:13
synopsebot R#1525 [open]: github.com/rakudo/rakudo/issues/1525 Useless useless when parens used around whatevercode in where 22:14
Zoffix timotimo: that looks to be an error from MoarVM innit? Is there a way to tweak it in HLL? I think apl "cannot unbox" errors could use an improvement 22:15
/apl/all 22:16
timotimo oh it is? one sec. 22:17
nope, it's X::Syntax::Number::LiteralType in rakudo 22:18
Zoffix No, I mean the "canmot unbox" one
timotimo oh yes
i think it'd actually be super easy to do this, hold on.
Zoffix g2g 22:19
timotimo i may already have the implementation done 22:21
Xliff timotimo++ # Supa fast! 22:29
Zoffix++ # Just coz.
timotimo yeah, except i'm still trying to get it to work :D 22:32
timotimo spews debug prints :) 22:38
potentially problematically this turns a runtime error into a compiletime error. not sure if that is wanted? 22:40
timotimo also, right now it suggests num(1) or 1.num %) 22:42
m: say 1.num
camelia No such method 'num' for invocant of type 'Int'. Did you mean any of these?
Num
sum

in block <unit> at <tmp> line 1
timotimo m: say num(1) 22:43
camelia Cannot invoke this object (REPR: P6num; num)
in block <unit> at <tmp> line 1
timotimo thought so
timotimo Cannot assign a literal of type Int (1) to a native variable of type Num. You can declare the variable to be of type Real, or try to coerce the value with 1.Num or Num(1), or just write the value as 1e0 22:56
seems good
huh, this is strange 22:57
m: my Num $a = <1/2>
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot assign a literal of type Rat (0.5e0) to a variable of type Num. You can declare the variable to be of type Real, or try to coerce the value with 0.5e0.Num or Num(0.5e0), or just write the value a…
timotimo how did it get that representation ...
jnthn <1/2> is a Rat literal 22:59
timotimo yeah, but why does it .perl to 0.5e0 there? 23:00
jnthn Oh...that's a very good question
m: say <1/2>.perl
camelia 0.5
timotimo yeah, it's not there :D
jnthn Yeah, it's fishy but not *that* fishy :)
timotimo oh, of course 23:05
i + that
inside the optimizer; maybe that uses smart_numify or something like that
m: my Num $a = <1/2+3/4i>
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot assign a literal of type Complex (<0.5+0.75i>) to a variable of type Num. You can declare the variable to be of type Numeric, or try to coerce the value with <0.5+0.75i>.Num or Num(<0.5+0.75i>)…
timotimo in that branch i call the actual .Numeric method 23:06
timotimo m: say <1/2>.^name 23:09
camelia Rat
timotimo m: say < 1/2 >.^name 23:10
camelia RatStr 23:10
timotimo ah, that's how you get that kind
Cannot assign a literal of type Rat (RatStr.new(0.5, "1/2")) to a native variable of type Num.
what exactly should be the right way here is a little muddy 23:12
Xliff finally reaches the dreaded <expr> in the DDL spec. 23:19
SmokeMachine m: use Test; class C is Any {...}; role R[::T] {}; my R[C] $a; class C {}; isa-ok $a, R[C] # should it be ok? 23:22
camelia not ok 1 - The object is-a 'R[C]'
# Failed test 'The object is-a 'R[C]''
# at <tmp> line 1
# Actual type: R[C]
timotimo hm, is this more interning failures?
SmokeMachine m: use Test; class C is Any {...}; role R[::T] {}; my R[C] $a; class C {}; ok $a ~~ R[C]
camelia ok 1 -