»ö« 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:09
captain-adequate left
00:14
cpage_ joined
00:20
troys is now known as troys_
00:26
Xliff left
00:30
lookatme joined
|
|||
lookatme | morning \o. | 00:30 | |
Herby_ | o/ | 00:31 | |
00:35
skids joined
00:37
[2300mAh] left
00:40
lookatme left,
lookatme joined
00:44
lookatme left,
lookatme joined
|
|||
Juerd | ♥ given $input { when any(@stack) { note "Already selected!" } ... } | 00:44 | |
00:48
lookatme left,
lookatme joined
00:51
kurahaupo joined
00:53
Cabanossi left
00:54
astj joined
00:55
Cabanossi joined
01:00
lookatme left
01:02
astj left,
astj joined
01:03
astj left
01:04
lookatme joined
01:08
lookatme left,
baest left,
lookatme joined,
baest joined
01:09
astj joined
01:13
Zoffix joined
|
|||
Zoffix | Any idea why when I run this program it always prints "Killing" three times, but frequently it doesn't end, suggesting the murder did not succeed? gist.github.com/zoffixznet/79543ee...p6-L37-L41 | 01:14 | |
As you can see, I even tried sending three different kill signals, to no avail | |||
And indeed `ps ax` shows the procs unkilled, still running | 01:16 | ||
01:17
cyphase left
|
|||
kurahaupo | Zoffix: do you own the processes in question? | 01:18 | |
Zoffix | kurahaupo: they're started by that very script | ||
lookatme | Use SIGKILL ? | ||
kurahaupo | check for error returns? | ||
lookatme | check $! ? | 01:19 | |
Zoffix | Error returns from where? | ||
lookatme: at which point? | |||
And yeah, I'm already sending SIGKILL | |||
MasterDuke | if you add signal handlers to the code you're running in the Proc, do they fire? | ||
kurahaupo | error returns from the kills | 01:20 | |
Zoffix | kurahaupo: it just returns the signal number | ||
MasterDuke | run under strace and see what that shows happening? | ||
01:21
cyphase joined
|
|||
Zoffix | adding `signal(SIGINT).tap: {say "got a signal"};` to the spawned procs and then sending $proc.kill: SIGINT don't print that message :/ | 01:23 | |
I don't know how to use strace. | |||
kurahaupo | strace -o newtracefile program args ... | 01:24 | |
MasterDuke | you'll want -f also | ||
Juerd | github.com/Juerd/shalog/blob/master/tracking.p6 # Beginning of something usable | ||
kurahaupo | but for this you'll want -f or -ff | ||
MasterDuke: snap | |||
01:25
astj_ joined
|
|||
Zoffix | Hm. The code's `say "Killing!"; say $proc.kill: SIGSEGV;` and it always prints 3 killing but only 1-3 "11"s | 01:25 | |
Juerd | At some point I want to spread my code over several files. Are there any best practices regarding putting multiple classes in a single file? | 01:26 | |
Zoffix | Juerd: no | ||
Juerd | Great, at least I can stop looking for them then :) | ||
kurahaupo | Zoffix: if you just want something to stop normally, SIGTERM should be your first choice. SIGHUP is typically caught by daemons and used to trigger reloading | 01:27 | |
not that you've made the relevant arrangements, but that's the convention | |||
01:27
astj left
|
|||
MasterDuke | you could add an `fprintf(stderr, "Kilroy was here")` to src/io/procops.c:1073 and see if the moarvm op is getting called 3 times | 01:28 | |
kurahaupo | for interactive processes SIGHUP indicates that its terminal has disconnected -- the "hup" or "hangup" refers to a phone line with a dial-up modem | 01:30 | |
Zoffix | Here's the strace. What am I looking for gist.githubusercontent.com/zoffixz...tfile1.txt ? | 01:31 | |
here's the program that I used to generate it: gist.github.com/zoffixznet/c737b79...75d9b5339f | |||
01:37
BenGoldberg joined
|
|||
Zoffix | Golfed down a bit: await ^2 .map: {start { with Proc::Async.new: $*EXECUTABLE, "-e", "sleep" -> $p { Promise.in(2).then: {say "Killing"; $p.kill: SIGTERM}; await $p.start } }} | 01:38 | |
What's weird is it doesn't appear to happen if that `^2` is a `^1` | |||
Zoffix files in hopes jnthn++ would know a fix | 01:39 | ||
01:40
lookatme left
|
|||
Zoffix | .ask jnthn any idea what may be causing a Proc::Async.kill to fail killing when there's more than one Proc::Async involved? This is sort of blocking my ecosystem toaster script :( would be sweet if it could be fixed: rt.perl.org/Ticket/Display.html?id=131479 | 01:43 | |
yoleaux | Zoffix: I'll pass your message to jnthn. | ||
Zoffix | Man, need to learn C so I could fix stuff like this on my own :* | ||
pilne | c is dark and full of terrors... but at least is isn't c++ (: | 01:45 | |
01:46
ilbot3 left
|
|||
pilne | one bad thing about perl6 is that after dipping my toes in it... trying to learn anything else for a change of career (i don't do anything programming related at the moment), feels pooptastic | 01:46 | |
MasterDuke | i added a print to that moar function. i see two "Killing"s, but only one print from moar | ||
01:48
ilbot3 joined,
ChanServ sets mode: +v ilbot3
01:50
cpage_ left
01:52
lookatme joined
01:53
Cabanossi left
01:55
Cabanossi joined,
kurahaupo_ joined
01:56
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:57
kurahaupo left
02:00
cpage_ joined
|
|||
Zoffix | pilne: yeah, that's why we say Perl 6 is the last language you'll ever learn :) | 02:00 | |
Zoffix goes into hybernation mode | |||
I see I first suspected .kill was busted last September: github.com/perl6/roast/issues/158 | 02:01 | ||
lookatme | I send SIGTERM can killed one of **Promise** which tag with "bar" | 02:02 | |
Zoffix & | 02:03 | ||
lookatme | @_@ | ||
02:04
kurahaupo_ left
|
|||
pilne | i just have to keep hoping i'll be in the right place at the right time to jump on something looking to try "anything" as a coding backend >.< but there is a lot of buzzword hype and shenanigans locally. | 02:05 | |
but just barely getting to know perl6, it feels fantastic for "big data" and even machine learning/AI stuff. | 02:06 | ||
02:11
jcallen_ is now known as jcallen
02:13
Herby_ left
|
|||
curt_ | performance isn't quite there yet, but NativeCall is my best friend. I love how trivial it is to drop into C. | 02:16 | |
Juerd | "The following packages were stubbed but not defined:", but if I remove the "..." it says about the definition later in the file: "Redeclaration of symbol 'Nowhere'" | 02:18 | |
Any ideas? | |||
(Nowhere is the name of the class) | |||
lookatme | Is machine learning/AI need performance ? | ||
Juerd, can you paste code to somewhere | 02:19 | ||
Juerd | lookatme: gist.github.com/Juerd/27947ac0e756...abf69011fd | 02:20 | |
02:20
zhongjin616 joined
|
|||
Juerd | It worked when I didn't have it in a .pm file | 02:20 | |
curt_ | I'm not doing machine learning/AI, my 'big data' is just volume. | ||
lookatme | Juerd, I comment on the gist | 02:27 | |
pilne | for research purposes, technically, machine learning and AI don't need speed, they need "flexibility", but speed is always nice in that area (: | 02:28 | |
02:29
raschipi joined
|
|||
TEttinger | pilne: there's also bearlibterminal if you don't need some of the stuff libtcod provides. it's probably much easier to call from a not-C language | 02:29 | |
lookatme | The document about that forward declared not very clear | ||
TEttinger | (libtcod defines their own kinds of list and such) | 02:30 | |
foo.wyrd.name/en:bearlibterminal | |||
pilne | ahhhh, TEttinger, i was mainly interested in libtcod for it's terminal stuffs, tyvm | ||
TEttinger | BLT's terminal is definitely better in a lot of ways | ||
pilne | and it reminds me of a good meal | ||
so it's like... doubleplusgood | 02:31 | ||
TEttinger | it allows movement of each char outside its position, plus layers | ||
and works with TTF fonts | |||
pilne | project tcodperl: killed before germination | ||
TEttinger | BLT only does terminal output, since most games want their own map gen anyway | 02:32 | |
pilne | this will allow me to just write all the "roguelike" stuff (ai, etc.) in perl6, and use that for terminal. | ||
TEttinger | yep | ||
roguebasin has good resources | |||
pilne | tyvm, no need to lug around the horse trailer full of horses i ain't using | ||
yeah, it's where i get most of my stuff, not sure how i missed that | |||
TEttinger | I don't know if BLT has much presence there. libtcod had a monopoly on full-color terminal-likes for many years | 02:33 | |
but it stopped mac support and various other oddities before finally picking up some pieces | |||
www.roguebasin.com/index.php?title=Dijkstra | |||
pilne | yeah, and it was kinda "more" than i wanted from a library, even when using it in a tutorial for python a longtime ago. | ||
TEttinger | (useful but easy to miss AI technique) | 02:34 | |
pilne | i actually read a comparison of fill, dijkstra, and a* recently | ||
02:34
xiaoyafeng joined
|
|||
TEttinger | I work on a very "more" library for roguelikes but it's in Java | 02:34 | |
02:34
aborazmeh left
|
|||
TEttinger | yeah, it's crazy the differences | 02:34 | |
xiaoyafeng | hello, I have a question. | 02:35 | |
pilne | i just have a hard time feeling comfy as a one-man-dev in javaland, everything just feels so "big" | ||
TEttinger | currently in my benchmarks, I have A* beating everything hand-down for short simple paths, but surprisingly a breadth-first search with no heuristic can beat A* on long and moderately convoluted paths | 02:36 | |
xiaoyafeng | what's different between ".".io.dir.grep: {d} and ".".io.dir.grep({d}); | ||
please help | |||
pilne | TEttinger: a* "thinks too much" on the long and convoluted paths i've noticed. | ||
TEttinger | hi xiaoyafeng. there's some experts around recently, but I am not one of them | 02:37 | |
pilne | likewise, my perl-fu is weak like cooked spaghetti | ||
xiaoyafeng | :(.... | ||
02:37
Cabanossi left
|
|||
TEttinger | (I'm rather sure Zoffix is an expert, since I've seen a lot of commits tied to the name) | 02:38 | |
pilne | m: ".".io.dir.grep: {d} | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: d used at line 1 |
||
lookatme | xiaoyafeng, no different. | 02:39 | |
curt_ | xiaoyafeng: subroutine(...) and subroutine: ... are just two ways of calling the sub | ||
pilne | it might just be alternate syntax, have you examined them? | ||
TEttinger | also you might not have access to current dir in the bot | ||
xiaoyafeng | ".".io.dir.grep: {.d} | ||
sorry | |||
raschipi | m: ".".io.dir.grep: {.d} | ||
camelia | No such method 'io' for invocant of type 'Str' in block <unit> at <tmp> line 1 |
||
lookatme | m: say ".".IO.dir.grep:{.d}; | ||
camelia | (".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".cpan".IO "rakudo-m-1".IO "rakudo-m-2".IO "rakudo-j-inst-1".IO "rakudo-j-1".IO "rakudo-j… | ||
xiaoyafeng | IO | ||
lookatme | m: say ".".IO.dir.grep({.d}); | 02:40 | |
camelia | (".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".cpan".IO "rakudo-m-1".IO "rakudo-m-2".IO "rakudo-j-inst-1".IO "rakudo-j-1".IO "rakudo-j… | ||
raschipi | It's just two ways of saying the same thing. | ||
02:40
Cabanossi joined
|
|||
TEttinger | oh, one was {.d} and one was {d} | 02:40 | |
pilne | god i love this bot | ||
TEttinger | it's a pretty great bot | ||
lookatme | It just two ways of function/sub call, you can chose your prefer style | ||
xiaoyafeng | so : and () is identical | ||
raschipi | What is different yould be ".".IO.dir.grep ({.d}); The space makes a difference. | 02:41 | |
m: ".".IO.dir.grep ({.d}); | 02:42 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3".".IO.dir.grep7⏏5 ({.d}); expecting any of: infix infix stopper statement end statement modifier st… |
||
lookatme | m: say ".".IO.dir.grep : {.d}; | ||
camelia | Cannot resolve caller grep(Seq: ); none of these signatures match: ($: Bool:D $t, *%_) ($: Mu $t, *%_) in block <unit> at <tmp> line 1 |
||
raschipi | m: say ".".IO.dir.grep\ ({.d}); | ||
camelia | (".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".cpan".IO "rakudo-m-1".IO "rakudo-m-2".IO "rakudo-j-inst-1".IO "rakudo-j-1".IO "rakudo-j… | ||
xiaoyafeng | well it's not allowed space. between sub and args | 02:43 | |
raschipi | m: say ".".IO.dir.grep\  ({.d}); | ||
camelia | (".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".cpan".IO "rakudo-m-1".IO "rakudo-m-2".IO "rakudo-j-inst-1".IO "rakudo-j-1".IO "rakudo-j… | ||
raschipi | You can even split into multiple lines, as long as you put a \ there. Otherwise it means something else. | 02:44 | |
xiaoyafeng | but why ".".IO.dir.grep: ({.d}) is allowed too? | ||
02:44
curt_ left
|
|||
raschipi | That is an alternative format. | 02:45 | |
xiaoyafeng | ok, now it's 3 ways to call a sub | ||
raschipi | Gotta have at least three ways of doing something in Perl6. | ||
xiaoyafeng | TIMTTWTDI | 02:47 | |
;) | |||
lookatme | m: say ".".IO.dir.grep {.d}; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unexpected block in infix position (missing statement control word before the expression?) at <tmp>:1 ------> 3say ".".IO.dir.grep7⏏5 {.d}; expecting any of: infix infix… |
02:48 | |
lookatme | m: say grep {.d}, ".".IO.dir; | ||
camelia | (".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".cpan".IO "rakudo-m-1".IO "rakudo-m-2".IO "rakudo-j-inst-1".IO "rakudo-j-1".IO "rakudo-j… | ||
02:49
noganex joined
|
|||
lookatme | m: say ({.d}).WHAT | 02:51 | |
camelia | (Block) | ||
lookatme | xiaoyafeng, ({.d}) also a callable Block | ||
02:51
noganex_ left
|
|||
lookatme | like {.d} does | 02:52 | |
xiaoyafeng | yeah, it makes sense | ||
02:56
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
raschipi | m: lc('Y','N'); lc 'Y','N' | 03:02 | |
camelia | 5===SORRY!5=== Calling lc(Str, Str) will never work with declared signature (Cool $s) at <tmp>:1 ------> 3<BOL>7⏏5lc('Y','N'); lc 'Y','N' Calling lc(Str, Str) will never work with declared signature (Cool $s) at <tmp>:1 ------> 3lc… |
||
raschipi | m: lc ('Y','N'); lc 'Y','N' | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Calling lc(Str, Str) will never work with declared signature (Cool $s) at <tmp>:1 ------> 3lc ('Y','N'); 7⏏5lc 'Y','N' |
||
lookatme | m: say lc('Y', 'N'); | 03:03 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Calling lc(Str, Str) will never work with declared signature (Cool $s) at <tmp>:1 ------> 3say 7⏏5lc('Y', 'N'); |
||
lookatme | m: say lc('Y'); | ||
camelia | y | ||
raschipi | bisectable6: say lc ('Y','N'); | 03:04 | |
bisectable6 | raschipi, On both starting points (old=2015.12 new=b667e81) the exit code is 0 and the output is identical as well | ||
raschipi, Output on both points: «y n» | |||
lookatme | m: say lc ('Y', 'N'); | ||
camelia | y n | ||
lookatme | m: say &lc.WHAT; | ||
camelia | (Sub) | ||
lookatme | m: say &lc('Y', 'N'); | 03:05 | |
camelia | Too many positionals passed; expected 1 argument but got 2 in block <unit> at <tmp> line 1 |
||
raschipi | I see, in the second, it was the version without parens that it didn't like. | ||
03:06
Cabanossi left
|
|||
lookatme | m: say &lc.signature.perl; | 03:06 | |
camelia | :(Cool $s) | ||
lookatme | m: say &lc(('Y', 'N')); | 03:07 | |
camelia | y n | ||
lookatme | m: say ('Y', 'N') ~~ Cool; | 03:08 | |
camelia | True | ||
lookatme | Oh.. @_@ | ||
03:08
Cabanossi joined
03:11
simonm left
|
|||
raschipi | m: say lc( ('Y','N') ); | 03:12 | |
camelia | y n | ||
lookatme | m: say &lc(('Y', 'N')).WHAT; | 03:13 | |
camelia | (Str) | ||
03:14
khw left
03:28
aborazmeh left
03:41
simonm joined
03:49
Xliff joined
|
|||
Xliff | \o | 03:49 | |
Is there a way to make a class that is only available to a specific scope? | |||
m: class A { my class B { method bb { say "bb"; } }; method new( B.bb; }; }; A.new; | 03:51 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed parameter at <tmp>:1 ------> 3method bb { say "bb"; } }; method new( B7⏏5.bb; }; }; A.new; expecting any of: constraint formal parameter |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new( B.new.bb; }; }; A.new; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed parameter at <tmp>:1 ------> 3method bb { say "bb"; } }; method new( B7⏏5.new.bb; }; }; A.new; expecting any of: constraint formal parameter |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; | ||
camelia | bb | ||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; A::B.new.bb; | ||
camelia | bb Could not find symbol '&B' in block <unit> at <tmp> line 1 Actually thrown at: in block <unit> at <tmp> line 1 |
||
Xliff | Hmm... that should work. | ||
03:52
Cabanossi left
03:53
Cabanossi joined
|
|||
raschipi | m: class A { our class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; A::B.new.bb; | 03:54 | |
camelia | bb bb |
||
raschipi | Xliff: ^^ | 03:55 | |
m: class A { our class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; B.new.bb; | 04:02 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared name: B used at line 1 |
||
raschipi | m: class A { our class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; my B.new.bb; | 04:03 | |
camelia | 5===SORRY!5=== Type 'B' is not declared at <tmp>:1 ------> 3} }; method new{ B.bb; }; }; A.new; my B7⏏5.new.bb; Malformed my at <tmp>:1 ------> 3; } }; method new{ B.bb; }; }; A.new; my7⏏5 B.new.bb; » | ||
Xliff | raschipi: Why "our" instead of "my"? | 04:07 | |
raschipi | They say where the symbol will be visible. 'my' means it's visible only inside the block, 'our' means it will be visible outside. | 04:08 | |
Xliff | But if I only want B visible to methods in A, isn't that the same? | 04:09 | |
raschipi | If you want B visible only inside, use my. If you want it visible outside, use our. | 04:10 | |
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new{ B.bb; }; method aa { say "aa" B.bb; }; A.new; A::B.new.bb; | 04:11 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3ethod new{ B.bb; }; method aa { say "aa"7⏏5 B.bb; }; A.new; A::B.new.bb; expecting any of: infix infix stopper postfix… |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new{ B.bb; }; method aa { say "aa"; B.bb; }; A.new; A::B.new.bb; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3{ say "aa"; B.bb; }; A.new; A::B.new.bb;7⏏5<EOL> |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new { B.bb; }; method aa { say "aa"; B.bb; }; }; A.new; A::B.new.bb; | ||
camelia | bb Could not find symbol '&B' in block <unit> at <tmp> line 1 Actually thrown at: in block <unit> at <tmp> line 1 |
||
raschipi | m: class A { my class B { method bb { say "bb"; } }; method new { B.bb; }; method aa { say "aa"; B.bb; }; }; A.new; A.new.aa; | 04:12 | |
camelia | bb bb No such method 'aa' for invocant of type 'Bool' in block <unit> at <tmp> line 1 |
||
raschipi | m: class A { my class B { method bb { say "bb"; } }; method new { B.bb; }; method aa { say "aa"; B.bb; }; }; A.new; A.aa; | ||
camelia | bb aa bb |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new { B.bb; }; method aa { say "aa"; B.bb; }; }; A.new.aa; | ||
camelia | bb No such method 'aa' for invocant of type 'Bool' in block <unit> at <tmp> line 1 |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new { B.bb; }; }; method aa { say "aa"; B.bb; }; A.new.aa; | ||
camelia | 5===SORRY!5=== Undeclared name: B used at line 1 Other potential difficulties: Useless declaration of a has-scoped method in mainline (did you mean 'my method aa'?) at <tmp>:1 ------> 3b"; } }; method new { B.bb; }; };… |
||
Xliff | m: class A { my class B { method bb { say "bb"; } }; method new { B.bb; }; }; method aa { say "aa"; B.bb; }; }; A.new.aa; | 04:13 | |
camelia | 5===SORRY!5=== Unexpected closing bracket at <tmp>:1 ------> 3b; }; }; method aa { say "aa"; B.bb; }; 7⏏5}; A.new.aa; Other potential difficulties: Useless declaration of a has-scoped method in mainline (did you mean 'my method aa… |
||
Xliff | OK, this needs an editor. | ||
04:14
geekosaur left
04:15
geekosaur joined
|
|||
Xliff | m: class A { | 04:16 | |
my class B { | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3class A {7⏏5<EOL> |
||
Xliff | method new { B.bb; }; | ||
method bb { say "bb"; }; | |||
}; | |||
method aa { say "aa"; B.bb; }; | |||
}; | |||
A.new.aa; | |||
Feck. | |||
class A { my class B { method new { B.bb; }; method bb { say "bb"; }; }; method aa { say "aa"; B.bb; }; }; A.new.aa; | 04:17 | ||
raschipi | Use a pastie | ||
Xliff | m: class A { my class B { method new { B.bb; }; method bb { say "bb"; }; }; method aa { say "aa"; B.bb; }; }; A.new.aa; | ||
camelia | aa bb |
||
Xliff | That would have been my next step if that hadn't worked. | ||
m: class A { my class B { method new { B.bb; }; method bb { say "bb"; }; }; method aa { say "aa"; B.bb; }; }; A.new.aa; A.B.new; | |||
camelia | aa bb No such method 'B' for invocant of type 'A' in block <unit> at <tmp> line 1 |
||
Xliff | m: class A { my class B { method new { B.bb; }; method bb { say "bb"; }; }; method aa { say "aa"; B.bb; }; }; A.new.aa; A::B.new; | ||
camelia | aa bb Could not find symbol '&B' in block <unit> at <tmp> line 1 Actually thrown at: in block <unit> at <tmp> line 1 |
||
raschipi | do a /msg camelia | 04:18 | |
Xliff | OK, so I don't really see a noticible difference between using "my" and "our" | ||
04:19
xtreak_ joined
|
|||
raschipi | m: class A { our class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; A::B.new.bb; | 04:19 | |
camelia | bb bb |
||
raschipi | m: class A { my class B { method bb { say "bb"; } }; method new{ B.bb; }; }; A.new; A::B.new.bb; | ||
camelia | bb Could not find symbol '&B' in block <unit> at <tmp> line 1 Actually thrown at: in block <unit> at <tmp> line 1 |
||
raschipi | The second one doesn't work because B doesn't exist outside of A | 04:20 | |
Xliff | Heh. | ||
Which is exactly what I want. | |||
I don't want B to work outside of A | |||
raschipi | So use it. What's the problem? | ||
Xliff | No problem. I just wanted to know if I was doing it the right way. | 04:21 | |
You suggested "our" and I was confused if I had missed something. | |||
No worries. | |||
Thanks for the input, though. | 04:22 | ||
raschipi | I see. Yeah, using 'my' is the way to go. If you want something else, there are other options. | 04:23 | |
04:23
Actualeyes left
|
|||
Xliff | 'k | 04:26 | |
04:28
pilne left
04:36
Cabanossi left
04:39
Cabanossi joined
04:40
xtreak_ left,
xtreak joined
04:41
fatguy joined
04:43
raschipi left
04:45
aborazmeh joined,
aborazmeh left,
aborazmeh joined
04:47
aindilis joined
|
|||
Xliff | m: class A { my class B { method new { B.bb; }; method bb { say "bb"; A.aa;}; }; method aa { say "aa"; B.bb; }; }; | 04:56 | |
camelia | ( no output ) | ||
04:56
xtreak left
|
|||
Xliff | m: class A { my class B { method new { B.bb; }; method bb { say "bb"; A.aa;}; }; method aa { say "aa"; B.bb; }; }; A.new.aa | 04:56 | |
camelia | (timeout)aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa bb aa … |
||
Xliff | m: class A { my class B { method new { B.bb; }; method bb { say "bb"; A.aa}; }; method aa { B.bb }; }; A.new.aa | 04:57 | |
camelia | (timeout)bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb … |
||
Xliff | m: class A { my class B { method bb { say "bb"; A.aa }; }; method a { say B.bb }; method aa { say "aa" }; }; A.new.a | 04:59 | |
camelia | bb aa True |
||
Xliff | m: class A { my class B { method bb { say "bb"; A.aa }; }; method a { B.bb }; method aa { say "aa" }; }; A.new.a | ||
camelia | bb aa |
||
Xliff | Rawk. | 05:00 | |
05:00
finanalyst joined
05:04
astj_ left
05:07
astj joined,
Cabanossi left
05:08
Cabanossi joined
05:10
pegop left
|
|||
finanalyst | can someone tell me what had happened to perl6-debug? I have just rerun 'rakudobrew build moar', then 'perl6-debug' and got 'perl6-debug: command not found' | 05:10 | |
05:11
astj left
05:14
troys_ is now known as troys
05:19
BenGoldberg left
05:25
aborazmeh left
05:30
ufobat joined
05:33
domidumont joined
05:36
domidumont left
|
|||
zengargoyle | finanalyst: i think it's broken or going away or being changed or something. you probably have a `perl6-debug-m` for the moar build but that gives some other error. | 05:52 | |
finanalyst | zengargoyle: if it's going away, it would be nice to know. | 05:53 | |
05:53
MasterDuke left
|
|||
zengargoyle | quotable6: perl6-debug | 05:53 | |
quotable6 | zengargoyle, gist.github.com/3ef7cdc97a78f145bf...78c134949d | ||
finanalyst | If being changed, when will it be back? | ||
05:53
ufobat left
|
|||
finanalyst | perl6-debug-m does not work at all - gives an error for all input | 05:54 | |
zengargoyle | gues that doesn't do what i thought. :) too many bots to keep track of. i remember seeing a bit of discussion about perl6-debug in the past few days here in IRC. | ||
05:55
Mithaldu left,
Mithaldu joined
|
|||
finanalyst | how to find discussion? | 05:55 | |
zengargoyle | if you search the IRC logs you'll probably find the answer. it was just a few days or so ago. | ||
irclog.perlgeek.de/perl6/2017-06-02 | 05:57 | ||
zengargoyle thinks theres a bot that can search the logs but i don't know which one or how it works. :/ | |||
05:58
cpage_ left
|
|||
zengargoyle | irclog.perlgeek.de/perl6/search/?n...erl6-debug | 05:58 | |
05:59
zhongjin616 left
|
|||
Xliff | Does FALLBACK take positional args? | 06:00 | |
Oh, nevermind. | 06:02 | ||
It can. | |||
zengargoyle | finanalyst: i think perl6-debug vs perl6-debug-m is a little implementation detail of rakudobrew vs rakudo-star or whatever. not sure if the brokeness is terminal or just a bit of "it hasn't caught up yet". :) but you're not alone, it doesn't work. | 06:03 | |
06:04
troys left
|
|||
finanalyst | zengargoyle: just looking through the last few logs | 06:04 | |
basically debug & Grammar:: Debug stopped working at the last update | 06:05 | ||
06:05
domidumont joined
06:06
astj joined
|
|||
zengargoyle | finanalyst: cool. BTW i'm probably going to steal your Task::Popular as a template to make my own little set of favorite modules because i'm too lazy to track down the old Task::Star. :P | 06:08 | |
finanalyst | zengargoyle: :) | ||
06:09
stmuk_ joined
|
|||
finanalyst | zengargoyle: By the way, I created a local directory on my computer, put a META6.json file in it with some modules I like to have, and then used zef on the directory URL | 06:09 | |
It nicely installed all the modules | 06:10 | ||
list the required modules in the depends list | |||
zengargoyle | but i wonder if having an actual Task::Popular module that has nothing but a bare actual module with a version so it can somehow be tested against is more cromulent than just a Null install with dependencies.... | ||
like the p5 'perl -MTask::Whatever\ 99999' quick check of is it installed or not??? | 06:11 | ||
06:12
stmuk left
|
|||
finanalyst | zengargoyle: not sure what you mean about "testing against" a distribution | 06:13 | |
zengargoyle | package manager satisfying dependencies is a bit different than being able to 'use Task::Whatever' and then check Task::Whatever's version inside the code. | 06:14 | |
it's sortof a meta thing that's probably not too important anyways... :) | 06:15 | ||
06:16
nadim_ joined
|
|||
lookatme | perl6 -MTask::Whatever ? | 06:16 | |
zengargoyle | `perl -MGetopt::Long\ 9999 -e1` -> Getopt::Long version 9999 required--this is only version 2.48 at /usr/share/perl/5.24/Getopt/Long.pm line 1530. | 06:18 | |
if Task::Popular (or Task::Whatever) doesn't actuall install a module named Task::Popular with a version, then as far as perl6 is concerned it doesn't exist. | 06:19 | ||
only the package manager can tell by checking wheter all dependencies are installes. | 06:20 | ||
if there's an actual Task::Poplular module that does nothing but is installed then the check is quick and easy. require Task::Popular. or query the version installed. | 06:21 | ||
06:22
wamba joined
|
|||
zengargoyle | lookatme: doing the -MSome::Module\ 9999999 is just a really quick and easy way to see if a module is installed and which version is actually installed. you ask perl to load a reallly high version and it fails and tells you which version it actually has or that there's no such module installed. | 06:25 | |
lookatme | zengargoyle, I see. I dont' know much about module version control. | 06:27 | |
zengargoyle | IMHO, it's best practice for every module/package/bundle/whatever to have an actual module that gets installed (even if it doesn't do anything) just so you can tell that it's there and what version it is. | ||
but i may be alone in this thinking :) | 06:29 | ||
lookatme | Is there a way use specify version module in command `perl6 -M..` or in Perl 6 script.. | ||
zengargoyle | i'm not really sure about p6. but that's pretty much exactly what's going on in p5. in a script 'use Foo 4;' is the command line 'perl "-MFoo 4" (because spaces). | 06:32 | |
06:33
darutoko joined
06:35
kyan left
06:36
lowbro joined
|
|||
zengargoyle | but the point is can you tell that Task::Whatever is installed or not? if Task::Whatever actually installs a Task::Whatever module then you can tell. if Task::Whatever is just a list of dependencies and doesn't install an actual Task::Whatever module, then you can't check that it has been installed except by checking all of the dependencies. | 06:36 | |
06:36
lowbro left,
lowbro joined
|
|||
zengargoyle | one way is easy, one is a PITA. :P | 06:38 | |
lookatme | zengargoyle, There are something about module version in document. Such as `module mymodule:ver<0.0.1> { }`, but I dont' think it's exactly way manager module version. | 06:39 | |
I gotta do a test about that. | 06:41 | ||
docs.perl6.org/language/modules#Ex..._Importing | |||
zengargoyle | i don't think i've seen many command line (or scripts) that actually use the version information.... github.com/dnmfarrell/Perl6-One-Liners this page has a few uses of -M but not that many. | 06:42 | |
lookatme | Use that module would be like that `perl6 -MSOme::Module::ver<0.0.1>` | 06:43 | |
I think they add the `-M` option recently | 06:44 | ||
The command **perl6** not have that option before | |||
zengargoyle | i don't think i've ever used a version in a -M other than checking whether module was installed or not.... | 06:46 | |
one-liner's are usually using what you know work. :) | 06:47 | ||
fatguy | anyone using IO-Notification-Recursive ? i need to catch file/dir event (create/modify/delete), how can i do that ? | 06:50 | |
06:50
parv joined
|
|||
zengargoyle | `perl6 '-MTask::Popular' -e ''` --> No output | 06:58 | |
`perl6 '-MTask::Popular' -e ''` --> ===SORRY!=== Could not find Task::Popular at line 1 in: ...... | 06:59 | ||
gah, `perl6 '-MPSGI' -e ''` --> No output. | 07:00 | ||
07:02
cpage_ joined
07:04
astj left
|
|||
parv | zengargoyle, what is the difference in commands with Task::Popular so that you get the output only on the second time? | 07:08 | |
lookatme | Zef can install specify version module like this `zef install Foo:ver<1.0.0>` | 07:09 | |
And I found it's work when I use `use Foo:ver<1.0.0>` in script file, but not in `-M` option. | 07:12 | ||
zengargoyle | lookatme: the first time was a cut-n-paste error.... -MPSGI shows nothing -MTask::Popular returns error (even though Task::Popular is installed) because Task::Popular doen't actually install a modules named Task::Popular, it just has a list of dependencies that must be met (which `zef install Task::Popular` will happily do. | 07:13 | |
Voldenet | fatguy: start with IO::Notification class, it has .watch-path command and a good example on consuming the supply :) | ||
zengargoyle | lookatme: me too. i haven't been able to make -MFoo:ver<x.y>' work after trying many variants.... | 07:14 | |
Voldenet | watch-recursive pretty much does the same, except it sets up watches for the tree and merges the supplies | 07:15 | |
fatguy | Voldenet: where can i find the example and types of event doc ? | 07:17 | |
zengargoyle | parv: oops, that cut-n-paste error reply was to your question... | 07:18 | |
Voldenet | hm, docs.perl6.org/type/IO::Notification | 07:19 | |
parv | zengargoyle, don't worry; i read that. | ||
zengargoyle | :) | ||
fatguy | Voldenet: i don't understand what is FileRenamed event classification | ||
i did look at p6doc | 07:20 | ||
07:20
wamba left
|
|||
Voldenet | Hmm, It's not very well-documented | 07:20 | |
github.com/rakudo/rakudo/blob/c194...ication.pm | |||
but at least the underlying enums and classes are short ;) | |||
07:21
nadim_ left
|
|||
Voldenet | apparently "event" is FileRenamed or FileChanged, no idea why inotify events like IN_CREATE are not described | 07:22 | |
07:26
skids left
|
|||
fatguy | Voldenet: thanks ! i will use p5 inotify2 for my case | 07:27 | |
07:33
lookatme left,
Sgeo_ joined,
lookatme joined
07:35
Sgeo left
07:36
Cabanossi left
07:38
rindolf joined,
Cabanossi joined
07:47
dct joined
07:48
astj joined
07:49
astj_ joined,
astj left
07:50
astj_ left,
finanalyst left,
astj joined
07:51
geekosaur left
07:52
xtreak joined,
geekosaur joined
|
|||
fatguy | how can i print current line number and namespaces ? | 07:52 | |
07:53
astj_ joined
07:56
astj left,
xtreak left
|
|||
lookatme | Do you mean $?LINE and $?PACKAGE | 07:57 | |
07:57
salv0 joined
|
|||
lookatme | fatguy, it's package, there no namespace. | 07:58 | |
08:02
Sgeo__ joined
|
|||
fatguy | lookatme: yes, how about printing the method ? the $?PACKAGE print the class name, i need to print module name then class , then method for debugging msg purpose | 08:03 | |
08:03
xtreak joined
08:04
Sgeo_ left,
dwarring left
08:05
zapwai left
|
|||
lookatme | fatguy, there are many compile-time variable about that: docs.perl6.org/language/variables#..._variables | 08:07 | |
The method is &?BLOCK | 08:08 | ||
m: class A { method f-print-name( ){ say &?BLOCK; } }; A.new.f-print-name; | |||
camelia | f-print-name | ||
fatguy | lookatme: thanks! | 08:14 | |
08:14
wamba joined
|
|||
lookatme | :) | 08:15 | |
08:15
xtreak left,
AlexDaniel joined
08:16
xtreak joined
08:18
nadim_ joined
|
|||
AlexDaniel | quotable6: ‘perl6-debug’ | 08:24 | |
quotable6 | AlexDaniel, gist.github.com/f23c1cb3afddef7ac0...d8142244ce | 08:25 | |
08:29
xiaoyafeng left
08:32
zakharyas joined
08:35
Cabanossi left
08:38
Cabanossi joined
08:40
Ven joined,
Ven is now known as Guest35264
08:44
zakharyas left
08:45
zakharyas joined
08:47
parv left
08:55
AlexDaniel left
09:01
xtreak_ joined
09:02
xtreak left
|
|||
rightfold | m: (my $foo) = (); | 09:04 | |
camelia | ( no output ) | ||
09:04
Guest35264 left,
sivoais left
09:05
vimal2012 joined,
sivoais joined
09:06
xtreak_ left
09:07
xtreak joined
09:09
xtreak left
09:10
xtreak joined
|
|||
vimal2012 | <:Lt> does not match anything, but <:Lu> matches 'T', 'V', 'M'. Aren't the letters 'T', 'V', 'M' titlecase letters in the following string? | 09:10 | |
p6: "Trump Visits Mexico" ~~ m:g/<:Lt>/ | |||
camelia | ( no output ) | ||
vimal2012 | p6: "Trump Visits Mexico" ~~ m:g/<:Lu>/ | ||
camelia | ( no output ) | ||
vimal2012 | p6: say "Trump Visits Mexico" ~~ m:g/<:Lu>/ | ||
camelia | (「T」 「V」 「M」) | ||
09:10
Ven joined
|
|||
vimal2012 | p6: say "Trump Visits Mexico" ~~ m:g/<:Lt>/ | 09:11 | |
camelia | () | ||
09:11
Ven is now known as Guest39608
|
|||
vimal2012 | None of the 26 Uppercase letters in English match <:Lt>. It looks like English doesn't have titlecase letters? Then what other languages have titlecase letters? | 09:15 | |
moritz | vimal2012: there's a greek title case latter, iirc | 09:16 | |
lookatme | m: say "Trump Visits Mexico" ~~ m:g/<:Lt>/; | 09:18 | |
camelia | () | ||
moritz | m: say (1..0x10FFFF).grep({ .chr ~~ /<:Lt>}).map(&uniname) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse regex; couldn't find final '/' at <tmp>:1 ------> 3say (1..0x10FFFF).grep({ .chr ~~ /<:Lt>7⏏5}).map(&uniname) expecting any of: infix stopper term |
||
moritz | m: say (1..0x10FFFF).grep({ .chr ~~ /<:Lt>/}).map(&uniname) | ||
camelia | (LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON LATIN CAPITAL LETTER L WITH SMALL LETTER J LATIN CAPITAL LETTER N WITH SMALL LETTER J LATIN CAPITAL LETTER D WITH SMALL LETTER Z GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI GREEK CAPITAL… | 09:19 | |
lookatme | m: say "Trump Visits Mexico" ~~ /<:Lt>/; | ||
camelia | Nil | ||
09:19
Guest39608 left
|
|||
rightfold | m: say "Dž" ~~ /<:Lt>/; | 09:19 | |
camelia | 「Dž」 | ||
rightfold | Seems to be those ligatures where the first letter is uppercase and the second one is lowercase | 09:20 | |
moritz | it's 4 latin and 27 greek capital letters that match <:Lt> | ||
lookatme | m: say "a Trump Visits Mexico" ~~ m:g/<:Lt>/; | ||
camelia | () | ||
09:22
Cabanossi left
09:23
TEttinger left,
Cabanossi joined
|
|||
rightfold | There's no ASCII in Lt | 09:23 | |
09:25
Ven_ joined
09:41
finanalyst joined
09:44
robertle joined
09:45
mr-foobar left
09:50
mr-foobar joined
09:52
fatguy left
09:55
Ven_ left
10:03
ufobat joined
10:06
vimal2012 left,
vimal2012 joined
|
|||
Zoffix | finanalyst: perl6-debug just bittrotted. It's not going away. Gonna try to fix it before next release (though I recall saying the same like 3 releases ago :P) | 10:06 | |
10:08
lookatme left
|
|||
Zoffix | xiaoyafeng, no difference, as both are compile time errors unless you augmented Strs to have .io and implemented `d` routine or constant :) There's, however, no difference between '.'.IO.dir.grep: {.d} and '.'IO.dir.grep({.d}); the `:` is just an alternative way to write `()` in this case, except you can't follow it with another method call in the same chain. | 10:09 | |
TEttinger, nah, I'm a total n00b. Started with Perl 6 like a week ago. | 10:11 | ||
And it's hrd | |||
10:11
Zoffix left
10:21
ChoHag left,
Cabanossi left
10:23
Cabanossi joined
10:36
astj_ left
11:00
sammers left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:06
Cabanossi left
11:08
Cabanossi joined
|
|||
tbrowder | .tell dwarring i installed latest version and both courier and times-roman show True for IsFixedPitch. i'm not positive about your methods but i think the default value of IsFixedPitch should be False, and the Adobe spec says the absence of it is False. | 11:16 | |
yoleaux | tbrowder: I'll pass your message to dwarring. | ||
11:23
grondilu left
|
|||
tbrowder | .tell dwarring the is-deeply test on the metric may be giving an unexpected result | 11:24 | |
11:27
labster left
11:34
wamba left,
xtreak left,
cpage joined
11:43
curt_ joined
11:46
vimal2012 left
11:59
pmurias joined
12:01
aborazmeh left
12:04
salv0 left
12:06
rindolf left
12:09
ufobat left
12:11
pmurias left
|
|||
tbrowder | .tell dwarring you need to actually test the module with a Font::AFM object, then the IsFixedPitch test fails for Courier using ok (expected True) | 12:12 | |
yoleaux | tbrowder: I'll pass your message to dwarring. | ||
12:14
finanalyst left
|
|||
Voldenet | m: say "Zażółć gęślą jaźń λ" ~~ m:g/<:Lt>/; | 12:14 | |
camelia | () | ||
Voldenet | m: say "Λ" ~~ m:g/<:Lt>/; | 12:15 | |
camelia | () | ||
12:17
pmurias joined
12:18
ufobat joined
12:19
mcmillhj joined
12:28
pmurias left,
pmurias joined
12:32
simonm left
12:34
pmurias left,
pmurias joined,
simonm joined
12:39
pmurias left
12:41
pmurias joined
12:42
pilne joined
|
|||
nebuchadnezzar | hello | 12:43 | |
tbrowder | .tell dwarring i have submitted a PR for new tests that show the problem | 12:54 | |
yoleaux | tbrowder: I'll pass your message to dwarring. | ||
nebuchadnezzar | I have a NFG character and I want the list of code points of the NFD form | 12:55 | |
timotimo | m: say "ö".NFD.perl | 12:56 | |
camelia | Uni.new(0x006f, 0x0308).NFD | ||
timotimo | m: say "ö".NFD.list.perl | ||
camelia | (111, 776).Seq | ||
nebuchadnezzar | thanks | 12:57 | |
13:08
aborazmeh joined,
aborazmeh left,
aborazmeh joined
13:09
pmurias left
13:23
nadim_ left
13:24
Zoffix joined
|
|||
Zoffix | When I Lock.protect something, does it matter where the lock is instantiated? I see the docs list it as `my $l = Lock.new; $l.protect({ #`( some unsafe operations here ) 1 + 1; });`, but it wonder why `$l` is involved there | 13:25 | |
Can it be written as just Lock.new.protect({ #`( some unsafe operations here ) 1 + 1; }); or does the Lock need to be created outside the threaded area? | |||
Aha! My hunch was right. Lock must be created outside the threaded area. | 13:29 | ||
This spams stuff in wrong order: perl6 -e 'await ^100 .map: { start { Lock.new.protect: { print "Foo"; sleep rand; print "Bar"; sleep rand; say "Ber"; } } }' | |||
While this works right (note how lock is outside the promises): perl6 -e 'my $l = Lock.new; await ^100 .map: { start { $l.protect: { print "Foo"; sleep rand; print "Bar"; sleep rand; say "Ber"; } } }' | |||
[Coke] | foo bar ber? heretic! | 13:30 | |
as a foo bar baz-ian, I must protest. | |||
Zoffix | :) | 13:31 | |
jnthn | .oO( foo bar ber-ians at the gate... ) |
||
yoleaux | 01:43Z <Zoffix> jnthn: any idea what may be causing a Proc::Async.kill to fail killing when there's more than one Proc::Async involved? This is sort of blocking my ecosystem toaster script :( would be sweet if it could be fixed: rt.perl.org/Ticket/Display.html?id=131479 | ||
Zoffix | jnthn: never mind about that ^. I just found where the bug's at. Race in $*KERNEL.signal | ||
jnthn | d'oh | 13:32 | |
Zoffix++ # bug hunting | |||
Zoffix | \o/ | ||
13:38
liweigan joined
|
|||
Geth | doc: f98e28f667 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Lock.pod6 Expand Lock.protect docs To explain the lock must be instantiated outside the threaded area |
13:40 | |
13:40
Zoffix left
13:45
fatguy joined
13:47
araraloren joined
|
|||
Voldenet | Could locks work with 6.0d's continuations? Would it be possible to use locks in async context? (schedule execution when lock available) | 13:51 | |
13:51
Cabanossi left
|
|||
Voldenet | something like: my $l = AsyncLock.new; await $l.lock(); ... $l.unlock(); | 13:52 | |
13:53
mcmillhj left
13:54
Cabanossi joined
|
|||
Voldenet | or even: my $l = AsyncLock.new; await $l.protect({ ...piece of async code }); | 13:54 | |
13:54
mcmillhj joined
|
|||
timotimo | ZofBot: if you $l = Lock.new inside of a multi-threaded area, you'll just be creating one lock per thread, which won't do very much :) | 13:59 | |
13:59
astj joined
|
|||
jnthn | Voldenet: I've pondered a Lock::Async at some point | 14:00 | |
It can be a kinda useful mechanism | |||
14:04
astj left,
ChoHag joined
14:13
dct left
14:16
nadim joined
14:21
rindolf joined
14:24
dct joined
14:38
aborazmeh left
14:41
holyghost joined
|
|||
araraloren | evening .o/ | 14:45 | |
dudz | \o. | 14:46 | |
14:52
mls left
14:53
zakame joined
14:54
mls joined
14:55
AnX joined,
Herby_ joined
|
|||
Herby_ | o/ | 14:56 | |
AnX | o/ | 14:57 | |
how to start with perl 6 | 14:58 | ||
14:58
AnX left
14:59
AnX joined,
amerlyq joined,
AlexDaniel joined
|
|||
Herby_ | Anx: here's a new book that was just released on getting started with Perl 6: greenteapress.com/wp/think-perl-6/ | 14:59 | |
14:59
khw joined
|
|||
moritz | AnX: do you have previous programming experience with other languages? | 15:02 | |
AnX | Hi | 15:03 | |
yes | |||
i worked sometime in perl 5, little tcl, shell, C/C++ | 15:04 | ||
thanks for the link Hereby_ | |||
moritz | then in a few weeks, www.apress.com/us/book/9781484228982 will be out | ||
that targets folks that are already familiar with the basic programming constructs | |||
AnX | ok i see .. that would be great | 15:05 | |
15:05
ovechkin joined
|
|||
robertle | moritz: is yours really 140 pages as the apress page says? | 15:06 | |
moritz | robertle: it's 125 pages content in A4 format | ||
robertle: so a bit more in a smaller format | |||
(A4 is pretty big, as far as books go) | |||
15:06
Cabanossi left
|
|||
robertle | ok, thanks | 15:07 | |
15:09
Cabanossi joined
|
|||
Herby_ | moritz: can't wait to read it | 15:11 | |
15:13
darutoko- joined,
darutoko- left
|
|||
Herby_ | question: I'm using zoffix's Twitter module. I used Zef to install it. How do I find the local path of the module on my pc? | 15:15 | |
15:15
Zoffix joined
|
|||
Herby_ | and he appears | 15:16 | |
Zoffix | I have a bot ping me 'cause you mentioned me | ||
Herby_ | ahhh | ||
15:16
darutoko left
|
|||
Zoffix | Herby_: why do you need a path? Theoretically there don't have to be one | 15:16 | |
Like, what are you trying tod o? | |||
Installed modules get precompiled, so I doubt the path will help you much | 15:17 | ||
Herby_ | I don't really know how to use git. I like your module and would like to try and add some more functionality to it | ||
figured if i could find the local file i could start adding additional GET methods | |||
Zoffix | right, module's path will be useless for that | ||
Herby_ | :( | ||
Zoffix | Just do git clone github.com/zoffixznet/perl6-Twitter Twitter | 15:18 | |
And then you'll have the Twitter dir. Go into it and you'll be able to load your local changes when you use `perl6 -Ilib` | |||
or do `perl6 examples/bot.pl6` that script already adds `lib` topaths | 15:19 | ||
Herby_ | ok. does it matter what folder I'm in when I do the: git clone github.com/zoffixznet/perl6-Twitter Twitter command? | ||
Zoffix | nope | 15:20 | |
Herby_ | awesome. I'll give it a shot, thanks | ||
15:21
cdg joined
|
|||
Zoffix | And if you end up with something that you'd want to add to the module, you need to "fork" my repo and then do a PR ("Pull Request"). Appears to be a guide for the process: gist.github.com/Chaser324/ce0505fbed06b947d962 | 15:22 | |
Zoffix vanishes into the shadows | |||
15:22
Zoffix left,
Actualeyes joined
15:25
cdg left,
cdg joined
15:30
ovechkin left,
liweigan left
15:31
zakharyas left
15:32
hythm left,
hythm joined,
lowbro left,
hythm left
15:33
hythm joined
15:34
hythm left,
hythm joined
15:36
hythm left
15:41
setty1 joined
|
|||
zakame | hi, is Task::Star gone from modules.perl6.org list? I can see its github still though | 15:47 | |
tadzik | yeah, it's been removed from the ecosystem | 15:48 | |
zakame | ah | ||
tadzik | some people actually noticed its disappearance though, so perhaps a fork would be desirable | 15:49 | |
zakame | there's still Task::Galaxy etc | ||
15:51
Cabanossi left
15:54
Cabanossi joined
15:57
cdg left
15:59
domidumont left
16:01
robertle left
16:06
hythm joined
|
|||
zengargoyle resists urge to summon the Z | 16:12 | ||
Herby_ | I think I'm missing an essential step on something. I cloned the perl 6 twitter module and am trying to add a new GET method | 16:14 | |
16:15
astj joined
|
|||
Herby_ | none of the changes I'm making appear to be taking affect. its like my script is still pointing to the Twitter module I installed with zef | 16:15 | |
instead of the local lib that I'm changing | |||
ahh nevermind | |||
ugexe | are you using -Ilib | ||
Herby_ | disregard | ||
ugexe | or -I. | 16:16 | |
Herby_ | looks like i needed to run it from the parent directory | ||
16:19
astj left
|
|||
ugexe | or you could -Ipath/to/parent-directory | 16:28 | |
or `PERL6LIB="/path/to/parent-directory" perl6 ...` | 16:29 | ||
16:29
cibs left
|
|||
Herby_ | ugexe: thanks | 16:30 | |
16:31
cibs joined
16:32
zakame left
|
|||
zengargoyle | don't export PERL6LIB=lib or similar, it makes things strange and slow whenever you change directories. :P | 16:32 | |
it took me way to long to figure out that setting PERL6LIB in my .profile was why p6 was so slow all the time but only sometimes. :) | 16:34 | ||
16:35
devmikey joined
16:37
robertle joined
|
|||
tbrowder | i've not noticed any ill effects using PERL6LIB defined with multiple ditrctories | 16:37 | |
16:37
holyghost left
16:38
devmikey left
|
|||
zengargoyle | if they're relative then it's like a new repo chain each time. (i think). i noticed by rsyncing rakudobrew installs (and ~/.perl6) across machines and noticing the startup lag after every sync. | 16:40 | |
16:42
Actualeyes left
16:43
troys joined
|
|||
eater | our can't have type constraints? | 16:43 | |
AlexDaniel | eater: seems so | 16:44 | |
eater | m: module Aliens { our Str $type-me = "ayyyy"; } say Alliens::typ-me; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Cannot put a type constraint on an 'our'-scoped variable at <tmp>:1 ------> 3module Aliens { our Str $type-me7⏏5 = "ayyyy"; } say Alliens::typ-me; expecting any of: constraint |
||
eater | is this an active design choice? | ||
geekosaur | I think the problem is that you 'our' it to use it in multiple modules; which one gets the type annotation, or do you need to check for matching annotations every time you compile *or load* a module that 'our's it? | 16:47 | |
jnthn | Yes; `our` is just a lexical alias to something in a package. And packages are really just a hash table of keys to values, which you can poke whatever you like into without even needing declaration. | ||
eater | ah | 16:48 | |
thanks | |||
sounds like a nice feature tho | |||
but I guess it's a bitch to implement in what a module is now? | |||
16:48
cdg joined
|
|||
jnthn | Even without a module... | 16:48 | |
module Foo { sub a { our Str $x }; sub b { our Int $x }; sub c { Foo::<$x> = 4.2 } } # uhh :) | 16:49 | ||
All of those are talking about the same slot. | |||
Uh, I meant even *within* a module. | |||
It's not so much a "hard to implement" as a "what would we even implement" ;) | 16:50 | ||
eater | you can define in a sub an our D: | ||
makes sense if you look at a module as hash | |||
jnthn | That's precisely what a module's symbol table is. | ||
16:53
ChoHag left
|
|||
eater | hmm, but from a non-"i know all the insides" standpoint, it seems rather confusing. you could just forbid our definition's outside the module block 😇 | 16:53 | |
keeps most code cleaner, and it looks like it would make more sense | |||
but idk, maybe Im missing something | 16:54 | ||
16:55
st_elmo joined
|
|||
eater | hmm maybe my idea of module's is just wrong | 16:57 | |
16:58
cdg_ joined,
cdg left
17:06
dct left
|
|||
TreyHarris | anybody here ever tried to learn duodecimal (dozenal) or sexagesimal? I just read something suggesting that some people with dyscalculia have had success with them. (I'm rather good with math but abysmal with arithmetic.) | 17:08 | |
17:19
mr-foobar left,
troys is now known as troys_
|
|||
Voldenet | well, I use base-60 for hours, it's quite neat | 17:19 | |
if that's what you mean | 17:20 | ||
17:20
AlexDaniel left
|
|||
TreyHarris | lol | 17:21 | |
Voldenet | but if someone asked me to added 34 to 48 i wouldn't be too sure | 17:22 | |
s/added/add/ | 17:23 | ||
17:23
mr-foobar joined
17:24
troys_ is now known as troys
17:33
AnX left
17:42
skids joined
17:49
st_elmo left
17:55
dct joined
18:05
ufobat left
|
|||
geekosaur | I remember playing with duodecimal a bit as a kid, but that's about it | 18:07 | |
dylanwh | base 6 is more fun | 18:08 | |
geekosaur | and the link to time _is kinda obvious for both of those bases :) | ||
(in fact, I kinda wonder the vintage of the claim that people have had success with those bases; they're much easier when you can just glance at the nearest clock... which doesn't work in the age of digital clocks :) | 18:09 | ||
18:09
mcafee joined
|
|||
geekosaur | then again, the flip side of _that_ one is that the Sumerians used those bases for a reason... | 18:10 | |
18:12
domidumont joined
|
|||
BooK | wasn't the reason for 12 or 60 is that it's easily divisible by 2, 3, 4 (and 5) | 18:17 | |
mcafee | Today I evaluated the expression [Z+] ((1,2,3),), expecting it to return (1,2,3) since I'm zipping a single element, but instead I got (6). What's going on here? | 18:18 | |
moritz | something flattens :( | 18:19 | |
m: say [Z+] ([1, 2, 3], ) | |||
camelia | (6) | ||
pilne | m: say [+] ([1, 2, 3],) | 18:20 | |
camelia | [1 2 3] | ||
pilne | m: say [Z+] ([1, 2, 3]) | 18:21 | |
camelia | (6) | ||
pilne | m: say [Z+] ([1, 2, 3], ) | ||
camelia | (6) | ||
pilne | hrm | ||
moritz | m: say [Z+] $(1, 2, 3) | 18:22 | |
camelia | (6) | ||
moritz | m: say [Z+] $(1, 2, 3), | ||
camelia | (6) | ||
mcafee | So it's not just me that's surprised? Whew! | ||
moritz | wow, it seems *really* eager the flatten the shit out of any single-element list it gets | ||
mcafee: your sanity isn't in question this time! :-) | 18:23 | ||
mcafee | It's really puzzling because I thought Z+ is supposed to combine elements from different lists, but here it seems to degenerate to [+] on a single list... | ||
I'm golfing and have written some code like: [Z+] @_.map: { ... } and it's falling over if @_ has just one element. | 18:25 | ||
18:33
ufobat joined
|
|||
b2gills | A work around [Z+] 0 xx *, |@_.map: { ... } | 18:34 | |
18:35
espadrine_ joined
18:36
TeamBlast left
|
|||
b2gills | I've come across this a few times, but I was always in the process of creating a golf, so I just quickly moved on to the next algorithm. | 18:36 | |
18:39
TeamBlast joined
|
|||
perlpilot | Though you'd have to change the identity element depending on the operation. | 18:39 | |
i.e. [Z*] 1 xx *, |@_.map: { ... } | 18:40 | ||
mcafee | Yeah, I came up with that workaround too, but I hate to lose all those strokes! | ||
18:43
TeamBlast left
18:45
Zoffix joined
|
|||
Zoffix | How specify a constraint for "all elements of array are either Cool:D or Nil or Any:U" ? | 18:45 | |
m: my @stuff = (1, Any, 3); -> @a where {@a.all.ACCEPTS: Cool:D|Nil|Any:U} { say "got it"}( @stuff ) | |||
camelia | Constraint type check failed in binding to parameter '@a'; expected anonymous constraint to be met but got Array ($[1, Any, 3]) in block <unit> at <tmp> line 1 |
||
Zoffix | Reading the Junction.ACCEPTS code suggests the above should work, but it doesn't | 18:46 | |
18:47
TeamBlast joined
|
|||
Zoffix | m: my @stuff = (1, Any, 3); say @stuff.map(*.ACCEPTS: Cool:D|Nil|Any:U) | 18:47 | |
camelia | (any(False, False, False) any(True, True, True) any(False, False, False)) | ||
Zoffix | Ah, ok | ||
well, I see why that way don't work, but what's the way? | |||
18:48
mr-foobar left
18:49
mr-foobar joined
|
|||
Zoffix | Actually, I don't want just any Any:U but THE Any:U | 18:51 | |
moritz | then you need { $_ === Any:U } | 18:52 | |
Zoffix | Well, that's the easy part. How to combine all that into something that doesn't look insane :D | 18:53 | |
18:53
zacts left
|
|||
dogbert17 | is this statement from the docs still correct: | 18:54 | |
Zoffix | Also, you need === Any, not === Any:U :) | ||
dogbert17 | "Coercion types are supposed to work wherever types work, but Rakudo currently (2015.02) only implements them for subroutine parameters." | ||
Zoffix | dogbert17: yes | 18:55 | |
m: my Int() $x | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Coercion Int(Any) is insufficiently type-like to qualify a variable at <tmp>:1 ------> 3my Int() $x7⏏5<EOL> expecting any of: constraint |
||
dogbert17 | Wasn't it implemented for return types or something to that effect | ||
Zoffix | Well, yes as in it don't work; I guess they're supposed to work | ||
m: -> --> Int() { '42' }().say | |||
camelia | 42 | ||
Zoffix | m: -> --> Int() { '42' }().^name.say | ||
camelia | Int | ||
Zoffix | dogbert17: looks like it | ||
dogbert17: oh, well, "subroutine" should read just "routine", since they work in methods too | 18:56 | ||
Zoffix wildly guesses they work in unpacking too | |||
m: my (Int() $x) := ('42',); dd $x | |||
camelia | Int $x = 42 | ||
dogbert17 | thx Zoffix, will update the text | ||
Zoffix | Haha yes :) | ||
dogbert17 | is unpacking the right term to use in the text | 18:57 | |
Zoffix | No idea | ||
moritz | isn't that just binding an anonymous signature? | ||
m: -> Int() $_ { say .^name }('42') | 18:58 | ||
camelia | Int | ||
Zoffix | m: my @stuff = (1, 42, 3); -> @ where {so all .map: {$_ ~~ Cool:D|Nil or $_ === Any}} { say "got it" }( @stuff ) | 18:59 | |
camelia | got it | ||
Zoffix | Well, that's the shortest I got it to. Any saner way? | ||
(`so ` part can be removed, but what else) | 19:00 | ||
I guess it ain't that bad. /me goes with that | |||
dogbert17 | how about: "Coercion types are supposed to work wherever types work, but Rakudo currently (2017.05) only implements them for routine parameters and return types." | ||
moritz | ... "only implements in signatures, for both parameters and return types" | 19:01 | |
*them | |||
19:01
Zoffix left
|
|||
dogbert17 | moritz++, will fix and commit | 19:01 | |
moritz | on a completely different topic... | 19:02 | |
I have the domain perl6book.com, which I intended as a landing page for my book | |||
but, apress has one, so I can reuse it for another purpose | |||
I thought I might give an overview of all Perl 6 books there | 19:03 | ||
and maybe even a small "which Perl 6 book to read" wizard | |||
any thoughts on that? Does anybody want to contribute? | 19:04 | ||
perlpilot | moritz++ sounds like an excellent idea. | 19:05 | |
Geth | doc: 2ebb405467 | (Jan-Olof Hendig)++ | doc/Language/functions.pod6 Fixed a few errors. Zoffix++, moritz++ |
19:06 | |
19:12
zakharyas joined
19:14
itaipu joined
19:15
cpage_ left
19:16
cpage_ joined
19:19
setty1 left
|
|||
moritz | I'm starting to collect data and thoughts at github.com/moritz/perl6book-web/bl...edesign.md | 19:21 | |
if anybody else wants to contribute, send a PR. Or if that's too much hassle, I can transfer the repo the perl6 org | 19:22 | ||
(though I feel bad doing that as long as there's so much out-of-date stuff on the front page) | |||
19:24
wamba joined
|
|||
moritz | ok, I'm filling out github.com/moritz/perl6book-web/bl...edesign.md now | 19:29 | |
if you think some of the characterizations are not fair or balanced, please speak up | 19:30 | ||
19:32
dct left
|
|||
tbrowder | moritz: how about the book Metagenomics? | 19:33 | |
moritz | tbrowder: that's a bit of a weird one. It doesn't advertise any Perl 6, but contains lots of it | ||
tbrowder: I'm having trouble coming up with a description that doesn't sound totally weird | 19:34 | ||
tbrowder | ok, Perl 6 in the trenches? | ||
moritz | link? | ||
19:34
grumble left
19:35
zakharyas left
|
|||
tbrowder | sorry, my attempt at humor, description of metagenomics... | 19:35 | |
19:35
troys is now known as troys_
|
|||
moritz | oh :-) | 19:35 | |
19:36
grumble joined
|
|||
moritz | anyone want to create a generic Perl 6 book logo, with camelia reading a book or something? :-) | 19:37 | |
zostay | i just found a weird bug in DateTime::TimeZone's tools for generating classes from the Olsen TZ database that looks like a grammar doing something a grammar should not be able to do | 19:40 | |
moritz | zostay: it became self-aware? | 19:41 | |
19:41
troys_ is now known as troys
|
|||
zostay | maybe | 19:41 | |
when you run the script, it outputs this error: Substring length (-3194) cannot be negative | |||
in any Str at /Users/sterling/.rakudobrew/moar-nom/install/share/nqp/lib/QRegex.moarvm line 1 | |||
19:42
zacts joined
|
|||
zostay | the line causing it is: my $yfrom = +$rule<from>; | 19:42 | |
where $rule<from> is a hash lookup in a Match | |||
moritz | try changing it to +~$rule<from> | 19:43 | |
just to see if it makes a difference | |||
zostay | same error | ||
moritz | right, it tries to call Str already | 19:44 | |
zostay | the more i work with it, the weird it behaves... like dd hangs trying to show the returned parse tree | 19:45 | |
19:46
kyan joined
|
|||
zostay | if i have Grammar::Tracer loaded, it starts tracing infinitely somewhere in the middle on the dd line | 19:46 | |
i'm wondering if one of the very common names used for the tokens might be clashing with a built-in | |||
but that's just a guess at this point | 19:47 | ||
19:48
cdg_ left
|
|||
moritz | zostay: try inspecting $rule<from> for its .from, .to and .orig properties | 19:49 | |
19:51
zacts left
|
|||
zostay | i think i just confirmed my hypothesis doing a search/replace and insert "tz-" on to the front of all the rule names fixed it... i wonder if having a rule named to or from is a no-no | 19:52 | |
moritz | erm, yes | 19:53 | |
and i can't believe I didn't notice | |||
tokens/rules are really methods on the cursor | 19:54 | ||
at least "orig", "target" and "pos" would be verboten | 19:55 | ||
but it seems of the Match methods/attributes are too | |||
19:55
mcmillhj left
|
|||
zostay | to and from are definitely the problem, i changed just those to tz-to and tz-from and the problem goes away | 19:55 | |
19:56
zacts joined
|
|||
zostay | this seems like a place where having final methods could be helpful | 19:56 | |
19:59
mcmillhj joined
|
|||
moritz | agreed | 20:00 | |
or having to be explicit about masking parent classes method | 20:01 | ||
zostay | yeah, true final would be anti-perl right? there'd have to be something like augment to get around it, right? ;) | ||
moritz | right :-) | ||
20:02
zapwai joined
20:03
mcafee left
20:06
zapwai is now known as Zapwai\lettuce
|
|||
moritz | my Perl 6 book decision tree: github.com/moritz/perl6book-web/bl...ision-tree :-) | 20:11 | |
20:18
cpage_ left
|
|||
ingy | is there a way to access all args like @_? | 20:20 | |
20:20
domidumont left
|
|||
moritz | |c in the signature | 20:20 | |
then c becomes a capture | 20:21 | ||
20:22
bdmatatu joined
|
|||
ingy | gist.github.com/anonymous/5a7c24b1...c8e2a5eed3 something like that | 20:25 | |
20:26
cpage_ joined
|
|||
moritz | m: sub foo(*@_ ($x, $y)) { die @_ }; foo('a', 'b') | 20:27 | |
camelia | a b in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
timotimo | m: sub foo(|c, $x, $y) { die c.list }; foo("a", "b") | 20:29 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Cannot put required parameter $x after variadic parameters at <tmp>:1 ------> 3sub foo(|c, $x7⏏5, $y) { die c.list }; foo("a", "b") expecting any of: constraint |
||
timotimo | ah, right | 20:30 | |
ingy | so no way without changing the sig? | ||
moritz | no official way, at least | 20:31 | |
I guess if you dive deep enough into nqp:: ops, you'll find something | |||
Xliff | \o | ||
ingy | :) | ||
20:31
mcmillhj left
20:33
mcmillhj joined
|
|||
ingy | p5 has to be better at something ;) | 20:33 | |
Xliff | What's the best way to check type against all elements of an array? | ||
moritz | fsvo "better" | ||
Xliff: all(@array) ~~ TheType | 20:34 | ||
Xliff | LOL | ||
I was doing TheType ~~ all(@array) | |||
And it wasn't working. | |||
Why is ~~ not commutative? | 20:35 | ||
Or is it the junction that is not commutative? | 20:36 | ||
timotimo | because that went very, very, very wrong in perl5 :) | ||
Xliff | LOL!!! | ||
timotimo | you remember how they got smartmatch, but then decided to toss it again? | ||
Xliff | No. | ||
I smell a story | |||
Is there a blog post, or is it timotimo story time? :) | |||
timotimo | not only was it a bad fit because of the lack of types in perl5, but it was also bad in general because they stole it before perl6ers realized commutative smartmatch is not a good idea at all | 20:37 | |
20:37
troys is now known as troys_
|
|||
Xliff | Ooooooo | 20:37 | |
So it's always better to do: <Thing you are checking> ~~ <Type>? | |||
m: say 4 = any(2, 3, 4, 5) | 20:38 | ||
camelia | Cannot modify an immutable Int (4) in block <unit> at <tmp> line 1 |
||
moritz | that's the only correct way to do it :-) | ||
Xliff | m: say 4 == any(2, 3, 4, 5) | ||
camelia | any(False, False, True, False) | ||
Xliff | m: say any(2, 3, 4, 5) == 4 | ||
camelia | any(False, False, True, False) | ||
20:38
mcmillhj left
|
|||
Xliff | OK, so it is smartmatch. | 20:38 | |
moritz | it's ~~ that's not commutative | ||
right | |||
Xliff | Up to this point, I've only used == with junctions. | ||
timotimo++ && moritz++ | 20:39 | ||
20:39
itaipu left
20:41
ufobat left
20:42
mcmillhj joined
|
|||
awwaiid | ingy: you can get some interesting things with MY::, but it is a superset of what you requested | 20:42 | |
m: sub my_params($x, $y) { say MY::.perl } ; my_params(2, 4) | 20:43 | ||
camelia | PseudoStash.new(("\$!" => Nil,"\$*DISPATCHER" => Mu,"\$/" => Nil,"\$_" => Any,"\$x" => 2,"\$y" => 4,"\$¢" => Nil)) | ||
ingy | awwaiid: awesome | ||
awwaiid | m: sub my_params($x, $y) { say MY::.perl; my $z = 7 } ; my_params(2, 4) | 20:44 | |
camelia | PseudoStash.new(("\$!" => Nil,"\$*DISPATCHER" => Mu,"\$/" => Nil,"\$_" => Any,"\$x" => 2,"\$y" => 4,"\$z" => Any,"\$¢" => Nil)) | ||
awwaiid | $z in scope but not defined, interesting. | ||
moritz | declaration is a compile-time operation | 20:45 | |
awwaiid | ah yes | ||
moritz | but the initialization is run time | ||
awwaiid | ingy: I hope you are doing horrible horrible things... whatchya up to? | 20:46 | |
ingy | I'm writing new languages in a dialect or perl6 for $work. | 20:47 | |
awwaiid | I cannot parse that sentence without more parenthesis, but sounds cool | ||
geekosaur | change "or" to "of" | 20:49 | |
awwaiid | ahh | ||
ingy | openresty.org has a (soon to be open-sourced) internal programming language called FanLang that uses (mostly) Perl6 syntax to compile to LuaJIT. And with that lanugage they are writing several other languages/DSLs internally. | ||
awwaiid | madness | 20:50 | |
20:50
troys_ is now known as troys
|
|||
moritz | that's what agentzh has been working on, right? | 20:51 | |
ingy | at the moment I'm implementing Template-Toolkit (Jemplate/Lemplate) in FanLang | ||
which itself is a language (DSL) | |||
yeah it's agentzh's startup company | 20:52 | ||
I bet I could port TT2 from Fan to Perl6 quite easily. | 20:53 | ||
20:53
TEttinger joined
|
|||
awwaiid | feel free | 20:53 | |
20:53
lizmat left
|
|||
ingy | :) | 20:53 | |
mostly I'm working on getting the p6 YAML stuff done ASAP | |||
zostay | \o/ | ||
ingy | Make YAML Great Again!!! | ||
[Coke] | "too soon" | 20:54 | |
ingy | YAML == SAD | ||
moritz | s/Again// # SCNR :) | ||
ingy | Hillary told me that YAML is already great. | ||
awwaiid | needs more exclamation marks. sad! | 20:55 | |
zostay | YAML is a polarizing force... like ingy... maybe ingy should run for President and have YAML as his running mate | ||
20:55
grondilu joined
|
|||
zostay | i'd vote for that duo | 20:55 | |
20:56
grondilu left,
grondilu joined
|
|||
ingy | tinita has YAML.pm6 working (over the libyaml stuff) | 20:56 | |
we should get that out this weekend | |||
awwaiid | I tell all my friends that ingy taught me in-person that YAML is a superset of JSON. Mostly they just stare at me because they haven't met Ingy so haven't felt the mad-science inspiration that drips from his soul | ||
ingy | heh | ||
awwaiid | also many of my friends are not programmers, and thus even further removed from being able to relate to my cool story | 20:57 | |
ingy | I feel totally "Ingy" trying to write a new language in a new language in a ... | ||
awwaiid | and getting paid to do it, so that's good | 20:58 | |
20:58
bdmatatu left
|
|||
ingy | +10! | 20:58 | |
Herby_ | whats the simplest way to pretty print a hash? | ||
or print a hash in a pretty state :) | |||
awwaiid | m: say {a => 2, b => 4}.perl | 20:59 | |
camelia | {:a(2), :b(4)} | ||
awwaiid | m: say {a => 2, b => 4} | ||
camelia | {a => 2, b => 4} | ||
timotimo | well, Data::Dump::Tree isn't simple, but it is really pretty | ||
moritz | awwaiid: that kinda reminds me of a story a colleague told me. At the dinner party of some ruby conf, he talked for over an our with some friendly Japanese guy | ||
timotimo | you can use json::fast's to-json with :pretty | ||
zostay | m: dd {a => 2, b => 4} | ||
camelia | Hash % = {:a(2), :b(4)} | ||
moritz | awwaiid: ... and only later learned that it was Matz :-) | ||
timotimo | that's rather simple and looks good | ||
awwaiid | hahaha | ||
How pretty is pretty, Herby_? | 21:00 | ||
Herby_ | thanks i'll take a look at | ||
sorry, missend | |||
pilne | i'd love to find an opportunity to jump ship from where i'm working now (non-coding) to something coding, but every time i sit down and try and work on something coding related that isn't perl6 now, i get frustrated at how much I feel like i'm appeasing the language instead of utilizing it lol. | ||
timotimo | i can only hope that when someone meets me at a party they aren't intimidated by me being the author of the #1 most cited perl6 module :) | ||
ingy | I can see that. I've had beers with Matz. He's totally chill. | ||
Herby_ | a json response from twitter, trying to print it out so i can see whats going on | ||
right now its just a blob | |||
pilne | and a good... 100% of the stuff around here is java/python/php/ruby (not in that order necesarily). | ||
zostay | pilne: where you at -ish? | 21:01 | |
moritz | Herby_: say .key, "\t", .value for %hash; | ||
pilne | ruby is "ok" but i feel like everything in that ecosystem is webdev | ||
[Coke] | pilne: makes you feel any better, I work somewhere where that is about 60/39/1 java/cold fusion/php | ||
pilne | zostay=> closest major metro (and it is close) is saint louis, missouri. | ||
your poor sanity coke | |||
Herby_ | moritz: thanks | 21:02 | |
pilne | there's some perl5 stuff around, but tbh, i barely know perl5. | ||
zostay | i'm near KC, assuming you won't relo, if you are open to working remote, we are hiring perl hackers like crazy | ||
ingy | I remember the first time I had lunch with TimToady. I was sitting next to him and I asked him a question and he just stared off into space. After a minute I just went back to eating. Then 5 minutes later he turns to me and gives me a 5 minute answer. | ||
pilne | p5 or p6 zostay? | 21:03 | |
zostay | p5, i don't know of much p6 work out there | ||
ingy | He never even nodded that he heard me or anything. It was awesome awkward. :) | ||
zostay | or python | ||
pilne | relocation might not be impossible, missouri end-to-end isn't that bad, i used to live near kingdom city in missouri. | 21:04 | |
21:05
mcmillhj left,
AlexDaniel joined
|
|||
pilne | i'm comfortable with python, i'm sure i could learn perl5 since well, perl6 is coming easy, but i'm not great in either, i took a long hiatus from programming when i got ptsd from c++ and java in 2000 lol. | 21:05 | |
ingy | ah nostalgia. ok back to the almost-p6-salt-mines... | ||
perlpilot | learning programming languages is easy ... learning how to /think/ is hard :) | 21:06 | |
moritz | perlpilot: you'd think that :-) | ||
Xliff | zostay: I am in DC and cannot relocate. Can I pass you a resume? ;) | 21:07 | |
perlpilot++ | |||
pilne | perlpilot=> my love of perl6 stems from the fact that it generally allows me to think how i want and it (often) easily translates to code. | 21:08 | |
Xliff | pline++ # Once you learn the syntax, this is (mostly) true. | ||
moritz | I'll be teaching a programing course at $work, starting next week | ||
(python though) | |||
perlpilot | indeed. That's one of the reasons I've stuck with Perl 5 since forever--it fits my brain well. Perl 6 more so. | ||
Xliff | python-- | 21:09 | |
moritz | looking forward to it | ||
Xliff | I have tried my hand at python. Was able to grok it enough to get it to do what I wanted in a large project. | ||
moritz | the initial response was pretty good: 25 out of about 200 employees signed up | ||
Xliff | Did not enjoy the experience. | ||
perlpilot | Xliff: python is okay until you try to do something perlish and it fights you ;) | 21:10 | |
moritz | it assumes a different mindset than Perl | ||
Xliff | Yes. I got Lisp flashbacks. | ||
moritz | it took me about 2 years to kinda like it | ||
timotimo | i built a pretty cool cellular automata simulator framework in python | ||
Xliff | I'm not supposed to have Lisp flashbacks!!! | ||
python: Lisp lite, without all of the bloody parens. | 21:11 | ||
perlpilot | .oO( <Xliff> I haven't even ever used Lisp! ) |
||
Xliff | O_O | ||
21:11
espadrine_ left
|
|||
Xliff | I never said that! | 21:11 | |
I disbelieve? | |||
(should have not ended that in a ?) | |||
perlpilot | It's funny that you equate Python and Lisp (when I used to hang out on #python, they did too), but I never thought they were that close | 21:12 | |
Python seems more like a high-level C to me. | |||
Lisp at least groks closures; python still struggles | 21:13 | ||
moritz | I still hate python's scoping (or lack thereof) | ||
Xliff | I have made my feelings on Lisp known here, before. | ||
irclog.perlgeek.de/perl6/search/?n...amp;q=Lisp | |||
tadzik | it's awful :| | ||
moritz | and implicit declaration of variables | ||
21:13
mcmillhj joined
|
|||
pilne | python's "do it this way or else" just kinda irks me... | 21:13 | |
Xliff | pilne++ | ||
perlpilot: The problem there is that C is not as pedantic as python. At least C knows its limitations. | 21:15 | ||
Python implies less restrictions than C, but in reality there are more | |||
:/ | |||
pilne | i mean, there's usually a lib or something to be able to to just about anything in python, but sometimes i look at it and go "but.... why?" (note: i've always loved scheme) | 21:16 | |
Xliff | You could say the same about C/C++ | ||
pilne | tbh i'd rather use python/ruby/perl on top of c, instead of c++ if i want more abstractions. | 21:17 | |
Xliff | NativeCall FTW! | ||
That was one of the things that drew me to Perl6. | |||
And maybe I am just more used to c++, but I would prefer that than python. | 21:18 | ||
pilne | i read through the docs on nativecall and still have a lot to learn about it, but damn it looks fun. | ||
Xliff | It is. | ||
Until your code blows up MoarVM | |||
21:18
mcmillhj left
|
|||
pilne | to be fair, the last time i was doing c++ it was c++98 | 21:19 | |
Xliff | Oooooooo | ||
perlpilot | Xliff: what are you doing with NativeCall? Anything interesting? | ||
Xliff | was doing C++ up until 2003 or 4ish? | ||
Then it was all Java and C# | |||
(and Perl <5 and 6> whenever I got some spare time) | |||
perlpilot: I am still trying to work on a P6 wrapper for libxml2 | 21:20 | ||
perlpilot | cool. | ||
Xliff | But Perl6's design has changed since then and everything that FROGGS and I have written will need to be rewritten. | ||
FROGGS is the current maintainer. I just contribute. | |||
I haven't touched it in months cos.... life | 21:21 | ||
I need to get back to it. | |||
21:21
Cabanossi left
|
|||
ingy | how many people here get paid to write perl6 (not to hack on the language itself)? | 21:22 | |
Xliff | ingy: Not much of a Perl6 market, yet. | ||
pilne | i write code snippets for 5/6 on my phone at work when there's downtime? lol. | ||
perlpilot | The 2 modules that I think allow Perl 6 the most flexibility and power are NativeCall and Inline::Perl5. If I can't do something directly in P6, I know I can delegate to P5 for most things and then NativeCall for everything else. | 21:23 | |
moritz | ingy: does getting paid for a Perl 6 book count? :-) | ||
ingy | no :) | ||
21:24
Cabanossi joined
|
|||
perlpilot | ingy: I've been trying come up with a good excuse to use P6 at work, but haven't found the right project yet. So ... not getting paid for P6 now, but I hope to in the not-too-distant future | 21:24 | |
AlexDaniel | ingy: I've never heard of anybody using just perl 6 on their job, but some people seem to use it for little scripts and stuff | ||
timotimo | i was being paid for perl6 work for a few months | ||
perlpilot | ingy: Although a few years ago, I got paid for P6 in that I used it to help with a fortran -> java translation. P6 did some parsing and provided a test framework. | 21:25 | |
ingy | perlpilot: awesome | 21:26 | |
pilne | my problem with trying to use anything at my job code-related is that the company will own it all with no obligation to compensate/promote me lol. | ||
ingy | yeah I think using P6 to make internal DSLs is a future | ||
agentzh/openresty are shooting for top performance so having full control of their runtime is critical. | 21:27 | ||
when writing new languages is trivial, everyone will do it | 21:29 | ||
unless it's in Haskell ;) | |||
writing new languages in Haskell is trivial (once you know Haskell...) | |||
21:30
mcmillhj joined
|
|||
ingy | or so I've heard | 21:30 | |
pilne | haskell does have incredible parsing/lexing abilities | 21:31 | |
perlpilot | Do you mean in the sense of using Parsec, or warping Haskell's syntax to suit your needs? | ||
pilne | but lord is it a mindbender of a language | ||
ingy was actually started the perl6 channel (back when au was trivially implementing p6 in Haskell) | |||
that's why it's on freenode | |||
s/was// | |||
timotimo | you haven't seen "mindbender of a language" until you've worked with prolog, IMO | 21:32 | |
ingy | (at the time I didn't consider p6 to be a Perl language :D | 21:33 | |
pilne | now *that* would be a fun inline module :p | ||
ingy 's mind is too bent already :( | |||
pilne | i love all the older smaller more-focused languages, and feel that perl, and perl6 have done the most when it comes to learning from those languages (well, moreso perl6, but for it's roots, perl5 can do some incredible things). | 21:34 | |
timotimo | why don't we get some Inline::Forth? :) :) | ||
21:35
mcmillhj left
|
|||
ingy | I think I wrote a CPAN Forth module | 21:35 | |
cen't remember | |||
metacpan.org/pod/Pegex::Forth | |||
21:35
perlpilot left
|
|||
Xliff | Someone mentioned Haskell? | 21:35 | |
YIKES! I'm outta here! ;) | 21:36 | ||
It's Friday anyways. | |||
ingy | Xliff: Perl6 came from Haskell! | ||
21:36
lizmat joined
|
|||
Xliff | ingy: Perl6 is less Haskelly than... Haskell | 21:36 | |
ingy | TimToady was said "People say that Perl 6 is Haskell's scripting language. I say that Haskell is Perl 6's functional language." | 21:37 | |
*once said | |||
japhb | timotimo: As a (years ago) Forthwright, I have to ask: Why would you want an Inline::Forth? Its use cases are pretty much diametrically opposed to Perl 6's. | 21:38 | |
ingy | at least that's what I remember (which isn't that much these days) | ||
timotimo | you're right, it was a little facetious | ||
ingy | japhb: Perl never asks Why... :) | 21:39 | |
Perl asks Why not...! | |||
21:39
mcmillhj joined
|
|||
pilne | acme anyone? (: | 21:39 | |
ingy | for better or worse. | ||
(or best) | |||
timotimo | a perl6-based forth should be called sixth | 21:40 | |
ingy | Forx | ||
japhb | Now, doing a teaching version of Forth with a debugger and visual editor and all that, written in Perl 6, that could be fun. | ||
lizmat | perltricks.com/article/on-sigils/ # also about Perl 6 | 21:41 | |
news.ycombinator.com/item?id=14462863 ^^^ HN comments | 21:45 | ||
Xliff | ??? | 21:47 | |
$ is "no type constraint"? | |||
According to that sigils article. | |||
moritz | what type constraint do you think that $ implies? | 21:48 | |
Xliff | Well. This is probably more Perl5 constraint. But I always thought of $ as a singular object or reference. | 21:49 | |
s/Perl5 constraint/Perl5 thinking/ | |||
@ isn't singular. | |||
% isn't either | 21:50 | ||
timotimo | stacks and queues are totally provided natively by perl5 though? | ||
Xliff | You can implement them with @ | 21:51 | |
pilne | singular/plural isn't really a "type" | ||
timotimo | i wouldn't say "can implement them" | 21:52 | |
by using .push and .shift you have a queue | |||
by using .push and .pop you have a stack | |||
Xliff | Exactly. | ||
timotimo | more like "you can ignore parts of @ to have a stack/queue" | ||
Xliff | LOL | ||
Fair enough. | |||
pilne | $, @, and % are more about the shape of the data being held, not what that data is made of. | ||
b2gills | a $ containing a @, contains a single @ value | 21:53 | |
Xliff | ^^ THIS | ||
pilne | makes sense to my brain | 21:54 | |
timotimo | i find the paragraph about variables with "the same name but different sigils" really confusing or misleading | ||
pilne | hell a $ containing a @ that contains %s still makes sense | ||
i try to avoid same name with different sigils, just cuz i can do it don't mean i should. | |||
timotimo | it's not about "the way the variable is stored in the namespace" | 21:55 | |
$foo and @foo are stored the exact same way in the namespace | |||
Xliff | pilne: But in that case, the $ still contains a singular @ value | ||
21:56
ChoHag joined
|
|||
pilne | yeup, i've never had a problem with that notion | 21:56 | |
21:57
mcmillhj left
|
|||
pilne | although using $x = @array to get the length of an arrray (context?) in perl5 is something i still see as one of those "wow cool" things but still trips me up sometimes | 21:57 | |
and lets not mention how i put $ instead of $_ twice the other day when working on some rosetta code for perl6.... | |||
ugexe | there is always $x += @array | 21:58 | |
pilne | lol | 21:59 | |
timotimo | and also, the paragraph above the OrderedHash.new code claims "if the sigil truly were an interface only in perl6 we could apply any of the sigils to the same variable" | 22:00 | |
but you *can* | |||
you just have to keep the name and put a sigil in front | |||
i.e. not my $ordered, then %ordered and @ordered | |||
but my $ordered, then %$ordered and @$ordered | |||
this really grinds my gears a little | |||
moritz | oops, midnight coming around suddenly. Time for sleep here :-) | 22:04 | |
22:05
MasterDuke joined
|
|||
timotimo | gnite moritz :) | 22:06 | |
22:11
mcmillhj joined
|
|||
timotimo | can someone reach david farrell? | 22:13 | |
22:15
astj joined,
mcmillhj left
22:20
astj left
22:21
skids left
|
|||
pilne | i wonder if i'd bugger up perlbrew trying to install two versions of perl simultaneously? | 22:21 | |
22:23
mcmillhj joined
|
|||
[Coke] | I've used perl 6 for a $dayjob script that is still in production | 22:28 | |
22:28
cgfbee left
|
|||
Xliff | pilne: Have two .rakudobrew directories. | 22:28 | |
[Coke] | (and some one offs to extract data from .docx) | ||
Xliff | .rakudobrew and .rakudobrew2 ... repeat for as many versions as you need. | 22:29 | |
[Coke]: What did you use to extract data from .docx? | |||
22:29
geekosaur left,
cgfbee joined
|
|||
pilne | nahhhhh i'll just try and focus my nearly non-existent patience (: | 22:30 | |
22:31
geekosaur joined
|
|||
Xliff | pilne: You're (patience's) funeral. :> | 22:31 | |
22:31
DrForr_ joined,
pochi joined
|
|||
pilne | LOL | 22:31 | |
22:31
zengargo1le joined
22:32
grondilu_ joined,
sivoais_ joined
22:34
mcmillhj left
22:36
Cabanossi left
22:37
jantore_ joined
|
|||
[Coke] | Xliff: don't have access to the repo atm, but basically: unzip the .docx and dig through the xml | 22:38 | |
22:39
Cabanossi joined
22:40
jantore left,
pochi_ left,
DrForr left,
sivoais left,
kent\n left,
bonsaikitten left,
araraloren left,
xiaomiao joined
|
|||
timotimo | one of perlbrew's features is having multiple perl5 versions installed and easily switching between them, isn't it? | 22:40 | |
22:40
Some-body_ joined,
araraloren joined
|
|||
[Coke] | aye. | 22:40 | |
22:41
kent\n joined,
Some-body_ is now known as DarthGandalf
22:42
simonm left
22:44
grondilu left,
zengargoyle left
|
|||
pilne | yes, i was just wondering if it would barf if i used two terminals to install two different versions at the same time | 22:45 | |
22:46
simonm joined
|
|||
timotimo | Xliff: what. rakudobrew's feature is to have multiple rakudo versions installed at the same time and switch with a single command | 22:49 | |
22:50
nadim left
|
|||
pilne | i think there was a bit of a misunderstanding as to what I was trying to do earlier. | 22:53 | |
22:56
lizmat left,
troys is now known as troys_
|
|||
Xliff | timotimo: Oh. I've never used that feature so I didn't know. | 23:02 | |
Change of topic. Is there a ^remove_method method in the MOP? | |||
timotimo | don't think so, no | 23:03 | |
Xliff | Crud. | 23:04 | |
So if I have a dynamically created method x() on an object. | |||
And I want to change the definition of x()... do I still use ^add_method and ^compose? | |||
timotimo | change the definition of it, eh ... | 23:05 | |
Xliff | yeah, eh | ||
timotimo | really, i'd probably use wrap on the routine object | ||
Xliff | "use wrap" | ||
??? | |||
Is there a helpful linky that explains that? | 23:06 | ||
timotimo | you use find_method and call .wrap(-> some-signature-or-something { new code }) | ||
normally you'd be calling to the original function inside the wrapper | |||
but you can abuse this to replace methods | 23:07 | ||
Xliff | And is this abusable behavior going to stick around, or is a later version of Rakudo going to close that hole? | 23:08 | |
Like... say.... 6.e? | |||
timotimo | i think you're supposed to have to "use soft" for this to work | 23:09 | |
Xliff | perl6advent.wordpress.com/2011/12/...rprofiler/ | 23:12 | |
^^ Something like that... but it doesn't use .wrap | |||
timotimo | yeah that changes how methods are returned from lookup | ||
Xliff | OK. So it looks like my FALLBACK method, which adds methods based on certain conditions, will need to handle all use cases in the method being added. | 23:14 | |
*Whee* | |||
I was hoping to just define the useful method when data existed and just have a dummy method when it didn't. | |||
Then I added the ability to load data at run time. | 23:15 | ||
timotimo | ah, hmm | ||
Xliff | Which means that the methods that were set to the dummy routine might then become available, later. | ||
timotimo | oh, hm. | ||
Xliff | I was hoping I could check the instance for all of the dummy methods and replace them. | ||
23:15
wamba left
|
|||
timotimo | watch out, though, instances don't have their own method tables and such | 23:16 | |
Xliff | Erp! | ||
timotimo | you'll want to mix in roles for that | ||
Xliff | so: class A { my class B {}; has B $!b; }; | 23:17 | |
Class B will have same method tables across each instance of A? | |||
timotimo | yup | ||
the method table is a property of the type | |||
Xliff | EEP! | ||
OK, but that doesn't hold true for Roles? | 23:18 | ||
(but if method table is property of the type... then that doesn't make sense.) | 23:19 | ||
timotimo++ # Gives me something to think about. | 23:21 | ||
Now... back to my regularly scheduled drining. | |||
s/drining/drinking/ | |||
pilne | ya'll are definitely further down the rabbit hole than I am | ||
Xliff | And if I was cogent enough to make that correction... I have not drunk enough! | ||
pilne | a nice craft beer or 3 sounds good for tonight | ||
23:21
Cabanossi left
23:24
Cabanossi joined
|
|||
timotimo | you can create roles dynamically through the MOP | 23:24 | |
23:26
setty1 joined
|
|||
Xliff | timotimo: OK. That is something. | 23:32 | |
timotimo | and by parameterizing a non-dynamic role you can also do some stuff | ||
Xliff | However I think I may just re-implement things so that the dynamic methods Do The Right Thing, regardless of whether the data exists or not. | 23:33 | |
Maybe when I understand more about Roles and their dynamic-ness I will write something that takes advantage of it. | |||
Any links on that particular subject would be good. :) | 23:34 | ||
Thanks. | |||
timotimo | oof | ||
23:57
labster joined
23:59
setty1 left
|