»ö« 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.
tbrowder how so? 00:00
AlexDaniel shell(“mkdir -p $whatever”), where $whatever can be $(rm yourimportantfile) 00:01
you can try jumping through the hoops with some module that will attempt to quote things in your variable, but why bother? 00:02
in perl 5 you'd use system() with multiple args, in perl 6 you use run
tbrowder um, i don't think shell mkdir will work if there is a file with same name
AlexDaniel and you're safe, almost!
tbrowder: the problem is not in mkdir. The problem is that you've just passed an arbitrary string into your shell and this string can contain anything 00:03
it can delete all your files or whatever 00:04
tbrowder i understand the security concerns mostly, but what options are there when you need to do it?
AlexDaniel system('mkdir', '-p', '--', $path) # perl 5
run ‘mkdir’, ‘-p’, ‘--’, $path # perl 6 00:05
00:05 telex left 00:06 travis-ci joined
travis-ci Doc build errored. Wenzel P. P. Peppmeyer 'provide example for run' 00:06
travis-ci.org/perl6/doc/builds/203273107 github.com/perl6/doc/compare/3085d...33f5e85200
00:06 travis-ci left
IOninja mkdir $path # perl 6 00:06
AlexDaniel IOninja: yea sure, that's not the point :)
00:06 telex joined
geekosaur lots of p5 programmers never escape strings sent to the shell. lots of p5 programs have potential security holes as a result, especially if used in a web context 00:06
AlexDaniel which is why I tried to make shell less available so hard 00:07
geekosaur got in the habit of religiously using Q even in quick one-offs, because p5's quotemeta just happens to do the right thing for POSIX shells
AlexDaniel geekosaur: it's not completely right, by the way
geekosaur (a little more than the right thing, but it can't introduce new problems)
AlexDaniel for example, it doesn't escape newlines correctly, if I'm not mistaken 00:08
geekosaur no, it screws up with single quoting, but usually I;'m using it in lieu of single quoting because the POSIX spec thereof has its own holes
00:12 ggoebel joined
AlexDaniel and note that if you're on the safe side and you always use run, you can still screw it up badly if you omit ‘--’ 00:14
geekosaur yep, but that's only distantly related (it's not *shell* quoting) 00:15
AlexDaniel yes yes 00:16
that's correct
ZzZombo hum... what exactly is QAST in slangs for? I seem to be missing something from the docs gfldex gave me regarding them. 00:20
00:22 xinming left 00:23 xinming joined
IOninja ZzZombo: search Day 1 for QAST: edumentab.github.io/rakudo-and-nqp-...ls-course/ 00:24
00:26 retupmoca joined
tbrowder AlexDaniel: ok, say i commit to using run, is it ok to form the complete cmd string first, then use .words to form the array to feed to run? 00:40
AlexDaniel tbrowder: most likely not
tbrowder: store your arguments in an array if you have to 00:41
all these problems come from the idea that you put your stuff into one string and then somehow attempt to split it (whether by shell or yourself). Just keep them separate all the way through 00:43
00:45 aborazmeh joined, aborazmeh left, aborazmeh joined 00:46 wamba1 left 00:49 IRCFrEAK joined, IRCFrEAK left 00:51 mawkish__ left, mawkish__ joined 00:54 mawkish__ left 00:55 mawkish__ joined 00:59 mawkish__ left, mawkish__ joined 01:03 mawkish__ left, mawkish__ joined 01:06 ZzZombo left 01:16 bolangi left 01:17 mawkish__ left, mawkish__ joined 01:23 bolangi joined 01:27 mawkish__ left, mawkish__ joined
BenGoldberg s: ((use NativeCall), (Pointer[Str]))[1], 'new', \() 01:36
SourceBaby BenGoldberg, Sauce is at github.com/rakudo/rakudo/blob/c1a0...0EFEE885A1 (NativeCall::Types)#L21
BenGoldberg ???
01:36 cibs left
timotimo that ... is not a link that works 01:37
AlexDaniel :D
01:38 cibs joined 01:48 kanishka left
BenGoldberg m: my $s = "a_b"; my $b = "B".lc; $s ~~ s/_?$b//; dd $s; 01:51
camelia Str $s = "a"
BenGoldberg m: my $s = "a_b"; my $b = "B"; $s ~~ s/_?$b.lc//; dd $s;
camelia Str $s = "a_b"
BenGoldberg m: my $s = "a_b"; my $b = "B"; $s ~~ s/_?{$b.lc}//; dd $s; 01:52
camelia Str $s = "a_b"
BenGoldberg m: my $s = "a_b"; my $b = "B".lc; dd $s ~~ s/_?$b//; dd $s;
camelia Match.new(ast => Any, list => (), hash => Map.new(()), orig => "a_b", to => 3, from => 1)
Str $s = "a"
BenGoldberg m: my $s = "a_b"; my $b = "B"; dd $s ~~ s/_?{$b.lc}//; dd $s;
camelia Match.new(ast => Any, list => (), hash => Map.new(()), orig => "a_b", to => 0, from => 0)
Str $s = "a_b"
BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/_?{$b.lc}//;
camelia Bool::True
BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/_? {$b.lc}//; 01:53
camelia Bool::True
BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/_? {$b.lc}//; dd $s;
camelia Bool::True
Str $s = "a_b"
BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/a_?//; dd $s; 01:54
camelia Bool::True
Str $s = "b"
BenGoldberg m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/$b_?//; dd $s;
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$b_' is not declared
at <tmp>:1
------> 3 $s = "a_b"; my $b = "a"; dd so $s ~~ s/7⏏5$b_?//; dd $s;
BenGoldberg m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/{$b}_?//; dd $s;
camelia Bool::True
Str $s = "a_b"
BenGoldberg m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/{$b} _?//; dd $s;
camelia Bool::True
Str $s = "a_b"
BenGoldberg wants to know why that's not doing what he's expecting it to do. 01:55
01:57 bladardle left
geekosaur m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/"$b" _?//; dd $s; 01:57
camelia Bool::True
Str $s = "b"
BenGoldberg Ok, thanks.
AlexDaniel m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/$b _?//; dd $s; 02:01
camelia Bool::True
Str $s = "b"
AlexDaniel m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/[$b]_?//; dd $s; 02:02
camelia Bool::True
Str $s = "b"
AlexDaniel m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/<{$b}> _?//; dd $s; 02:03
camelia Bool::True
Str $s = "b"
BenGoldberg m: my @args = 1..3; say @args.fmt: "%d,%03d,%3d" 02:31
camelia Your printf-style directives specify 3 arguments, but 1 argument was supplied
BenGoldberg m: my @args = 1...3; say @args.fmt: "%d,%03d,%3d"
camelia Your printf-style directives specify 3 arguments, but 1 argument was supplied
BenGoldberg m: my @args = 1..3; say @args.elems
camelia 3
AlexDaniel m: my @args = 1..3; say sprintf "%d,%03d,%3d", @args 02:33
camelia 1,002, 3
AlexDaniel BenGoldberg: you want [s]printf, not fmt
BenGoldberg Yeah, I realized that. Silly me, not reading the docs ;)
AlexDaniel nowadays the docs are pretty good, by the way 02:34
BenGoldberg True, that.
AlexDaniel m: my @args = 1..4; say sprintf "%d,%03d,%3d", @args 02:36
camelia Your printf-style directives specify 3 arguments, but 4 arguments were supplied
AlexDaniel m: my @args; say sprintf "%d,%03d,%3d", @args
camelia Your printf-style directives specify 3 arguments, but no argument was supplied
AlexDaniel wonders what is going to happen if an array with negative size is passed…
c: 2016.02 my @a[-9223372036854775808,-2]; say sprintf "%d,%03d,%3d, @a 02:39
committable6 AlexDaniel, gist.github.com/6e516278130b3dbb02...00a2e71735
AlexDaniel c: 2016.02 my @a[-9223372036854775808,-2]; say sprintf "%d,%03d,%3d", @a
committable6 AlexDaniel, ¦«2016.02»: Your printf-style directives specify 3 arguments, but no argument was supplied␤ «exit code = 1»
AlexDaniel awwwwwwwwwwwwww 02:40
wait
but where's the line number
ah, ok, RT #130506
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130506
02:45 ilbot3 left 02:48 ilbot3 joined, ChanServ sets mode: +v ilbot3 03:06 AlexDaniel left 03:13 adu joined 03:15 aborazmeh left 03:30 noganex joined 03:33 noganex_ left 03:55 madgoat joined, madgoat left 03:59 MasterDuke left 04:22 quester joined 04:24 resol joined
BenGoldberg m: sub test { Proxy.new: GET => { say "in get" } }; my $test := test; say $test for 1..3; 04:29
camelia Required named parameter 'FETCH' not passed
in sub test at <tmp> line 1
in block <unit> at <tmp> line 1
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" } }; my $test := test; say $test for 1..3;
camelia Required named parameter 'STORE' not passed
in sub test at <tmp> line 1
in block <unit> at <tmp> line 1
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; my $test := test; say $test for 1..3;
camelia in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
True
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
True
in get
in get
in get…
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; my $test := item test; say $test for 1..3;
camelia in get
in get
in get
True
True
True
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; const foo = test; say foo for 1..3; 04:30
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix = instead
at <tmp>:1
------> 3ORE => { say "in store" } }; const foo =7⏏5 test; say foo for 1..3;
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; const foo = test(); say foo for 1..3;
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix = instead
at <tmp>:1
------> 3ORE => { say "in store" } }; const foo =7⏏5 test(); say foo for 1..3;
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant foo = test(); say foo for 1..3;
camelia in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
True
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
in get
True
in get
in get…
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant foo = item test(); say foo for 1..3;
camelia in get
in get
in get
True
True
True
04:30 resol left
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant foo = item test(); foo = 5; 04:31
camelia in get
in get
in get
Cannot modify an immutable Bool
in block <unit> at <tmp> line 1
04:31 resol joined
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant Int foo = item test(); foo = 5; 04:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3RE => { say "in store" } }; constant Int7⏏5 foo = item test(); foo = 5;
BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; Int constant foo = item test(); foo = 5;
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3t" }, STORE => { say "in store" } }; Int7⏏5 constant foo = item test(); foo = 5;
expecting any of:
infix
infix stopper
s…
04:45 grondilu left
adu hi BenGoldberg 04:47
BenGoldberg Hello. 04:48
adu how goes? 04:49
04:53 adu left
[Coke] gfldex: I think you committed bdf8ca8c - why did you commit so many failing code snippets? 04:55
BenGoldberg is writing a perl6 plugin for his favorite irc client, hexchat.
BenGoldberg is wondering how to intercept prints to stdout, so they get printed to the window instead of the bitbucket. 04:57
Geth doc: a9b7d1e04f | (Will "Coke" Coleda)++ | doc/Type/Pair.pod6
remove trailing whitespace
04:58
doc: b62e25b2b4 | (Will "Coke" Coleda)++ | doc/Type/Any.pod6
Skip all the new broken placeholder sigs

These skips should be removed as part of completing the TODO
04:58 Cabanoss- joined
[Coke] BenGoldberg: see github.com/jaffa4/string-stream 04:59
04:59 resol left
BenGoldberg What I meant was, do I just assign to $*OUT ? 05:00
05:00 awwaiid joined 05:01 Resol joined 05:02 Cabanossi left, Cabanoss- is now known as Cabanossi
[Coke] BenGoldberg: Yes - the README shows an example of how to do it for $*IN 05:04
Geth doc: 5929f94fab | (Will "Coke" Coleda)++ | 2 files
learn new words
05:13 labster left 05:16 wamba1 joined 05:36 travis-ci joined
travis-ci Doc build passed. Will "Coke" Coleda 'learn new words' 05:36
travis-ci.org/perl6/doc/builds/203325603 github.com/perl6/doc/compare/b62e2...29f94fab15
05:36 travis-ci left, ZzZombo joined, ZzZombo left, ZzZombo joined
samcv yay new words 05:40
05:43 travis-ci joined
travis-ci Doc build passed. Will "Coke" Coleda 'Skip all the new broken placeholder sigs 05:43
travis-ci.org/perl6/doc/builds/203324399 github.com/perl6/doc/compare/4a33f...2e25b2b42c
05:43 travis-ci left
[Coke] When poking at pod objects, can you get back at the original line number the text came from?? 05:44
I was hopig it'd be in the (e.g.) Pod::Block::Code object.
*hoping
05:54 obfusk_ left 05:57 curan joined 06:06 holyghost joined, Todd joined
Todd Hi All 06:06
I am confused as to how to get the local data and time. 06:07
samcv m: say $dt.now 06:08
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$dt' is not declared
at <tmp>:1
------> 3say 7⏏5$dt.now
samcv m: say DateTime.now
camelia 2017-02-20T07:08:27.631597+01:00
samcv m: say time
camelia 1487570920
samcv m: say now
camelia Instant:1487570960.465280
06:08 holyghost left
samcv Todd, seems like you're looking for DateTime 06:08
Todd Oh that was easy. Thank you! 06:09
samcv :)
m: my $now = DateTime.now(formatter => { sprintf "%02d:%02d", .hour, .minute }); say $now 06:10
camelia 07:10
samcv Todd, you can subtract DateTime objects too
Todd Cool. What I wanted was to put the time on to a report I was generating. The on line DateTime had my head spinning 06:11
samcv but i think that just gets seconds
the doc page you mean?
masak Todd: any way you know we could improve the docs in this case? 06:12
m: say DateTime.now.timezone 06:13
camelia 3600
Todd docs.perl6.org/routine/DateTime
masak that's the URL, yes :)
what part of it had your head spinning?
Todd was where I was at. An improvement would be to have a beginners section and then an advanced section. What I saw blew my mind
Jumping right into "class" is a refresher for those that already knwo what is going on. 06:14
masak how about docs.perl6.org/type/DateTime -- probably the page you tried to end up on 06:16
Todd that is better, but ... 06:19
06:19 faraco joined
faraco howdy 06:19
Todd method DateTime(--> DateTime), I have no idea what is meant by -->DateTime. Is it calling itself?
And, say Date.new('2015-12-24').DateTime what is that all about. Why twice and why is there a date in single quotes. 06:20
This is what blows a beginner's mind
Need a beginners section too
06:21 faraco left
[Coke] --> is how to specify the return type in the signature 06:23
(--> is searchable on the site, btw.) 06:24
Todd And to a dumb ass like myself, that means nothing. That is why I need a beginners section before jumping into the complicated stuff.
[Coke] we definitely need topics for beginners. (the individual class pages are probably not going to be those pages) 06:25
For now, feel free to ask questions here.
Todd Look back in this log. I asked how to do it as I was confused. Someone answered
perl6 -e 'say DateTime.now;'
It was that stinkin' easy!
06:26 mawkish__ left
Todd I might be a bit of a hard case. I can not learn from takihg courses. My head hits the table. The only way I learn (programming) is to actually code something I need. (I do have a background in serveral old languages, such as pascal and modula2. I code a lot in bash too.)) 06:28
And one example trumpts 1000 words 06:29
While we are on the subject, if I search for perl 6 stuff, I get swamped with perl 5 stuff. Be nice if there was a way around that 06:33
BenGoldberg Search for "perl6" instead of "perl 6"
Todd I usually go to docs.perl6.org/ and use their search. But sometimes the answer is too compliated for a beginner 06:34
That is what I do
BenGoldberg hmms.... 06:35
Todd duckduckgo.com/?q=perl6+datetime&a...a=software
gfldex Todd: you are talking to your Perl 6 search engine right now
Todd is a search for datetime
BenGoldberg So, what's a question which, on the docs.perl6.org site, has an overly complicated answer?
Todd yes I am. Something you'd like me to try?
docs.perl6.org/routine/DateTime 06:36
is todays confusing result. This is a refreshed for those who already know what they are doing. It lacks a begeinners section 06:37
BenGoldberg It is a little bit confusing. The web site lets you search for methods, classes, and lots of other types of things.
It's not uncommon for a class's method to have the same name as another class.
The method for taking a Date object, and creating a DateTime object out of it, is named DateTime. 06:38
Geth doc/coke/examples: e4c8c21cdc | (Will "Coke" Coleda)++ | 2 files
refactor so extract-pod can be used elsewhere
06:39
doc/coke/examples: 1610498482 | (Will "Coke" Coleda)++ | 3 files
Run one example per test, not one file

For #1194
  * Eliminate separate example extraction step
  * Use the same extract-pod mechanism used by htmlify
   (gets us the same precompilation for unchanged source)
  * When a test fails, output the original code snippet
   (Line number is desired, but isn't part of the Pod object)
Todd Got to go. Thank you all for the help!
BenGoldberg When you type into the search field on docs.perl6.org, many things appear, and we don't *yet* have a way of putting the most relevant things near the top.
06:39 Todd left
samcv ^ 06:40
i hate when i type in the word verbatim, and i get like 30 results
with the one i want at the bottom or just some random stop
*spot
masak the word "verbatim" gives 30 hits? that doesn't sound quite right. 06:41
BenGoldberg We should sort by lexical distance, perhaps?
masak samcv: more seriously though, sounds like there ought to be some sort of relevance ordering
samcv i type in grep and it shows one of the results as `ge`
which is like 2 letters different from grep
seems it shouldn't show that result imo 06:42
no not that word
i used the word verbatim as a word, not as that word verbatim verbatim
06:42 wamba1 left
samcv i mean making exact matches show at the top should be not hard either? 06:43
Geth doc: coke++ created pull request #1207:
Coke/examples
BenGoldberg Also, there's the PageRank algorithm, and a simple sort by popularity.
[Coke] there is a ticket for improving the search results ordering, yes. 06:44
(exact matches being the first part of that, yes)
BenGoldberg Basically, all the things which good search engines use in deciding what pages come up when someone types something, we can do.
[Coke] hurls github.com/perl6/doc/labels/search
having a "see all" would be nice (needs dynamic search or a search results page, which is one of the tix) 06:45
06:45 bwisti left
samcv so `ab` and `bc` have the same lexical distance from `abc` is that correct? 06:46
BenGoldberg Yes. 06:47
[Coke] I think "have a lexical distance from 'abc' which is less than some constant" is accurate and less strict.
masak I think "is it an exact match on a method name? then bring it to the top" would do wonders 06:48
[Coke] masak: #247
06:48 jonas1 joined
[Coke] also, feedback on the new examples PR welcome, thanks. 06:50
06:50 RabidGravy joined
[Coke] (also we're testing 3466 examples in the source, whee) 06:51
06:55 ufobat joined 06:56 mawkish__ joined 06:58 bwisti joined, darutoko joined 07:00 CIAvash joined 07:02 quester left 07:03 mawkish__ left, ccakes_ is now known as ccakes, mawkish__ joined 07:08 Actualeyes left 07:10 labster joined, sjohnson left 07:13 mawkish_ joined, travis-ci joined
travis-ci Doc build passed. Will "Coke" Coleda 'Run one example per test, not one file 07:13
travis-ci.org/perl6/doc/builds/203338032 github.com/perl6/doc/compare/e4c8c...1049848273
07:13 travis-ci left 07:15 mawkish__ left 07:18 wamba1 joined 07:23 BenGoldberg left, bjz joined, mawkish_ left, Actualeyes joined, mawkish_ joined
samcv imo would be nice if `ab` had a closer score than `bc` 07:26
if it matched the start of something could weight a little higher
TimToady m: my %r; push %r <== a => 42, |('b' X=> 72, 89), |('c' X=> 1, 2, 3, 4); say %r 07:28
camelia {a => 42, b => [72 89], c => [1 2 3 4]}
TimToady IOninja: note you can subvert the named param thing with feed operators as well 07:29
07:33 abraxxa joined 07:36 ccakes left 07:38 ccakes joined 07:39 mawkish_ left 07:40 mawkish_ joined 07:41 abraxxa left 07:42 abraxxa joined 07:43 mawkish_ left 07:44 mawkish_ joined, ZzZombo left 07:46 vike left 07:47 mawkish_ left 07:48 mawkish_ joined 07:49 mawkish_ left 07:50 bolangi left 07:52 bolangi joined 07:53 vike joined
masak arnsholt: huh. I had no idea that C and Smalltalk were created in the same year. 07:55
well, hm. maybe that's bending it a little bit. but it could be argued. 07:56
08:00 mr-foobar joined
arnsholt Oh, fun! 08:01
I usually say that Smalltalk is advanced future technology from the 1980s
(Much like Unicode) 08:02
masak wow, and Coq is older than Haskell. didn't know.
arnsholt Possibly even neater!
masak arnsholt: back in the 1990s I heard that string theory was science from the 21st century that accidentally ended up in the 20th.
haven't heard that much lately though :P
arnsholt =D 08:03
masak arnsholt: advanced future technology, yes. but I remember delving into the Smalltalk metamodel as jnthn was reading the "Art of the Metaobject Protocol"
and my predominant thought was how inheritance-based it looked, and how that made it kind of rigid in a bad way 08:04
imagine doing the same with roles, I thought :)
arnsholt Yeah, I do miss roles occasionally 08:08
08:14 agentzh left 08:23 zakharyas joined 08:29 bwisti left 08:31 khw left
masak does the MOP allow you to emulate them? 08:35
ISTR roles (though called "traits") were invented in the Smalltalk continuity 08:36
arnsholt Yeah, you can probably bolt it on somehow
08:36 rindolf joined
arnsholt Yeah, I think I see how even 08:39
Your class object can have an initializer (MyClass class>>initialize), which I *think* should be called at appropriate times
You can then compose in your roles there 08:40
Although you may have to take care to get things right when a class gets recompiled
08:41 wamba1 left 08:43 cibs left 08:45 dogbert17 left, cibs joined 09:04 andrzejku joined 09:06 dakkar joined 09:12 kyan left
andrzejku hi guys 09:15
:)
DrForr Mornin'. 09:16
andrzejku DrForr, I think Perl6 got capabilities for IoT 09:17
09:18 cschwenz joined
DrForr Yay! 09:19
andrzejku yeah
:D
I got an idea to make somekind of framework in Perl6 to make Perl6 services and protocol for IoT using XMPP 09:20
and I think that's enough
the next thing is what's the way to call perl from C++ 09:23
09:26 wamba1 joined 09:30 cschwenz left
andrzejku is that even possible to embed perl6? 09:34
09:38 ZzZombo joined, ZzZombo left, ZzZombo joined
ZzZombo Remind me if there is a way to make associative container with preserved order of insertion? 09:44
09:57 bjz_ joined
jnthn andrzejku: I believe Inline::Perl6 is doing it somehow; I think the majority of work is done Perl 6 side using NativeCall 09:58
Woodi andrzejku: re embading perl6: I think not yet. but you can always use cooperating proceses via network, file or pipe 09:59
09:59 bjz left 10:02 ChoHag joined, TEttinger left
Woodi oops :) 10:02
andrzejku: don't listen to me then :)
ZzZombo: github.com/zostay/perl6-ArrayHash 10:03
andrzejku hi Woodi :D
didn't see you for a long time
ZzZombo m: make 42;say $/
camelia Cannot bind attributes in a Nil type object
in block <unit> at <tmp> line 1
ZzZombo y u no maek 42??? 10:04
Woodi andrzejku: usually I'm in background, having output from #here :)
ZzZombo How the fuck does github.com/tony-o/perl6-slang-sql/...QL.pm6#L71 work? 10:08
m: class A { method foo { self."!bar"() };method !bar { say 'BARRED!' } };my $a=A.new;say $a.foo;
camelia No such method '!bar' for invocant of type 'A'
in method foo at <tmp> line 1
in block <unit> at <tmp> line 1
10:12 mulk[m] left, Matias[m] left 10:15 nowan left 10:18 nowan joined 10:19 obfusk joined 10:24 pyrimidine left 10:31 cibs left 10:33 cibs joined 10:38 bjz_ left, astj_ joined, astj left 10:45 bjz joined 10:46 wamba1 left 10:51 salva left 11:04 wamba1 joined 11:09 emeric left 11:10 espadrine_ joined 11:17 salva joined 11:22 CIAvash left
SmokeMachine m: class A { method foo { self!bar };method !bar { say 'BARRED!' } };my $a=A.new;say $a.foo; 11:22
camelia BARRED!
True
SmokeMachine m: class A { method foo { self!"bar"() };method !bar { say 'BARRED!' } };my $a=A.new;say $a.foo; 11:23
camelia BARRED!
True
11:23 espadrine_ left, pyrimidine joined
SmokeMachine ZzZombo: 👆 11:23
11:27 astj_ left, astj joined 11:28 astj left, astj joined 11:31 bolangi left 11:33 bolangi joined 11:37 lukaramu joined 11:43 itaipu joined 11:45 salva left 11:47 labster left 12:15 sivoais_ is now known as sivoais, sivoais left, sivoais joined 12:21 sufrostico joined 12:23 lep-delete left 12:25 poska joined
poska hey. anyone tried successfully running the Perl6 version of Inline::Python on Windows? 12:26
12:30 lep-delete joined
Geth doc: ee05bc96ef | (Tom Browder)++ | doc/Type/Proc.pod6
shell also creates Proc.new
12:33
12:40 jraglin joined 12:41 jraglin left
tbrowder .tell AlexDaniel i've started tweaking Proc docs based on discussions yesterday. what do think about adding a warning about the dangers of using either run or shell? if not in Proc, maybe in some other, more general place. 12:44
yoleaux tbrowder: I'll pass your message to AlexDaniel.
12:47 zakharyas left
dogbert11 .seen RabidGravy 12:48
yoleaux 14 Feb 2017 19:36Z <IOninja> dogbert11: do you get any warnings about Failures in DESTROY when running this code on 32-bit box? gist.githubusercontent.com/zoffixz...e2bb791e4a
14 Feb 2017 19:40Z <IOninja> dogbert11: previous URL seems busted; this one: gist.github.com/zoffixznet/b7fe891...4a664b2822
I saw RabidGravy 19 Feb 2017 18:20Z in #perl6: <RabidGravy> yeah
12:48 MasterDuke joined
dogbert11 .tell RabidGravy do you remember what test(s) you're running when you got SEGV's with Squirrel? (RT #129946) 12:49
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129946
yoleaux dogbert11: I'll pass your message to RabidGravy.
ZzZombo SmokeMachine: ?? 13:01
$/.'!make'($block);
it's not the same as $a!"bar".
13:02 zakharyas joined 13:05 ChoHag left
moritz $a!bar calls a private method 13:14
$a.'!make'() calls a method whose first character is a !
ZzZombo how the crow do you even make a method to start with '!'? 13:15
moritz through the MOP, for example 13:16
tbrowder .tell AlexDaniel it looks to me like the args for run (and now shell) are in the wrong order. also, run needs to be shown as a method. also the sig for method shell looks wrong (incomplete).
yoleaux tbrowder: I'll pass your message to AlexDaniel.
moritz $class.^add_method('look, funny chars in here', method () { say 42 }
)
IOninja nqp: class Foo { method !bar () { say(42) } }; Foo.new.'!bar'()
camelia 42
SmokeMachine is there any http client on ecosystem that works with unix socket? 13:17
moritz you mean talking HTTP over unix socket instead of TCP? 13:19
I'm not aware of one, though that doesn't mean much
13:20 araraloren joined
moritz I think our Apache does that, when you use mod_proxy with a socket 13:20
SmokeMachine moritz: yes... Im thinking of writing a docker api client... 13:24
I think im trying use docker:from<Python> first...
jnthn pondered doing a Docker client, then realized that yak would need shaving first... 13:25
moritz SmokeMachine: maybe investigate HTTP::UserAgent; it already does normal socket and SSL socket, maybe it's got the API already to plug in a custom socket
jnthn moritz: So far as I understand it (possibly incorrectly), we'd need to support domain sokcets
(at Perl 6 level)
SmokeMachine I searched by UNIX on its GitHub page... with no luck... 13:26
jnthn Guess I can see if I can sneak it in to IO::Socket::Async at some point...
SmokeMachine no luck installing Inline::Python... :( 13:27
13:31 lukiramu joined 13:35 lukaramu left
Geth doc: efe309a2b5 | (Tom Browder)++ | doc/Type/Proc.pod6
put $cmd arg in right place
13:36
13:36 rindolf left, newbie1 joined
IOninja m: my %h = :.abs with 5; say %h 14:01
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed initializer
at <tmp>:1
------> 3my %h = :7⏏5.abs with 5; say %h
expecting any of:
colon pair
IOninja awww, I wish this were a shortcut as well :)
timotimo oh, like abs => $_.abs?
IOninja Yeah :) 14:02
perlpilot
.oO( Why can't Perl just *know* what I want and do that?!? )
IOninja Yeah :)
Geth doc: bebafa50bf | (Tom Browder)++ | doc/Type/Proc.pod6
fix code format
14:03
14:03 poska left 14:06 sena_kun joined
sena_kun 14:06
IOninja 14:08
heh JSON::Tiny has a bug 14:10
star: use JSON::Tiny; say to-json [Inf, -Inf, NaN]
camelia [ Inf, -Inf, NaN ]
IOninja star: use JSON::Fast; say to-json [Inf, -Inf, NaN]
camelia [
{
"0": null
},
{
"0": null
},
{
"0": null
}
]
IOninja :S 14:11
timotimo what, again? 14:12
also, not "JSON::Tiny has a bug", but "JSON::Fast has a bug"
IOninja They both have bugs.
JSON ain't got Inf -Inf or NaN
timotimo timo@schmand ~/p/e/json_fast (master)> perl6 -Ilib -e 'use JSON::Fast; say to-json [Inf, -Inf, NaN]'
[
Inf,
jnthn Apparently null is the correct answer
timotimo -Inf,
NaN
]
IOninja I can't even fathom what JSON::Fast is doing.
timotimo oh F you, json :) :) :)
* 1fedaa3 - don't asplode when using to-json on a Num. (6 months ago) <Timo Paulssen> 14:13
that's what it is doing
can we get a newer json::fast into star?
do we have a simple "isnanorinf" thing? 14:14
IOninja nqp :) 14:15
timotimo right
what is the right answer for jsonifying -0e0?
IOninja .isNaN in Perl
dunno
IMO using Mojo::JSON as a reference is a good bet
samcv star-m: use JSON::Fast; say to-json([Inf, -Inf, NaN] 14:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')'
at <tmp>:1
------> 3JSON::Fast; say to-json([Inf, -Inf, NaN]7⏏5<EOL>
samcv star-m: use JSON::Fast; say from-json(to-json([Inf, -Inf, NaN]))
camelia [{0 => (Any)} {0 => (Any)} {0 => (Any)}]
Geth doc: 50c88b6d53 | (Tom Browder)++ | doc/Type/Proc.pod6
correct @args position, grammar
14:17
ZzZombo wtf is that JSON?
timotimo stop beating that dead horse
that was fixed 6 months ago
ZzZombo oh, it's converted back to Perl.
jnthn timotimo: www.ecma-international.org/publicat...ma-262.pdf page 507 14:18
"NaN and In伀氂inity regardless of sign are"
represented as the String null.
samcv I have taken to saving stuff using .perl since i can just load it without a module :)
timotimo thank you 14:19
samcv assuming i don't need another program to use it
timotimo mmyes, 伀氂.
jnthn uh...that copy paste went weird...what happend to the f? :D
timotimo probably a pdf that uses ligatures
jnthn It's an f in the PDF
haha, yes
IOninja Well, that's pretty sucky
I don't want nulls
timotimo set $*FIGHT_THE_POWER = "yes", and json_fast will print these as is 14:20
samcv (Note that these two in伀氂inite Number values are
produced by the program expressions +Infinity (or simply Infinity) and ‐Infinity.)
IOninja As is is broken. 14:21
Encode them as strings.
timotimo ugh, that's also weird
now a float turns into a string
14:21 skids joined
samcv jnthn, what's that you saying Inf and -Inf should be represented by null? 14:21
14:22 ChoHag joined
jnthn samcv: The ECMA standard that specifies JSON /o\ 14:22
samcv that's depressing. you lose information
jnthn (Link just above where I said it)
samcv no i'm looking at it
IOninja Yeah, JSON sucks.
14:23 itaipu left
IOninja Time to start a new standard. 14:23
stmuk_ YAML!
oh wait maybe JSON isn't so bad :P
samcv +Infinity and -Infinity is what the standard says produces infinity and -infinity 14:24
so idk
timotimo no, that's how you get that in javascript
samcv that's what i mean
but json specifies you totally lose all meaning. ugh
timotimo yes, it does 14:25
samcv sad
14:25 mr_ron joined
samcv P6ON 14:25
obviously the best object notation :)
IOninja "pee...six...on"
timotimo totally
with pair notation <3 14:26
IOninja :)
timotimo i love me some pair notation
IOninja Well, I'm going with .perl .EVAL for my thing. I need dem Infs
14:27 mr_ron left, huf left 14:28 mr_ron joined
stmuk_ EVAL is very slow .. p6doc uses it 14:28
ZzZombo Why panda > zef?
stmuk_ its a pity there isn't serialisation
IOninja ZzZombo: it isn't
sena_kun ZzZombo, zef > panda 14:29
ZzZombo oh, I meant the other way
stmuk_ actually wasn't there a moar serialisation or something branch once?
IOninja hm, yeah, EVALFILE is taking so long that I think it's stuck in a infiniloop
ZzZombo: because it's better,
samcv eval is so slow because it has to start up the whole parser again right? 14:30
ZzZombo what "rakudobrew rehash" is supposed to do?
sena_kun ZzZombo, zef's development is more lively + it has more features(afaik)
samcv what sena_kun said
ZzZombo yea, right 14:31
timotimo ZzZombo: it checks if there's any new scripts in "bin" folders and rebuilds the forwarder scripts
14:31 cibs left
ZzZombo where do I get that command then? 14:32
timotimo "get that command"? i don't understand 14:33
if you're not using rakudobrew at all, you don't need to do anything
ZzZombo that's what I was told to do, so IDK.
timotimo told by whom or what?
14:33 cibs joined
ZzZombo App::Mi6 is not installed. Please type the following in your command line: 14:33
panda update
panda install App::Mi6
rakudobrew rehash
Atom plugin fr P6 14:34
samcv what are you trying to use ZzZombo
timotimo ah
ZzZombo for*
samcv i didn't have much luck with that one
timotimo just ignore the rakudobrew thing
samcv ZzZombo, i would check this out github.com/samcv/Atom-as-a-Perl6-IDE
14:34 itaipu joined
samcv i made a really nice thing on good atom plugins for Perl 6 14:34
with instructions and everything
and atom-perl6-editortools still points to the old syntax highlighter :( 14:36
still tries to download the old one when i just tried to install it
IOninja 42s to EVALFILE a 72kb file with a dumped array in it :S 14:37
samcv :S
ZzZombo, you still there? 14:38
ZzZombo yes
samcv ok. you checking out that github i linked you to
ZzZombo yea
samcv should make sure language-perl6fe is uninstalled before installing the syntax highlighter, cause it will conflict 14:39
andrzejku hey
I create small PoC for Perl6 IoT 14:40
samcv if you really want to use atom-editortools check it out on github, and then run `apm link path/to/atom-perl6-editor-tools`
andrzejku github.com/damaxi/IoT if someone want to help me 14:41
DrForr andrzejku: Excellent!
andrzejku that would be greate :)
samcv and it'll install the git version which won't depend on the old syntax highlighter.
andrzejku but I know I always can count on you in Perl6 knowledge
DrForr Looks like a good idea, I *think* Perl6 can compile on RPi, though memory is probably going to be a bit of an issue. 14:44
Geth perl6.org: 4aba6334ed | (Samantha McVey)++ | source/whatever/index.html
Add a link github project on configuring Atom as a Perl 6 IDE
14:47
samcv will be good so more people can find that page from now on
ZzZombo ugh, "apm" is an unknown command. 14:48
14:54 andrzejku left 14:55 retupmoca left 14:56 wamba1 left 14:57 salva joined 15:00 curan left
ZzZombo Failed to activate the atom-perl6-editor-tools package 15:01
Cannot find module 'atom-space-pen-views'
samcv ^
15:01 itaipu left
samcv yeah that module doesn't work properly 15:02
that's why i uninstalled it :\
15:02 Actualeyes left
samcv are you on windows? 15:02
ZzZombo crap
yes
samcv ok that's why
ZzZombo what do you mean? 15:03
samcv apm == atom package manager
ZzZombo yea? 15:04
samcv it should be installed on windows though apparently
ZzZombo it's just wasn't on my PATH
15:04 huf joined
samcv ah ok 15:04
but regardless that plugin is broken.
ZzZombo it*
samcv at least any time I have ever tried it. but those plugins i linked you to should make using perl 6 fairly nice 15:05
15:05 wamba1 joined
ZzZombo yea, thanks! 15:08
15:08 itaipu joined
samcv i gotta go to bed all. night o/ 15:11
ZzZombo what's up with "item= Regex methods are slow but thorough -- they will look back in the string and really try." and others in docs.perl6.org/language/grammar_tutorial 15:12
?
doesn't seem right 15:13
15:13 AlexDaniel joined
sena_kun ZzZombo, should be fixed. It seems that there was =item2. 15:13
yes, the latest PR in this section did it. I'll fix it now. 15:15
15:16 Actualeyes joined
Geth doc: f98aa973b6 | Altai-man++ | doc/Language/grammar_tutorial.pod6
Fix item=

Should be =item instead.
15:18
sena_kun ZzZombo++ 15:19
ZzZombo great 15:21
thanks.
sena_kun ZzZombo, no problem, thanks for your report. \o/
ZzZombo how could I parse something like " this is a quoted string 1234!@!#!$\" that ends only here" in a grammar? 15:29
sena_kun ZzZombo, what result format do you expect?
ZzZombo that is, everything between " " is accepted except a newline, and \ can be used to escape the ". 15:30
sena_kun, whatever is inside the quotes.
as a string
IOninja m: '" this is a quoted string 1234!@!#!$\" that ends only here"' ~~ /'"' (.+?) <!before \\>'"'/; say $/[0] 15:31
camelia 「 this is a quoted string 1234!@!#!$\」
IOninja bah
m: '" this is a quoted string 1234!@!#!$\" that ends only here"' ~~ /'"' (.+?) <!after \\>'"'/; say $/[0]
camelia 「 this is a quoted string 1234!@!#!$\" that ends only here」
ZzZombo does . not match \n? I'm completely out of the loop with P6 regex... Somebody tell me go learn it already. 15:32
IOninja It does.
ZzZombo well, then one last thing is to exclude it. 15:33
IOninja use \N
15:34 khw joined
ZzZombo m: '"this is a quoted string 1234!@!#!$\" that ends only here"' ~~ /'"' (\N*?) <!after \\>'"'/; say $/[0] 15:35
camelia 「this is a quoted string 1234!@!#!$\" that ends only here」
ZzZombo m: '""' ~~ /'"' (\N*?) <!after \\>'"'/; say $/[0]
camelia 「」
ZzZombo fantastic
thanks a lot!
AlexDaniel m: ‘"this is a quoted string 1234!@!#!$\" that ends only here"’ ~~ /‘"’ ~ [<!after 「\」> ‘"’] (\N*?)/; say $/ 15:38
yoleaux 12:44Z <tbrowder> AlexDaniel: i've started tweaking Proc docs based on discussions yesterday. what do think about adding a warning about the dangers of using either run or shell? if not in Proc, maybe in some other, more general place.
camelia 「"this is a quoted string 1234!@!#!$\" that ends only here"」
0 => 「this is a quoted string 1234!@!#!$\" that ends only here」
yoleaux 13:16Z <tbrowder> AlexDaniel: it looks to me like the args for run (and now shell) are in the wrong order. also, run needs to be shown as a method. also the sig for method shell looks wrong (incomplete).
AlexDaniel m: ‘"this is a quoted string 1234!@!#!$\" that ends only here"’ ~~ /‘"’ ~ [<!after 「\」> ‘"’] (\N*?)/; say $0
camelia 「this is a quoted string 1234!@!#!$\" that ends only here」
AlexDaniel ZzZombo: another way to write it ↑
15:40 wamba1 left
IOninja m: say 「\」 15:41
camelia \
IOninja m: say '\'
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'"
at <tmp>:1
------> 3say '\'7⏏5<EOL>
expecting any of:
argument list
single quotes
term
IOninja m: say Q'\'
camelia \
AlexDaniel yep, it's weird. Most of the time you actually want 「」 and not ‘’
15:41 pmurias joined
IOninja m: say Q'\'' 15:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say Q'\'7⏏5'
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
IOninja must've been thinking of '' 15:42
pmurias =SORRY!=== Error while compiling <tmp>␤Two terms in a row␤at
<tmp>:1␤------> say Q'\'⏏'␤ expecting any of:␤ infix␤ infix stopper␤
postfix␤ statement end␤ statement modifier␤ …»
[16:42] [pmurias(+i)] [2:freenode/#perl6(+Cnt)]
[#perl6] =SORRY!=== Error while compiling <tmp>␤Two terms in a row␤at
<tmp>:1␤------> say Q'\'⏏'␤ expecting any of:␤ infix␤ infix stopper␤
postfix␤ statement end␤ statement modifier␤ …»
[16:42] [pmurias(+i)] [2:freenode/#perl6(+Cnt)]
sorry
IOninja heh
15:43 rindolf joined
pmurias blogs.perl.org/users/pawel_murias/2...-test.html - rakudo.js update 15:43
IOninja pmurias++ cool 15:45
sena_kun pmurias++, your work is awesome.
TimToady you can't really use <!after> like that and get away with it 15:48
what about \\" and \\\" and so on? 15:49
AlexDaniel .tell tbrowder I've created github.com/perl6/doc/issues/1208, but other than that it does not look too bad
yoleaux AlexDaniel: I'll pass your message to tbrowder.
AlexDaniel TimToady: nobody said that you can escape backslashes :)
but yes
15:49 eroux left
AlexDaniel .tell tbrowder the dangers can be documented in language/traps, maybe 15:50
yoleaux AlexDaniel: I'll pass your message to tbrowder.
TimToady ZzZombo: instead of using <!after>, it's usually better to do something like [ '\\' . | <-[ " \n ]> ]* 15:52
you could probably get away with [ '\\' . || \N ]*? '"' 15:53
TimToady has never used <!after> for anything useful, and it's a bit of an attractive nuisance... 15:55
MasterDuke pmurias++ 15:58
IOninja ah, right, TimToady++ 16:01
16:02 jonas1 left
Geth doc: titsuki++ created pull request #1209:
Add a concrete example of CStruct initialization
16:03
doc: fd1ad28777 | titsuki++ | doc/Language/nativecall.pod6
Add a concrete example of CStruct initialization
doc: c53899df49 | (Itsuki Toyota)++ | doc/Language/nativecall.pod6
Merge pull request #1209 from titsuki/add-cstruct-example

Add a concrete example of CStruct initialization
16:04 araraloren left, bwisti joined 16:08 sufrostico left
ufobat s: &trait_mod:<is>(:$default) 16:08
SourceBaby ufobat, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Variable '$default' is not declared␤at -e:6␤------> put sourcery( &trait_mod:<is>(:<HERE>$default) )[1];␤
16:09 sufrostico joined
ufobat could anyone help me with SourceBaby :-) i'd like to figure out the source for the is default trait 16:12
jnthn s: &trait_mod:<is>(:default)
SourceBaby jnthn, Something's wrong: ␤ERR: Cannot resolve caller trait_mod:<is>(:default); none of these signatures match:␤ (Mu:U $child, Mu:U $parent)␤ (Mu:U $child, :$DEPRECATED!)␤ (Mu:U $type, :$rw!)␤ (Mu:U $type, :$nativesize!)␤ (Mu:U $type, :$ctype!)␤ (Mu:U $type, :$unsigned!)␤ (Mu:U $type, :$hidden!)␤ (Mu:U $type, Mu :$array_type!)␤ (Mu:U $type, *%fail)␤ (Attribute:D $attr, |c is raw)␤ (Attrib
jnthn s: &trait_mod:<is>(Routine, :default)
timotimo right, you need to query the dispatcher for the candidate that fits
SourceBaby jnthn, Something's wrong: ␤ERR: 'Routine' cannot inherit from 'default' because it is unknown.␤ in block <unit> at -e line 6␤␤
jnthn heh, it's not passing that as a named for some reason...
timotimo i don't think you can do it without a defined Routine 16:13
jnthn Ohh
timotimo also, the s bot doesn't want you to do a call
jnthn s: &trait_mod:<is>(sub fo() { }, :default)
SourceBaby jnthn, Ehhh... I'm too scared to run that code.
jnthn haha
Yeah
timotimo s: &trait_mod:<is> \(&say, :default)
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( &trait_mod:<is><HERE> \(&say, :default) )[1];␤ expecting any of:␤ infix␤ infix stopper␤
timotimo s: &trait_mod:<is>, \(&say, :default)
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/80e0...ts.pm#L131
jnthn timotimo++
timotimo :)
16:14 sufrostico left 16:16 sufrostico joined
ufobat thanks! 16:17
timotimo YW
IOninja s: &trait_mod:<is>, \(sub {}, :default) 16:20
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/80e0...ts.pm#L131
IOninja Good bot!
IOninja pets SourceBaby
ufobat :) 16:21
16:29 zakharyas left
ufobat could i have a trait_mod:<is> that only applies to attributes of classes that implement a certain role? because the iplementation of this trait_mod would relay on methods and attributes of this role? 16:30
16:32 itaipu left
jnthn Attribute:D $a where $a.package.does(RoleName) perhaps 16:34
Or $a.package ~~ RoleName
timotimo having that in the signature as a constraint would mean that if the class doesn't implement that certain role, you'll get a very mysterious error message 16:36
so make sure to also give it a very general candidate that can provide a proper exception
ufobat okay thank you! :) 16:42
i'll play with that later! :)
sena_kun there was changes in roast lately that affected fudge, how the process of new test's adding looks like now? 16:46
16:48 araujo left
sena_kun nevermind me. 16:54
[Coke] titsuki ? 16:55
pmurias if I have a division operator from my bignum library that rounds towards zero how should I turn it into one that rounds down? (or am I forced to look at modulo) 16:56
[Coke] m: IntStruct.WHAT.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
IntStruct used at line 1
16:58 cale2 joined
cale2 howdy 16:58
.seen cale2
yoleaux You're right there.
cale2 .seen tony-o
yoleaux I saw tony-o 17 Feb 2017 20:30Z in #perl6: <tony-o> do you just need a CC to get an SSL cert for it or do you need the config done?
17:04 dustinm`_ joined 17:07 tony-o_ joined
Geth doc/coke/examples: 3499d0c47e | (Will "Coke" Coleda)++ | xt/examples-compilation.t
Count chunks from 1, not 0
17:08
sena_kun should I create a new test file exclusively for :dba adverb in modifier section? It doesn't fit well in other places. 17:09
17:09 dustinm` left, tardisx left, LeCamarade left, k-man left, andrewalker left, tony-o left, altLeCamarade joined, tardisx joined 17:10 k-man joined
pmurias anyone here wants to talk how nqp.js/rakudo.js should be built? (the hard part form me is how it should interacting with the npm) 17:10
s/talk/discuss/
17:11 andrewalker joined
Geth doc: a8feef1689 | (Tom Browder)++ | doc/Type/IO.pod6
tweak run words and examples
17:13
[Coke] pmurias, sure 17:16
pmurias it seems to me that nqp should have a package.json in the root of the repo 17:18
in addition to the one we have for the nqp-js-compiled-js 17:19
[Coke] ... ok, I can't help. :)
pmurias for rakudo.js I'm leaning towards having something like 'perl Configure.PL --backends=js --get-npm' that would just install a prebuilt nqp.js from the npm 17:23
jnthn A tad off-topic but someone here probably knows. :) In bash (or also using standard UNIX tools) is there a way to do 'some-command | tee foo.txt', but (a) also capturing stderr in foo.txt, (b) leaving both stdout/stderr intact (so 2>&1 before the | tee will not fly), and (c) not swallowing the exitcode of the original command like tee seems to? 17:25
I guess this also boils down to "can I redirect to a file and leave the output to the console intact"... 17:26
pmurias: Is there a reason not to have --gen-nqp just work out for the JavaScript backend? 17:27
(e.g. just bulid it)? 17:29
Since NQP updates relatively often, and the NPM build may lag, unless we are automatically publishing it
pmurias jnthn: --gen-nqp should work, OTOH that would require building the moarvm as I don't keep a prebuilt nqp-js-on-js in the nqp repo 17:35
timotimo jnthn: what happens if you tee with the append mode from two "processes"? 17:37
cale2 jnthn: kyclark.gitbooks.io/metagenomics/c...cises.html do a ctrl+F for "You can redirect errors into a file like so:"
17:38 dakkar left
timotimo like ((foo | tee -a foobar.txt) (somehow switch 1 and 2) | tee -a foobar.txt) (somehow switch 1 and 2 back) 17:38
ugexe i would think using a tee on stdout and a tee on stderr could somehow be made to handle it
timotimo sounds like we want a perl6 script that does that
because perl6 is good at that kind of stuff 17:39
ugexe run/shell :merge doesn't work yet
cale2 In the book example it shows `$ program 1>out 2>err` where stout gets printed to a file named out and sterr gets printed to a file named err
ugexe or maybe it does now. i havent checked in over a year now that i think about it :)
timotimo you don't want to merge 17:40
cale2 `$ program 2>err` prints errors to a file named err and prints stout to the console
jnthn cale2: Thanks, but that's not quite it; I need the 2 streams in 1 file and also on the console; that just sends them to a file
timotimo that's the whole point
jnthn Well, I want the file merged
cale2 ah 17:41
timotimo right, but if you :merge, you can't pick apart stdout and stderr for proper output any more :)
jnthn ugexe: (tee on stdout/stderr) I played a bit with that, but `command > >(tee foo) 2> >(tee foo)` goes pretty badly (not surprisingly) :) 17:42
Oh, and it merges the streams...d'oh
cale2 just don't cross the streams 17:43
jnthn Oh, but that's fixable with `> >(tee foo) 2> >(tee foo 1>&2)`
17:44 itaipu joined
cale2 for the people here, I started putting together a little book about perl6 ecosystem stuff. including web dev. mainly to teach myself in the process. here's a rough draft of the web chapter github.com/WildYorkies/peregrinati...owToWeb.md 17:44
timotimo jnthn: you need to tell it to open in append mode, don't you?
17:46 BenGoldberg joined
jnthn timotimo: heh, that does seme to work, though I'm still a tad uneasy about two processes having opened the same file :) 17:47
BenGoldberg Can anyone tell me whether it's possible to unload code? I'm writing a perl6 plugin for my favorite irc client, and I want to be able to load and unload individual scripts. 17:48
MasterDuke cale2: nice. noticed you typo'ed receive as recieve a couple times though 17:51
BenGoldberg If not, I can probably just use one separate interpreter for each and every script, but that would surely be a serious waste of memory.
cale2 MasterDuke: good catch. I've just been writing it on the github online editor, so no spellcheck there :P 17:54
17:58 pyrimidine left, robertle joined
Geth ecosystem: bradclawsie++ created pull request #298:
added DB-Rscs
17:58
El_Che lo 17:59
Geth ecosystem: 7001b90dec | (brad clawsie)++ | META.list
added DB-Rscs
18:00
ecosystem: d676c82300 | Altai-man++ | META.list
Merge pull request #298 from bradclawsie/master

added DB-Rscs
Voldenet well, a propos what BenGoldberg said, is there some good tool to instrument memory allocations/deallocations and general usage in moarvm? 18:02
timotimo the profiler does that, but the html frontend is currently a bit b0rked in that regard 18:03
you can get it to output sqlite-supported .sql and manually inspect it, but that's not ideal, of course
i've been working on an nqp:: op called "vmhealth" that outputs a few stats about the process, including how much memory is used in which size buckets and how many minor and major collections have happened so far 18:04
Voldenet Nifty!
18:05 itaipu left
timotimo github.com/MoarVM/MoarVM/pull/536 - got any comments on the data it presents? 18:05
o i had meant to post the current output
18:06 itaipu joined 18:07 wamba1 joined
robertle I can get --profile to segfault quite reproducibly btw... is that a known thing? anyone seen it? I only see it in parallel workloads... 18:07
timotimo yes, it asplodes when you have more than one thread
18:08 andrzejku joined
timotimo this game is refusing to do a major collection :D 18:09
a-ha! 18:10
18:10 mr_ron left
Voldenet timotimo: hm, the output is very /internal/ - it's not a bad thing, but you could do naming to be more... friendly ;) 18:10
nursery_bytes -> bytes_per_thread 18:11
gc_seqnr -> gc_runs
timotimo sure, that's easy
18:12 mr_ron joined
MasterDuke robertle: RT #128280 is related 18:13
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128280
18:21 BooK left 18:23 dogbert17 joined, AlexDaniel left 18:25 st_elmo joined
gfldex tbrowder: I strongly disagree with your commit a8feef1689. You removed a lot of information without adding any clarity. 18:49
18:49 espadrine joined
tbrowder gfldex: sorry, but on my browser i saw formatting errors (mismatched ,') and no explanation for the shell example in the middle of discussion of run, a 18:51
yoleaux 15:49Z <AlexDaniel> tbrowder: I've created github.com/perl6/doc/issues/1208, but other than that it does not look too bad
15:50Z <AlexDaniel> tbrowder: the dangers can be documented in language/traps, maybe
gfldex tbrowder: I do agree that the example could do with some explanation and we should do something about the font (if we can actually find a good webfont). But removing the vital infromation that no shell-out happens is a big no-no. 18:54
tbrowder please revert if you wish...and you're right, i probably should have commented or discussed it first
Geth doc: e3ce0985fe | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6
Revert "tweak run words and examples"

This reverts commit a8feef1689a8a1657f3e5f16c122c390bffc5e23.
18:55
gfldex tbrowder: what OS is your browser running on?
andrzejku :) 18:56
tbrowder i see it both on Debian (Chrome) and ios9 (also Chrome)
18:56 pyrimidine joined
tbrowder please help my proc understanding: how does p6 run a system command without "shelling out?" 18:59
is ther
gfldex tbrowder: by asking the OS to run the executable directly
tbrowder: if the OS could not do that, it would not be able to run a different shell then the default 19:00
tbrowder: can you see the following 4 glyphs? „ “ ‚ ‘ 19:01
tbrowder hm...that AFAIK isn't explained very clearly anywhere in current docs.
gfldex tbrowder: I don't think it should. To shell or not to shell is a question for operation system design. 19:02
19:05 atweiden joined
atweiden m: gist.github.com/atweiden/99d94483b...9f16419c28 19:05
camelia Current date: 2017-02-20
Target date: 2023-09-12
Days remaining: 2395
Bitcoin block count: 798809
Decred block count: 798926
atweiden what is strange about this gist is if i uncomment line 28 to pull current-block-count from the cmdline, it returns a totally erroneous result 19:06
however, you'd need additional software to repro 19:07
19:07 Tonik joined
tbrowder glyphs: i see but don't have a keyboard to repeat all of them, and my eyes aren't seeing clearly, but i think they are two pairs of non-ascii quotes; if you want users to be aware of system dangers i think shellout is well wort mentioning. 19:07
atweiden have tried playing with qx{} and shell to no avail 19:08
aw jeez, nvm 19:09
gfldex tbrowder: those glyphs are standard quote and single quote chars for many middle and east european countries. Also they are distinct from the quotes a shell would use, what makes them useful for run and shell. 19:10
19:10 atweiden left
gfldex tbrowder: shell could do with a little warning about shell escapes. I will add one. 19:10
tbrowder ok, back to shell, is diff between run and shell somewhat like diff between p5 exec and system? or did they both "shellout?" 19:12
Geth doc: 061178a707 | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6
some explaining in the example
19:14
doc: f5f1ddd02a | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6
add explicit warning sign to `shell`
tbrowder to me the capability of the run command is very powerful, now that i have a better feel for it--obviates need for using NativeCall for any things i think.
s/any/many
19:15 Actualeyes left
tbrowder changes look better 19:17
gfldex tbrowder: in Perl 5 both system and exec are quite magic, they may or may not run a shell depeding on arguments 19:18
tbrowder ok, so, in p6, can we say that, using run, we will never shell out? 19:20
gfldex tbrowder: the OS may not agree and if a shebang is used a shell may be run anyway on *nix 19:21
tbrowder thanks!
gfldex tbrowder: however, shell escapes should never happen on run
tbrowder gotcha 19:22
looks like i should never have to use shell just to run a sys cmd on *nix then (i know, never say never) 19:23
19:25 darutoko left
tbrowder one more question gfldex, i asked AlexDaniel yesterday about forming a complete command string and then using .words to feed run with the resulting array. yr opinion? 19:25
gfldex tbrowder: if you run a .p6 as a cron job or udev you may have to run a shell to make things work
hobbs tbrowder: as long as you know exactly what you're doing (that string doesn't contain any multi-word strings) 19:26
19:26 itaipu left
gfldex tbrowder: .words may be more liberal when it comes to <ws> then you may like. Not sure tho. 19:26
tbrowder okay, i'll keep that in mind since i'm working on a cron job now. 19:27
multi-word example?
hobbs in p5 I often end up writing something like system(qw(command -flags -flags -flags), $arg, '-opt', $arg)
where the initial qw part is akin to what you're talking about
19:28 itaipu joined
tbrowder in p5 i usually formed the complete cmd string outside and then fed single str to system 19:29
19:29 Actualeyes joined
gfldex some time ago I had to deal with a file called „Let's do it!.doc“. That was a real PITA. 19:29
hobbs tbrowder: yeah, that's best avoided
I try to be properly paranoid about that at all times
RabidGravy Was someone looking for me earlier, my scrollback only goes back five hours :) 19:30
yoleaux 12:49Z <dogbert11> RabidGravy: do you remember what test(s) you're running when you got SEGV's with Squirrel? (RT #129946)
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129946
tbrowder well, since i don't program on windows i usually don't have problems with weird file names. i just rename those i get from windows friends. 19:31
RabidGravy well I think it was something to do with samewith but I couldn't reproduce out of the code 19:32
tbrowder gfldex: thanks for the enlightenment!
gfldex yw
dogbert17 RabidGravy: so if you ran the tests several/many times it would eventually SEGV? 19:33
gfldex samcv: please have a look at the highlight for docs.perl6.org/type/IO#sub_run if you got the time to spare
RabidGravy dogbert17, no it would reliably segv after a certain number of tests 19:34
I took all the samewith out and it stopped doing it
samcv gfldex, can you open a ticket for me? 19:35
dogbert17 so the code in your repo is 'fixed'?
19:35 sufrostico left
samcv github.com/perl6/atom-language-perl6 19:35
BenGoldberg hobbs, Just so you know, even with strict and warnings on, -opt works perfectly fine without quotes around it.
hobbs BenGoldberg: true enough
BenGoldberg thinks that that was introduced to make Tk code look nicer. 19:36
19:37 sufrostico joined
gfldex samcv: github.com/perl6/doc/issues/1210 19:37
samcv thx
RabidGravy dogbert17, yeah, it's fine now, I even upped the number of tests and everything 19:39
obviously it's still unfinished but it works for the simple stuff 19:40
dogbert17 RabidGravy: I'm looking at SEGV issues in RT in order to figure out which of them are still relevant, i.e. still bugs out 19:42
RabidGravy right, well the approximate cause of that was highly nested methods with samewith 19:45
19:45 sufrostico left
RabidGravy let me try and find the commit that fixed it 19:46
19:46 cibs left
dogbert17 thx 19:46
19:47 TEttinger joined
SmokeMachine m: say 55296.chr # why? 19:47
camelia Error encoding UTF-8 string: could not encode codepoint 55296
in block <unit> at <tmp> line 1
19:47 sufrostico joined 19:48 sufrostico left, cibs joined 19:51 andrzejku left, andrzejku joined
andrzejku hi :) 19:53
19:54 Tonik left
DrForr Evenin'. 19:54
19:54 eroux joined 19:56 gdonald joined 20:04 jjido joined 20:14 eroux left 20:16 eroux joined 20:18 ufobat left 20:28 eroux left 20:34 eroux joined 20:37 jjido_ joined 20:39 jjido left
SmokeMachine .u pizza 20:41
yoleaux U+1F355 SLICE OF PIZZA [So] (🍕)
20:43 jjido_ left
BenGoldberg Don't say such things, you'll make me hungry! 20:43
hobbs I *am* hungry 20:44
SmokeMachine sorry! 20:45
gfldex .u Eierschecke
yoleaux No characters found
gfldex :(
20:47 labster joined
RabidGravy dogbert17, I think github.com/jonathanstowe/Squirrel/...8090b623ba but there were a lot 20:50
20:51 AlexDaniel joined 20:53 raiph left
andrzejku how can I measure time in script? 21:00
some reliable time subs?
gfldex m: say 'start'; sleep 10; say now - BEGIN now; 21:01
camelia start
10.0095722
21:04 gdonald left, jjido joined, gdonald joined
andrzejku gfldex thnks 21:06
21:10 bjz left 21:12 itaipu left
robertle anyone know a programmatic way to find out if a comp unit I know by name is module or a class? 21:19
timotimo i don't think you can get that info without loading the compunit
robertle loading as in require? 21:20
lizmat and a new Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/02/20/...ng-slangs/ 21:22
21:24 labster left
robertle ::($f).HOW seems to do something along those lines... 21:24
21:25 andrzejku left, sena_kun left, sunnavy left
Voldenet Okay, I've made some grammars... but they're all of type "Match", which is not very preferable. 21:26
jnthn m: class C { }; module M { }; say C.HOW ~~ Metamodel::ClassHOW; say M.HOW ~~ Metamodel::ClassHOW
camelia True
False
21:26 sunnavy joined
Voldenet Is usage of gather/take pattern a good idea here? 21:26
moritz Voldenet: the typical way to return non-Match things from grammars is to use make() or $/.make() 21:28
jnthn Voldenet: Are you trying to produce a more relevant data structure from the data the grammar matches?, rather than just having the Match object?
If so, see make and action classes
Voldenet jnthn: Well, it makes sense, but that feels very /java/ :P
moritz Voldenet: see perlgeek.de/blog-en/perl-6/2017-00...ammar.html
or leanpub.com/perl6 for a bit more verbose treatment </plug> 21:29
jnthn Voldenet: You can embed the make statements directly inside of the tokens
If writing an actions class is really too objectional :P 21:30
Voldenet Now that's the /perl/, post the example :P
just a simple one will do
jnthn m: grammar G { token TOP { <word>+ % ',' { make [$<word>.map(*.made)] }; token word { \w+ { make ~$/ } }; say G.parse('abc,def,gh').ast.perl 21:31
camelia 5===SORRY!5===
Unrecognized regex metacharacter ; (must be quoted to match literally)
at <tmp>:1
------> 3d>+ % ',' { make [$<word>.map(*.made)] }7⏏5; token word { \w+ { make ~$/ } }; say G
Malformed regex
at <tmp>:1
------> 3+ % '…
jnthn d'oh :)
m: grammar G { token TOP { <word>+ % ',' { make [$<word>.map(*.made)] } }; token word { \w+ { make ~$/ } }; say G.parse('abc,def,gh').ast.perl
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3 } }; say G.parse('abc,def,gh').ast.perl7⏏5<EOL>
expecting any of:
postfix
statement end
statement modifier
stateme…
jnthn grr
m: grammar G { token TOP { <word>+ % ',' { make [$<word>.map(*.made)] } }; token word { \w+ { make ~$/ } } }; say G.parse('abc,def,gh').ast.perl
camelia ["abc", "def", "gh"]
jnthn There we go
Voldenet that looks incredibly hacky ( ¬‿¬) 21:32
jnthn Too late to count braces, apparently :)
Voldenet my kind of perl (⌐‿⌐ )
21:34 itaipu joined
BenGoldberg m: dd Any.kv 21:41
camelia ()
BenGoldberg m: dd 1.kv;
camelia (0, 1).Seq
BenGoldberg m: dd "foo".kv 21:42
camelia (0, "foo").Seq
BenGoldberg m: dd Any.defined
camelia Bool::False
BenGoldberg m: dd (class :: { sub defined { True } }).kv; 21:43
camelia ()
BenGoldberg s: Int, 'kv', \()
SourceBaby BenGoldberg, Sauce is at github.com/rakudo/rakudo/blob/80e0...Any.pm#L93
BenGoldberg m: my $foo = class :: { sub defined { True } }; dd $foo 21:44
camelia <anon|60285232> $foo = <anon|60285232>
BenGoldberg m: my $foo = class :: { sub defined { True } }; dd defined $foo
camelia Bool::False
BenGoldberg s: &defined, Any 21:45
SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{<anon|65569312>}, Any); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
BenGoldberg s: &defined, \(Any)
SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{<anon|65569312>}, Capture); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
BenGoldberg s: &defined, \()
SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{<anon|65569312>}, Capture); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
BenGoldberg Surely Sub+{<anon|65569312>} should match with &code, and \() with Capture? 21:47
s: Any, 'defined', \() 21:48
SourceBaby BenGoldberg, Sauce is at github.com/rakudo/rakudo/blob/80e0.../Mu.pm#L91
BenGoldberg m: my $foo = class :: { sub defined { True } }; dd definite $foo 21:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
definite used at line 1. Did you mean 'defined'?
21:52 wamba1 left 21:54 labster joined 21:55 jjido left 21:58 itaipu left
cale2 does anyone have good examples for `andthen` and `orelse`? 22:02
IOninja I have a few, but I'm hesitant to let you judge their goodness. 22:04
AlexDaniel looks at irclog.perlgeek.de/perl6/search/?n...;q=andthen
IOninja heh
cale2: some github.com/perl6/geth/blob/master/...m6#L34-L45 22:05
`with` compiles to `andthen` so you can rephrase any of em in the other direction
cale2 IOninja: We need examples for andthen and orelse in the docs, but I honestly can't think of when to use andthen. most people use defined-or (//) instead of orelse as well 22:07
22:07 kurahaupo__ joined
IOninja how? 22:08
22:08 st_elmo left
IOninja They're quite different. 22:09
m: Int orelse fail "Can't use {$_.^name}; gimme a proper number" 22:10
camelia Can't use Int; gimme a proper number
in block <unit> at <tmp> line 1
IOninja m: Int // fail "Can't use {$_.^name}; gimme a proper number"
camelia Can't use Any; gimme a proper number
in block <unit> at <tmp> line 1
IOninja m: my $answer; say $answer // 42 22:11
camelia 42
IOninja m: my $answer; say $answer or say "No answer"
camelia (Any)
IOninja m: my $answer; say $answer orelse say "No answer"
camelia (Any)
IOninja bah
22:11 skids left, RabidGravy left
IOninja m: sub foo { }; foo 42 // say "No answer" 22:12
camelia Too many positionals passed; expected 0 arguments but got 1
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
IOninja m: sub foo ($) { }; foo 42 // say "No answer"
camelia ( no output )
IOninja m: sub foo ($) { }; foo 42 orelser say "No answer"
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3sub foo ($) { }; foo 42 o7⏏5relser say "No answer"
IOninja m: sub foo ($) { }; foo 42 orelse say "No answer"
camelia No answer
IOninja And so on. Different precedence
notandthen seems to be undocumented 22:14
s: &infix:<notandthen>
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/80e0...rs.pm#L640
IOninja and `without` compiles to it, so same as with andthen and with; can rephrase in different order. 22:15
gfldex IOninja: it seams to be un-roasted too
IOninja yikes
AlexDaniel oops…
IOninja Well, it is, indirectly. There are at least some tests for without 22:16
kinda scary that some things have 0% coverage :( 22:17
Voldenet what's the serialization method of choice to use with perl6? 22:21
JSON/XML/Protobuf/?
IOninja TIL that .perl.EVAL route is uber slow. 22:22
And JSON doesn't preserve Inf/-Inf/NaN
Voldenet True, but it's not a big problem. 22:23
+ could be worked out with storing them as strings 22:25
still, what /works best/ in perl6? :P
perlpilot whatever actually *works* ;-) 22:26
perlpilot still slightly wishes someone would port Sereal to Perl 6 though. 22:27
Geth doc: cdb9fe2895 | (Wenzel P. P. Peppmeyer)++ | doc/Language/phasers.pod6
LEAVE a simple example behind
22:31 perlpilot left 22:36 Voldenet left
BenGoldberg So I've got a question: If I wanted some random program to have a plugin based architecture, and wanted plugins to not be able to see each other, I could load each one's code inside of individual Safe.pm objects. Throwing away or resetting the object would obviously unload most or all of the plugin's data. How would I do this in perl6? 22:40
Err, "I could (in perl5) load ..."
22:40 sufrostico joined 22:41 Voldenet joined, Voldenet left, Voldenet joined 22:42 dotness joined 22:43 dotness left 22:44 sufrostico left 22:46 sufrostico joined
Voldenet okay, I'm trying to use glorious perl to parse json - it obviously fails because the class can't be represented by the serializer anyhow 22:48
is there some funny feature which I can use to turn class into a "hash"?
IOninja ....to *parse* JSON? wat 22:49
22:49 rindolf left
Voldenet s/parse/serialize/ 22:49
ugh
it doesn't even mean the same thing, ekhm 22:50
in JS you JSON.Parse :P
or .parse
22:50 BenGoldberg left
DrForr And in Perl 6 you JSON::Fast.from-json :) 22:50
IOninja Voldenet: dunno, maybe someone done cooked up a role you could mix in 22:51
22:51 dotness joined
Voldenet DrForr: class x { has $.i; }; use JSON::Fast; my @a = map { x.new(:i($_)) }, 1..3; say to-json(@a); 22:51
IOninja Voldenet: and what about class Y { has $!x } ? 22:52
Voldenet the same
IOninja the same what?
Voldenet [{ "0": null }, ...] etc.
22:53 dotness left
Voldenet [{ "0": null }, { "0": null }, { "0": null }] 22:53
this is actually the result without newlines
IOninja Oh, just make them all { "0": null } ?
a class would serialize to { "0": null }?
Voldenet Yeah
however, if I add "is Hash" then I get empty objects, which is... something :P
IOninja Oh, heh, I thought you wanted to extract attributes and all
Voldenet I'm just trying to do some "good, OOP" serialization :) 22:54
IOninja star: use JSON::Fast; say to-json class {}.new but '{ "0": null }'; 22:55
camelia {
"0": null
}
IOninja star: use JSON::Fast; my @a = map { x.new(:i($_)) }, 1..3; @a .= duckmap: -> $_ where $ !~~ Str|Numeric { $_ but '{ "0": null }'; }; say to-json @a 22:56
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
x used at line 1
IOninja star: use JSON::Fast; class x { has $.i }; my @a = map { x.new(:i($_)) }, 1..3; @a .= duckmap: -> $_ where $ !~~ Str|Numeric { $_ but '{ "0": null }'; }; say to-json @a
camelia [
{
"0": null
},
{
"0": null
},
{
"0": null
}
]
IOninja Worked the first time... That means it got a bug in it :} 22:57
22:57 kurahaupo__ left
Voldenet :-) 22:57
22:58 sufrostico left 23:13 pmurias left 23:15 ufobat joined 23:16 Actualeyes left 23:25 SCHAAP137 left 23:32 SCHAAP137 joined 23:36 skids joined, lep-delete left 23:40 Actualeyes joined, lep-delete joined
timotimo i'll give JSON::Fast support for a dynvar that'll make Inf, -Inf, and NaN non-standard json 23:42
Geth doc: titsuki++ created pull request #1211:
Use Point instead of IntStruct
23:43
timotimo for when you need to use json for stuff, but your other side is also perl6
Geth doc: b69701502c | titsuki++ | doc/Language/nativecall.pod6
Use Point instead of IntStruct
doc: c24beb8e3b | (Itsuki Toyota)++ | doc/Language/nativecall.pod6
Merge pull request #1211 from titsuki/fix-cstruct

Use Point instead of IntStruct
23:44 lukiramu left
IOninja cool 23:48
timotimo gaaaah what the fuck zef 23:49
[Coke] titsuki++
IOninja
.oO( a dynvar with a hash.... :{ NaN => 'NaN', Set => { .keys.sort.join: ',' }, {$_ !~~ Str|Numeric } => {'0': Nil} }
23:50
)
timotimo then i'll rename it JSON::Slow
IOninja :)
It'll be fast eventually... when Perl is fast.
timotimo nevarrrrrrrr 23:51
anyway, i pushed that patch
and bumped the version number 23:52
cale2 what's a simple module that I can use as an example of great modules 23:59