»ö« 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:04 labster left 00:07 labster joined 00:11 pyrimidine joined 00:12 labster left, Resol_ joined 00:15 Resol left, pierre joined 00:16 pyrimidine left 00:44 itcharlie1 left 00:45 nowan joined 00:51 bwisti left, llfourn joined 00:56 mephinet left, mephinet joined, llfourn left 00:58 pyrimidine joined 01:03 cdg left, itcharlie joined 01:07 itcharlie left, Actualeyes joined
SmokeMachine Does it make sense that as we have Inline::Perl5 (for example) to run perl5 code, we have a perl5 zef's plugin to install perl5 modules from cpan (I sad perl5 as example, could be python, java, or any language) (I thought that because I was trying to use a python lib with Inline::Python but I had no idea how to install a python library... and wandered that 01:14
would be great to just do something like: zef install --from-python docker (Docker was that python lib)
ugexe: tony-o: do you think that makes sense? ^^ 01:15
cale2 SmokeMachine: would it just alias `pip install` ? 01:16
tony-o i'm curious of the same cale2 01:17
SmokeMachine cale2: I don't know... maybe?
cale2 well, you can install cpan modules with zef, right?
tony-o not sure how that'd work with cpan, though. just use whatever the defaults are?
cale2 if you install perl5 modules with zef, does it alias `cpanm` ? 01:18
01:18 ufobat_ left
SmokeMachine Maybe it could install on a different directory that would only be used by inline::* (I'm sorry, I'm just wondering...) 01:19
01:21 mcsnolte left
ugexe you can do this now the rough way with Build.pm. alternatively a plugin that is just an adapter to Menlo:from<Perl5> 01:21
SmokeMachine That would make sense to be done? 01:22
cale2 I'm confused about all of the cpan integration with zef. Is it talking about the Perl5 cpan? Or is it talking about a yet-to-be-built perl6 cpan? 01:25
ugexe its talking about the perl6 distributions on cpan 01:27
tony-o SmokeMachine: i don't know if a universal package installer is the next logical step for installers or not. it can certainly be done, it hasn't really been needed much before this 01:30
at least i haven't seen that need from where i'm sitting 01:31
cale2 My favorite tooling is Mix in Elixir 01:34
it doesn't lock you in like golang, but it provides everything you could possible want. And a nice plugin system that allow extra stuff for frameworks and whatnot 01:35
SmokeMachine I just think that would make sense once we can run libs of another languages inside your perl6 code... that would make you "do not leave perl6" even when installing those libs... 01:36
But I'm not sure if it would worth 01:37
01:38 llfourn joined
cale2 SmokeMachine: Isn't the ability to run other languages inside Perl6 a stopgap? I mean, the Python and Perl5 interpreters are faster than Rakudo. So it's not like it's a long term thing. Feels more like a "get people up and running quickly" thing 01:38
SmokeMachine cale2: (Sorry, what means stopgap?) I'm not sure if it's just up and running quickly thing... there's Inline::* in perl5 too... 01:44
01:45 pyrimidine left
SmokeMachine cale2: for example, in my case I was trying to use a python lib because it doesn't exist in perl6 and I just wanted to prototype what I was thinking... 01:46
cale2 what library?
SmokeMachine a Docker client... 01:47
cale2 I often wonder how these libraries are created. OpenCV, Selenium, Docker... They have to bind to something...
So does the OpenCV team write their code in C, then all the other languages like Python, Node, Ruby write bindings to the C code? 01:48
SmokeMachine docker-py.readthedocs.io/en/stable/
On Docker case, it's a rest API through a unix socket... 01:49
cale2 Ah, so there could be a Perl6 SDK no prob
SmokeMachine Not the unix socket yet... 01:50
And that's not done yet... so I can't prototype right now...
cale2 what's different between unix sockets and tcp sockets? 01:52
SmokeMachine IMHO that's the great thing about Inline::*... if that doesn't exists in perl6 yet, doesn't matter! Use another language to prove your point, and if you prove that, write it in "the right way"...
cale2: unix sockets aren't from network that's a special case of memory files... 01:53
cale2 ah, yes... how the hell does a person "create" a socket in Perl6 01:54
it's got to be done in Rakudo, no?
tony-o m: IO::Socket.new
camelia IO::Socket is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
cale2 But a new type of socket 01:55
like a new socket protocol
IO::Socket::IPC.new 01:56
lucs What's texas notation for the infinity symbol? 01:57
01:58 pierre left
ugexe m: class IO::Socket::Foo does IO::Socket { method recv { "..." } }; say IO::Socket::Foo ~~ IO::Socket; say IO::Socket::Foo.new.recv 01:59
camelia 5===SORRY!5=== Error while compiling <tmp>
IO::Socket is not composable, so IO::Socket::Foo cannot compose it
at <tmp>:1
02:02 pierre joined 02:07 risou_awy joined, risou_awy is now known as risou
IOninja lucs: Inf and -Inf 02:08
lucs: they're all up in here: docs.perl6.org/language/unicode_texas.html
m: .Num.say for 1/0, -1/0 02:09
camelia Inf
-Inf
IOninja *trollface* :)
02:10 labster joined, risou left, risou_awy joined, risou_awy is now known as risou 02:11 aborazmeh joined, aborazmeh left, aborazmeh joined 02:12 risou left, risou_awy joined, risou_awy is now known as risou
lucs Inf, got it, thanks. 02:14
02:20 romrador left 02:23 cdg joined 02:28 kalkin- left, kalkin- joined 02:29 Sqirrel left 02:38 Sqirrel joined 02:43 cdg left 02:44 cale2 left 02:45 AlexDaniel left
ZzZombo I broke something: 02:48
m: my token eol { \h* [\w+\n || \n] <ws>* };say "asd\n dsa\n" ~~ /<eol>/
:S
IOninja .ask [Coke] how detailed should the grant report be? Is this more to ensure I'm doing *something* or do people want to know all the details of what I did? In these three verbosity options, which is most preferred? gist.github.com/zoffixznet/90cb249...c5e7b40b89
yoleaux IOninja: I'll pass your message to [Coke].
camelia (timeout)
IOninja ZzZombo: "zero or more" tokens keeps matching on and on 02:49
m: my token eol { \h* [\w+\n || \n] <ws> };say "asd\n dsa\n" ~~ /<eol>/
camelia 「asd

eol => 「asd

ws => 「 」
02:49 nightfrog left
ZzZombo okay, but originally I wanted to see if recursive regexes work, seems they don't. 02:50
m: my token eol { \h* [\w+\n || \n] <eol>* };say "asd\n dsa\n" ~~ /<eol>/
camelia No such method 'eol' for invocant of type 'Cursor'
in regex eol at <tmp> line 1
in block <unit> at <tmp> line 1
02:51 nightfrog joined
ZzZombo m: my token eol { [\h* [\w+\n || \n]]+ };say "asd\n dsa\n" ~~ /<eol>/ 02:51
camelia 「asd
dsa

eol => 「asd
dsa
IOninja m: say grammar { token eol { \h* [\w+\n || \n] <eol>* } }.parse: "asd\n dsa\n", :rule<eol>
camelia 「asd
dsa

eol => 「 dsa
IOninja They work fine. 02:52
ZzZombo ah, thanks.
02:52 mr_ron left
IOninja (no idea why standalone version doesn't) 02:53
q|"zero or more" tokens keeps matching on and on| <-- guess not quite accurate, since <eol>* works fine. But it's something in that area. There's a ticket with a long explanation on this topic somewhere, but I'm failing to find it on perl6.fail 02:55
m: say grammar { token TOP { <x>+ }; token x { .+ } }.parse: 'x' 02:56
camelia 「x」
x => 「x」
IOninja m: say grammar { token TOP { <x>+ }; token x { .* } }.parse: 'x'
camelia (timeout) 02:57
IOninja Ah. Infinite repetition of a token that can match without advancing the cursor position is what the hang is at
ZzZombo hey, IOninja, can I somehow make the following tokens: 02:59
proto rule directive {*}
token directive:sym<include> { '#include'\h+<value> }
token directive:sym<base> { '#base'\h+<value> } 03:00
trigger first on the '#' and then only match either 'base' or 'include'? I don't qute like that I repeat the triggering '#' in all places.
IOninja token pref { '#' }; and then use <pref> inside the directives is what I'd do
or <.pref>
(non-capturing version) 03:01
would be nice to stuff such stuff into the proto, but it'll complain
m: grammar { proto token TOP { '#' * }; token TOP:sym<meow> { .+ } }.parse: 'x'
camelia 5===SORRY!5=== Error while compiling <tmp>
Proto regex body must be {*} (or <*> or <...>, which are deprecated)
at <tmp>:1
------> 3grammar { proto token 7⏏5TOP { '#' * }; token TOP:sym<meow> { .+
IOninja wonder if it's just NYI or there's some blocker for making that work 03:02
ZzZombo Yeah, I was quite surprised protos can't be used in such way.
03:05 mr_ron joined 03:12 cdg joined 03:16 itcharlie1 joined, ChoHag left 03:18 cdg left 03:19 cdg joined 03:27 noganex_ joined 03:29 cdg left, xtreak joined, noganex left 03:30 cdg joined 03:37 pyrimidine joined 03:42 pyrimidine left
sammers hi #perl6 03:42
04:01 mcmillhj joined 04:08 agentzh left
ugexe m: say grammar { token TOP { <directive> }; token directive { "#" <.directive-name> }; proto token directive-name {*}; token directive-name:sym<include> { <sym>\h+.* }; token directive-name:sym<base> { <sym>\h+.* } }.parse: "#include\tasdn" 04:09
camelia 「#include asdn」
directive => 「#include asdn」
04:09 cibs left
ugexe not quite, but something like that 04:10
04:11 cibs joined
ZzZombo yeah, I just put '#'<directive> directly into the rule, an your directive-name is just directive in my code. 04:11
04:12 solarbunny left 04:13 xtreak left 04:16 xtreak joined 04:20 solarbunny joined 04:21 Tonik joined 04:22 girafe joined 04:23 itcharlie1 left 04:25 pierre left 04:26 Tonik left 04:28 agentzh joined 04:36 mr_ron left 04:41 mcmillhj left
ZzZombo GG Github search, searching for "keyvalue" in ValveSoftware/source-sdk-2013 yeilds nothing, but a bit of navigating and I found this: github.com/ValveSoftware/source-sd...alues.cpp. 04:43
04:47 khw left 04:51 agentzh left 04:52 pierre joined 04:55 Cabanoss- joined 04:57 pierre left 04:59 Cabanossi left, Cabanoss- is now known as Cabanossi 05:14 yadzi joined 05:16 cdg_ joined 05:19 cdg left, wamba1 joined 05:28 pyrimidine joined 05:32 pyrimidine left 05:33 mcmillhj joined, pyrimidine joined 05:37 mcmillhj left, pyrimidine left 05:41 eythian left, eythian_ joined
TimToady IOninja: it would have to be '#' {*} anyway, since bare * is a valid quantifier 05:42
05:43 aborazmeh left
TimToady m: my token eol { \h* [\w+\n || \n] <eol>* };say "asd\n dsa\n" ~~ /<eol>/ 05:44
camelia No such method 'eol' for invocant of type 'Cursor'
in regex eol at <tmp> line 1
in block <unit> at <tmp> line 1
TimToady m: my token eol { \h* [\w+\n || \n] <&eol>* };say "asd\n dsa\n" ~~ /<eol>/
camelia 「asd
dsa

eol => 「asd
dsa
TimToady I thought the form without & used to work at one time, hmm...
ZzZombo: ^^^ 05:45
ZzZombo thank you
TimToady dinner & 05:46
05:51 curan joined 06:04 rurban joined 06:07 cyphase left 06:08 bwisti joined, pierre joined 06:11 llfourn left 06:12 cyphase joined, pierre left 06:14 hartenfels joined 06:22 ufobat_ joined 06:34 pyrimidine joined 06:37 hartenfels1 joined 06:39 hartenfels left, hartenfels1 is now known as hartenfels 06:41 wamba1 left 06:42 cibs left 06:43 labster left, cibs joined 06:50 RabidGravy joined 07:04 agentzh joined 07:06 cibs left 07:08 cibs joined, agentzh left, llfourn joined, cgfbee left 07:13 llfourn left 07:14 labster joined 07:19 cgfbee joined 07:26 wamba1 joined 07:27 cibs left, kaare_ left 07:28 Sqirrel left, cibs joined 07:31 AlexDaniel joined, darutoko joined 07:33 cschwenz joined
gfldex [Coke]: do you remember in what method IO::Handle did throw? If it's just one we could mix in a role with a methods that does nothing and could drop the dep again. 07:35
07:35 Sqirrel joined 07:36 faraco joined
faraco howdy 07:36
cschwenz as MoarVM, Rakudo, Rakudo Star, and NQP are under the Artistic License 2.0… am i correct in stating Perl 6 is under the Artistic License 2.0? 07:38
gfldex cschwenz: it means that one compiler that implements Perl 6 is released under the terms of that license. The language itself is an abstract concept. 07:41
cschwenz okay, fair enough. just wanting to get licensing of my perl6 code correct to mitigate license mismatches and the resulting addition mental workload around "can i use this thing?" (for example, consider a Perl 6 project which uses AGPL3) 07:45
07:45 eythian_ is now known as eythian 07:48 bwisti left 07:49 TEttinger left, abraxxa joined 07:52 bolangi left 07:53 kaare_ joined
ZzZombo how can I declare a hash in a class of some type? 07:55
gfldex m: class C { has %.h }; dd C.new
camelia C.new(h => {})
gfldex ZzZombo: your question does not compute 07:56
do you want to type on the class, the hash keys or the hash values?
ZzZombo maybe I wasn't clear enough, I mean the hash should have a type constraint of,say String:D;
hash values 07:57
gfldex m: class C { has %.h of Int }; dd C.new
camelia C.new(h => (my Int %))
gfldex m: class C { has Int %.h }; dd C.new
camelia C.new(h => (my Int %))
gfldex docs.perl6.org/type/Hash#Constraint_value_types 07:58
ZzZombo since you mentioned it, how can you constrain the type of keys?
gfldex m: class C { has %.h{Int} }; dd C.new 07:59
camelia C.new(h => (my Any %{Int}))
gfldex it's not really a constrain on the keys tho. It actually specialises the Hash itself.
ZzZombo is there any difference? 08:00
cschwenz does the specialization survive a .clone ?
gfldex m: my %h{Int}; dd %h; my \h = %h.clone; dd h; 08:02
camelia Hash[Any,Int] %h = (my Any %{Int})
(my Any %{Int})
08:05 dakkar joined 08:09 llfourn joined
gfldex ZzZombo: see github.com/rakudo/rakudo/blob/nom/...sh.pm#L454 08:10
08:14 xtreak left, llfourn left 08:17 xtreak joined, xinming_ joined 08:20 xinming left, faraco left 08:21 zakharyas joined 08:26 rindolf joined 08:28 Qwerasd joined, ChoHag joined
Qwerasd Can someone explain to me why 'print [0..5] ~ "\n"' prints '0 1 2 3 4 5'~"\n" whereas 'say [0..5]' prints '[0 1 2 3 4 5]'~"\n" 08:41
moritz Qwerasd: say() uses .gist to convert its arguments to strings 08:42
and .gist is optimized for human consumption, whereas perl uses .Str, which is optimized for computer consumption, roughly speaking
Qwerasd I'm relatively new to perl6 -- that's an understatement I just brew installed it, I decided to give it a try after years of perl5 and seeing that perl6 code looks much more readable. 08:43
ZzZombo m: my token string { '"'~'"' <( [\N | \\<[\\ " n t]>]* )> || <-[\s { } "]>+ };say '"GameInfo"' ~~ /<string>/ 08:44
camelia 「GameInfo」
string => 「GameInfo」
ZzZombo how come this works fine here, but my grammar fails at the very first token that is exactly "GameInfo"? 08:45
moritz hard to tell without seeing your grammar
have you tried removing the <( and )> ? 08:46
ZzZombo currently I shrunk it down to "token TOP { [<string><.ws>?]* }"
and it still fails miserably. 08:47
Qwerasd The whole suffixing functions with .func thing is very javascript looking. I.E. .list, .gist, .Str, etc.
moritz we call them methods
ZzZombo and the file I tried to parse starts exactly with "GameInfo"
Qwerasd Ah.
ZzZombo complete with the quotes.
Qwerasd Well, in javascript the suffixed functions are part of a prototype I.E. 'String.prototype.append = function() { }'. How do methods work in perl6? Is it similar to javascript's style or does it still have the same philosophy of perl5's very -- well, variable variable types? 08:50
08:51 wamba1 left
moritz Qwerasd: Perl 6 has a meta object protocol, and a default class-based OO implementation 08:51
(but not only supporting classes, also roles, subset types, enums etc.)
Qwerasd Can you dumb it down for a poor tired soul? I'm quite literally tired, it's 4 in the morning for me haha. 08:52
08:52 kyan left
Qwerasd Expand "meta object protocol", I get the rest except that. 08:52
zengargoyle hey, any Perl6 peeps going to SCALE 15x (the Southern California Linux Expo)? i'll be at the Los Angeles Perlmongers booth for a bit hopefully doing a bit of Perl promotion... 08:53
Qwerasd God knows perl needs promotion, it's the internet's punching bag -- language-wise.
zengargoyle of course most P6 seem to be on the other side of the world, but you never know.... :P 08:54
Qwerasd I do like the way perl 6 is syntaxed, it looks a lot like javascript. 08:55
moritz ZzZombo: the problem might be that a grammar always wants to match the string completely, but using <( and )> inside a regex limits the extend of the match
Qwerasd: Perl 6 has classes, pretty much like python, except with a more declarative syntax 08:56
ZzZombo huh, I've been using them in that particular rule for two days, only now it started to misfire.
moritz then maybe that hyposis is wrong 08:57
so, what changed?
Qwerasd I'll just look up some examples of perl 6 OO and let my brain marinate.
ZzZombo well, I've rewrote all other rules, pretty much only that.
that is, the string rule wasn't touched.
Qwerasd I like the naming of the "WHAT" method. 08:58
I also like the even further non-enforcement of using parens. 08:59
09:00 astj left
ZzZombo m: my token string { '"'~'"' ([\N | \\<[\\ " n t]>]*) || (<-[\s { } "]>+) };say '"GameInfo"' ~~ /<string>/ 09:00
camelia 「GameInfo」
string => 「GameInfo」
0 => 「GameInfo」
ZzZombo WTF, this version still fails locally.
09:00 astj joined, jonas1 joined
ZzZombo Qwerasd: I like pretty much everything but classes. Classes in P6 are too awkward for me. 09:02
Qwerasd They're too simplified, ZzZ
ZzZombo yea, that.
I hoped for an quality improvement over P5, but was disappointed. Why basically implemented Moo(se) in core. 09:03
They* 09:04
Qwerasd If the way they are implemented was syntactic sugar, and a more perl 5-like way was still available I'd like that.
The way they have them doesn't allow for stranger objects, like perl 5 does (at least that's not apparent on the surface from what I can see) 09:05
jnthn Moose was in the first place inspired muchly by Perl 6's OO design.
gfldex Qwerasd: we allow any degree of strangeness
Qwerasd *most* objects in perl5 are just glorified hashes, but the keyword there is most.
gfldex m: class C { method FALLBACK(|c) { say "WAAAAA HAAA HAAA HAAA" } }; my $c = C.new; $c.be-sane-now 09:07
camelia WAAAAA HAAA HAAA HAAA
Qwerasd I mean, you could write a perl 5 style object in perl 6.
By just writing an initializer.
gfldex you could do that woth a slang. It would be silly but can be done. 09:08
Qwerasd is FALLBACK called if an unknown method is used?
gfldex yes
09:08 llfourn joined
Qwerasd Is perl6 code very easy to debug, it seems like it really doesn't like erroring. 09:09
gfldex or better, if FALLBACK is defined, it becomes the dispatcher for objects of that class
Qwerasd Reword that, I didn't understand what that meant. 09:10
gfldex it's a lot easier to debug, mostly because any Perl 6 program will have less bugs to start with
Qwerasd Haha
gfldex then, most mistakes can be caught earlier with type checks
Qwerasd So perl6 is very heavily typed then. 09:11
gfldex and there is a debugger and tracer for grammars, and as such, for regex
Qwerasd Whereas the typing in perl5 is much more obfuse
gfldex not really
it is heavily typed but most of the time it uses the default type Any
that you don't need to type
see gfldex.wordpress.com/2015/11/28/pe...generator/ 09:12
09:12 agentzh joined 09:13 llfourn left
gfldex there are plenty of buildin types and most of you debugging consists of .WHAT.say 09:13
Qwerasd So I don't suppose any monster constructions like @$$ArrayRefRef would be seen in perl6 09:14
09:14 Lucas_One joined
gfldex no, references are the default and Any and Cool take care of most type casts for you 09:14
09:15 cibs left
Qwerasd Saying "Any and Cool" doesn't help, I've no idea anything about Any and Cool. 09:15
gfldex see docs.perl6.org/language/typesystem...erl_6_Type 09:16
09:16 agentzh left
arnsholt Any is the root of the standard type hierarchy 09:16
So an class you define will be a subclass of Any
09:16 cibs joined
gfldex Mu is the root but Any is the default parent of any class 09:16
arnsholt (There are some types that don't inherit from Any, like junctions, but that's fairly esoteric)
Cool is the type that handles most of the Perly dwimminess of converting between integer and string representations and such 09:17
(Because those objects are cool with it =)
Qwerasd There are a lot of very unique operators in perl 6 09:18
that have very bizzare names, making it so unless you know what the operators do, it's hard to make heads or tails of some snippets of code.
gfldex they are not uniq at all, you can find them in other languages as well. We do use uniq names for them tho, to make reading code possible without having to keep track of the type of every variable. 09:19
09:19 chee is now known as need, need is now known as chee
Qwerasd I mean, having stuff like "has $.myVar is rw" unless you know what it does makes no sense to read. 09:20
gfldex that is true for any feature of any language
Qwerasd Yes, but most languages have similar operators. 09:21
gfldex what sucks
Qwerasd I think maybe perl 6 is a little too concise, but that's just a surface level impression.
gfldex we got +| as the bitwise or operator, other languages us the same operator for bitwise and logic operations 09:22
Qwerasd bitwise OR is always always ||
| **
gfldex so you need to keep track of the type of both operands
Qwerasd not ||
gfldex if you are unlucky you got an automatic type cast where you don't want one
those bugs can be nasty to track down 09:23
that's an entire class of bugs that don't exist in Perl 6
Qwerasd | OR, ^ XOR, & AND, and NOT is a bit nonstandard, it changes between languages
arnsholt How often do you actually need bitwise logic in Perl though? 09:25
gfldex since it's slow as fuck, we don't need it at all right now :)
arnsholt Those operators were taking up valuable real-estate, so Larry decided to move the bitwise stuff to less prominent ops, so that more useful things could take stuff like | and &
Qwerasd You're talking to a guy currently working on a CPU emulator that emulates the generic bitwise logic. 09:26
gfldex we got operators for you!
Qwerasd Haha, well, I'm writing it in javascript. 09:27
arnsholt Well, in that case if it really bothers you to use the default operators, you can always redefine it: 09:29
m: multi infix:<|>($a, $b) { $a +| $b }; say 1 | 2
camelia 3
gfldex m: sub infix:<∨>(\a, \b){a +| b}; say (123 ∨ 456); 09:30
camelia 507
Qwerasd '.say for [1..100]; say "Poof!"' This is a fun challenge to try to code golf.
cosimo 1 09:33
Qwerasd 1 what?
arnsholt m: .say for [1..100]; say "Poof!" 09:34
camelia 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53…
Qwerasd It on seperate lines prints the numbers from 1 to 100 and then "Poof!"
09:35 cdg_ left
Qwerasd even better '.say for [1..100, "Poof!"]' 09:35
o
that doesn't work in perl6 09:36
09:36 lukaramu joined
arnsholt m: .say for |(1..5), "Poof"; 09:36
camelia 1
2
3
4
5
Poof
Qwerasd '.say for [1..100].push("Poof!");' there 09:37
arnsholt List flattening is different in Perl 6
Qwerasd ah I see
That's probably the shortest out of all langs I've tried this in, then, '.say for |(1..100),"Poof!";' 09:39
only, 27 chars
in perl5 it's 'print $_."\n" for @{[1..100,"Poof!"]}' which is significantly longer 09:41
arnsholt No need to do the @{[]} shenanigans, though 09:43
Qwerasd Try it without,
arnsholt 1..100, "Poof!" works fine on its own in my Perl 09:44
Or rather 1..5
Because I'm lazy
Qwerasd ah right, I don't need the [] around it
that's my mistake
arnsholt And on 5.12 and later there's say
Qwerasd I thought of an interesting code golf, for 1..100 print $_ factorial
arnsholt perl -E 'say for 1..5,"Poof!"'
moritz m: say [*] 1..$_ for 1..20 09:46
camelia 1
2
6
24
120
720
5040
40320
362880
3628800
39916800
479001600
6227020800
87178291200
1307674368000
20922789888000
355687428096000
6402373705728000
121645100408832000
2432902008176640000
Qwerasd Impressive
moritz m: say[*] 1..$_ for 1..20 09:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Use of non-subscript brackets after "say" where postfix is expected; please use whitespace before any arguments
at <tmp>:1
------> 3say7⏏5[*] 1..$_ for 1..20
expecting any of:
arg…
moritz m: say [*]1..$_ for 1..20
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say [*]7⏏051..$_ for 1..20
expecting any of:
infix
infix stopper
postfix
statement end
statement mod…
Qwerasd m: say [*] 1.. for 1..10 09:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
for used at line 1
09:49 robertle left
Qwerasd m: say [*] 1.. for 1..10 09:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
for used at line 1
moritz m: .say for [\*] 1..10
camelia 1
2
6
24
120
720
5040
40320
362880
3628800
Qwerasd m: .say for [\+} 1..10 09:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Prefix + requires an argument, but no valid term found
at <tmp>:1
------> 3.say for [\+7⏏5} 1..10
expecting any of:
prefix
Qwerasd oops
m: .say for [\+] 1..10
camelia 1
3
6
10
15
21
28
36
45
55
Qwerasd triangle numbers. 09:51
m: .say for [\/] 1..10
camelia 1
0.5
0.166667
0.041667
0.008333
0.001389
0.000198
0.000025
0.0000028
0.00000028
moritz more general, reduce with intermediate results
jnthn It's deliberate that [\ looks like a triangle, fwiw :) 09:52
Qwerasd moritz: is that a challenge, I don't understand what the challenge is if it is, and if it's an explanation of something I still don't understand. 09:53
m: .say for [\+|] 1..10 09:55
camelia 1
3
3
7
7
7
7
15
15
15
Qwerasd Woah, that's like, all sorts of binary.
m: .say for [\+^] 1..10
camelia 1
3
0
4
1
7
0
8
1
11
Qwerasd That is also very binary, who'd'a thunk? 09:56
09:56 cibs left
Qwerasd m: .say for [\+&] 1..10 09:57
camelia 1
0
0
0
0
0
0
0
0
0
Qwerasd Well that one was obvious 09:58
09:58 cibs joined
Qwerasd m: .say for [\^] 1..10 09:58
camelia one(1)
one(1, 2)
one(1, 2, 3)
one(1, 2, 3, 4)
one(1, 2, 3, 4, 5)
one(1, 2, 3, 4, 5, 6)
one(1, 2, 3, 4, 5, 6, 7)
one(1, 2, 3, 4, 5, 6, 7, 8)
one(1, 2, 3, 4, 5, 6, 7, 8, 9)
one(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Qwerasd What does the ^ operator do in perl6, I shoulda figured that out beforehand.
timotimo it creates a "one" junction 09:59
like | creates an "any" junction and & creates an "all" junction
Qwerasd What are junctions?
m: .say for [\**] 1..10
timotimo think of them as superpositions of values
camelia (timeout)10
3486784401
timotimo m: say "yay" if any(1, 2, 3) >= 3; 10:00
camelia yay
timotimo m: say "yay" if all(2, 3, 4) >= 3;
camelia ( no output )
timotimo m: say "yay" if one(2, 3, 4) > 3;
camelia yay
Qwerasd K 10:01
Why did it have so much trouble with exponents?
It hit a numeric overflow and then didn't know how to handle it is my guess since when I ran it in my terminal it hit a numeric overflow.
moritz Qwerasd: because exponentiation is right-associative, and [\**] respects that 10:02
Qwerasd mmmm
moritz so a**b**c is actually a**(b**c)
timotimo but ... how 10:04
1 ** 2 ** 3 ** 4 is just 1?
oh
right associative
you already said that
Qwerasd the docs.perl6.org is much... brighter than perldoc... 10:07
gfldex that's to indicate your future :->
timotimo is it because links are blue instead of black? 10:08
ZzZombo is there a more generic way to express [\n || $] in grammar? That is, end of line/input, but advancing past newlines if possible. 10:09
Qwerasd It's because the background is FFFFFF white instea of grey
10:09 Sqirrel left
Qwerasd No shorthand if else in perl6? I tried $x?trueResult():falseResult() 10:09
10:09 llfourn joined
timotimo it's spelled ?? !! 10:10
gfldex m: say Ture ?? 'oi‽' !! 'naaa'
camelia 5===SORRY!5=== Error while compiling <tmp>
Expected a term, but found either infix ?? or redundant prefix ?
(to suppress this message, please use a space like ? ?)
at <tmp>:1
------> 3say Ture ??7⏏5 'oi‽' !! 'naaa'
Qwerasd weird
ture
gfldex m: say (True ?? 'oi‽' !! 'naaa'); 10:11
camelia oi‽
jnthn m: say True ?? 'oi‽' !! 'naaa'
camelia oi‽
10:11 CIAvash joined
Qwerasd m: say False ?? '∆' !! 'π' 10:12
camelia π
timotimo bisectable6: say 4.9999999999999999 ~~ 1..^5 10:14
bisectable6 timotimo, On both starting points (old=2015.12 new=1811b80) the exit code is 0 and the output is identical as well
timotimo, Output on both points: False
10:14 llfourn left
timotimo apparently we've always been comparing Rat by turning them into .Num first 10:14
ZzZombo why does Grammar::Trace not show non named parts of regex matching? 10:15
it it possible to enable that?
is it*
Qwerasd me: True|False ?? say "yo" 10:19
me: True||False ?? say "yo"
no me, haha
m: True|False ?? say "yo"
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused: Found ?? but no !!
at <tmp>:1
------> 3True|False ?? say "yo"7⏏5<EOL>
expecting any of:
postfix
Qwerasd m: say True|False ??"yo" !! ""
camelia yo
Qwerasd 'say (!($_%3) ?? "Fizz"~(!($_%5) ?? "Buzz" !! "") !! (!($_%5) ?? "Buzz" !! $_)) for 1..25' Y'all should try to code golf this. 10:24
ZzZombo ===SORRY!=== 10:25
Type check failed in binding to assignval; expected Grammar::VDF::Key-Value:D but got Array
Any way to get the source of the error? Isn't it supposed to output that by default, like camelia does? 10:26
10:29 Ven joined
Ven m: my $a = 0; my $b = 0; $a := $b; 10:29
camelia ( no output )
Ven star: my $a = 0; my $b = 0; $a := $b; 10:30
camelia ( no output )
Qwerasd Anyone going to code golf that I put?
Ven This doesn't work in the REPL. 10:31
I guess this is because of how the REPL does frames. Not sure if this is worth reporting?
jnthn Ven: How does it fail? 10:33
10:33 llfourn joined
Qwerasd I codegolfed it a little bit. 'say (!($_%3)??"Fizz"!!"")~(!($_%5)??"Buzz"!!"")~(($_%3&$_%5)??$_!!"") for 1..25' 10:33
Ven jnthn: ===SORRY!=== Error while compiling: Cannot use bind operator with this left-hand side ------> $a := $b⏏; 10:34
Qwerasd: `!($_%3)` is `$_%%3` 10:35
Qwerasd ooo, useful
'say ($_%%3??"Fizz"!!"")~($_%%5??"Buzz"!!"")~($_%3&$_%5??$_!!"") for 1..25' 10:36
timotimo ooooh it's a ven! 10:37
the ven diagram now has ven's circle overlapping with #perl6's circle :P
Ven timotimo: hi timo, how is your timo doing?
timotimo my timo's okay 10:38
jnthn Ven: Hm, think that one already is reported :)
Ven jnthn: alright, thanks. I know there are well-known bugs in the REPL-and-scoping-aren't-friends category
timotimo yeah ;( 10:39
ZzZombo !!!
timotimo XXX 10:40
ZzZombo type constraining values in hash breaks .push and .append, that's the cause of the error.
what do :(
Ven Qwerasd: "{"Fizz"if $_%%3}{"Buzz"if $_%%5}" is golfier 10:41
Qwerasd Where is the $_ if neither?
timotimo ZzZombo: it seems like your code was trying to autovivify an array inside your array 10:42
Qwerasd also will that work for the FizzBuzz ?
Ven Qwerasd: here's my golf: say "{"Fizz"if $_%%3}{"Buzz"if $_%%5}"||$_ for 1..25
timotimo ZzZombo: compare this:
Qwerasd impressive, ven
timotimo m: my @foo; @foo[1][2] = 99; dd @foo
camelia Array @foo = [Any, [Any, Any, 99]]
ZzZombo no exactly, .push turned a key into array because of a duplicate name. 10:43
not*
Ven Qwerasd: I'm fond of PPCG, though b2gills usually outgolfs my Perl 6 answers :). (or outspeeds me)
ZzZombo well, tried to turn.
timotimo right, so it's like this:
m: my %stuff; %stuff<hello> = "hi"; %stuff.push("hello" => 99); dd %stuff
camelia Hash %stuff = {:hello($["hi", 99])}
ZzZombo well, more like my Int:D %hash ... 10:45
Ven D:
10:45 mcmillhj joined
Ven `use InvertedTypeSmiley;` 10:45
gfldex Ven did you mean "ᗡ:"? 10:48
Qwerasd Lol
Ven gfldex: I obviously did, thanks. :)
gfldex www.twiki.org/cgi-bin/view/Blog/Blo...ry201211x1
10:48 Qwerasd left 10:49 mcmillhj left
gfldex m: ⸵9ʌ ǝsn 10:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus statement
at <tmp>:1
------> 3<BOL>7⏏5⸵9ʌ ǝsn
expecting any of:
prefix
term
gfldex looks like Rakudo wont work in Australia
ZzZombo YAY 10:59
Almost done
Now, where do I apply for contributing a module? 11:00
gfldex ZzZombo: see github.com/perl6/ecosystem/
ZzZombo: I found it good advice to use travis before commiting to the ecosystem 11:01
ZzZombo what's that? All I know it always reports that "doc build errored". 11:02
gfldex travis uses container magic to test stuff in a clean install
if you forgot to provide deps in the META* it will tell you
ZzZombo Do I have to install anything for that?
gfldex no
it fetches stuff from github for you 11:03
and you sign in with your github account
ZzZombo well then, I could look into it.
gfldex travis-ci.org/
you may want to steal the .travis.yml form some other project 11:04
11:06 cdg joined
ZzZombo Is there some way to automatically change type of a variable as appropriate so it would first try float, int and then finally leave it as a string? 11:07
I want parsed values to be stored in "native" form, and only use string as a last resort. I guess I could just process them again though.
11:07 cschwenz left 11:08 labster left
jnthn Does val maybe do what you want? 11:09
IOninja m: try {.Numeric} andthen .^name.say orelse .^name.say val('42e5').Numeric
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3ic} andthen .^name.say orelse .^name.say7⏏5 val('42e5').Numeric
expecting any of:
infix
infix stopper
statement end
IOninja m: try {.Numeric} andthen .^name.say orelse .^name.say with val '42e5'
camelia Slip
IOninja bah
stupid bug
jnthn m: say val("42").WHAT 11:10
camelia (IntStr)
jnthn m: say val("4.22").WHAT
camelia (RatStr)
jnthn m: say val("not a number").WHAT
camelia (Str)
ZzZombo nice!
IOninja m: $_ ~~ Numeric ?? .Numeric.^name.say !! .^name.say with val '42e5'
camelia Num
ZzZombo thanks!
IOninja m: $_ ~~ Numeric ?? .Numeric.^name.say !! .^name.say with val 'blah'
camelia Str
11:10 cdg left
Ven IOninja: why are you coercing if it's already a Numeric? 11:11
IOninja ZzZombo: basically you get an allomorph. You can leave it as is, or call .Numeric on it to get the number.
Ven m: .Numeric.^name.say with val 'blah'
camelia Failure
Ven m: .Numeric.^name.say orelse "oops" with val 'blah'
camelia WARNINGS for <tmp>:
Useless use of constant string "oops" in sink context (line 1)
Failure
Ven m: (.Numeric.^name // "oops").say with val 'blah'
camelia Failure
Ven m: (.Numeric.^name orelse "oops").say with val 'blah'
camelia Failure
Ven sigh.
IOninja don't use .^name 11:12
Ven yeah, it's too late
IOninja I'm coercing because you don't always want to deal with an allomorph
Ven m: say val('h') ~~ Numeric; say val('1') ~~ Numeric;
camelia False
True
Ven alright
IOninja m: bag(42, <42>).keys.elems.say
camelia 2
IOninja And the Slip in my first eval is the Empty given by `andthen`... actually not even a bug 11:13
11:13 risou is now known as risou_awy
IOninja m: try {.Numeric} andthen .^name.say or .^name.say with val '42e5' 11:13
camelia NumStr
IOninja m: try {.Numeric} andthen .^name.say or .^name.say with val 'foo'
camelia Str
Ven m: .Numeric andthen .^name.say orelse .^name.say with val 'foo' 11:14
camelia Slip
Ven m: .Numeric andthen .^name.say orelse .^name.say with val '1234'
camelia Int
11:14 risou_awy is now known as risou
Ven m: val('abc').Numeric.^name.say 11:14
camelia Failure
Ven m: with val('foo').Numeric { .Numeric.^name.say } else { .^name.say } 11:15
camelia Failure
Ven I guess you're not supposed to chain andthen/orelse like that. Or maybe use notandthen...
m: (Failure.new andthen 1).^name.say 11:16
camelia Slip
Ven aye...
IOninja well you get Empty in orelse.
You can chain if you like, but you get an updated $_ not the original
There is a bug with chaining though ATM: rt.perl.org/Ticket/Display.html?id...et-history
Ven m: say Slip.new orelse 1
camelia WARNINGS for <tmp>:
Useless use of constant integer 1 in sink context (line 1)
()
ZzZombo make $_ ~~ Numeric ?? .Numeric !! .Str with val ~$<string>[0]; 11:17
works like charm.
Ven m: say (Slip.new orelse 1)
camelia 1
IOninja m: say (Empty orelse 1)
camelia 1
IOninja there's a hack to make that work, but it ain't good anough
Ven m: say ((.Numeric andthen .^name) orelse .^name) with val '1234' 11:18
camelia Int
Ven m: say ((.Numeric andthen .^name) orelse .^name) with val 'foo'
camelia Slip
ZzZombo stop fucking with my brain, please... that's too much Perl for me D:
IOninja the failed andthen returns an Empty and you're calling .^name on it in your orelse
Ven yeah you get the andthen's Slip :P.
IOninja ZzZombo: you have to put a dollar in the swear jar.
ZzZombo $dollar.give 11:19
Ven my last readings of design documents predate andthen/orelse being implemented, and Slip/Empty existing, so I'm not sure.
> Returns the first argument whose evaluation indicates failure (that is, if the result is undefined). 11:20
11:20 xtreak left
Ven m: say Empty.defined; say (Empty andthen 1); 11:20
camelia False
-> ;; $_ is raw { #`(Block|31254472) ... }
Ven m: say Empty.defined; say (Slip.new andthen 1); 11:21
camelia False
-> ;; $_ is raw { #`(Block|31357720) ... }
Ven m: say Empty.defined; say (Failure.new andthen 1);
camelia False
()
Ven so it's not returning the first !.defined argument...:P 11:22
IOninja The Block thing is the bug I linked to. Basically you get a thunk as a block and the trick is: how do you figure out when it's a thunk and when it's user's block? The Empty and chaining messes up argument positions, so you get block returned
Ven: it isn't. Not sure what you're reading. I thought I fixed the docs for that...
barring the bug, it returns Empty 11:23
Ven My bad, I'm reading the design documents. Where can I read up on why this was changed?
I remember mis-implementing andthen ~2 years ago along with timotimo :P.
timotimo yeah, we did that very well 11:24
IOninja postfix with/without compile to andthen/notendthen; to make them flatten properly they return Empty.
Ven well, I misunderstood what was supposed to happen, and you helped me implement the wrong semantics timotimo++
IOninja IMO that's a mistake, but TimToady ruled I was wrong :}
timotimo %)
IOninja s: &infix:<orelse>
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/1811...rs.pm#L658
Ven
.oO( I don't know why you'd want to do that, but since it's Perl 6, it'll be easy nonetheless )
IOninja Ven: there's some notes in the commit message: github.com/rakudo/rakudo/commit/28...ecdb5e1c92 11:25
And that fix isn't good enough, hence rt.perl.org/Ticket/Display.html?id...et-history
Ven
.oO( Perl 6 makes it easy to implement wrong things, so you can figure out where everything went awry quicker )
IOninja I'm guessing the thunky blocks have annotations or something up on them or we can add them, so then we can look at them and just execute the thunks before returning them 11:26
Ven IOninja: I see. thanks.
IOninja And the problem will go away
11:26 cibs left
Ven I'm not overly surprised an heuristic would get a corner case wrong. I'm not sure on the difference between notandthen and orelse now, though... 11:26
11:27 mcmillhj joined 11:28 cibs joined
IOninja Ven: notandthen aborts on the first .defined arg (returns empty); orelse returns it instead. 11:29
m: Int notandthen "hi".say; Int orelse "hi".say 11:30
camelia hi
hi
IOninja m: 42 notandthen "hi".say; 42 orelse "hi".say
camelia hi
11:30 risou is now known as risou_awy
IOninja m: 42 notandthen "hi-notandthen".say; 42 orelse "hi-orelse".say 11:31
camelia hi-notandthen
IOninja doh
11:32 mcmillhj left
IOninja m: "hi-notandthen".say without 42 11:32
camelia ( no output )
IOninja don't get it
m: 42 notandthen "hi-notandthen".say notandthen "meow".say; 11:33
camelia hi-notandthen
meow
IOninja don't get thunked properly?
IOninja & # work
there ain't no tests for notandthen, so... it doesn't really exist in the language :P 11:34
11:34 pyrimidine left 11:35 xtreak joined 11:40 xtreak left 11:41 AlexDaniel left 11:42 bjz joined
IOninja m: my $x; my $y; my @a = ($x notandthen $y notandthen 'all systems are reset and ready to go'); my @b = ($x orelse $y orelse 'all systems are dead, using backup value'); dd [@a, @b] 11:46
camelia [["all systems are reset and ready to go"], ["all systems are dead, using backup value"]]
IOninja m: my $x = 42; my $y = 72; my @a = ($x notandthen $y notandthen 'all systems are reset and ready to go'); my @b = ($x orelse $y orelse 'all systems are dead, using backup value'); dd [@a, @b]
camelia [[], [42]]
IOninja There. Example that actually works.
with notandthen you're checking stuff's undefined. with orelse you're trying to find the first defined thing
11:48 cdg joined
IOninja m: dd (42 notandthen "hi".say notandthen "meow".say) 11:56
camelia hi
meow
Empty
IOninja m: dd (Int andthen "hi".say andthen "meow".say)
camelia Empty
IOninja Don't see wtf is going on. Both use the same O config and their code is identical except one uses if .defined and other unless .defined :/
sammers hi #perl6 11:58
IOninja oh... missing it on this line methinks: github.com/rakudo/rakudo/blob/nom/....nqp#L6328
\o 11:59
12:00 konobi left
sammers does iterating an array of hashes supposed to iterate over each pair if there is a single hash? 12:00
m: my @a = [%{ a => 'b', c => 'd'}]; my $i = 0; @a.map: -> %h { say $i; say %h.perl; $i++ }
camelia 0
:a("b")
1
:c("d")
sammers compared to the array having multiple hashes... 12:01
timotimo well, your literal there is just an array of pairs
sammers m: my @a = [%{ a => 'b', c => 'd'}, %{ e => 'f', g => 'h' }]; my $i = 0; @a.map: -> %h { say $i; say %h.perl; $i++ }
camelia 0
{:a("b"), :c("d")}
1
{:e("f"), :g("h")}
timotimo single-arg rule there
12:01 mcmillhj joined
timotimo your [ ] is iterating over the contents 12:01
m: dd [[[[[[[1]]]]]]]
camelia [1]
sammers ok
IOninja m: my @a = [%{ a => 'b', c => 'd'},]; my $i = 0; @a.map: -> %h { say $i; say %h.perl; $i++ }
timotimo m: dd [[[[[[[1],],],],],],]
camelia 0
{:a("b"), :c("d")}
[[[[[[[1],],],],],],]
IOninja m: my @a = %{ a => 'b', c => 'd'}; my $i = 0; @a.map: -> %h { say $i; say %h.perl; $i++ } 12:02
camelia 0
:a("b")
1
:c("d")
IOninja m: my @a = %{ a => 'b', c => 'd'},; my $i = 0; @a.map: -> %h { say $i; say %h.perl; $i++ }
camelia 0
{:a("b"), :c("d")}
IOninja No need for the []
sammers why does it behave differently though? why not just treat the single hash inside the array as one iteration? 12:04
timotimo which exact one are we talking about right now?
sammers I guess, I expect a single hash in an array to behave the same as multiple hashes in an array
12:05 bjz left
timotimo you're not building a hash inside an array, though 12:05
you're asking for the hash to be iterated and the result of it to make up the contents of the array
that was introduced so that you could do stuff like [<foo bar baz>]
m: dd [<foo bar baz>]
camelia ["foo", "bar", "baz"]
timotimo m: dd [<foo bar baz>,]
camelia [("foo", "bar", "baz"),]
sammers hmm, ok, so how should I create a List / array of hashes?
timotimo you can just push each hash into the array for example 12:06
12:06 mcmillhj left
timotimo or create the list with a map or for loop 12:06
sammers m: my @a = [%{ a => 'b', c => 'd'}, %{ e => 'f', g => 'h' }]; my $i = 0; @a.map: -> %h { say $i; say %h.perl; $i++ }
camelia 0
{:a("b"), :c("d")}
1
{:e("f"), :g("h")}
sammers so that is a list of hashes, right?
IOninja sammers: just add a comma if you wrote just one hash
timotimo yup
sammers ok, so always append the comma?
timotimo yup
sammers ok, thanks
that clears that up
jnthn The way I think of it is that we iterate the top-level thing inside of [...] 12:07
(And anywhere else following this "single arg rule")
[%h] # iterates %h itself
12:07 bjz joined
jnthn [%h,] # iterates the 1-element list containing %h 12:07
sammers ok, that is good to know... thanks. 12:08
jnthn Also worth noting that , is what constructs lists in Perl 6, not parens.
timotimo why do we have a core.d btw?
is that still a thing? or is it just left-overs in my local checkout?
jnthn timotimo: It's a thing :)
IOninja timotimo: a thing. v6.d.PREVIEW with nonblocking await and react 12:09
sammers ok, unrelated question, is it possible to call a sub from a string? so instead of passing its name around like &foo, I want to pass it around quoted, "foo", then call it someowhere else.
IOninja m: use v6.d.PREVIEW; say &await.file
camelia SETTING::src/core.d/await.pm
sammers jnthn, thanks, that is very good to know
IOninja m: ::('&say')('meow'(
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')'
at <tmp>:1
------> 3::('&say')('meow'(7⏏5<EOL>
expecting any of:
argument list
timotimo oh! .d
IOninja m: ::('&say')('meow')
camelia meow
IOninja sammers: ^
timotimo that's "version d", not "the same thing as /etc/init.d"
jnthn m: my $sub = "abs"; say &::($sub)(-42) 12:10
camelia 42
jnthn timotimo: haha, never thought of that pun :P
timotimo has an initial draft fix for 4.999999999999999 cmp 5 =:= Same
sammers IOninja, jnthn: thanks... that is what I was looking for.
jnthn Lunch time for me :) 12:11
bbl
12:11 bjz_ joined 12:14 bjz left 12:15 mcmillhj joined
timotimo m: say 4.999999999999999 cmp 5.0 12:16
camelia Less
timotimo god damn it
my fix was in the wrong place :)
s: &infix:<cmp> \(Rat:D, Int:D) 12:17
s: &infix:<cmp>, \(Rat:D, Int:D)
12:17 wamba1 joined
SourceBaby timotimo, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')' ␤at -e:6␤------> put sourcery( &infix:<cmp><HERE> \(Rat:D, Int:D) )[1];␤ expecting any of:␤ infix␤ infix stopper␤ 12:17
timotimo, Sauce is at github.com/rakudo/rakudo/blob/1811...der.pm#L10
12:17 llfourn left
timotimo oh jesus 12:17
s: &infix:<cmp>, \(4.99999999999999999, 5) 12:18
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/1811...der.pm#L30
timotimo that scared me for a moment
ugh, it goes via .Bridge there
IOninja but... the current result is right? 12:19
ZzZombo can somebody expand docs.perl6.org/routine/val and add it into the search index?
12:19 mcmillhj left
IOninja Do they get converted to Nums? 12:19
timotimo yup 12:20
the .Bridge result
IOninja ahh :(
timotimo m: say 4.999999999999999 cmp 5
camelia Less
timotimo um...
m: 4.999999999999999 ~~ 1..^5
camelia ( no output )
timotimo m: say 4.999999999999999 ~~ 1..^5
camelia True
timotimo m: say 4.999999999999999 cmp 5
camelia Less
IOninja you'd figure there'd be a Rat Int candidate that can compare it correctly
timotimo ... what?!
12:21 llfourn joined
IOninja Well, that result is right :) 12:21
timotimo i copypasted the wrong one :) 12:22
m: 4.9999999999999999 cmp 5
camelia WARNINGS for <tmp>:
Useless use of "cmp" in expression "4.9999999999999999 cmp 5" in sink context (line 1)
timotimo m: say 4.9999999999999999 cmp 5
camelia Same
timotimo there we go.
IOninja m: dd 4.999999999999999.Bridge
camelia 5e0
timotimo it does work properly with the cmp 5.0 one where both are Rat
but how is that possible? 12:23
because that one just calls .Num on both ends
IOninja we can add a Rat/Int, Int/Rat candidates
and do proper comparison without loss of precision
timotimo m: given 4.9999999999999999 { say .Bridge; say .Num }
camelia 5
5
IOninja I meam Rational, not Rat
hell, it'd just be Rational(Int) { callwith... } 12:25
s: &infix:<cmp>, \(4.99999999999999999, 5.0)
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/1811...ors.pm#L50
IOninja :S 12:26
IOninja expected more....
timotimo oh, hold on
i was also comparing things with my local patch 12:27
ZzZombo why does docs.perl6.org/routine/Numeric actually refer to Numeric.log?
timotimo haha, that's funny
(also: wrong)
ZzZombo dis not :( I wanna see it
timotimo it's not supposed to be a routine at all 12:28
docs.perl6.org/type/Numeric
you want dis
ZzZombo well, I want RatStr.Numeric, I guess.
huh 12:30
docs.perl6.org/routine/Str
same story
IOninja ZzZomvo, it just returns it as a number, the Ray
ZzZomvo, it just returns it as a number, the Rat
timotimo could be every single method of Str is competing to become routine/Classname
routine/Str i mean
ZzZombo there must be a fundamental error in the docs
IOninja s: &infix:<<<=>>>, \(4.99999999999999999, 5.0)
SourceBaby IOninja, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Preceding context expects a term, but found infix , instead␤at -e:6␤------> put sourcery( &infix:<<<=>>>,<HERE> \(4.99999999999999999, 5.0) )[1];␤
IOninja can someone type that with proper fancy quotes? 12:31
ZzZombo what is :$val-or-fail in val?
timotimo sure
s: &infix:['<<=>>'], \(4.99999999999999999, 5.0)
SourceBaby timotimo, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Missing << or >>␤at -e:1␤------> <<=><HERE>>␤ expecting any of:␤ infix␤ infix stopper␤
timotimo :o
IOninja ZzZombo: it'll explode for non-numbers
timotimo s: &infix:«<=>», \(4.99999999999999999, 5.0)
that's the one you mean i presume
IOninja timotimo, I wanna look at <=>
yey
Thanks
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/1811...at.pm#L289
timotimo wow, that took a while, didn't it?
s: &infix:['<=>'], \(4.99999999999999999, 5.0) 12:32
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/1811...at.pm#L289
timotimo so ... how come the ['<<=>>'] one is exploding? :o
IOninja what sort of op is that?
timotimo it's not an op
but how does it explode inside the ' ' quotes?
IOninja Well, Rational cmp Rational should be using <=> not call cmp on .Nums 12:33
12:33 pyrimidine joined
timotimo oh, is it that easy? 12:33
IOninja I'd think so
timotimo cool
patch away! ;)
IOninja and add Rational/Rational(Int) and Rational(Int) Rational candidates, so we use proper precision in those cases too 12:34
Will do in 3.5 hours :)
ZzZombo why can't you do my Int(Str) $x?
timotimo nice
coercive types (currently) only work as parameters 12:35
because then we have a single spot where we can/should code-gen the coercion
12:44 mcmillhj joined
IOninja I meant Rat(Int); there ain't no .Rational method 12:45
12:47 sena_kun joined 12:48 aborazmeh joined, aborazmeh left, aborazmeh joined 12:49 mcmillhj left
ZzZombo hey, can I in my actions class don't distinguish different branches of a protorule: 12:49
proto token directive {*}
token directive:sym<include> { 'include' <.hws> <value> }
token directive:sym<base> { 'base' <.hws> <value> }
and simply use one method for all that simply stores them in an array instead of doing something as a more complete class would do?
timotimo it uses only one method, yeah 12:50
12:50 CIAvash left
timotimo wait 12:50
i'm confusing things right now, aren't i?
jnthn Yeah, it'd call two separate methods there
I'd perhaps factor it differently 12:51
12:51 shlomif joined
arnsholt Yeah, either you'll have to have two action methods, or merge the two rules into "token directive { [include | base] <.hws> <value> }" 12:51
jnthn token directive { <directive-name> <.hws> <value> }
token directive-name { < include base > } 12:52
Or so
arnsholt Yeah, I like that last one
12:52 rindolf left, shlomif is now known as rindolf
jnthn fwiw, the main reason I'd tend to pick protoregexes over an alternation is because I want different action methods. 12:53
arnsholt Then directive-name's AST can be the class to use for the directive AST node, and directive can instantiate it a la "$<directive-name>.ast.new(value => $<value>.ast)"
jnthn That or because I want tthe set to be extensible in a subclass
ZzZombo but then each class that would actually handle includes and other directives would have to do branching itself, and in more complex cases there could be a fair number more of them to handle.
jnthn An, then proto token directive-name { * } and then token directive-name:sym<include> { <sym> } etc. might do it 12:54
timotimo watching an strace of the CounterMutexSingleton with --num_threads=90000 is amusing 12:55
ZzZombo An?
timotimo oh, ww
arnsholt s/Ah/An/ # I think
jnthn Ah, yes :-)
arnsholt Or rather, the inverse >.<
Muphry's law strikes again
jnthn :-) 12:56
12:57 aborazmeh left
ZzZombo jnthn: but that's basically that I have right now. Hey, can I at least make something like: 12:59
method directive($/) { $!directives.push($<directive>.made)}
method directive:sym<include>=directive;
method directive:sym<base>=directive;
12:59 risou_awy is now known as risou
jnthn Well, can just factor it out: Well, method !directive($/) { ... }; method directive:sym<include>($/) { self!directive($/) } 13:01
s:2nd/Well,//
Or do a meta-programming thing 13:02
BEGIN { for <include base> { ::?CLASS.^add_method("directive:sym<$_>", method ($/) { ... }) } } inside of the class 13:03
IOninja Is BEGIN required? I figured the body runs at compile time... 13:05
ZzZombo in Perl5 that would be just
...
our &x=&method
isn't there something like that?
IOninja Perl 5 ain't got methods :) 13:06
You can assign callables the same way tho
m: my &x = Str.^lookup: 'say'; x 'meows' 13:07
camelia meows
Ven .ask zoffix twitter.com/zoffix/status/834074966274482177 why `(my \n = $++)` vs `(state $n)++`?
yoleaux Ven: I'll pass your message to zoffix.
jnthn IOninja: Yes, it's required; in Perl 6 classes are constructed at BEGIN time
IOninja: If you do otherwise then you'll end up with a module that won't precomp well 13:08
IOninja Ven: was trying different things with $ at first and at the end didn't think of changing it to state
jnthn: thanks.
ZzZombo m: class A { method x { say 'X\'d' } our &y=&x };A.new.y
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus statement
at <tmp>:1
------> 3class A { method x { say 'X\'d' } o7⏏5ur &y=&x };A.new.y
expecting any of:
whitespace
ZzZombo m: class A { method x { say 'X\'d' }; our &y=&x };A.new.y 13:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
x used at line 1
IOninja ZzZombo: mhm, that won't work. You've just added a sub, not a method.
13:09 hartenfels left
IOninja It works in perl 5 because methods are just subs 13:09
jnthn Methods are added (only) via .^add_method
And live in the meta-object
Not in the package
Packages are orthoganol to method dispatch in Perl 6.
timotimo welllllll, you can also add methods by wrapping .^find_method :P 13:10
arnsholt Yeah. Perl 6 objects and Perl 5 objects are very different
13:11 ChoHag left 13:13 agentzh joined, Hor|zon joined 13:14 Hor|zon_ joined 13:15 bjz joined 13:16 bjz_ left, risou is now known as risou_awy
ZzZombo wat 13:16
m: class A { method x { say 'X\'d' }};BEGIN A.^add_method('y',&A.x);A.new.y
camelia 5===SORRY!5=== Error while compiling <tmp>
Illegally post-declared type:
A used at line 1
IOninja ZzZombo: use ::?CLASS instead of A 13:17
And &A.x isn't what you think it is.
ZzZombo ===SORRY!=== Error while compiling <tmp>
No such symbol '::?CLASS'
sena_kun hi folks.
13:18 agentzh left
moritz hi sena_kun 13:18
you likely want a.^add_method('alias', A.^find_method('old_name'))
(to ZzZombo)
IOninja ZzZombo: you've messed up closing brace 13:19
jnthn And put the BEGIN inside of the class body
IOninja m: class A { method x { say 'X\'d' }; BEGIN ::?CLASS.^add_method('y', ::?CLASS.^lookup: 'x') }; A.new.y
camelia X'd
13:19 aborazmeh joined, aborazmeh left, aborazmeh joined
IOninja m: class A { method x { say 'X\'d' }; BEGIN A.^add_method('y', A.^lookup: 'x') }; A.new.y 13:20
camelia X'd
IOninja Well, and A works too, but ::?CLASS is bettah
ZzZombo m: class A { method x { say 'X\'d' }; BEGIN {my $x=::?CLASS.^lookup: 'x';::?CLASS.^add_method('y', $x) }; A.new.y
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3::?CLASS.^add_method('y', $x) }; A.new.y7⏏5<EOL>
expecting any of:
statement end
statement modifier
statement modifier loop
ZzZombo m: class A { method x { say 'X\'d' }; BEGIN {my $x=::?CLASS.^lookup: 'x';::?CLASS.^add_method('y', $x) }}; A.new.y 13:21
camelia X'd
sena_kun today I have a stupid question that was answered here many times for sure, but I didn't note the answer, unfortunately. I'm trying to write a test for roast. I have roast repo. I'm trying to test my changes with: "./fudgeandrun path-to-test.t". But I got an error about Test::Util instead, that is inside of packages/Test/Util.pm. What is the correct way to run a single test file?
ZzZombo but why does &A.x does't work?
not* 13:22
jnthn &A means "the subroutine A", .x is calling a method on it
IOninja sena_kun: you run it from rakudo's repo where it's located in t/spec
sena_kun IOninja, argh. why.
IOninja sena_kun: I guess because 99.99999% of the time the tests are run by rakudo devs, not by someone just checking out the roast repo. 13:23
ZzZombo so what is the right way?
moritz sena_kun: because the test suite needs to make assumptions about paths
IOninja sena_kun: it should be possible to make the tests invocation-location-agnostic, but hasn't been done.
huggable: FindBin
huggable IOninja, use lib $*PROGRAM.parent.parent.child("lib").Str; # finds lib/ for scripts in bin/ or t/ 13:24
moritz and even if possible, I'm not sure that's a good idea
IOninja moritz: how come?
other than it being more work
moritz because then we require new implementations to implement a whole lot of extra stuff before they can start running those tests
sena_kun Um, okay. Thanks for the explanation, now I'll remember it better.
IOninja Ah. Fair enough.
moritz I'd be surprised if the FindBin trick would work with a two-year old rakudo 13:26
IOninja sena_kun: you may wanna point that out to mr_ron (I think). They've been working on moving fudgeandrun to roast. Probably possible to make fudgeandrun change the dir to make all the paths work out as if they were run from a ../../
or something or other.
.seen mr_ron 13:27
yoleaux I saw mr_ron 31 Jan 2017 22:47Z in #perl6: <mr_ron> Warning on mixed | and || and related documentation needs github.com/perl6/doc/issues/1141
IOninja Yeah, that's the right nick.
[Coke] .seen IOninja 13:28
yoleaux 02:48Z <IOninja> [Coke]: how detailed should the grant report be? Is this more to ensure I'm doing *something* or do people want to know all the details of what I did? In these three verbosity options, which is most preferred? gist.github.com/zoffixznet/90cb249...c5e7b40b89
I saw IOninja 13:27Z in #perl6: <IOninja> Yeah, that's the right nick.
sena_kun IOninja, I just thought that he worked exactly on this type of issues and assumed it was solved.
IOninja ZzZombo: the right way is what your last eval with .^lookup; there are several other ways to find the method too, like .^find_method and .^can
[Coke] gfldex: pretty sure it was an nqp level error with no backtrace.
13:29 mcmillhj joined
IOninja sena_kun: in your case adding PERL6LIB=packages/ likely will make it work 13:29
But roast as a whole makes other assumtions about locations of axuliary files, I believe
13:32 lukiramu joined
IOninja & 13:33
13:33 ChoHag joined 13:34 mcmillhj left
moritz last I looked, the fact that roast made assumptions about such paths was also documented in roast's README 13:35
sena_kun with "PERL6LIB=packages/ ./fudgeandrun file" it doesn't work either. Anyway, I'll just use "make spectest" from rakudo repo root, I guess.
moritz which, of course, noody bothers to read.
IOninja sena_kun: don't; it takes ages to run. Use t/fudgeandrun from rakudo repo
13:35 lukaramu left
IOninja t/fudgeandrun t/spec/blah/blah.t 13:35
moritz or make t/sepc/path/to/file
sena_kun Ah, it was in t folder. Thanks! 13:36
[Coke] IOninja: I've seen all three levels of detail; If you can give the detail in [1], I for one would appreciate it. 13:37
IOninja [Coke]: will do.
13:57 mcmillhj joined, hartenfels joined 14:03 bjz left 14:04 aborazmeh left
ZzZombo what the hell, Perl: 14:09
method walk(Grammar::VDF::Section:D :$start=$.root,Callable:D &section_code={;},Callable:D &kv_code={;})
Cannot put optional positional parameter &section_code after variadic parameters
Geth doc: bf93d3d9be | Cale++ | doc/Language/haskell-to-p6.pod6
add gather/take examples
14:10
14:11 itaipu joined
ZzZombo "Long Names 14:11
To exclude certain parameters from being considered in multiple dispatch, separate them with a double semi-colon."
w-what?
moritz multi f($x ;; $y) { ... } 14:12
only $x's type is considered in multi dispatch
ZzZombo but... why "Long Names"??
moritz the signature is part of the long name of a candidate 14:13
14:14 committable6 left
ZzZombo so why :$start is considered variadic? I've refreshed my knowledge of variadic arguments, it certainly isn't declared like *%slurp. 14:20
moritz named args are optional by default 14:21
14:21 skids joined
ZzZombo so?.. named and positional are completely indepedent as far as the ordering (w/o referring to previous arguments) is concerned, aren't they? 14:22
moritz they are 14:23
but doesn't a variable number of named args still makes a routine varidadic?
IOninja Then why does it matter if you put them before positionals in a signature? 14:24
ZzZombo but there is NO variance
moritz ZzZombo: there isn't? 14:26
ZzZombo: a named being present or not is variance
IOninja: I think it's one of the places where Perl 6 tries to be prescriptive
ZzZombo eh? it has got a default value, so in my book it means it's present all the tme
14:26 committable6 joined, ChanServ sets mode: +v committable6
ZzZombo now if Perl does have a strange view of things... 14:27
moritz the *argument* isn't present allt he time
the *paramater* always has a value, sure
IOninja m: sub (:$x!, $y) {}
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot put required parameter $y after variadic parameters
at <tmp>:1
------> 3sub (:$x!, $y7⏏5) {}
expecting any of:
constraint
moritz but variadic (in my understanding) means variable number of *arguments*
IOninja: that's LTA 14:28
IOninja this feels more like a bug in the code that looks for variadic positionals
rather than prescriptive
¯\_(ツ)_/¯
moritz I dimly recall another rule requiring positional before named, but my memory on that is fuzzy
IOninja but it's been that way since before 2014.01 14:29
sena_kun github.com/perl6/roast/pull/244 closes rt.perl.org/Public/Bug/Display.html?id=130712. 14:31
ZzZombo wait, how do I make a routine accept anything Callable? I get mysterious errors like "Type check failed in binding to &section_code; expected Callable[Callable] but got Block (-> ;; $_? is raw { #`...)".
moritz &code 14:33
in the signature
14:33 sammers left 14:35 ChoHag left
IOninja Callable $foo also works. 14:35
m: -> Callable & {}(&say) 14:36
camelia Type check failed in binding to <anon>; expected Callable[Callable] but got Sub (sub say (| is raw) { ...)
in block <unit> at <tmp> line 1
IOninja You doubled up the Callable...
arnsholt And Callable $foo is equivalent to &foo, no?
IOninja m: say :(Callable $foo) eqv :(&foo) 14:37
camelia False
IOninja I think so...
arnsholt Failing due to &foo and $foo, possibly
?
IOninja I think so.
m: say :(Callable $foo) ~~ :(&foo) 14:39
camelia True
IOninja There's also this bug; dunno if such not-really-Callable-callables are produced in user code tho: rt.perl.org/Ticket/Display.html?id...et-history 14:41
14:41 itaipu left 14:42 ChoHag joined 14:44 lichtkind_ joined 14:46 sammers joined 14:47 lichtkind__ left 14:50 itaipu joined 14:52 yadzi left
IOninja m: %*ENV<RAKUDO_EXCEPTIONS_HANDLER>='Meows'; class Exceptions::Meows { method process ($e) {say "daum, boy; yer code's broke as 'ell"; 0}}; EVAL 'sub () is return 42 {}' 14:58
camelia daum, boy; yer code's broke as 'ell
IOninja (re testing for text of error in roast) Even with rakudo you can alter error output. 14:59
14:59 curan left
IOninja There's prolly plenty of tests that do test, but it just feels wrong to have those on the same level as all the other tests. 15:00
15:00 risou_awy is now known as risou
IOninja and we can always move them from rakudo to roast; going the other way is much harder. 15:01
sena_kun IOninja, athemerge was a bit faster than I though, since I didn't change X::AdHoc to Exception yet. :) 15:02
*the merge
IOninja sena_kun: it's fine there, I think. If we do add a more detailed exception, we can just change the test to test for it. In roast, we can't just change tests willi-nilly 15:03
sena_kun IOninja, well then.
15:04 wamba1 left, ChoHag left 15:06 wamba1 joined 15:09 llfourn left 15:10 salv0 left 15:11 gregf_ left, pmurias joined
pmurias SmokeMachine: it would make sense to have our module installer install Perl 5 (and other language) models if they are dependencies of Perl 6 modules 15:12
15:17 risou is now known as risou_awy 15:21 ChoHag joined, gregf_ joined 15:22 wamba1 left
[Coke] pmurias: There are many ways to install p5 modules, we shouldn't get involved. 15:22
15:27 bwisti joined 15:32 rurban left
moritz also, what if we depend on python modules through Inline::Python? 15:34
or any other language, through another Inline:: module?
15:34 pyrimidine left, pyrimidine joined 15:35 hartenfels left 15:40 pyrimidine left
IOninja we could get involved on `zef`'s level. e.g.: it'd offer a plugin and user can set it to run `cpanm -vn Module::Name` for any Perl 5 deps. 15:42
Someone would set it up to do something else.
Make it automatically install all the deps instead of my having to do all that stuff myself. Seems useful. 15:43
[Coke] -1 from me. 15:44
IOninja ¯\_(ツ)_/¯ don't use the plugin. 15:45
Seems entirely a user-space choice.
perigrin where do you draw the line?
IOninja We don't. We don't have control over it.
I could churn out an installer that looks for `depends-apt-get` key in META file and runs `sudo apt-get get blah blah` on that.
perigrin What about c-level deps? 15:46
IOninja See above.
perigrin So ... unless the author thought to put depends-pacman people on arch can't do anything?
IOninja They'd have to install manually, just like now, yes. 15:47
Or I could churn out an installer that figures that stuff out for arch
Don't even need to churn out an installer.... zef is pluggable; 'd just write a plugin that does that
ZzZombo m: say $_ for () orelse say 'LUL'; 15:51
camelia ( no output )
ZzZombo m: say $_ orelse say 'LUL' for ();
camelia ( no output )
IOninja say returns True
ZzZombo :(
IOninja um 15:52
m: dd (say $_ for ())
camelia ()
15:52 pyrimidine joined
IOninja m: dd (say $_ for ()).defined 15:52
camelia Bool::True
IOninja the thing returns an empty list which is defined, I think is more correct here :)
m: say $_ for () or say 'LUL';
camelia LUL
True
gfldex m: my &nay = &say but False; dd so &nay 15:53
camelia Bool $val = Bool::False
IOninja ohh that's how it does it. weird
ZzZombo m: say $_ for (1) or say 'LUL'; 15:54
camelia 1
IOninja I don't follow it actually. `or` and `orelse` end up parsed differenly? The `or` gives the result to `say` but `orelse` thunks it or something?
m: say $_ for () andthen say 'LUL'; 15:55
camelia LUL
True
IOninja ...
m: say Empty
camelia ()
IOninja don't get it
m: (say $_) for () or say 'LUL'; 15:56
camelia LUL
True
IOninja m: (say $_) for () orelse say 'LUL';
camelia ( no output )
IOninja oh
15:56 llfourn joined
IOninja m: (say $_) for (() orelse say 'LUL'); 15:56
camelia ( no output )
IOninja m: (say $_) for (() or say 'LUL');
camelia LUL
True
IOninja That's how it parses.
I get it \o/ 15:57
m: ().defined.say
camelia True
IOninja m: () orelse say 'wat'
camelia ( no output )
IOninja m: ().self orelse say 'wat'
camelia ( no output )
IOninja what gives?
oh nevermind 15:58
bah
Hacking time \o/
15:58 risou_awy is now known as risou 15:59 wamba joined 16:00 ChoHag left 16:01 llfourn left, pyrimidine left 16:02 ChoHag joined
ZzZombo m: say $_ for (1) or say 'LUL'; 16:05
camelia 1
ZzZombo why the hell
(say "$indent\t$_.name()\t=>\t$_.value()" for ($section.keys.all-values)) or say '<none>';
then doesn't work, complaining I used up Seq?
ugh
I meant
say "$indent\t$_.name()\t=>\t$_.value()" for ($section.keys.all-values) or say '<none>';
with the braces it works.
16:06 wamba left
IOninja .cache it? 16:07
16:07 wamba joined
ZzZombo that's not the point, it's that after embracing the expression it works again. 16:08
IOninja No idea what you mean by embracing
Any idea what this is for? github.com/rakudo/rakudo/blob/nom/...7061-L7064 16:09
ZzZombo uh
<ZzZombo> with the braces it works.
IOninja notanthen is missing from the list but I don't know what it does.
ZzZombo literally said it above
IOninja ZzZombo: saw it; don't know what you mean.
ZzZombo (say "$indent\t$_.name()\t=>\t$_.value()" for ($section.keys.all-values)) or say '<none>';
vs 16:10
say "$indent\t$_.name()\t=>\t$_.value()" for ($section.keys.all-values) or say '<none>';
IOninja ...those are parentheses :/
perlpilot round brackets ;)
IOninja and yeah, makes sense. In the first case you're consuming the seq to find out if it's true or not and then consuming it second time to iterate over it; in the second case you only iterate over it and use the result of `for` in the conditional 16:11
moritz without the parenthesis, EXPR for A or B evaluates A twice
once for the "or" and once for the "for"
and you can't consume a Seq twice
ZzZombo well then, makes sense.
thanks
16:12 ggoebel left
IOninja s: &METAOP_TEST_ASSIGN 16:12
s: &METAOP_ASSIGN
SourceBaby IOninja, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared name:␤ METAOP_TEST_ASSIGN used at line 6␤␤ 16:13
IOninja, Sauce is at github.com/rakudo/rakudo/blob/c550...aops.pm#L2
IOninja huh
s: &METAOP_TEST_ASSIGN:<andthen> 16:14
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/c550...aops.pm#L9
IOninja What's this stuff's for? 16:15
Like what's with these special cases for all these ops? (and I see <or> and <and> are missing :/)
oh 16:16
m: my $x = 42; $x andthen= 72; say $x
camelia 72
IOninja m: my $x = 42; $x and= 72; say $x
camelia 72
IOninja mhm, that's the METAOP_TEST_ASSIGN stuff 16:17
.... now I wonder if the missing <or> and <and> is an error :|
16:18 parisba left
IOninja moves this soliloquy to #perl6-dev 16:18
16:19 committable6 left
IOninja but the answer is yes :D 16:19
What's up with commitable? Something's making it stall.
16:20 parisba joined 16:21 ChoHag left, committable6 joined, ChanServ sets mode: +v committable6 16:22 committable6 left, committable6 joined, ChanServ sets mode: +v committable6
[Coke] so, this code is failing in examples-compilation (but only when running all the tests. running just the one file, it works fine) 16:30
class IO::Socket::INET does IO::Socket {}
dies with:
No appropriate parametric role variant available for '<anon|140234519215376>::IO::Socket'
m: class IO::Socket::INET does IO::Socket {}
camelia 5===SORRY!5=== Error while compiling <tmp>
IO::Socket is not composable, so IO::Socket::INET cannot compose it
at <tmp>:1
[Coke] m: if False { class:: { class IO::Socket::INET does IO::Socket {} }} 16:31
camelia 5===SORRY!5=== Error while compiling <tmp>
IO::Socket is not composable, so IO::Socket::INET cannot compose it
at <tmp>:1
SmokeMachine pmurias: as Inline::* for example? do you think that install Inline::Python, for example, should install python?
IOninja m: class IO::Socket {}; class IO::Socket::INET does IO::Socket {}
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of symbol 'IO::Socket::INET'
at <tmp>:1
------> 3; class IO::Socket::INET does IO::Socket7⏏5 {}
IOninja weird eh? 16:32
m: role IO::Socket {}; class IO::Socket::INET does IO::Socket {}
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of symbol 'IO::Socket::INET'
at <tmp>:1
------> 3; class IO::Socket::INET does IO::Socket7⏏5 {}
16:32 cale2 joined
cale2 not sure what the ideal oauth1 implementation would be. in an effort to keep it as simple as possible, this is what I dreamed up in the readme github.com/WildYorkies/perl6-oauth.../README.md 16:35
16:35 pyrimidine joined, kurahaupo joined
cale2 make an unsigned request, then sign it (which adds the authorization header), then send it off 16:35
[Coke] IOninja: I think I'll skip it for now. unskipping skipped tests can be a project at some point. 16:36
Geth doc: 7ac8ab13f9 | (Will "Coke" Coleda)++ | doc/Language/grammars.pod6
remove trailing whitespace
16:38
doc: 4576bd8474 | (Will "Coke" Coleda)++ | doc/Language/haskell-to-p6.pod6
remove trailing whitespace
doc: 00d98337d5 | (Will "Coke" Coleda)++ | doc/Type/IO/Socket/INET.pod6
Don't test this signature

Fails xt/examples-compilation.t (when running all files, but not when run for the one pod file its in)
16:40 ggoebel joined 16:46 kurahaupo left 16:53 mcmillhj left 16:54 abraxxa left 16:57 llfourn joined 16:59 itaipu left 17:02 llfourn left 17:03 Qwerasd joined 17:06 AlexDaniel joined 17:08 ChoHag joined
IOninja m: say 42 xor 5 17:08
camelia 42
IOninja don't seem to be documented
It doesn't thunk anything, right? `$x xor say "hi"` will always say hi? 17:09
s: &infix:<xor>
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/c550...ol.pm#L142
b2gills .tell Ven I'll tell you the same thing I'm sure I told Hotkeys, if you want me to delay answering Code Golfs I will
yoleaux b2gills: I'll pass your message to Ven.
17:10 zakharyas left
IOninja ah 17:10
wait.. 17:11
m: say (42 xor 5)
camelia Nil
IOninja m: say (42 xor say "hi")
camelia hi
Nil
IOninja yeah, guess it'll always say hi when just two args are given
b2gills say (42 xor 5 xor say 'hi') 17:12
m: say (42 xor 5 xor say 'hi')
camelia Nil
IOninja I was asking 'cause I see `xor=` form isn't made to thunk
And I guess in that form you can only give two args?
m: my $x; $x xor= say "hi"; # supposed to always say hi, right? 17:13
camelia hi
b2gills I can't think of a way it could get more than 2 args without creating your own QAST nodes
IOninja cool
AlexDaniel xor :O 17:14
17:15 risou is now known as risou_awy
IOninja AlexDaniel: something's wrong with commitable. Pinged out twice today, though the process was still running. Rest of the gang was fine. 17:15
I mean... while no one (I think?) was using it.
17:16 committable6 left
AlexDaniel hmmmmm 17:16
b2gills m: sub infix:<Zxor> (\l is rw,\r){ my \r= [xor] l,|r;r??r!!l}; $_ = 5; $_ Zxor= 0,0,0; .say 17:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Can only use 'is rw' on a scalar ('$' sigil) parameter
at <tmp>:1
AlexDaniel doesn't get back online
b2gills m: sub infix:<Zxor> (\l,\r){ my \r= [xor] l,|r;r??r!!l}; $_ = 5; $_ Zxor= 0,0,0; .say
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of symbol 'r'
at <tmp>:1
------> 3sub infix:<Zxor> (\l,\r){ my \r7⏏5= [xor] l,|r;r??r!!l}; $_ = 5; $_ Zxor=
expecting any of:
new term to be defined
AlexDaniel my best guess would be that it is this server issue again
(freenode server issue I mean)
b2gills m: sub infix:<Zxor> (\l,\r){ my \a= [xor] l,|r;a??a!!l}; $_ = 5; $_ Zxor= 0,0,0; .say
camelia WARNINGS for <tmp>:
Useless use of constant integer 0 in sink context (lines 1, 1, 1, 1)
5
b2gills m: sub infix:<Zxor> (\l,\r){ my \a= [xor] l,|r;a??a!!l}; $_ = 5; $_ Zxor= (0,0,0); .say
camelia 5
17:18 cschwenz joined
AlexDaniel yea, sometimes it gets stuck on “Attempting to connect to server” 17:18
17:19 committable6 joined, ChanServ sets mode: +v committable6
AlexDaniel all bots are on wilhelm.freenode.net, but committable is on leguin.freenode.net 17:19
could be the issue? I don't know…
but I'm hoping it will fix itself :) 17:20
committable6: be a good bot like evalable, or no meat for you :P
committable6 AlexDaniel, ¦«be»: Cannot find this revision (did you mean “all”?)
17:22 itcharlie joined
IOninja heh, it was Zoffix who added multi sub infix:<cmp>(Rational:D \a, Rational:D \b) candidate and made it a.Num cmp b.Num 17:24
It replicated old behaviour instead of Doing The Obviously Righter Thing -_- 17:25
17:25 pyrimidine left 17:26 pyrimidine joined
cale2 m: say [or] (false, false, false, false) 17:28
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
false used at line 1
Ven b2gills: Don't worry, I know Jelly/CJam/Pyth and a few others, I have plenty to golf from :)
yoleaux 17:09Z <b2gills> Ven: I'll tell you the same thing I'm sure I told Hotkeys, if you want me to delay answering Code Golfs I will
AlexDaniel cale2: False
cale2 m: say [or] (False, False, False, False)
camelia False
cale2 m: say [or] (False, False, True, False) 17:29
camelia True
AlexDaniel I don't think you need parens there
cale2 m: say [or] False, False, True, False
camelia True
AlexDaniel u: false
unicodable6 AlexDaniel, Found nothing!
AlexDaniel u: boolean
unicodable6 AlexDaniel, Found nothing! 17:30
AlexDaniel u: truth
unicodable6 AlexDaniel, U+4DFC HEXAGRAM FOR INNER TRUTH [So] (䷼)
AlexDaniel :S
17:30 pyrimidine left
cale2 m: say any False, False, True, False 17:30
camelia any(False, False, True, False)
cale2 m: say so any False, False, True, False 17:31
camelia True
cale2 need to read up on what "so" does
m: say do any False, False, True, False
camelia any(False, False, True, False)
AlexDaniel cale2: it's just .Bool
or prefix ?
cale2 why doesn't `any` evaluate right away? it just constructs a junctino?
IOninja cale2: because... that's what any does. 17:32
It constructs a Junction.
17:32 dustinm`_ left
Qwerasd m: say so ^(False, False, True, False) 17:32
camelia True
cale2 any and all are both Junction constructors.
What about Junction.new
AlexDaniel cale2: as well as & | ^ 17:33
IOninja cale2: If you like long-winded code, sure, you can use Junction.new :)
AlexDaniel which are just other ways of saying all any one
Qwerasd m: say so none(False, False, True, False)
camelia False
17:33 pyrimidine joined
Qwerasd m: say so none(False, False, False) 17:33
camelia True
Qwerasd Junctions are weird, but they look useful.
IOninja perl6.party/post/Perl-6-Schrodinge...-Junctions 17:34
cale2 I think I prefer the [or] and [and] operators instead :D
more explicit
timotimo it's far from the same thing
m: my Junction $vals = any(1, 2, 3, 4); $vals **= 2; say $vals == 16
camelia any(False, False, False, True)
timotimo m: my Junction $vals = any(1, 2, 3, 4); $vals **= 2; dd $vals
camelia Junction $vals = any(1, 4, 9, 16)
timotimo see how it distributes the **= over all values in the junction? 17:35
IOninja Most common use is to shorten expressions: $x eq 'foo'|'bar'|'ber'
Qwerasd Yeah an any junctions the way I understand it looks like a list that distributed operations over itself.
$x eq ^('foo', 'bar', 'baz') 17:36
it's longer tho
and less clear.
IOninja than $x eq 'foo' or $x eq 'bar' or $x eq 'ber'?
cale2 the [+] thing is like a fold in a functional language. Or reduce, rather
junctions, are sort of like folds and reduce too, though, right? 17:37
samcv we use sha1 for modules right? security.googleblog.com/2017/02/an...ision.html
or is it sha256?
IOninja Qwerasd: the ^('foo', 'bar', 'baz') thing is wrong. That's the Range construction op
AlexDaniel I think the coolest thing with Junctions is that you can shove them into places where no junction was expected, and it will work just fine
IOninja m: dd ^('foo', 'bar', 'baz')
camelia ^3
IOninja m: dd eager ^('foo', 'bar', 'baz')
camelia (0, 1, 2)
timotimo AFKBBL 17:38
IOninja BBQ
17:38 pyrimidine left
IOninja samcv: sha1. That article don't matter to us, since we're not using it to crypt stuff. 17:39
Qwerasd Wait then would it be ^[] instead of ^() or am I just crazy?
IOninja Qwerasd: neither.
Qwerasd Then I'm just crazy.
samcv well would only matter if somebody got it into @INC? or would have to be in our specific library folder
IOninja Qwerasd: 'a' ^ 'b'; the Junction op is the prefix op
Qwerasd Is there a way to define infix methods? 17:40
IOninja dammit
Qwerasd: I meant, Junction is the *infix* op, whereas ^[] ^() is the *prefix* op, which is the Range constructor
Qwerasd Ye I got that.
IOninja Qwerasd: infix... methods. Not sure what you mean. You can define infix *ops*
Qwerasd It's a bit confusing, the information density in perl6 is higher than other languages.
IOninja m: sub infix:<♥> { "$^a loves $^b" }; say 'me' ♥ 'Perl 6' 17:41
camelia me loves Perl 6
IOninja Qwerasd: mhm, a bit. But there's a lot of consistency, so once you start noticing patterns, it's a bit easier to take it all in.
Qwerasd Yeah
The whole infix and prefix ops being different think threw me off 17:42
IOninja Like 'foo' ~ 'bar' is string concatenation... +$foo coerces $foo to Numeric... So what's the op to coerse something to Str? ... it's prefix ~
17:43 dustinm` joined
IOninja Qwerasd: the useful rule to remember there is Perl 6 expects an op after a term and two terms in a row is an error. So stuff like `$x ++ $y` may look really weird (and not something you see in real code) but with that rule in mind, it's clear that that is $x + (+$y) 17:43
Qwerasd ~$foo
right?
IOninja Yeah
m: $foo = class { method Str { 'wooo Imma string now, yo' } }.new; say ~$foo 17:44
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$foo' is not declared
at <tmp>:1
------> 3<BOL>7⏏5$foo = class { method Str { 'wooo Imma s
IOninja m: my $foo = class { method Str { 'wooo Imma string now, yo' } }.new; say ~$foo
camelia wooo Imma string now, yo
wamba m: my $a = Failure.new; $a.defined; say ($a and True ); .say without $a;  say ( $a andthen True ); 17:45
camelia (HANDLED) Failed

(HANDLED) Failed

()
17:45 st_elmo joined 17:46 jonas1 left
IOninja wamba: calling .defined or .Bool on Failure marks it as hangled. 17:46
17:46 rurban joined
IOninja and makes it non-explosive 17:46
and without calls .defined and `and` calls .bool
*.Bool
Qwerasd m: my %hash = "Foo" => "Bar", "Biz" => "Baz"; say %hash«Foo» 17:47
camelia Bar
17:47 rurban1 joined
Qwerasd I find it funny that «» gets turned to {}, seems like a weird thing to include in a language. 17:47
wamba IOninja: Ok, but why "andthen" not return Failure but Slip? 17:48
IOninja Qwerasd: not really equivalent. 17:49
b2gills postcircumfix: «…» gets turned into postcircumfix: { Q:qq:ww'…' }
circumfix: «…» gets turned into Q:qq:ww'…' 17:50
IOninja Qwerasd: here's a long explanation on the difference: rt.perl.org/Ticket/Display.html?id...xn-1449761
Qwerasd I see, reading furhter in the perl 6 docs, I see it quotes its arguments
further*
17:50 agentzh joined
b2gills notice that it quotes it exactly the same as the circumfix version 17:51
17:51 rurban left
IOninja wamba: it returns Empty if any of the arguments aren't defined. This is so it can be used inside lists. Postfix `with` compiles to `andthen` under the hood, for example 17:51
17:53 pyrimidine joined
IOninja m: multi x (:$foo!) { say "here" }; multi x (:$bar!) { say "there" }; my $foo; my $bar = 42; x |($foo andthen :$foo), |($bar andthen :$bar) 17:54
camelia there
IOninja m: multi x (:$foo!) { say "here" }; multi x (:$bar!) { say "there" }; my $foo = 42; my $bar; x |($foo andthen :$foo), |($bar andthen :$bar)
camelia here
IOninja ^ one example.
wamba IOninja: Could you show me useful example which use this behaviour? 17:56
TimToady makes more sense in a list comprehension 17:57
IOninja wamba: one's above.
17:58 yadzi joined, yadzi left, llfourn joined
wamba IOninja: thank you, 17:58
IOninja m: dd 4.99999999999999999999999.FatRat 17:59
camelia FatRat.new(499999999999999999999999, 99999999999999991611392)
Qwerasd what does dd do?
IOninja Seems off? kinda expected a 1 with zeros in the denominator
Qwerasd: dumps stuff: docs.perl6.org/programs/01-debuggi...unction_dd 18:00
TimToady m: dd <4.99999999999999999999999>.FatRat 18:03
camelia FatRat.new(499999999999999999999999, 100000000000000000000000)
Qwerasd wait if ~$foo forces $foo into a string, it seems like what should happen is $_~$foo
18:03 llfourn left
Qwerasd m: my $foo = 10; "bar"; say ~$foo 18:03
camelia WARNINGS for <tmp>:
Useless use of constant string "bar" in sink context (line 1)
10
18:04 llfourn joined
TimToady IOninja: bare 4.99999999999999999999999 turns into a Rat before you FatRat it 18:04
IOninja m: say 499999999999999999999999 ~~ UInt64
camelia False
IOninja Oh, tis too big 18:05
Qwerasd m: my $foo = 10; say ~$foo; say $_
camelia 10
(Any)
IOninja m: dd WHAT <4.99999999999999999999999>
camelia RatStr
IOninja TimToady: and that one doesn't?
s: RatStr, 'FatRat', \|()
18:05 dakkar left
IOninja s: RatStr, 'FatRat', \() 18:05
TimToady FatRat knows to use the Str part
SourceBaby IOninja, Something's wrong: ␤ERR: Could not find candidate that can do \(())␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29␤ in block <unit> at -e line 6␤␤
IOninja, Something's wrong: ␤ERR: Could not find candidate that can do \()␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29␤ in block <unit> at -e line 6␤␤
IOninja Ah :) nice
TimToady++ thanks. 18:06
TimToady m: dd '4.99999999999999999999999'.FatRat
camelia No such method 'FatRat' for invocant of type 'Str'
in block <unit> at <tmp> line 1
TimToady arguably that should work too
IOninja m: dd [.Num, .Int, .Rat] with '4.99999999999999999999999'
camelia [5e0, 4, <499999999999999999999999/100000000000000000000000>]
IOninja will add
TimToady m: say 100000000000000000000000.msb 18:08
camelia 76
TimToady hmm
that's odd
IOninja s: '', 'Rat', \()
TimToady m: say '4.99999999999999999999999'.Rat.WHAT
camelia (Rat)
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/e0a9...ol.pm#L258 18:09
18:09 llfourn left
IOninja m: say 4.99999999999999999999999 <=> 5 18:09
camelia More
IOninja y u wrong
18:09 andrzejku joined
TimToady how did dd get a denom of 100000000000000000000000 out of a .Rat? 18:10
IOninja m: dd val('4.99999999999999999999999', :val-or-fail) 18:11
camelia <499999999999999999999999/100000000000000000000000>
IOninja s: &val, \('4.99999999999999999999999', :val-or-fail)
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/e0a9...hs.pm#L131
TimToady but it's after a .Rat
18:12 Qwerasd left
IOninja the return from val about is a Rat too, and the ''.Rat is ''.Numeric.Rat is val('', :val-or-fail).Rat 18:12
m: dd Rat.new: 499999999999999999999999, 100000000000000000000000 18:13
camelia <499999999999999999999999/100000000000000000000000>
IOninja And I guess that's that cause 18:14
TimToady that kinda violates the Rat invariant...
but maybe it's okay, since it's not sticky through Rat ops 18:15
IOninja Should it throw or return a FatRat or Num?
18:15 risou_awy is now known as risou 18:16 tomaw left, tomaw joined
TimToady but if it does actually store a FatRat under Rat, then if we ever actually make the denom a UInt64, it's gonna break 18:16
pmurias SmokeMachine: installing python itself seems a stretch, but having the user able to tell zef 'install python modules using this' seems desirable
TimToady or a uint64 18:17
IOninja m: say 4.99999999999999999999999 <=> 5.0 18:18
camelia More
TimToady but if it accidentally a 100000000000000000000000 in there, then .FatRat y u no workie?
IOninja m: say 4.99999999999999999999999.norm <=> 5.0.norm
camelia More
IOninja m: say 4.99999999999999999999999.nude
camelia (499999999999999999999999 99999999999999991611392)
TimToady m: say 99999999999999991611392.msb 18:19
camelia 76
TimToady still >64 bits, and wrong to boot
IOninja yikes 18:20
Don't really get why it gives More tho
TimToady maybe any literal Rat that exceeds 64-bit denom should automatically turn into a RatStr?
IOninja Why not into a FatRat?
TimToady because FatRats are contagious 18:21
IOninja Ah
TimToady m: say <4.99999999999999999999999> <=> 5.0
camelia Less
IOninja ...
s: &infix:«<=>», \(<4.99999999999999999999999>, 5.0) 18:22
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/3e88...at.pm#L289
IOninja s: &infix:«<=>», \(4.99999999999999999999999, 5.0)
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/3e88...at.pm#L289
IOninja heh
m: say <4.99999999999999999999999>.nude
camelia (499999999999999999999999 100000000000000000000000)
IOninja Ah, k, now I finally get why it gives Less. 18:23
TimToady m: say <4.99999999999999999999999>.Numeric.WHAT
camelia (Rat)
IOninja m: say FatRat.new(0, 0) <=> Inf 18:25
camelia Nil
IOninja m: say <0/0> <=> Inf
camelia Nil
18:25 cschwenz left
IOninja cute... 18:25
Hm... "github.com/rakudo/rakudo/blob/3e88...um.pm#L390 18:28
Hm... "Here we treat NaN as undefined": github.com/rakudo/rakudo/blob/3e88...um.pm#L390
and giving a weird result in return?
can't compare a NaN or something. 18:29
m: say 4.999999999999999999 cmp 5.0
camelia Same
IOninja well, I got a fix for that but it breaks <0/0> cmp Inf comparison
m: say <0/0> cmp Inf
camelia More
IOninja guess it's IEEE time again, but I'm out of non-IO tuits for the day. 18:30
Will finish it off tomorrow
18:31 Actualeyes left
IOninja
.oO( a.isNaN || b.isNaN ?? a cmp b !! a <=> b )
18:32
18:32 risou is now known as risou_awy
IOninja infiniloop \o/ 18:35
.oO( a.isNaN || b.isNaN ?? a.Num cmp b.Num !! a <=> b ... I guess)
18:43 eroux left 18:48 Actualeyes joined 18:53 Actualeyes left
IOninja for Cool.FatRat, I'm adding self.Numeric.FatRat... which I *hope* does the right thing for all the Cools? 18:59
19:00 mcsnolte joined
IOninja m: dd Duration.new: 4.99999999999999999999999 19:00
camelia Duration.new(<499999999999999999999999/99999999999999991611392>)
IOninja m: dd Duration.new: <4.99999999999999999999999>
camelia Duration.new(<499999999999999999999999/100000000000000000000000>) 19:01
IOninja m: dd Duration.new(<4.99999999999999999999999>).Numeric.FatRat
camelia No such method 'FatRat' for invocant of type 'Duration'
in block <unit> at <tmp> line 1
IOninja ummm
m: dd Duration.new(<4.99999999999999999999999>).Rat
camelia <499999999999999999999999/100000000000000000000000>
IOninja s: Duration.new(<4.99999999999999999999999>), 'Rat', \() 19:02
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/3e88...tion.pm#L8
IOninja s: Duration.new(<4.99999999999999999999999>), 'FatRat', \()
SourceBaby IOninja, Something's wrong: ␤ERR: Could not find candidate that can do \()␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29␤ in block <unit> at -e line 6␤␤
IOninja I see -_-
Deep does the rabbit... I mean fat rat... hole goes.
m: say Duration ~~ Numeric 19:03
camelia True
IOninja So Numeric ain't providing .Numeric method.
19:04 darutoko left
IOninja .. or .FatRat method :\ 19:04
19:05 llfourn joined
IOninja oh wait, it does have Numeric. nm 19:05
time to take a break for today with this :)
19:07 cdg left, eroux joined
MasterDuke m: say "groß".fc; say "groß" ~~ /:i gross / 19:07
camelia gross
Nil
MasterDuke should ^^^ match? 19:08
19:08 rurban1 left
IOninja hehe 19:08
It does!
m: say "groß".fc; say "groß".fc ~~ /:i gross /
camelia gross
「gross」
IOninja m: say "groß".fc; say "groß".fc ~~ /:i groß / 19:09
camelia gross
Nil
IOninja awww
19:09 rurban joined, rurban left
MasterDuke ha, yeah, that's what i was trying to show 19:09
IOninja++
19:10 llfourn left
IOninja There's this ticket: rt.perl.org/Ticket/Display.html?id...et-history 19:10
Well, I dunno if you're meant to use .fc on the string in that case.
MasterDuke m: say "groß".fc; say "groß" ~~ /:i groß /
camelia gross
「groß」
MasterDuke doh 19:11
IOninja m: say "groß".fc ~~ / gross /
camelia 「gross」
IOninja m: say "groß" ~~ / groß /
camelia 「groß」
IOninja like, it matches without even the :i thing 19:12
MasterDuke well yeah
IOninja works fine in Perl 5 19:13
so yeah, a bug :)
19:13 yadzi joined, breinbaas left 19:14 ChoHag left 19:15 mcmillhj joined
IOninja m: say 4.999999999999999999 cmp 5.0 19:15
camelia Less
IOninja m: 42 notandthen say "hi"
camelia ( no output )
IOninja yey
19:18 eroux left
IOninja samcv: oh, sorry, I thought it was the old sha1 one article. 19:19
ehehehe, well, it got a website, a trendy name, and a logo: shattered.io/ gotta a serious vuln :P 19:20
timotimo 𐄹yolo 19:21
19:23 Actualeyes joined 19:26 TEttinger joined 19:29 cdg joined
geekosaur like nobody saw that coming. sha1's been deprecated for a reason 19:32
IOninja :)
19:32 yadzi left 19:34 cdg left 19:35 mcmillhj left, raiph left 19:38 mcmillhj joined 19:42 mcmillhj left 19:43 andrzejku left 19:44 andrzejku joined 19:46 andrzejku left 19:47 bjz joined 19:48 Actualeyes left 19:49 espadrine joined 19:50 andrzejku joined 19:51 mcmillhj joined 19:55 pyrimidine left, pyrimidine joined, mcmillhj left 20:00 pyrimidine left 20:03 rumble joined 20:05 Qwerasd joined, mcmillhj joined 20:06 noganex_ left, llfourn joined 20:07 grumble left, rumble is now known as grumble 20:09 ggoebel left, mcmillhj left 20:10 mcmillhj joined
IOninja Any cool way to find all core types that are Cool? 20:11
Using grep -FR 'is Cool' ATM... hoping I got 'em all that way 20:12
SmokeMachine IOninja: not cool, but: github.com/FCO/Test-Fuzz/blob/mast...or.pm6#L19 20:13
gfldex IOninja: you could adapt perl6-doc/util/list-missing-methods.p6 20:14
IOninja I got Instant, List, Map, Range, Complex, Str, Rat, Nil, Match, Num, StrDistance, Seq, IO::Path, Duration
oh, right
SmokeMachine++ thanks
20:14 llfourn left 20:16 risou_awy is now known as risou
IOninja m: CORE::.keys.grep(* ne 'IterationEnd').map({CORE::{$_}}).grep({!.DEFINITE and $_ ~~ Cool}).unique.say 20:16
camelia ((Slip) (PromiseStatus) (StringyEnumeration) (Distribution) (int16) Nil (Setty) (FileChangeEvent) (UInt64) (Rational) (RatStr) (uint64) (Numeric) (Instant) (byte) (Bool) (Associative) (Iterator) (uint32) (ProtocolFamily) (Rat) (Enumeration) (Blob[uint16]…
IOninja umm hehe 20:17
m: my byte $x = 42; say $x 20:19
camelia 42
IOninja TIL we have that
MasterDuke m: my byte $x = 256; say $x 20:20
camelia 0
MasterDuke m: my byte $x = 255; say $x
camelia 255
moritz m: say byte.^name 20:21
camelia byte
moritz I kinda expected that to spit back uint8 at us :-)
20:22 rindolf left, Actualeyes joined
MasterDuke m: say byte.^mro 20:22
camelia ((byte) (Int) (Cool) (Any) (Mu))
gfldex IOninja: run this in the docs root gist.github.com/a73657f6d5dd9d34a4...67b6050003 20:24
20:24 noganex joined 20:25 breinbaas joined
IOninja gfldex: seems busted. I see Positional in the results. 20:25
But I guess to make my original question more precise: I want just the types that have `is Cool` not their subclasses. 20:26
gfldex IOninja: sorry, silly me
IOninja And using grep I found them to be: Instant, List, Map, Range, Complex, Str, Rat, Nil, Match, Num, StrDistance, Seq, IO::Path, Duration
gfldex IOninja: then just grep type-graph.txt
IOninja + Int 20:27
+ FatRat
gfldex++ thanks 20:28
gfldex gist.github.com/gfldex/bd0e2e1aa5e...f056953fbc 20:29
that gist actually works
The type graph in the docs only shows direct decendents, I wonder if we should list all. 20:32
20:33 risou is now known as risou_awy
IOninja I think the htmlify.p6 does a check to see whether a routine belongs to the class it's documented in, right? 20:34
20:34 st_elmo left
IOninja Seems busted for roles. Numeric is documented to provide a .Rat method: docs.perl6.org/routine/Rat but it actually doesn't github.com/rakudo/rakudo/blob/nom/....pm#L4-L30 20:35
moritz if so, I certainly didn't put that in
20:37 ggoebel joined
IOninja " felher committed with moritz on Jul 6, 2012" 20:37
moritz huh?
IOninja Well, the docs for Numeric.Rat. Not the bustification of htmlify.p6
moritz oh
IOninja I recall when we were trying to add some method to docs it was complaining about it, and the cause was because the sub or op was defined in Str.pm but we documented it in Cool.pm or something or other 20:38
20:39 itaipu joined
IOninja I'll fix the Rat/FatRat docs tonight or tomorrow. Haven't checked if any other methods are similarly incorrectly documented. 20:39
I meant .Rat/.FatRat for all types and roles
Here's the code that complains about it: github.com/perl6/doc/blob/master/h...#L633-L646 20:42
moritz but that just tries to parse the doc block to see if it's a method or a sub 20:45
not whether it actually exists in the class or role you're documenting
the last part of the error message is a bit confusing though 20:46
IOninja I think I added it 20:47
with a useless commit message: github.com/perl6/doc/commit/e5ef1d...61360335b2
At least there's a date... 20:48
IOninja checks IRC logs
Geth doc/WildYorkies-patch-1: d399c960e2 | Cale++ | lib/Pod/Htmlify.pm6
change return-ifs to switch
20:49
20:49 Actualeyes left
Geth doc: WildYorkies++ created pull request #1214:
change return-ifs to switch
20:50
IOninja umm... gotta relocate.
I remember samcv was trying to document something and the build was failing and that was because routine was defined in Str (or Cool) but she was documenting it in Cool (or Str). Don't see off hand in the log where that event occurs irclog.perlgeek.de/perl6/2016-12-09 20:51
Might be previous day
IOninja &
[Coke] I am surprised if that was an actual build fail. huh 20:57
andrzejku the perl6 nativecall 20:58
are really hard to understand
Geth doc/WildYorkies-patch-2: 8db2bcbc1d | Cale++ | lib/Pod/Convenience.pm6
change else-if to given/when switch
doc: WildYorkies++ created pull request #1215:
change else-if to given/when switch
doc: a9a6a83d98 | (Brad Gilbert)++ | doc/Language/haskell-to-p6.pod6
map and grep for list comprehensions
21:01
21:02 rurban joined
Geth doc: 9bb3ae7355 | (Brad Gilbert)++ | doc/Language/haskell-to-p6.pod6
clean up cruft from tuples example
21:05
21:05 Actualeyes joined 21:06 Qwerasd left 21:10 llfourn joined 21:14 bjz left 21:16 llfourn left, cdg joined
IOninja cale2, it's not mandatory to use `given` with `when` 21:16
cale2 ah... good to know 21:17
IOninja m: for ^10 { when *.is-prime { "tis prime".say }; when * %% 2 { "tis even".say }; "this number sucks".say } 21:18
camelia tis even
this number sucks
tis prime
tis prime
tis even
tis prime
tis even
tis prime
tis even
this number sucks
Geth doc/WildYorkies-patch-2: 5a5a507b29 | Cale++ | lib/Pod/Convenience.pm6
get rid of given and alias
21:19
21:19 itaipu left 21:20 itaipu joined
cale2 so there's no real "switch block". There's just chains of when 21:22
AlexDaniel kinda
IOninja mhm
AlexDaniel m: default { say ‘well… ok!’ } 21:23
camelia well… ok!
cale2 `when` is basically the same as `if` except `when` automatically smartmatches and passes item to anon variable
IOninja `given` is just a handy way to alias stuff to $_
moritz `when` also short-circuits to avoid a second match
gfldex cale2: proceed and succeed require a given block
IOninja cale2, and block form `when` also shortcuircuits
moritz m: given 1 { when True { say 1 }; when True { say 2 } }
camelia Potential difficulties:
Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead
at <tmp>:1
------> 3given 1 { when 7⏏5True { say 1 }; when True { say 2 } }
Smartmat…
IOninja Do they?
Weird
moritz m: given 1 { when 1 { say 1 }; when Int { say 2 } }
camelia 1
moritz DWIM etc 21:24
AlexDaniel m: when Any { say ‘:O’ }; default { say ‘well… ok!’ }
camelia :O
AlexDaniel m: default { say ‘well… ok!’ }; when Any { say ‘:O’ }
camelia well… ok!
AlexDaniel hmm…
cale2 default is just an alias for `when True` right? 21:25
moritz m: given 1 { default { say 1 }; say 2 }
camelia 1
gfldex m: when so True { proceed } 21:26
camelia ( no output )
moritz cale2: looks like it, yes
IOninja m: proceed
camelia proceed without when clause
in block <unit> at <tmp> line 1
IOninja m: when 42 { proceed }
camelia ( no output )
AlexDaniel so default has to be the last one always?
IOninja gdflex, seems it don't?
gfldex indeed 21:27
tony-o m: given 1 { default { 'def'.say; }; when 1 { '1'.say; }; };
camelia def
cale2 m: when 42 ~~ Any { say "hi"; proceed; } say "bye";
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3when 42 ~~ Any { say "hi"; proceed; }7⏏5 say "bye";
cale2 m: when 42 ~~ Any { say "hi"; proceed; }; say "bye";
camelia hi
bye
IOninja AlexDaniel, yup and I recall there being a ticket asking that we warn when it isn't
cale2 proceed just needs when, not given
AlexDaniel #RT 129025 21:28
RT #129025
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129025
21:29 girafe left 21:30 andrzejku left, bolo58249 joined 21:31 hankache joined 21:32 robertle joined 21:33 labster joined
bolo58249 hello. I'm wondering if Perl 6 is a good first language to learn. Any opinions from experienced multi-linguists would be appreciated! Thanks. 21:35
hankache hola #perl6
cale2 hola
gfldex bolo58249: the language itself is fine as a first language, the ecosystem and resources for double beginners are not (IMHO) 21:36
AlexDaniel bolo58249: just try it and see if it works for you?
b2gills I think in the future when there are better docs, or you have a good teacher, it could be a good first language
AlexDaniel b2gills: when was the last time you looked at the docs? :P
cale2 bolo58249: learning Perl6 will expose you to the whole world of programming. Not just one paradigm 21:37
gfldex our tutorials are very lacking
bolo58249 what are "double beginners"?
21:37 gregf_ left
b2gills The docs are good if you already have a logical mind, or already know another similar language 21:37
gfldex beginners of Perl 6 and programming
cale2 library.oreilly.com/book/063692006...perl-6/toc
read this and try it out :)
bolo58249 ok thanks
hankache bolo58249 check out perl6intro.com I hope it helps. 21:38
gfldex a tripple beginner would also not know how a computer works
b2gills A good way to learn it currently is to ask questions here (using a paste bin)
gfldex and a quadruple beginner would not know how to use a computer
AlexDaniel
.oO( WHAT THE HELL IS COMPUTER ?! www.poorlydrawnlines.com/comic/naive-dramatic/ )
21:39
b2gills A computer is obviously a person who computes numbers, duh. 21:40
IOninja :) 21:41
geekosaur hey, used to be true
AlexDaniel when was the last time somebody used this word with that meaning?
geekosaur 40s? 21:42
ish
and what we call "computer" was "calculator"/"calculating machine"
(this is also why "pocket calculator", from which we've dropped the "pocket") 21:43
bolo58249 the women doing the math in that new nasa movie were called "computers" I think 21:44
21:44 ChoHag joined
geekosaur yeh, ws thinking there are likely to be areas (government being a likely one) where it held out into the 50s or even 60s 21:45
I should rephrase that from government to military probably
gfldex most companies didn't have computer well into the 70s 21:46
to pricy
bolo58249 then they brought in the IBM machine to "compute" the trip to the moon and the ladies programmed it with FORTRAN 21:47
IOninja What new NASA movie?
gfldex when I was a wee boy the accountant in my dads firm used something like this www.technikum29.de/shared/photos/r...os27-2.jpg
bolo58249 I think it was called "Hidden Figures"
gfldex made a hell of a noise
bolo58249 About some of the women who did the maths on the moon landing project. 21:48
AlexDaniel
.oO( not that people are completely silent… )
gfldex the machine made the noise, not the lady 21:49
21:49 ufobat_ left
cale2 how long does travis ci take? 21:56
a while
21:56 pyrimidine joined
b2gills travis ci is a commercial product and they use the otherwise unused time to test open source projects 21:59
22:00 hankache left 22:01 pyrimidine left, pyrimidine joined 22:02 itaipu left
gfldex cale2: there are no binary packages available for rakudo, so the bulk of the 6 min is used to build the compiler 22:04
actually we do have bin packages, we just don't use them in travis 22:05
22:06 pyrimidine left
cale2 moritz: messaged my friend about your book cover 22:08
doing an interpretation of camelia would be a hell of a challenge. 22:09
22:09 pyrimidine joined
cale2 "make a book cover for a technical programming book. but tie in this cartoon butterfly to your design" 22:09
22:10 RabidGravy left 22:12 llfourn joined, skids left
cale2 Perhaps a butterfly riding on the back of a camel towards a large CRT monitor on the horizon 22:13
22:13 pyrimidine left
timotimo a butterfly lifting a camel, perhaps 22:13
gfldex i would prefer a butterfly feeding from the flower of the tree of knowledge :-> 22:14
timotimo so a blooming apple tree?
gfldex they never said what tree it actually is in the bible
well, it says: the tree of knowledge of good and evil 22:15
cale2 well, "by example" sort of indicates a journey is about to take place, right?
gfldex not sure if apple trees have such knowledge
cale2 if you really want a memorable cover, get someone that typically draws concert posters to do it 22:16
gfldex i my experience examples are mostly stationary
22:17 llfourn left, risou_awy is now known as risou
cale2 but you write the examples together over time 22:18
gfldex if you write the examples while in a train or bus, then yes, it's a jouney 22:20
in the natural languages I use mixing "work" and "journey" don't mix well 22:21
cale2 haha 22:22
lizmat news.ycombinator.com/item?id=13715048 # no mention of Perl 6 books (yet) :-(
cale2 a lot of the No Starch Press python books have a snake doing random things: www.nostarch.com/inventwithpython www.nostarch.com/pythoncrashcourse 22:23
gfldex the problem with illustrations on programming books is that pretty much anything on the topic is either an abstract concept or a written symbols. Both are pretty hard to turn into sweet pictures.
may be the reason why o'reilly tends to put unrelated animals on their covers 22:24
cale2 I think it's just meant to grab attention, right? All the o'reilly animals are sort of their "brand". You instantly know its an oreilly book 22:25
22:25 atweiden-air joined
gfldex lizmat: that list is missing Higher-Order Perl, so they don't know what they are talking about anyways :-> 22:26
lizmat yeeah, and it's missing Beginning Perl as well, as pointed out in the comment
still...
gfldex cale2: that's certainly the result, but may not have been the intention
22:29 sena_kun left
El_Che "Practical mod_perl" <-- whut? 22:29
gfldex wow, he put the whole Higher-Order Perl book up for download as a pdf
atweiden-air with parameterized roles `role ABC[Bool:D $si, 'A', 'B']` and `role ABC[Bool:D $si, 'Y']` 22:31
is it possible to grep the array `my ABC:D @roles` for `ABC[True, *@]` so as to ignore the variable length Str components of the ABC role params?
22:31 itaipu joined
atweiden-air i know i can .grep(ABC[True, Str]|ABC[True, Str, Str]) 22:32
22:34 risou is now known as risou_awy
gfldex atweiden-air: you could use an empty class as a base type for both roles 22:34
cale2 Perl 6 by Example: The Perl of Great Price 22:35
22:35 mcmillhj left, mcmillhj joined
atweiden-air maybe it can be solved with macro 22:36
22:37 Voldenet left, cibs left
gfldex atweiden-air: it can for sure be solved without a macro. The code example you provided is a bit thin tho. 22:37
atweiden-air gfldex: ix.io/nJB 22:38
22:39 cibs joined
atweiden-air gfldex: am using Mode:D $.mode is required attribute currently 22:39
instead of having $mode in the role params 22:40
22:40 mcmillhj left, cdg left 22:42 Voldenet joined, Voldenet left, Voldenet joined
IOninja oh, didn't realize the 4.99999999999 cmp 5 thing was a ticket... 22:42
rt.perl.org/Ticket/Display.html?id...xn-1449958 22:43
My reading of it tell me the OP is expecting 4.99999999999999999999999999999999999999 ~~ 0..^5 to give True as well, but that won't be the case 22:44
gfldex atweiden-air: you get exactly what you ask for, .gist is just to stupid to handle autopunned roles properly.
lizmat IOninja: why won't that be the case>
? 22:45
IOninja m: dd 4.99999999999999999999999999999999999999
camelia <499999999999999999999999999999999999999/99999999999999997748809823456034029568>
IOninja lizmat: because of that ^
I'm not entirely clear what are we supposed to do for Rats whose parts are >64bit.
gfldex atweiden-air: or better, it's not clever enough to show a role with no attributes 22:46
22:46 khw joined
atweiden-air gfldex: .gist isn't the problem. i would just prefer if the grep could look more like `@sectional-inline.grep(SectionalInline[FINN, *@]).say;` 22:46
timotimo well, if you don't ask for a FatRat, you're in the wrong there anyway
lizmat m: 499999999999999999999999999999999999999/99999999999999997748809823456034029568 # indeed
camelia WARNINGS for <tmp>:
Useless use of "/" in expression "499999999999999999999999999999999999999/99999999999999997748809823456034029568" in sink context (line 1)
gfldex atweiden-air: you are not doing anything with the role parameters, so there is no reason to keep them around
lizmat m: say 499999999999999999999999999999999999999/99999999999999997748809823456034029568 # indeed
camelia 5
IOninja TimToady: why is it bad that FatRat is infectious? So is Num. Seems making a FatRat when we can't fit stuff into a Rat is a DWIM. 22:47
gfldex atweiden-air: there is no way to do that because roles don't exist at runtime and a slurpy is a runtime construct
atweiden-air: anything you think is a role at runtime is actually a class of the same name that remebers that it's a autopunned role 22:48
atweiden-air: and classes don't exist at runtime either
atweiden-air: and yes, that makes sense :)
IOninja TimToady mentioned returning a RatStr for such Rats; I'm a bit fuzzy on how that's meant to work. Is that like a non-infectious FatRat?
22:50 kurahaupo joined
IOninja Oh, OK, I think I get why infectious FatRats are bad. You basically have this giant thing when you probably don't care about all of that precision in most cases. 22:50
IOninja will give returning a RatStr idea a go sometime in next few days 22:52
timotimo wow, holy jesus
IOninja ?
timotimo www.tbray.org/ongoing/When/201x/20...C7159-JSON - there's details here that i had never heard of
IOninja heh 22:53
u lie. I recall pointing out the RFC in the Issue about failing to parse non-objects in top level 22:54
timotimo yeah, but i didn't realize the ecma one was rushed out because of panic and such
i knew of the rfc
IOninja Ah
timotimo i just assumed "because ecma standardises javascript, they are the authority on Json, too"
we might want to put tests into our json modules that handle what happens when an "object" has multiple entries for the same keys 22:56
oh 22:58
... normalization for keys ...
23:01 mcmillhj joined 23:03 kurahaupo left, kurahaupo joined 23:04 Ven left 23:05 cale2 left 23:06 mcmillhj left 23:09 atweiden-air left 23:12 wamba left 23:13 llfourn joined
Geth doc: 9403489786 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6
Even if the heading says "class" it's not about classes but about the

these are the Perl 6 docs, not a CS text book.
This is my first shot at explaining what the declarator actually does. I'm not overly happy with the wording, improvements are welcome.
23:14
gfldex IOninja: seams like Geth did something odd to the commit message above 23:15
timotimo "but about the"? 23:16
it didn't do something odd
you're just not supposed to have a multi-line first-line :) 23:17
23:17 bolo58249 left 23:18 llfourn left
gfldex but but but long text is long! 23:20
23:22 Geth left, Geth joined, ChanServ sets mode: +v Geth
Geth doc: 9403489786 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6
Even if the heading says "class" it's not about classes but about the

type declarator called class, hence the heading right above it. Also, these are the Perl 6 docs, not a CS text book.
This is my first shot at explaining what the declarator actually does. I'm not overly happy with the wording, improvements are welcome.
23:22
IOninja gfldex: Thanks. Fixed. 23:23
23:23 itaipu left 23:26 itcharlie left 23:29 bwisti left 23:30 rurban1 joined 23:32 rurban left 23:38 lep_ joined 23:39 lep-delete left 23:40 skids joined, itaipu joined, bwisti joined 23:45 risou_awy is now known as risou 23:46 Actualeyes left 23:48 cdg joined 23:53 cibs left 23:54 travis-ci joined
travis-ci Doc build errored. Cale 'change return-ifs to switch' 23:54
travis-ci.org/perl6/doc/builds/204737635 github.com/perl6/doc/commit/d399c960e25a
23:54 travis-ci left, cibs joined