»ö« 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.
dalek kudo-star-daily: e5ff808 | coke++ | log/ (6 files):
today (automated commit)
00:00
[Coke] someone who knows travis: we need a way to run the 6.c tests in spectest, in addition to the other config/builds. (I do this by insuring t/spec has a checkout of 6.c instead of master, but we could probably make a *test target for it) 00:01
00:02 bpmedley left, firstdayonthejob left 00:09 pmurias left
Zoffix Do we have a Perl 6 blog space where anyone could write? Is it just blogs.perl.org/ ? 00:11
00:13 donaldh left
timotimo i think there's more than just ugexe's blog up on ugexe.com; i think tony-o's hosted there, too 00:14
Zoffix chuckles at the flashing skulls 00:15
timotimo :D
00:28 shmibs left
Skarsnik Good night #perl6 00:28
Zoffix night
00:28 Skarsnik left 00:29 shmibs joined 00:30 spider-mario left 00:32 cdg_ left 00:45 dj_goku left 00:48 pierre-vigier joined 00:50 pierre-vigier left 01:02 BenGoldberg joined
TimToady hmm, when I try the p6doc with the suggested Type::Str.split, the first thing I notice is that the Usage lines are flowed into a paragraph, which renders them less than readable 01:09
01:09 yeahnoob joined, bpmedley joined
TimToady also, maybe we should have a shorter way to get at a type than a Type:: prefix 01:09
a program like p6doc really oughta be taught what a bare "Str.split" means 01:11
01:23 wamba left
Zoffix PERL 6 SUCKS!!! :) blogs.perl.org/users/zoffix_znet/20...erl-6.html 01:28
Man, that took $n amount of hours too long. I'm way behind on my much more important Warframe-playing quota.
\o
01:29 Zoffix left 01:31 colomon left 01:36 colomon joined 01:40 Actualeyes joined 01:50 espadrine left 01:53 leont left 01:56 cpage_ left
lucs Filetest operators appear to report that a broken symlink file just doesn't exist (nor is a file, or a link, or readable). 01:58
(can't show it with camelia though) 01:59
01:59 atweiden joined
lucs And my rakudo is oldish (but stable enough for what I'm doing, so I'm a bit wary of rebuilding everything again just to test :-( ) 02:00
02:01 geraud left
lucs gist.github.com/lucs/e7c89c1046982d38cdbf 02:04
02:04 cpage_ joined 02:06 xpen joined 02:08 zwu joined 02:17 zwu left
dalek c: fcaf3ec | (Brock Wilcox)++ | doc/Language/variables.pod:
Fix sigil table formatting
02:17
02:18 zwu joined
zwu why there are many old bugs issued even in 6 years ago at rt.perl.org. I'm curious how many bugs have been fixed and how many bugs are remained? 02:20
awwaiid zwu: probably a lot of the open bugs are irrelevant and need to be culled; need someone to go through and evaluate them 02:22
hm. rakudo.org still doesn't mention the 2015.12 release :( 02:23
Juerd How likely are bugs from years ago to still matter?
skids A lot are valid bugs, but on less urgent subsystems. 02:24
Some were left as low-hanging-fruit so new contributers could cut their teeth. 02:25
Juerd Did that work out?
awwaiid hmm. someone needs to give me rights to close these things 02:26
skids In some cases, probably. I imagine there are a few heavy controbuters that started out that way.
awwaiid: do you have the right to comment on a bug when logged in?
awwaiid skids: yes
skids Then you can mark them resolved probably, from a drop-down when commenting. 02:27
But mae sure the bug has tests first.
02:28 dj_goku joined, dj_goku left, dj_goku joined
awwaiid I'm looking at rt.perl.org/Ticket/Display.html?id=68024 as an example. You're right that I get a status update dropdown in the comment form, but it only has "open" and "open (unchanged)" as my options 02:28
skids Unfortunately the rigt to flag things as "test needed" and "lhf" seems to be a separate thing.
awwaiid lemme try another one...
Juerd skids: Although I agree that bugs *should* have regression tests, there are almost 1200 open/new bugs in the queue. I don't think it's realistic to spend a lot of time on each of them.
skids Well, part of the reason there are 1200 is becaus someone made a bug for every roast test a year or so ago. 02:29
(fudged test, that is)
02:31 colomon left
Juerd skids: From quickly browsing through the 24 pages of bugs, the ones you describe appear to be only 3 pages. 02:31
Is there a list of people who can close bugs or grant priviliges? 02:34
s/lig/leg/
Also, there seem to be quite a few bugs that are just IRC logs. I find those highly annoying.
awwaiid well... my survey just now found that most of these are actually actionable (from a semi-random sample)
02:35 colomon joined
awwaiid but I've just started 02:35
Juerd awwaiid: Do you have bug closing permissions?
skids Juerd: I do, apparently. 02:36
Juerd If not, I suggest that when leaving a comment you include something that's machine-parsable :)
skids WRT IRC log bugs, it's better the issue be filed than not is the general attitude -- not everyone has time to make a nice RT. 02:37
Juerd skids: Agreed, but given a screenful of log, it would be nice if it at least highlighted the actual bug 02:38
02:38 kaare_ joined
Juerd skids: But I've opened more bugs at random and apparently it isn't as much of a problem as I initially thought 02:39
I can't paste multi-line things into the REPL. Is that a known behavior?
02:40 cuonglm joined
skids perl6 -e '<paste thing here>' enter? 02:41
Though a lot of people tend to use ' on camelia a lot so that sometimes needs some massage. 02:42
Juerd perl6 -
Otherwise I still can't paste things containing single quotes
- will read from stdin, which is fine (perl5-like) 02:43
02:43 psy_ left 02:44 zwu left 02:45 ilbot3 left 02:48 ilbot3 joined 02:49 raiph joined
awwaiid Juerd: nope, no closing permissions. But my sample so far still says that maybe I don't _need_ it so much as I haven't found too many to close. 02:51
Juerd I think that everything that emits a proper NYI or has a NYI-skip test can just be closed. The issue is tracked in the source, so why duplicate the data in a bug? 02:53
It just clutters the queue
But maybe it's just me and my aversion to long lists of backlog 02:55
02:57 molaf_ joined 02:59 sammers joined 03:01 molaf left 03:05 kaare_ left 03:06 cpage_ left 03:09 kid51_ joined
cuonglm (1, 2, 3).join('\n') and (1, 2, 3).join("\n") produced different output because the interpreting for \n inside double and single quote 03:10
Is that behavior documented else where in Perl6 doc?
I went through doc.perl6.org/routine/join#class_List but found nothing 03:11
03:11 kid51 left
skids cuonglm: I think that falls out just from '\n' and "\n" beig different strings. 03:12
raiph cuonglm: doc.perl6.org/language/quoting 03:13
sammers hello, what is the simplest way to convert an array of strings, '1-2-3'.split('-'), to an array of Int? I am using `for` at the moment... wondering if there is a better way.
03:14 kid51_ left, Ch0c0late left
skids m: "1-2-3".split("-")».Int.say # might not be implemented very efficiently ATM 03:15
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3)␤»
skids m: "1-2-3".split("-").map(*.Int).say 03:16
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3)␤»
sammers skids, thanks, that looks good.
03:18 itaipu left
skids m: say +«"1-2-3".split("-") # for golfers 03:18
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3)␤»
raiph m: say '1-2-3'.comb: /\d*/ # for hairstylists
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 )␤»
03:18 uruwi joined
uruwi a 03:19
raiph b, c d golfish?
Juerd m: say '1-2-3'.comb: /\d+/ # for those who don't like the double spaces in the output :P
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3)␤»
skids has to be of Int 03:20
cuonglm raiph: I read that link, too. But it still made me confused. '\n' and '\\n' are the same
raiph: looks weird to me. Anyway, thanks for the information
skids: Thanks
raiph m: say '\n', '\\n'
camelia rakudo-moar 0c4db8: OUTPUT«\n\n␤»
raiph cuonglm: yw 03:21
skids m: "\n".ords.say; '\n'.ords.say; '\\n'.ords.say
camelia rakudo-moar 0c4db8: OUTPUT«(10)␤(92 110)␤(92 110)␤»
sammers skids, can you explain this +«?
skids It's a prefix hyper operator. 03:22
Juerd sammers: prefix + numifies, and with « it operates on a list of things
sammers ok, that looks very useful... what is the prefix to stringify? 03:23
Juerd sammers: ~
raiph m: say q[This back\slash stays], q[This back\\slash stays] # cuonglm did you see that bit in the doc i linked?
camelia rakudo-moar 0c4db8: OUTPUT«This back\slash staysThis back\slash stays␤»
sammers ok, ah, alright, starting to make sense now...
skids doc.perl6.org/language/operators#H..._Operators
Juerd sammers: + is for numbers, ~ is for strings, ? is for bools, ! is for bools but negated ;) 03:24
sammers m: say ?«"True-False-True).split("-") 03:25
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9lnlipQiOa␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/9lnlipQiOa:1␤------> 3say ?«"True-False-True).split("-")7⏏5<EOL>␤ expecting any of:␤ double qu…»
sammers m: say ?«"True-False-True").split("-")
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/h5oBe486Ks␤Unexpected closing bracket␤at /tmp/h5oBe486Ks:1␤------> 3say ?«"True-False-True"7⏏5).split("-")␤»
sammers m: say ?«("True-False-True").split("-") 03:26
camelia rakudo-moar 0c4db8: OUTPUT«(True True True)␤»
Juerd Uh oh
sammers hmm
Juerd m: "A" |~ "B";
camelia rakudo-moar 0c4db8: OUTPUT«WARNINGS for /tmp/0sq90EMpgO:␤Useless use of "|" in expression "\"A\" |~ " in sink context (line 1)␤»
Juerd m: say("A" |~ "B")
camelia rakudo-moar 0c4db8: OUTPUT«any(A, B)␤»
Juerd I did not expect that to become a junction.
Should be buffer bitwise or...
OH!
sammers m: say ?«("1-0-1").split("-")
camelia rakudo-moar 0c4db8: OUTPUT«(True True True)␤»
Juerd m: say("A" ~| "B")
camelia rakudo-moar 0c4db8: OUTPUT«C␤» 03:27
Juerd Sorry, had it the wrong way around :)
cuonglm raiph: Yes, that's why I said it looks weird to me :D
BenGoldberg m: say [|~] "A", "B"; 03:28
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4ltXyn5cLl␤Prefix ~ requires an argument, but no valid term found␤at /tmp/4ltXyn5cLl:1␤------> 3say [|~7⏏5] "A", "B";␤ expecting any of:␤ prefix␤»
Juerd sammers: Note that the string "False" is true.
BenGoldberg m: say [~|] "A", "B";
camelia rakudo-moar 0c4db8: OUTPUT«C␤»
skids sammers: Any nonempty string is True when boolified
BenGoldberg m: say so "0"
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
BenGoldberg m: say so "False"
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
03:29 Peter_WR left
sammers in that situation, is there a way to convert the string to bool? 03:29
BenGoldberg So that the string "False" becomes false?
sammers right 03:30
BenGoldberg Hmm...
Juerd sammers: Not built-in
sammers this isn't something I need atm, just curious.
BenGoldberg m: True.WHAT.say 03:31
camelia rakudo-moar 0c4db8: OUTPUT«(Bool)␤»
BenGoldberg m: Bool.keys.say
camelia rakudo-moar 0c4db8: OUTPUT«()␤»
03:31 zwu joined
BenGoldberg m: Bool.enums.keys.say 03:31
camelia rakudo-moar 0c4db8: OUTPUT«Method 'enums' not found for invocant of class 'Bool'␤ in block <unit> at /tmp/eu1nw2ylDF line 1␤␤»
sammers thanks everyone, you have been very helpful... 03:32
BenGoldberg m: say Bool.^attributes; 03:34
camelia rakudo-moar 0c4db8: OUTPUT«Method 'gist' not found for invocant of class 'BOOTSTRAPATTR'␤ in block <unit> at /tmp/tOEDmGkz4j line 1␤␤»
BenGoldberg j: my @a = Bool.^attributes;
camelia rakudo-jvm 6c0f93: OUTPUT«java.lang.RuntimeException: java.lang.StackOverflowError␤␤»
raiph m: use MONKEY; augment class Str { multi method gist ("Foo") { 42 } }; say "Foo" 03:36
camelia rakudo-moar 0c4db8: OUTPUT«Foo␤»
03:38 pat_js joined
cuonglm Is there any way to list all builtin class in perl6? 03:39
I mean all things listed here doc.perl6.org/type.html 03:40
autarch m: class C { submethod DESTROY { say self } }; C.new for 1..10 03:41
yoleaux 11 Jan 2016 08:12Z <nine> autarch: Have you thought about using network connections to communicate the results of test subprocesses to the master? I guess that could be easier than trying to get concurrent writing to files performant cross platform. And it would also make it trivial to run high level clusterwide tests :)
camelia ( no output )
autarch should I not expect DESTROY methods to be called when the interpreter exits?
nine: that sounds like a good idea to investigate
hoelzro autarch: unless --full-cleanup is specified, no
autarch is DESTROY not intended to be used much? 03:42
skids autarch: still tbd I think for now they only do so for GC purposes.
hoelzro cuonglm: CORE::.keys should give you a good push in the right direction
autarch: I think it depends on the use 03:43
autarch also, I don't see anything about --full-cleanup when I run "perl6 --help"
hoelzro autarch: it's a MoarVM option =/
autarch digs out an example ...
hoelzro should really add MVM_FULL_CLEANUP
autarch m: class C { has @.threads; method foo { @!threads = (^10).map: { Thread.start( name => $_, sub { sleep 1; say $*THREAD.name } ) }; say @!threads; }; submethod DESTROY { say 'bye'; .finish for @!threads }; }; C.new.foo; exit 0
camelia rakudo-moar 0c4db8: OUTPUT«[Thread #3 (0) Thread #4 (1) Thread #5 (2) Thread #6 (3) Thread #7 (4) Thread #8 (5) Thread #9 (6) Thread #10 (7) Thread #11 (8) Thread #12 (9)]␤»
autarch so there's what I think is a reasonable example of why I might want DESTROY to be called on interpreter exit 03:44
hoelzro autarch: in that instance, you should probably have a cleanup method and call it in a leave phaser
autarch hoelzro: that puts the burden on the user of class C in that case, rather than letting C implement its own cleanup - that doesn't seem like a great design for an API
hoelzro agreed
cuonglm hoelzro: It's interesting. Thanks. How can I found documentation for CORE? 03:45
hoelzro I'm with you on having a global destruction time, the leave phaser is just what's been recommended to me in the past
autarch is this something I should file a bug for?
hoelzro cuonglm: I don't know if it's doc'd on doc.perl6.org, but it's in the design docs under S02 03:46
autarch: you could, but it may just end up getting rejected
autarch well, that's ok
hoelzro jnthn (and others) have argued that we shouldn't be relying on a global destruction time
but you probably have better arguments than I for making a case for it =)
autarch oh, if it's already decided then there's no point filing a bug 03:47
hoelzro I don't know if it's decided spec-wise; I think the spec says implementations are free to do what they want
autarch ok, I'll file a bug
hoelzro well, before you do
lemme see if I can dig up a discussion about it when I was asking
that way you can have some context
skids cuonglm: design.perl6.org/S02.html#Pseudo-packages 03:48
hoelzro skids++
autarch rt.perl.org/Ticket/Display.html?id=127243 03:49
I'd also note that "implementations can do what they want" has historically not worked so great, at least not with C
hoelzro heh
good point
autarch what you end up with is people relying on undefined behavior, bugs across platforms, and a general huge freaking mess
cuonglm hoelzro: and skids: Thanks
hoelzro autarch: irclog.perlgeek.de/perl6/2015-07-22#i_10938226 03:50
autarch hmm, I guess I could record all the active threads in a package level variable and have an END block 03:52
autarch pukes a little in his mouth after typing that
hoelzro haha
I think we need a better solution 03:53
autarch I do like the idea of having a $*TEARDOWN option which allows you to _disable_ this and risk the consequences
but the default should really be to run all the DESTROYers
hoelzro I mean, the GC (in Moar) knows which objects have a finalizer or not
so if nothing has a finalizer, you don't need to do the full cleanup
right?
I think they're even tracked in their own queue, so you don't even need to do the full heap traversal 03:54
(that could be out of date or a misconception of mine)
zwu just thought if perl 6 needs to support thread local storage ? 03:55
autarch I updated the ticket to point to that discussion too
hoelzro thanks autarch
autarch this seems quite critical to making threading really useful, since otherwise it's quite easy to have the main thread exit while child threads are still running 03:56
03:57 noganex joined
autarch sheesh, I used quite in one sentence, boo me 03:57
03:59 noganex_ left, pjscott joined 04:00 pjscott left
autarch quite twice* 04:01
04:01 dayangkun joined
autarch on another DESTROY topic, I also noted that it doesn't seem to be called at block exit either 04:05
hoelzro nope
autarch is there a way to inject a LEAVE into the caller?
hoelzro it's like Java/C# GC; it's not specified when or if the finalizer will run
there might be, but I don't know offhand
autarch there are certain useful things you can do in p5 with DESTROY that it'd be nice to do in p6 04:06
but not all of them actually need DESTROY 04:07
hoelzro it would be nice if we had facilities similar to p5 Guard, but on the object level
one of the core devs may have some ideas on that 04:09
autarch yeah, that's what I was thinking of
04:11 llfourn left, dfg5678 joined
skids whiteknight.github.io/2012/05/23/de...s_are_hard # blast from the past, back when parrot was the VM, FWIW 04:11
hoelzro nice find skids 04:12
skids I think some of the obstacles listed in there were parrot-specific, but some may still be pertinant 04:13
04:14 herby_ joined
herby_ good evening, everyone! 04:14
skids o/ 04:15
hoelzro greetings!
herby_ trying to tackle the dailyprogrammer problem since there isn't a perl6 solution yet
www.reddit.com/r/dailyprogrammer/c...the_stock/
if I had an array of <jame sally jesse raphael>, how do I get the index spot of jesse? 04:16
hoelzro herby_: you want index
m: <jame sally jesse raphael>.index('jesse')
camelia ( no output )
hoelzro m: say <jame sally jesse raphael>.index('jesse')
camelia rakudo-moar 0c4db8: OUTPUT«11␤»
hoelzro oh, my bad 04:17
I always make that mistake =/
index is for strings only
you want first
herby_ m: my @array = ['james', 'sally', 'jesse']; say @array.index('jesse')
camelia rakudo-moar 0c4db8: OUTPUT«12␤»
hoelzro m: say <jame sally jesse raphael>.first('jesse', :k)
camelia rakudo-moar 0c4db8: OUTPUT«2␤»
herby_ yeah
there we go :)
I knew perl 6 had an easy way to do it
just didnt know what 04:18
m: say ['james', 'sally', 'jesse', 'raphael'].first('raphael', :k)
camelia rakudo-moar 0c4db8: OUTPUT«3␤»
gfldex .index coerces to Str 04:19
04:19 adhoc left
herby_ thanks, hoelzro! 04:19
hoelzro no problem!
04:20 adhoc joined 04:21 BenGoldberg left
herby_ m: my @array = <5 3 8 16 10>; my @newArray = @array[5..]; say @newArray; 04:22
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eL2odGvlFg␤Please use ..* for indefinite range␤at /tmp/eL2odGvlFg:1␤------> 3<5 3 8 16 10>; my @newArray = @array[5..7⏏5]; say @newArray;␤»
herby_ blah
04:22 BenGoldberg joined
herby_ m: my @array = <5 3 8 16 10>; my @newArray = @array[2..]; say @newArray; 04:22
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LXg9M9Xzu5␤Please use ..* for indefinite range␤at /tmp/LXg9M9Xzu5:1␤------> 3<5 3 8 16 10>; my @newArray = @array[2..7⏏5]; say @newArray;␤»
herby_ one more question. how do I slice an array, say from spot number 3 to the end? 04:23
hoelzro m: my @array = <5 3 8 16 10>; say @array[2..*];
camelia rakudo-moar 0c4db8: OUTPUT«(8 16 10)␤»
hoelzro you almost had it!
herby_ thought I was close! 04:24
m: say <1.2 4.4 3.2 8.8>.first( 04:28
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/aE0CTxOqOH␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/aE0CTxOqOH:1␤------> 3say <1.2 4.4 3.2 8.8>.first(7⏏5<EOL>␤ expecting any of:␤ argument list␤»
herby_ m: say <1.2 4.4 3.2 8.8>.first(4.4)
camelia rakudo-moar 0c4db8: OUTPUT«4.4␤»
hoelzro be careful when using real numbers 04:29
.first uses ACCEPT (iirc), so you may end up missing an element due to representational error
herby_ hmm. thought I had a clever solution to that challenge problem
m: say ["1.2", "4.4", "3.2", "8.8"].first("4.4") 04:30
camelia rakudo-moar 0c4db8: OUTPUT«4.4␤»
04:30 zwu left 04:31 dfg5678 left
herby_ oh well, still learned something new. thanks again 04:31
hoelzro happy to help 04:32
04:32 yqt left 04:36 cpage_ joined
skids m: (1, 3, 2, 5, 7, 8).pairs.squish(:as({ state $f = -1 => Inf; "$f <=> $_".say; $f.value <=> $_.value; LEAVE { $f = $_ } })).say # ?!? why that last iter? 04:37
camelia rakudo-moar 0c4db8: OUTPUT«WARNINGS for /tmp/bTkyHvPIqn:␤Useless use of "<=>" in expression ".value <=> $_.value" in sink context (line 1)␤-1 Inf <=> 0 1␤0 1 <=> 1 3␤1 3 <=> 2 2␤2 2 <=> 3 5␤3 5 <=> 4 7␤4 7 <=> 5 8␤5 8 <=> Mu<72861600>␤Method 'value' not found for i…»
skids m: (1, 2).squish(:as({ $_.perl.say })) 04:39
camelia rakudo-moar 0c4db8: OUTPUT«1␤2␤Mu.new␤»
04:43 cuonglm left 04:44 pierre-vigier joined
Hotkeys if you've got a version like class Foo::Bar:ver<1.2.3> 04:44
04:44 herby_ left
Hotkeys is there a way to get that version 04:44
in code
via the MOP or something?
04:46 BenGoldberg left
skids m: class Foo::Bar:ver<1.2.3> { }; Foo::Bar.^ver.say 04:47
camelia rakudo-moar 0c4db8: OUTPUT«v1.2.3␤»
Hotkeys oh
that's easier than i thought it would be
thanks skids
skids np.
m: class Foo::Bar:ver<1.2.3> { }; Foo::Bar.HOW.^methods».name.sort.perl.say 04:48
camelia rakudo-moar 0c4db8: OUTPUT«("ACCEPTS", "ACCEPTS", "ASSIGN-KEY", "ASSIGN-POS", "AT-KEY", "AT-POS", "Array", "BIND-KEY", "BIND-POS", "BUILDALL", "BUILDALLPLAN", "BUILDPLAN", "BUILD_LEAST_DERIVED", "Bag", "BagHash", "Bool", "CREATE", "Capture", "DELETE-KEY", "DELETE-POS", "DUMP", "DUMP…»
skids Not all of those are part of the 6.c standard, some are rakudo internals. 04:49
skids wonders whether .ver is.
pierre-vigier strange thing about flattening of list 04:50
p6: say flat ( (1,2),(3,4));my @m = (1,2),(3,4); say flat @m;
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤((1 2) (3 4))␤» 04:51
pierre-vigier it does not seem normal, does it?
skids pierre-vigier: Arrays (versus Lists) are itemized element by element, they are considered as flat as they want to be.
You have to explicitly .map(*.flat) to break the itemization. 04:52
(Except for dimensional arrays, apparently)
By default @m is an Array.
Hotkeys m: my @m = (1,2).Slip,(3,4).Slip; say flat @m;
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤»
Hotkeys this might help too
skids m: say flat ( (1,2),(3,4));my @m := (1,2),(3,4); say flat @m; 04:53
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤(1 2 3 4)␤»
pierre-vigier p6: say flat ( (1,2),(3,4));my @m = (1,2),(3,4); say @m.map( *.flat );
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤((1 2) (3 4))␤»
skids Binding instead of assigning puts the List directly into @m instead of making an Array.
pierre-vigier hum, so no way to force flatten an array? 04:54
Hotkeys not unless you flatten everything in it first
pierre-vigier .map( *.flat) does not seem to work
Hotkeys hmm
skids say flat ( (1,2),(3,4));my @m = (1,2),(3,4); say @m.map( *.flat ).flat;
pierre-vigier p6: say flat ( (1,2),(3,4));my @m = (1,2),(3,4); say @m.map( *.flat ).flat;
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤(1 2 3 4)␤»
Hotkeys m: my @m = (1,2),(3,4); say @m.map(*.Slip).flat
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤»
skids The map flattens each itemized element into a list but the result of it is not itself flat. 04:55
pierre-vigier ok, there is something i do not follow hwew
oh, ok
Hotkeys why is it that *.Foo doesn't need the curlies but any other map stuff does 04:56
not just doesn't need the curlies but gets mad when you use them
skids * generates whatever code. { * } is a block that returns Whatevercode, which never gets run. 04:57
pierre-vigier the origin of my question was to check if every element of an array of array is a Numeric ( i can't use shaped array for my case, at least not now)
Hotkeys actually 04:58
pierre-vigier p6: my @m = [ [ 1,2],[3,4.0]]; if all( @m.map(*.Slip).flat ) ~~ Numeric { say "ok";} else { say "ko";}
camelia rakudo-moar 0c4db8: OUTPUT«ok␤»
Hotkeys you can use flatmap for that
pierre-vigier it's working, but feels "complicated"
Hotkeys my @m = [ [ 1,2],[3,4.0]]; if all(@m.flatmap) ~~ Numeric { say "ok";} else { say "ko"; } 04:59
er
m: my @m = [ [ 1,2],[3,4.0]]; if all(@m.flatmap(* ~~ Numeric)) { say "ok";} else { say "ko"; }
camelia rakudo-moar 0c4db8: OUTPUT«ko␤»
Hotkeys hmm
m: my @m = [ [ 1,2],[3,4.0]]; if all(@m.flatmap(*)) { say "ok";} else { say "ko"; }
camelia rakudo-moar 0c4db8: OUTPUT«Cannot call flatmap(Array: Whatever); none of these signatures match:␤ ($: &block, :$label, *%_)␤ in block <unit> at /tmp/3GrL8lIZVz line 1␤␤»
Hotkeys er 05:00
pierre-vigier m: my @m = [ [ 1,2],[3,4.0]]; if all(@m.flatmap({})) ~~ Numeric { say "ok";} else { say "ko"; }
camelia rakudo-moar 0c4db8: OUTPUT«Cannot call flatmap(Array: Hash); none of these signatures match:␤ ($: &block, :$label, *%_)␤ in block <unit> at /tmp/mQZ8bo_zG6 line 1␤␤»
pierre-vigier m: my @m = [ [ 1,2],[3,4.0]]; if all(@m.flatmap({*})) ~~ Numeric { say "ok";} else { say "ko"; }
camelia rakudo-moar 0c4db8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/foPRN6CnHp␤{*} may only appear in proto␤at /tmp/foPRN6CnHp:1␤------> 3[ [ 1,2],[3,4.0]]; if all(@m.flatmap({*}7⏏5)) ~~ Numeric { say "ok";} else { say "k␤ expecting any of:␤ argument l…»
Hotkeys never mind
it doesn
't flatten like I thought it did
you'll have to do it the previous way 05:01
pierre-vigier ok, thank you
feel a bit stragne, need to get used to it
but flatmap to apply a function will solve me some hassle
skids m: my @a = [1,2],[3,4]; say so [&&] @a.map( { $_.all ~~ Int } ); 05:02
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
pierre-vigier i did implement a kind of flatmap my self, taht apply a funcction on element or call map with the same param if it's an array
Hotkeys skids that only works for one level deep though
pierre-vigier my @a =[[1,2],[3,4]] ; say so [&&] @a.map( { $_.all ~~ Int } ); 05:03
m: my @a =[[1,2],[3,4]] ; say so [&&] @a.map( { $_.all ~~ Int } );
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
pat_js is there a regex adverb to state that you only want matches for the whole string?
skids pierre-vigier: If I had to I would bet there will be some sort of syntactical relief for Array flattenning by 6.d as it is starting to be a FAQ.
pierre-vigier ok
hoelzro pat_js: you can throw ^ and $ at the beginning and end of the regex 05:04
pierre-vigier anyway, it's solving my issue for now
thank you a lot :)
Hotkeys hoelzro++
skids Hotkeys: I thought that was all that was needed?
Hotkeys I guess
it'd be nice for a generic flat though
flatten all the way arrays or lists
s/generic/general
pat_js is there a regex adverb to state that you only want matches for the whole string? 05:05
sorry
05:06 pierre-vigier left
skids Oh. hold on. There may be a trick. 05:06
pat_js hoelzro: I want the grammar to be provided from somewhere else. Is there no other way but to state a new grammar.
skids m: my @a = [1,2],[3,4]; @a[*;*;*].say
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤»
05:07 pierre-vigier joined
hoelzro pat_js: could you give an example of what you'd like to do? just pretend an adverb *does* exist and write some example code 05:07
sortiz m: my @a = 1,(3,4,(5,6,6)),7; say so all(@a.List.flat) ~~ Int;
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
05:08 llfourn joined
sortiz pierre-vigier, ^^ 05:08
skids my @a = 1,[3,4,[5,6,6]],7; say so all(@a.List.flat) ~~ Int;
m: my @a = 1,[3,4,[5,6,6]],7; say so all(@a.List.flat) ~~ Int;
camelia rakudo-moar 0c4db8: OUTPUT«False␤»
skids The problem is really nested arrays. 05:09
pat_js sub do-something-with-grammar(Str $string, Grammar $grammar){ my $Match = grammar.match($string, 'TOP', :whole-match); … do something}
pierre-vigier hum, still pretty comfused :) 05:10
but map( @.Slip|List|flat ).flat
pat_js oh forgot die "match failed" unless $Match
pierre-vigier seems to be working
in my usecase
hoelzro hmm...do regexes have something like nextsame?
pat_js: gimme a second; I'll try an experiment 05:11
skids m: my @a = 1,[3,4,[5,6,6]],7; say so all(@a[*;*;*]) ~~ Int;
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
skids m: my @a = 1,[3,4,[5,"a",6]],7; say so all(@a[*;*;*]) ~~ Int;
camelia rakudo-moar 0c4db8: OUTPUT«False␤»
skids That'll get you 3 dims. Now if only I could remember if there was a way to get infinite *;'s
05:12 molaf_ left
pierre-vigier m: my @a = [[1,2],[3,4]];say @a[*;*]; 05:12
camelia rakudo-moar 0c4db8: OUTPUT«(1 2 3 4)␤»
pierre-vigier hum, interesting, it's rakudo, or perl 6.c ? 05:13
skids That I do not know.
05:13 llfourn left, zengargoyle joined
pierre-vigier m: my @a = [[1,2],[3,4]];say @a[*][*]; 05:13
camelia rakudo-moar 0c4db8: OUTPUT«([1 2] [3 4])␤»
hoelzro pat_js: wait...don't grammars implicitly anchor to the beginning and end of a string? 05:14
skids I do think the dimensional mapping to nesting is in the design documents, ISTR. Whather it's flat, or at least listy, I don't know if that is specced.
zengargoyle somewhat irked that just running perl6 leaves 5M of stuff in ~.perl6
skids Grammar.parse anchors and .subparse does not IIRC. 05:15
05:15 joydo joined
pat_js hoelzro: oh, you're right, I'm sorry 05:15
Hotkeys oh
interesting 05:16
skids Though, the modifier in question for anchoring is :p (a.k.a. :pos)
Hotkeys m: my @a = 1,[3,4,[5,6,6]],7; all(gather @a.deepmap(*.take)) ~~ Numeric 05:18
camelia ( no output )
Hotkeys m: my @a = 1,[3,4,[5,6,6]],7; say all(gather @a.deepmap(*.take)) ~~ Numeric
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
Hotkeys There's a fun one
deepmap isn't in the docs
sortiz m: my @a = 1,[3,4,[5,6,6]],7; dd @a[**]
camelia rakudo-moar 0c4db8: OUTPUT«HyperWhatever in array index not yet implemented. Sorry. ␤ in block <unit> at /tmp/eq0X87StqZ line 1␤␤»
sortiz um 05:19
Hotkeys my @l = [[1], 2, [[3,4], 5], [[[7,8,9]]], [[[6]]], 7, 8, []]; say all(@l.deepmap(* ~~ Numeric));
m: my @l = [[1], 2, [[3,4], 5], [[[7,8,9]]], [[[6]]], 7, 8, []]; say all(@l.deepmap(* ~~ Numeric));
camelia rakudo-moar 0c4db8: OUTPUT«all([True], True, [[True True] True], [True True True], [True], True, True, [])␤»
Hotkeys oops
05:19 lostinfog left
Hotkeys m: my @l = [[1], 2, [[3,4], 5], [[[7,8,9]]], [[[6]]], 7, 8, []]; say all(gather @l.deepmap(*.take)) ~~ Numeric 05:20
camelia rakudo-moar 0c4db8: OUTPUT«True␤»
sortiz Hokeys++ # for deepmap 05:22
Hotkeys I wish it was in the docs
it's nice
05:22 daotoad joined
sortiz \o bed time 05:23
05:23 sortiz left
Hotkeys oh 05:24
here's an even nicer one 05:25
never mind I lied
05:25 daotoad left 05:27 pierre-vigier left 05:32 pat_js left 05:33 pjscott joined, pjscott left
skids m: use Test; is (1,2), [1,2] # :/ 05:35
camelia rakudo-moar 0c4db8: OUTPUT«ok 1 - ␤»
05:38 pierre-vigier joined 05:41 pierre-vigier left, pierre-vigier joined 05:44 snarkyboojum joined, snarkyboojum left 05:51 llfourn joined 05:52 dayangkun left, skids left 05:53 pjscott joined 05:56 Cabanossi left 05:58 Cabanossi joined 06:10 sjoshi joined 06:12 khw left 06:13 raiph left 06:21 pierre-vigier left, darutoko joined 06:25 pierre-vigier joined 06:26 Ch0c0late joined 06:30 ribasushi joined
uruwi I need a talk buddy 06:33
jeek Hi!
06:36 pjscott left
uruwi Hi 06:37
Sorry it took a bit of time to respond
06:37 pjscott joined
jeek No worries. 06:38
06:39 joydo left
uruwi i.imgur.com/qrLN9qH.png 06:39
^ what I'm working on
06:40 pierre-vigier left
gfldex m: sub f ($a where * ~~ Str) {}; try { f 10; CATCH { default { .WHAT.note } } }; 06:41
camelia rakudo-moar 0c4db8: OUTPUT«(AdHoc)␤»
gfldex that's not good
any test that wants to check against a constraint type check, will have to use .Str ~~ /Constraint type check failed/ to tell if the right exception was thrown 06:42
06:44 pierre-vigier joined 06:46 pjscott left 06:48 pierre-vigier left 06:53 domidumont joined 06:58 domidumont left 06:59 domidumont joined 07:04 salv0 left 07:14 r1991 joined 07:15 r1991 left 07:17 CIAvash joined 07:18 dalee left 07:24 FROGGS joined 07:31 atweiden left
dalek kudo/nom: 991f9a2 | skids++ | src/core/Nil.pm:
Fix some Nil LTA warnings.
07:39
kudo/nom: d22af32 | niner++ | src/core/Nil.pm:
Merge pull request #683 from skids/nil

Fix some Nil LTA warnings.
07:44 TEttinger left
nine .tell donaldh I know it-s perl6-debug-m. There's also perl6-debug-j, so I just replace "perl6-debug" in $*EXECUTABLE by "perl6" 07:47
yoleaux nine: I'll pass your message to donaldh.
nine .tell donaldh do you have any other precomp issues? 07:48
yoleaux nine: I'll pass your message to donaldh.
07:52 Sqirrel left
nine .tell Zoffix very nice blog post :) 08:01
yoleaux nine: I'll pass your message to Zoffix.
08:04 abraxxa joined 08:06 firstdayonthejob joined 08:08 pecastro joined
moritz URL? 08:08
CIAvash blogs.perl.org/users/zoffix_znet/20...erl-6.html 08:13
08:14 lnrdo joined 08:17 rurban joined
[Tux] csv-ip5xs 50000 18.238 12.588 08:19
test 50000 24.998 24.330
test-t 50000 12.862 11.961
csv-parser 50000 51.677 -0.602
08:20 zakharyas joined
FROGGS [Tux]: hi, where was that chart again? 08:20
[Tux] tux.nl/Talks/CSV6/speed4.html tux.nl/Talks/CSV6/speed5.html
08:21 lnrdo left, lnrdo joined 08:22 pierre-vigier joined
FROGGS [Tux]: thank you 08:22
08:25 lnrdo left 08:27 rurban left, _nadim joined 08:31 uruwi__ joined 08:34 uruwi left, Ch0c0late left 08:36 brrt joined 08:38 firstdayonthejob left 08:47 rindolf joined 08:48 dakkar joined 08:49 andreoss joined
timotimo o/ 08:50
brrt \o timotimo 08:51
pierre-vigier Any way to make a list or an array immutable? 08:59
m: my @l = (1,2,3); @l[0]=9; say @l; 09:00
camelia rakudo-moar d22af3: OUTPUT«[9 2 3]␤»
pierre-vigier without creating a constant
idea would be an object that contains a list
i want to return a view of that list, but immutable 09:01
timotimo m: my @l = (1, 2, 3) but role { method ASSIGN-POS(|) { die "immutable!" }; method AT-POS(|) { my \result = callsame; return result } }; try @l[0] = "hi"; say @l
camelia rakudo-moar d22af3: OUTPUT«[hi 2 3]␤»
masak good antenoon, #perl6
timotimo m: my @l = (1, 2, 3) but role { method ASSIGN-POS(|) { die "immutable!" }; method AT-POS(|) { my \result = callsame; return Proxy.new( FETCH => sub (|) { result } } }; try @l[0] = "hi"; say @l
camelia rakudo-moar d22af3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/15zaTEHgZH␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/15zaTEHgZH:1␤------> 3 Proxy.new( FETCH => sub (|) { result } 7⏏5} }; try @l[0] = "hi"; say @l␤ expectin…»
timotimo m: my @l = (1, 2, 3) but role { method ASSIGN-POS(|) { die "immutable!" }; method AT-POS(|) { my \result = callsame; return Proxy.new( FETCH => sub (|) { result }) } }; try @l[0] = "hi"; say @l 09:02
camelia rakudo-moar d22af3: OUTPUT«[hi 2 3]␤»
timotimo oh
09:02 [ptc] left
timotimo duh, when list assignment happens, the role gets dropped 09:02
m: my @l = (1, 2, 3); @l does role { method ASSIGN-POS(|) { die "immutable!" }; method AT-POS(|) { my \result = callsame; return Proxy.new( FETCH => sub (|) { result }) } }; try @l[0] = "hi"; say @l
camelia rakudo-moar d22af3: OUTPUT«[1 2 3]␤»
timotimo m: my @l = (1, 2, 3); @l does role { method ASSIGN-POS(|) { die "immutable!" }; method AT-POS(|) { my \result = callsame; return Proxy.new( FETCH => sub (|) { result }, STORE => sub (|) { say "denied!"; die "immutable!" }) } }; try @l[0] = "hi"; say @l 09:03
camelia rakudo-moar d22af3: OUTPUT«[1 2 3]␤»
dalek kudo/nom: ec03d6e | lizmat++ | src/core/ (4 files):
Move FILETEST-MODIFIED to Rakudo::Internals

Also, have it return epoch, rather than Instant, as we don't need instants for internal usage: especially if the Instant is derived from epoch.
pierre-vigier applying a role in runtime, good idea
timotimo m: my @l = (1, 2, 3); @l does role { method ASSIGN-POS(|) { say "denied via assign-pos"; die "immutable!" }; method AT-POS(|) { my \result = callsame; return Proxy.new( FETCH => sub (|) { result }, STORE => sub (|) { say "denied!"; die "immutable!" }) } }; try @l[0] = "hi"; say @l
camelia rakudo-moar d22af3: OUTPUT«denied via assign-pos␤[1 2 3]␤»
pierre-vigier once again purpose, is 09:04
i have my Math::Matrix class, where i want to access elements like that , my $m = Math::Matrix.new([[1,2],[3,4]]); say $m[0][0]; 09:05
making read only as the first step is easy
in ASSIGN-POS
however, i can update the second level, as it's an array of array
timotimo right 09:06
pierre-vigier so i want that AT-POS, instead of returning a list
timotimo well, at some point you'd be using a shaped array for this, hopefully
pierre-vigier return an immutable one
timotimo but they are not optimized at all right now, so they carry a performance penalty
pierre-vigier i would like too, but i'm still facing issue with that yet
like partial view
however, i might not need it
demanstration of the problem 09:07
timotimo yeah, partial views
pierre-vigier m: my Int @a[2,2] = (1,2),(3,4); say @a[0]; 09:08
camelia rakudo-moar d22af3: OUTPUT«Partially dimensioned views of arrays not yet implemented. Sorry. ␤ in block <unit> at /tmp/OxohvJmXXR line 1␤␤»
pierre-vigier still i will check i can use taht
maybe, create an accessor to get a line
as a matrix
09:10 xyf joined
timotimo so your matrix type will double as a representation for vectors? 09:14
pierre-vigier not really, in fact you are right, i should probably not allow to access a "row" 09:15
but jsut a cell
in taht case, i might be able to do everything with shaped array
even now 09:16
timotimo it'll still be slower than AoA ;(
dalek kudo/nom: 6525cdf | lizmat++ | src/core/ (4 files):
Move FILETEST-ACCESSED to Rakudo::Internals

Also, have it return epoch, rather than Instant.
pierre-vigier ok, i will create an accessor cell 09:17
only document that one for now
as it's not an important part
and not expose [] operator
until a further to come decision :D
so i can play with both implemenation as internal only 09:18
Hotkeys Thinking about contributing to the Lingua::* part of the ecosystem
09:19 kjs_ joined
Hotkeys Linguistics is my major and perl 6 is my current programming language of interest 09:19
Might as well mix them together
masak Hotkeys: go for it! :) 09:20
09:20 kjs_ left, rindolf left, kjs_ joined
Hotkeys I was thinking about doing part of speech tagging but it's fairly complicated 09:21
I might try something simpler to get my feet wet
El_Che Hotkeys: interesting
masak +1 on starting simple 09:22
09:22 burnersk joined 09:23 snarkyboojum joined
brrt another +1 09:24
all working complex systems started out as simple systems :-)
El_Che and then they imploded :)
09:24 RabidGravy joined
Hotkeys Lol 09:25
I've never really done big ecosystem contributions before 09:26
This is exciting
By big I mean creating things rather than fixing a line somewhere etc
El_Che Hotkeys: what better scenario than in a new language? 09:27
(one heavily inspired by linguistics, even) 09:28
Hotkeys Yep
Much easier (you know what I mean) in a new language
09:29 burnersk left, Amnez777 left
dalek kudo/nom: 509545a | lizmat++ | src/core/ (4 files):
Move FILETEST-CHANGED to Rakudo::Internals

Also, have it return epoch, rather than Instant.
09:33
_nadim good morning 09:34
lizmat afk for a few hours&
09:34 rindolf joined 09:35 yeahnoob left 09:39 wamba joined
gfldex m: sub f (*@a where all(*) ~~ Str) { say @a>>.WHAT }; f(<a b c>); 09:43
camelia rakudo-moar 6525cd: OUTPUT«Constraint type check failed for parameter '@a'␤ in sub f at /tmp/nBjV2r82ds line 1␤ in block <unit> at /tmp/nBjV2r82ds line 1␤␤»
gfldex m: sub f (*@a where all(@a) ~~ Str) { say @a>>.WHAT }; f(<a b c>);
camelia rakudo-moar 6525cd: OUTPUT«(Array)␤»
gfldex what does * turn into in that case?
09:44 wamba left, wamba joined
brrt good question.... 09:45
masak it's not a whatever star, if that's what you're asking.
oh, the above one, in the `where` clause. sorry, I missed that one :) 09:46
gfldex i shall point you better next time
masak I don't know exactly what it turns into... but it feels inconsistent to me to expect the above one to work when the below one works!
(because the below one is already a thunk, you're basically over-thunking with the above one) 09:47
09:47 [ptc] joined, wamba left
gfldex masak: while we are at the subject of thunk, could you add thunk and it's meaning to doc.perl6.org/language/glossary ? 09:48
09:48 burnersk joined
masak gfldex: I'm pretty sure I saw it in S99 the other day. maybe copy it from there? 09:49
09:50 wamba joined, cognominal_ joined
gfldex found it 09:51
09:52 cognominal left 09:53 kjs_ left, snarkyboojum left, M-eternaleye left, salva left, grassass left 09:56 salva joined, shadowpaste left 09:58 shadowpaste joined
El_Che what wat the trick again to prevent java type declarations?: has OpenLDAP::DataConsistency::ConfigInfo $info = OpenLDAP::DataConsistency::ConfigInfo.new(); 09:58
$.info
dalek c: c63d94b | (Wenzel P. P. Peppmeyer)++ | doc/Language/glossary.pod:
glosarify thunk
09:59
c: c4076e8 | (Wenzel P. P. Peppmeyer)++ | doc/Language/glossary.pod:
Merge pull request #343 from gfldex/master

glosarify thunk
10:00 M-eternaleye joined
timotimo El_Che: you want .= new 10:00
10:00 grassass joined
El_Che thank you, that was it 10:00
timotimo that works because a variable of type OpenLDAP::DataConsistency::ConfigInfo is initialized to the type object for you. and calling .= new on that is the same as what you wrote in full
El_Che I was looking at the doc, but didn't find it 10:01
10:03 dj_goku left
_nadim Is there a way to persist variable between code blocks in a string? I searching for a P6 equivalent toText::Template and it seems I'll have to roll one. 10:04
timotimo _nadim: you can use $(...) instead of { ... } 10:05
the { } gives you an extra scope (because it's curlies and curlies do that)
masak timotimo: with the added comment that `has` declarations are special enough that `.= new` has to be fairly special-cased as well ;)
timotimo but $(...) doesn't add another scope
masak: yeah :S 10:06
masak: because with a has declaration, the initialization has to move into the BUILD/BUILDALL
_nadim timotimo: grat, I'll try it immediately
masak timotimo: yes, because it's a thunk with a `self`, which doesn't exist until then 10:07
vide:
m: class A { has $.b }; class B { has A $.a .= new(:b(self)) }; say ?B.new.a.b
camelia rakudo-moar 509545: OUTPUT«True␤»
timotimo ah, yes
verily so
10:10 leont joined 10:14 zakharyas left
masak m: class A { has $.b }; class B { has A $.a .= new(:b(self)) }; my $b = B.new; say $b === $b.a.b # more telling 10:15
camelia rakudo-moar 509545: OUTPUT«True␤» 10:16
10:16 salva left, Amnez777 joined, Amnez777 left, lnrdo joined, Amnez777 joined 10:17 grassass left
_nadim question #1 is there anything like a "Safe" as we have in P5? 10:18
10:18 peter4 joined
timotimo i don't know what that is, can you explain? 10:18
10:18 Amnez777 left, Amnez777 joined 10:19 alpha123 left
_nadim search.cpan.org/~rgarcia/Safe-2.35/Safe.pm 10:19
10:19 salva joined
leont There is a restricted environment AFAIK, camelia uses it, no idea how it works 10:20
timotimo we have nothing ready-to-use like that, but our own EVAL allows you to at least supply different lexical environments 10:21
and eval cannot install new lexicals in an outer scope or anything like that
gnu.wildebeest.org/blog/mjw/2016/0...-warnings/ - pretty 10:22
_nadim unfortunately there's not much about that in the docs. Maybe some article, or advent, URL one can point me to?
10:22 grassass joined
timotimo i don't think so :( 10:23
_nadim It will come :) 10:24
10:24 virtualsue joined
timotimo what leont referred to is the RESTRICTED setting, which is a "first line of defense" and utterly easy to circumvent if you know a bit about internals 10:24
10:24 zakharyas joined
_nadim question #2: given a name and some value, how does one create a variable in scope? eg: ('hi', 'there') would give a $hi containing 'there'. 10:26
10:26 wollmers joined
timotimo variables and lexical scopes are compile-time constructs and are fixed at run-time 10:27
_nadim so I need to Eval this? 10:28
no Symbole table to play with?
timotimo i think so 10:29
_nadim A last one. perlsec, Safe, Opcode, Taint , ... any documentation about this? 10:31
these
timotimo i don't think so, no 10:33
gfldex Perl 6 is untainted
_nadim gfldex: what do you mean by that? 10:34
timotimo we don't have tainting support yet 10:35
gfldex there is no tainted mode 10:36
10:37 kjs_ joined 10:39 sftp left
El_Che is there an obvious way to redirect (or drop stdout). Testing a method that just prints a sample config, so I want to make sure the method executes fine, but don't care about the output 10:44
timotimo we have a module for that 10:45
IO::Capture::Simple or something?
10:45 espadrine joined
El_Che timotimo: no select function like in p5? 10:46
timotimo i've never been a perl5 programmer, so i have no idea about that :)
El_Che timotimo: in perl stdin, err en out are dynamic variables that can be changed (e.g. to a filehandle) 10:47
RabidGravy El_Che, you can just set $*OUT etc to a suitably handle like object 10:48
timotimo right
El_Che RabidGravy: I'll give it a go
10:50 _Gustaf_ joined
DrForr El_Che: promises &c replace that, I think... 10:51
timotimo i'm not sure our stdin is tappable
10:52 brrt left
El_Che well, I want to omit a say in the method without needing to mock the method 10:54
timotimo right
so you either use IO::Capture::Simple or IO::MiddleMan 10:55
El_Che I get that, but it sounds silly to add a dependency just for testing, no? 10:56
10:56 rurban joined
timotimo i don't think so 10:57
sadly, we don't have a "testing-depends" or so
RabidGravy arguable, if you make your own, possibly complex, code to use in a test then you have to arrange to have that tested too
timotimo github.com/sergot/IO-Capture-Simpl.../Simple.pm - look how simple that is
El_Che timotimo: I agree 10:58
RabidGravy timotimo, sure we do, unfortunately panda at the moment just flattens all the test-depends, build-depends and depends into one dependency list
timotimo oh!
well, of course it does. because it decides to build and test stuff before installing :)
though with --notests it could skip the test-depends part
RabidGravy yeah 10:59
El_Che META.info only has @depends
10:59 anaeem1_ joined, anaeem1_ left
RabidGravy no, really it has test-depends and build-depends as well 10:59
timotimo what pieces of the infrastructure allow for that?
RabidGravy design.perl6.org/S22.html#build-depends 11:00
El_Che Not in the doc: doc.perl6.org/language/modules#Dist...ng_Modules . Leave the doc as it is, untill panda supports test en build-depends?
timotimo we have a meta info tester. does it respect that? we have docs. do they mention it?
RabidGravy Test::META suppports it yeah, but as it's "optional" there's not much it can do with it 11:01
timotimo right.
RabidGravy El_Che, I think it should probably be in that document because panda *does* support them, just not very cleverly and future software may do better 11:02
El_Che Adding it and people will expect it to work. 11:04
Adding a note make it somewhat too verbose 11:05
RabidGravy iit does "work" inasmuch as a test-depends or build-depends gets added to the dependencies
El_Che * Support for this entry is planned to work in future versions of Perl 6 module installers like panda and zef. 11:06
RabidGravy: I get that, but that's pretty useless, no?
RabidGravy whatever 11:07
zengargoyle hrm, what replaced «as IO» in: sub foo(:$path as IO) { ... } 11:08
11:08 kjs_ left
timotimo IO(AcceptableSupertypes) 11:08
alternatively just IO()
11:08 leont left
timotimo (that'll be the same as IO(Any), but IO(Cool) may be more helpful) 11:08
zengargoyle thanks 11:09
timotimo yw
zengargoyle fixing up old module post xmas.... 11:10
timotimo good :)
zengargoyle wonders how experimental «pack» is....
timotimo we don't guarantee that it'll work in the future. but i believe through the use v6.c syntax you can get the current implementation for a long-ish time 11:11
RabidGravy zengargoyle, it's more that people don't like and think something better can be done but nothing better has emerged
zengargoyle Text::Fortune needs simple pack/unpack of the .dat
timotimo how simple is it?
can you share a link?
11:11 kjs_ joined
zengargoyle just 'N' and 'C' 11:12
timotimo num and char? 11:13
no, num makes no sense
integers and characters?
zengargoyle github.com/zengargoyle/Text-Fortun...ortune.pm6 11:14
yeah, integers and one char
timotimo ah, as simple as that
zengargoyle $dat.read(4).unpack('N'); like
timotimo yeah, yeah
11:14 pecastro left
timotimo we really need a good primitive to move between common representations of things and simple bufs ... 11:15
RabidGravy the code for unpack isn't particularly complex, you could just rip that part for your own code
11:15 pat_js joined, rurban left 11:18 TimToady left 11:20 TimToady joined 11:21 rurban joined 11:25 jdrab_ is now known as jdrab, jdrab left
pat_js I have a question about the chunks method of the Match objects 11:25
timotimo do you mean "caps"? 11:26
11:26 pierre-vigier left
pat_js no I mean the chunks 11:26
moritz pat_js: ask away
pat_js why is the value sometimes a Str and sometimes a submatch?
especially when the key is ~
moritz pat_js: because it gives the string in chunks that matches and chunks that didn't get matched by anything 11:27
timotimo ah, i didn't even know about the chunks method yet :)
moritz or not by a submatch, at least
timotimo oh hey moritz!
moritz pat_js: and the ~ key is for things that weren't matched by a submtach
\o timotimo
pat_js: see also: doc.perl6.org/routine/chunks 11:28
if you don't want the parts that didn't get matched by something capturing, use .caps
pat_js but how do I find out where the sub strings indicated by '~' are located? 11:29
timotimo i wonder: should we collect a list of examples from examples.perl6.org that demonstrate use of a given method well (-ish)?
pat_js: i'd assume you'd take the .to of the previous entry and the .from of the following (-1 on the .from, probably)
pat_js that's where i came from.
timotimo: but that's very statefull, I wanted to avoid that. 11:30
timotimo i don't see a good reason why it wouldn't mix in a role with .from and .to into the strings that are keyed with ~
11:30 brachtmax joined
timotimo perhaps a .orig to make it more compatible with the submatches 11:31
pat_js perl6: grammar {rule TOP{<x> <y>};token x{x*}; token y{y*}}.parse('x y').chunks».value».from 11:32
camelia rakudo-moar 509545: OUTPUT«Method 'from' not found for invocant of class 'Str'␤ in block <unit> at /tmp/tmpfile line 1␤␤»
( no output )
timotimo yeah 11:33
pat_js perl6: grammar {rule TOP{<x> <y>};token x{x*}; token y{y*}}.parse('x y').chunks».value».from
camelia rakudo-jvm 6c0f93: OUTPUT«Method 'from' not found for invocant of class 'Str'␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-moar 509545: OUTPUT«Method 'from' not found for invocant of class 'Str'␤ in block <unit> at /tmp/tmpfile line 1␤␤»
pat_js oh sorry, didn't want to paste it again.
timotimo i'm suggesting to change the chunks method to make that work
it'll have a performance impact, though
11:34 itaipu joined
El_Che tadzik: how strict does Config::INI needs to be? I see it does not support #comments as pretty common on unix config files. 11:35
11:36 xpen left
pat_js is there a "Substring Role"? I highly doubt that. Maybe the case is too specific. 11:46
11:46 Actualeyes left, aenaxi left 11:50 pierre-vigier joined
zengargoyle will make getting rid of «use experimental :pack;» in Text::Fortune a TODO item for later. :) probably along with a major re-think as T::F was my first Perl 6 module from long ago and is a bit icky. but it passes tests again... 11:50
FROGGS pat_js: what would this role do? 11:51
timotimo FROGGS: it'd probably look a bit like Match; .orig, .from, .to 11:53
pat_js FROGGS: I was just pondering, because of my problem higher up. timotimo suggested that a role should be mixed into the string that come as values to '~' in the result of the .chunks method 11:55
nine El_Che: even if the *depends are merge into one list at installation by panda, it makes still sense. For example uninstall might want to check if other modules depend on the to-be-uninstalled one and warn if so. There we don't want to see build or test-depends
11:58 aenaxi joined 12:00 Skarsnik joined
Skarsnik Helo 12:02
12:03 wamba left
awwaiid Why is &prefix:<+^> bitwise negation (instead of &prefix:<-^>) ? ohhh wait.... duh, the "+" is just the bitwise op indicator. Nevermind... posted here for posterity 12:04
timotimo yeah, it's not 100% fantastic
12:04 uruwi_ joined 12:05 uruwi__ left, Fleurety left
timotimo but it's still nice to have the indicator in front 12:06
12:06 Actualeyes joined
dalek kudo/nom: 8b227ba | lizmat++ | src/core/Exception.pm:
Add X::IO::Unknown exception class
12:06
kudo/nom: 9b8773d | lizmat++ | src/core/Rakudo/Internals.pm:
Handle errors from nqp::fileops

Turns out some of the nqp::fileops can actually return -1, which would cause a false positive.
12:09 lnrdo left
RabidGravy I don't suppose there is some succinct mechanism whereby if one has a list of Callables then you can run all those that match the supplied args ? 12:11
12:12 sjoshi left
moritz m: ( -> { say 'argless'}, -> Int { say 'Int'} )>>.?() 12:12
camelia rakudo-moar 9b8773: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Q9muFK6BLn␤Cannot use .? on a non-identifier method call␤at /tmp/Q9muFK6BLn:1␤------> 3 'argless'}, -> Int { say 'Int'} )>>.?()7⏏5<EOL>␤»
RabidGravy sort of lke "'@callables>>.(@args)" but with a grep on the signatures involved 12:13
moritz m: $_.?() for ( -> { say 'argless'}, -> Int { say 'Int'} )
camelia rakudo-moar 9b8773: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rIg726aRHt␤Cannot use .? on a non-identifier method call␤at /tmp/rIg726aRHt:1␤------> 3$_.?()7⏏5 for ( -> { say 'argless'}, -> Int { say␤»
moritz RabidGravy: we have .?method() for invoking-if-signature-matches, but it doesn't seem to work direction invocation 12:14
which is a shame
RabidGravy so grep then 12:15
gfldex m: ( -> { say 'argless'}, -> Int { say 'Int'} )>>.?&postfix:<<()>>
camelia rakudo-moar 9b8773: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SCh2kPAlMf␤Undeclared routine:␤ postfix:<()> used at line 1. Did you mean 'postfix:<i>', 'postfix:<-->', 'postfix:<ⁿ>', 'postfix:<++>'?␤␤»
gfldex is .() an operator? 12:16
moritz m: (-> { say 'argless'}).()
camelia rakudo-moar 9b8773: OUTPUT«argless␤»
moritz gfldex: ^^ yes
gfldex how is it defined?
moritz same as (), roughly (but it doesn't for the "everything followed by () is a routine invocation" rule)
12:18 lnrdo joined
Skarsnik hm, does that loop on a recent rakudo? gist.github.com/Skarsnik/df17adee07c18fa52c00 12:18
RabidGravy m: ( -> { say 'argless'}, -> Int { say 'Int'} ).grep(())>>.()
camelia ( no output )
RabidGravy m: ( -> { say 'argless'}, -> Int { say 'Int'} ).grep(:())>>.()
camelia ( no output )
RabidGravy er, something like that anyway 12:19
12:19 brrt joined
gfldex m: ( -> { say 'argless'}, -> Int { say 'Int'} )>>.?&postcircumfix:<( )>; 12:19
camelia rakudo-moar 9b8773: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4Rk2UMC3ce␤Undeclared routine:␤ postcircumfix:<( )> used at line 1. Did you mean 'postcircumfix:<{ }>', 'postcircumfix:<[ ]>', 'postcircumfix:<[; ]>', 'postcircumfix:<{; }>'?␤␤»
lizmat Skarsnik: could you try renaming Channel to something else? Perhaps some interaction with the built in Channel ?
timotimo i don't think you can do it like that, Skarsnik
Skarsnik yes, but that make rakudo go on forever. Should it stop to resolve the circular dependancy? 12:20
dalek kudo/nom: 6edbd16 | lizmat++ | src/core/IO.pm:
Remove untested, undocced, unused version of IO.all
RabidGravy m: ( -> { say 'argless'}, -> Int { say 'Int'} ).grep(\())>>.() 12:21
camelia ( no output )
vytas timotimo, are you planning to do perl6 weekly ? :P
Skarsnik It's the montly perl6 weekly :)
timotimo vytas: yeah ... yesterday i wasn't feeling well at all, so i didn't get around to doing anything at all
RabidGravy m: ( -> { say 'argless'}, -> Int { say 'Int'} ).grep({ $_.signature ~~ \()})>>.()
camelia ( no output )
timotimo i hope i can do it today, but today is also a bit of a busy day
vytas timotimo, fair play :)) thanks
RabidGravy I'm sure I can work this out 12:22
ilmari m: ( -> { say 'argless'}, -> Int { say 'Int'} ).grep({ $_.signature ~~ :()})>>.() 12:23
camelia rakudo-moar 9b8773: OUTPUT«argless␤»
RabidGravy yay! 12:24
ilmari m: .WHAT.say for :(), \()
camelia rakudo-moar 9b8773: OUTPUT«(Signature)␤(Capture)␤»
Skarsnik lizmat, renaming the class change nothing ^^
lizmat :-(
12:25 muraiki joined
timotimo Skarsnik: as i said, you're apparently building a totally common use-loop 12:26
well, i didn't say it exactly like that 12:27
Skarsnik Yes, but should it detect it? x)
timotimo hm.
well, it could, i guess
RabidGravy I thought it used to to be honest
12:27 pjscott joined
RabidGravy at least at the first level 12:27
timotimo it used to be honest? :P
Skarsnik I can't install another rakudo aside this one. I don't have free space x) 12:28
RabidGravy now it's corrupt and deceitful
anyway, off out for about
nine RabidGravy: yes we had a circular dependency detection.
12:29 sjoshi joined, sammers left
Skarsnik hm, let add space to this system 12:29
lizmat Skarsnik: I just found out I had 350MB of precomp in my ~/.perl6 dir 12:30
perhaps that needs cleaning
Skarsnik oh
root@testperl6:~/piko/Discord# du -sh ~/.perl6/
39M /root/.perl6/
not that bad x)
12:32 RabidGravy left, lnrdo left
timotimo i only have 18mb in there 12:33
12:34 lnrdo joined
nine if you compile rakudo a couple times per day, it accumulates faster 12:34
timotimo right 12:35
Skarsnik let's update virtual box ) 12:36
12:36 AlexDaniel joined
lizmat every commit I do, is at least one compile + spectest cycle 12:38
AlexDaniel huggable: help
huggable AlexDaniel, I'm a factoid bot. See me my source at github.com/zoffixznet/perl6-IRC-Cl...in-Factoid
12:40 sena_kun joined 12:41 virtualsue left, sammers joined 12:42 virtualsue joined, virtualsue left, lnrdo left
AlexDaniel huggable: @arr.flat as 「Array.flat」 is gesigned to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121 12:42
huggable AlexDaniel, nothing found
AlexDaniel huggable: flat as 「Array.flat」 is gesigned to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121 12:43
huggable AlexDaniel, nothing found
12:43 lnrdo joined
timotimo you need ":is:" 12:43
AlexDaniel huggable: @arr.flat :is: 「Array.flat」 is gesigned to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
huggable AlexDaniel, Added @arr.flat as 「Array.flat」 is gesigned to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
AlexDaniel huggable: @arr.flat
huggable AlexDaniel, 「Array.flat」 is gesigned to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
AlexDaniel ok
gesigned… dammit 12:44
timotimo hahaha
AlexDaniel huggable: ^delete @arr.flat
huggable AlexDaniel, Marked factoid `@arr.flat` as deleted
timotimo it seems like you can just :is: it again and it'll be edited
AlexDaniel huggable: @arr.flat :is: 「Array.flat」 is designed to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
huggable AlexDaniel, Added @arr.flat as 「Array.flat」 is designed to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
AlexDaniel huggable: @arr.flat
huggable AlexDaniel, 「Array.flat」 is designed to flat shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
AlexDaniel I'm not sure if “to flat” is correct English, it is probably not… 12:45
timotimo nah, "to flatten" should be right
lizmat flatten
AlexDaniel huggable: @arr.flat :is: 「Array.flat」 is designed to flatten shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
huggable AlexDaniel, Added @arr.flat as 「Array.flat」 is designed to flatten shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
AlexDaniel huggable: @arr.flat
huggable AlexDaniel, 「Array.flat」 is designed to flatten shaped arrays. See rt.perl.org/Public/Bug/Display.html?id=127121
AlexDaniel great
timotimo it seems like the ^delete step is also recorded as just an edit 12:47
dalek kudo/nom: 997d7d1 | lizmat++ | src/core/ (2 files):
Make RAKUDO_MODULE_DEBUG output a bit more readable
AlexDaniel huggable: hyper problems :is: See rt.perl.org/Public/Bug/Display.html?id=127099 and rt.perl.org/Public/Bug/Display.html?id=127190
huggable AlexDaniel, Added hyper problems as See rt.perl.org/Public/Bug/Display.html?id=127099 and rt.perl.org/Public/Bug/Display.html?id=127190
dalek ast/linkable-anchors: 64b031f | (Brock Wilcox)++ | S03-operators/bit.t:
Add annotations to make roast deep-linkable
12:48
AlexDaniel huggable: ugly stacktraces :is: Indeed, stacktraces are less than awesome due to how precompilation works. This is a known issue. There is also a bug report: rt.perl.org/Public/Bug/Display.html?id=126908 12:49
huggable AlexDaniel, Added ugly stacktraces as Indeed, stacktraces are less than awesome due to how precompilation works. This is a known issue. There is also a bug report: rt.perl.org/Public/Bug/Display.html?id=126908
nine AlexDaniel: you could probably /msg that to the bot
AlexDaniel nine: oh yeah, perhaps. Though maybe it is useful for others to see what I am adding. I hope that it's not too spammy 12:51
sena_kun Where does panda store modules? I removed .perl6 but they are still here. 12:52
nine m: say CompUnit::RepositoryRegistry.repository-for-name("site"); 12:53
camelia rakudo-moar 997d7d: OUTPUT«inst#/home/camelia/rakudo-m-inst-1/share/perl6/site␤»
nine sena_kun: ^^^
FROGGS nine: can we already query a module for its storage location?
nine: or at least which cur is responsible? 12:54
nine: or what was the pendant of .candidates again? 12:55
nine FROGGS: no that's unmerged in the query_repos branch 12:56
That branch contains even an uninstall method 12:57
timotimo neato!
12:58 kaare_ joined
FROGGS uhhhh! 12:58
nine++
bbl
nine The thing with uninstall is, that it takes a Distribution object leaving the question, where this object is coming from. That could be $*REPO.resolve(CompUnit::DependencySpecification(:short-name<Inline::Perl5>, :ver(v0.1)).dist but that feels like a bit of a roundabout way. 13:01
13:01 brrt left
nine my $comp-unit = $*REPO.resolve(CompUnit::DependencySpecification(:short-name<Inline::Perl5>, :ver(v0.1)); $comp-unit.repo.uninstall($comp-unit.dist); 13:02
13:03 brrt joined, brrt left 13:04 sftf joined 13:05 FROGGS left
sena_kun If it works, then where is the problem? Bad code you can rewrite as fast as you find better solution and make a commit, but everytime reinstalling all perl6 by hands - isn't it harder/worse? 13:05
13:05 xyf left
nine sena_kun: I'm not sure what you mean? 13:06
sena_kun: are you arguing for merging that branch?
sena_kun nine, *
DrForr And '*' means what? 13:07
sena_kun nine, you said that code above is a bit unclear and smells. But if it works... I can't be confident, because I don't know rules of merging here, but I don't think that package manager without "uninstall" button is strange anyway. 13:08
s/don't// 13:09
masak hello from a _train_ \o/ 13:10
13:10 ribasushi left
nine sena_kun: we're currently figuring out how to do backwards incompatible changes in Perl 6. I think we have a decent plan and we have made progress on the implementation and I think we can merge that soon. Then we can return to merge feature branches quickly. 13:10
timotimo yo masak, happy training!
sena_kun DrForr, I just sent notification, because I forgot it in previous message. So '*' means something like 'Look at previous message'. 13:11
13:11 sjoshi left, grassass left
DrForr Ah. 13:12
timotimo i think in this channel we usually write ^, ^^ or ^^^
or sometimes even ^^^^
sena_kun nine, if it so - okay, sorry for arguing about things I don't know well yet.
masak timotimo: the actual training is tomorrow :P
DrForr masak: What on, if I might ask? 13:13
(as I might want to compare notes...)
sena_kun timotimo, thanks.
lizmat m: .say for dir
camelia rakudo-moar 997d7d: OUTPUT«"/home/camelia/.cpanm".IO␤"/home/camelia/.local".IO␤"/home/camelia/.npm".IO␤"/home/camelia/.perl6".IO␤"/home/camelia/.perlbrew".IO␤"/home/camelia/.rcc".IO␤"/home/camelia/.ssh".IO␤"/home/camelia/Perlito".IO␤"/home/camelia/evalbot".IO␤"/hom…»
13:13 jeek left
lizmat and here I thought we had disallowed dir() without args ? 13:14
Skarsnik ok, recent rakudo still does not see the circular depandacy
lizmat m: .say for dir("") # ah, the empty string
camelia rakudo-moar 997d7d: OUTPUT«Must specify something as a path: did you mean '.' for the current directory?␤ in block <unit> at /tmp/IW7Ca8r0u2 line 1␤␤»
nine sena_kun: just shows you care :)
13:15 _Vi left, muraiki left
daxim doc.perl6.org/» click on the link titled "'»' is a regex" - 404 13:15
13:16 travis-ci joined
travis-ci Doc build canceled. Wenzel P. P. Peppmeyer 'Merge pull request #343 from gfldex/master 13:16
travis-ci.org/perl6/doc/builds/101789123 github.com/perl6/doc/compare/fcaf3...076e859e1a
13:16 travis-ci left 13:17 grassass joined, rurban1 joined
daxim doc.perl6.org/syntax/$/ likewise 404 13:18
gfldex doc.perl6.org/syntax/%24 <-- works
masak DrForr: Git, this time
timotimo why don't we try an automated crawler that reports 404s? 13:19
daxim I don't want $ I want $/
13:19 rurban left
DrForr Cool. I could probably use that course :) 13:19
masak DrForr: we seem to have a constant trickle of Git deliveries. (and we like that, because we have lots of in-house Git knowledge.)
13:22 suman joined, sjoshi joined
AlexDaniel by the way, non-texas version of ^ is ↑ (though any other unicode arrow will do) 13:22
masak m: say 1 ^ 2; say 1 ↑ 2 13:23
camelia rakudo-moar 997d7d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/07tA4JwXOh␤Confused␤at /tmp/07tA4JwXOh:1␤------> 3say 1 ^ 2; say 17⏏5 ↑ 2␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ statem…»
masak AlexDaniel: Rakudo seems to disagree.
suman There's a great need to improve Perl 6 documentation. While python's documentation is awesome, perl 6 has still a lot to go.
AlexDaniel in IRC, not in Perl 6 :D
13:23 xyf joined 13:24 wamba joined
DrForr suman: Volunteers gladly accepted! 13:25
AlexDaniel it seems that you can't enter ↓ and ↑ using compose key by default
DrForr Hrm, I could use that to add the tetration operator :)
Skarsnik Cool be nice to have a tool provided with rakudo like debianbugrepport x) 13:26
13:26 DukeOfPerl joined
daxim AlexDaniel, AltGr+y …+u …+i …+U on a qwerty ←↓→↑ 13:26
Skarsnik ok circular dependancy repported x) rt.perl.org/Ticket/Display.html?id=127247 13:27
AlexDaniel daxim: what the idea behind those?
daxim also, if you install kragen's .XCompose, you get Compose - > resulting →
define idea
AlexDaniel daxim: U perhaps stands for Up, but what about the others? 13:28
<- and -> are supported by compose key in linux by default
it's just that there is no ↑↓
13:28 DukeOfPerl left
nine Skarsnik: AFAIK there's already an open ticket for that 13:29
Skarsnik: I merged the tickets 13:30
daxim you assume they were chosen for mnemonic value, but this isn't the case!
Skarsnik erf, sorry
dalek kudo/nom: 5ed58f6 | lizmat++ | / (6 files):
Rip out remaining dead code from newio branch
13:31 sjoshi left
daxim with kragen's .XCompose: (Compose up up) or (Compose - ^) giving ↑, (Compose down down) or (Compose - v) giving ↓ 13:31
13:31 kjs_ left
suman And also we don't have much video tutorials on youtube, even for perl 5. While python has thousands (PyData, Enthought, Continuum) and what not. Its easier to migrate to python for newcomers due to vast amount of video tutorials and resources. We need to have the same abreadth of materials for perl 6 too. 13:31
13:31 xpen joined
daxim I want a pony. 13:32
AlexDaniel daxim: that totally makes sense and it is great
dalek ast: b6f5abc | lizmat++ | S (2 files):
Remove references to dead code of newio branch

The code was not referenced, and could only be run if you knew of its internals. So, as far as I'm concerned, this is a valid change to the 6.c version of roast and to be cherry-picked if necessary.
masak heh, I just found blogs.perl.org/users/leon_timmerman...erent.html 13:33
AlexDaniel suman: I don't think that anybody will disagree with that. The question is, who is going to do that (if not you)? :)
masak apparently macros in Perl 6 are really really cool :P
moritz masak: make it true!
masak on a more serious note, I find it difficult to engage in that comment thread, because they're talking about Perl 6 macros without any knowledge of what has happened since the Big Investigation started 13:34
let me take some examples, and leave it at that:
_nadim can one scope a "use Module::Something"?
lizmat afk for a few hours again& 13:35
masak from the post itself: "In Lisp macros are possible because its uniform syntax of trees of symbols. In Perl 6 macros are made possible by its key innovation."
moritz masak: I saw the hn submission of the article with (2010) in the heading, and immediately decided not to read it
masak I don't really know what that means :)
oh! 2010!
that makes more sense, then
Skarsnik x)
moritz _nadim: imports are lexical anway
masak anyway
Qtrees are pretty un-Lisp-like at this point
suman AlexDaniel unfortunately I am also a newbie. I am myself learning python with the videos I have heard of perl's power of text processing. Thus I am fascinated towards perl. However I am having difficulty learning it myself. Definitely I don't have enough materials. 13:36
masak the closer comparison is IntelliJ's PSI
13:36 DukeOfPerl joined
AlexDaniel suman: that's really, really good! You're the one that can do this job better than others! 13:36
DukeOfPerl has been working towards Perl AI since 1965, before Perl came to be. 13:37
DrForr suman: Perl 5 is better documented by far, but Perl 6 is new, and you sound like you'd be an ideal candidate for stumbling into the dark holes where things are missing :)
masak "The reason lisps are what they are is that they're homoiconic, i.e. the representation of the program is also a data structure [...] of the language itself." -- this is true in Perl 6. Qtrees are a data structure of the language itself.
DukeOfPerl ai.neocities.org/P6AI_man.html -- Killer App User Manual
DukeOfPerl is getting out of Dodge after a drive-by P6AI meme-insertion.
13:37 DukeOfPerl left
_nadim moritz: thanks for the information 13:38
masak "How would I define the equivalent of a Lisp macro to turn (5 10 /) into (/ 10 5) in Perl 6?" -- the current answer, unimplented so far but fairly straightforward, is visitor macros. (or perhaps they will be called "watcher macros") 13:39
AlexDaniel .u 🐪
yoleaux U+1F42A DROMEDARY CAMEL [So] (🐪)
AlexDaniel .u 🐫
yoleaux U+1F42B BACTRIAN CAMEL [So] (🐫)
masak (as in "watcher doin' there, buddy?") :P
AlexDaniel two camels in unicode but no butterfly
whyyy…
suman DrForr even the documentation should look attractive I guess :) May be we can change theme of perl 5 documentation. No offense, I find python's documenation eegant. 13:40
masak "Lisp is not something to aspire to. It's alleged beauty lies in its rejection of all the useful tools of communication in favor of the dubious benefits of homoiconicity." -- good news! Qtrees don't turn everything into a cons list! :D
lizmat m: say ++"🐪"
camelia rakudo-moar 997d7d: OUTPUT«Cannot call prefix:<++>(Str); none of these signatures match:␤ (Mu:D $a is rw)␤ (Mu:U $a is rw)␤ (Int:D $a is rw)␤ (int $a is rw)␤ (Bool $a is rw)␤ (Num:D $a is rw)␤ (Num:U $a is rw)␤ (num $a is rw)␤ in block <uni…»
daxim U+1F98B BUTTERFLY
lizmat m: my $a = "🐪"; $a++; say $a
camelia rakudo-moar 997d7d: OUTPUT«🐫␤»
lizmat m: my $a = "🐪"; $a++; say $a.uniname
camelia rakudo-moar 997d7d: OUTPUT«BACTRIAN CAMEL␤»
lizmat m: my $a = "🐪"; say $a.uniname; $a++; say $a.uniname
camelia rakudo-moar 997d7d: OUTPUT«DROMEDARY CAMEL␤BACTRIAN CAMEL␤»
lizmat :-)
masak "I hope Perl 6 only steals some aspects of macro from Lisp. I hope it stays true to Perl 1-5's design, that is: caring about syntax and making things easy for the programmers instead of parsers." -- check.
that is all. 13:41
lizmat: that looks like a lightning talk all on its own :P
lizmat it's just an easter egg I put in long ago :-) 13:42
arnsholt masak: Where are those quotes from?
nm. I learned how to backlog 13:43
masak blogs.perl.org/users/leon_timmerman...erent.html
[Coke] m: CORE::.values.map({$_.WHAT}).grep(* !~~ Sub) # Is this a bug?
camelia ( no output )
AlexDaniel Zoffix++ # nice blog post
[Coke] (locally that dies with a complaint about shortname) 13:44
masak I found nothing all that quoteworthy from the HN thread: news.ycombinator.com/item?id=10884950
lizmat [Coke]: because IterationEnd lives in CORE::, .values doesn't work right on CORE::
zefram++ pointed that out extensively
DrForr suman: It's not going to get better without people working on it, how about it?
suman DrForr 13:45
DrForr Yeah I agree. I will contribute as much as I can.
masak no need for that double negation. it *is* going to get better *with* people working on it -- right? ;) 13:46
nine m: say CORE::.values.map({$_.WHAT}).grep(* !~~ Sub)
camelia rakudo-moar 997d7d: OUTPUT«Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CurriedRoleHOW'␤ in block <unit> at /tmp/41NzwQrmnJ line 1␤␤»
masak I mean, that seems to be the likely path ahead to me.
DrForr Cool! I'm probably going to write some placeholder s/// docs this weekend... 13:47
masak does anyone else find adverb node attachment hard to reason about in practice? 13:48
moritz masak: me
masak I just had a situation where I inserted a `&&` in code, and the `&&` "stole" the adverb from a .{}
jnthn lizmat: IterationEnd will likely end up becoming a term defined in the compiler and mapped to something under Rakudo::Internals.
AlexDaniel oh wow 13:49
who's that? :)
jnthn: I missed you! :)
jnthn o/ AlexDaniel :)
masak jnthn! \o/ 13:50
jnthn masak: I think that in no small part comes from them being parsed as pretend infixes...
[Coke] I've spotted a wild jnthn++ !
jnthn And so precedence comes in to play.
masak jnthn: thing is, it's *correct* semantics. after the fact, I can explain to myself how it happened
jnthn: but it still makes me think, because I tend to want to understand things that trip me up 13:51
jnthn: it seems I need something like a mental rule "hey, there's an adverb here. proceed with caution -- don't just insert more infixes before it"
jnthn I guess you can use "and" instead of && to fix the case in question?
masak probably. but that's off-putting to me, since I always use `&&` in `if` statements 13:52
I only use `and` between statements
13:52 suman left 13:55 xpen left, rurban1 left
sergot doc.perl6.org/routine/.%3F 13:56
13:57 rurban1 joined
sergot there is a problem when searching for ? and clicking "Postfix .?" 13:57
jnthn masak: Yes, can sympathize with that...
masak jnthn: I ended up writing it as `$expr && ($obj{$key} :exists)`
[Coke] sergot: can you open a ticket on github.com/perl6/doc/issues ?
sergot: We have a few cases where the search or the filename is wonky still 13:58
moritz iirc there are several open issues regarding search and/or weird URLs
sergot [Coke]: of course :)
moritz our options are limited as long as we remain with static pages
13:59 raiph joined
AlexDaniel moritz: what about something like this: stackoverflow.com/questions/1613652...parameters 14:00
moritz AlexDaniel: that requires dynamic content, yes 14:01
14:01 risou is now known as risou_awy
AlexDaniel right 14:01
or at least some kind of a wrapper 14:02
14:02 risou_awy is now known as risou
AlexDaniel wait, I think that I wanted to do it other way round 14:02
14:02 sena_kun left
moritz AlexDaniel: though when we do that, we can use the URL routing facility of the web framework we use; don't need to use mod_rewrite then 14:02
AlexDaniel: the problem is that / can't be part of file names, and there are some odditiies with dots too 14:03
lucs Does anything like 'stat' exist yet?
AlexDaniel moritz: right
moritz mapping // as a search term to //.html is... problematic :-)
timotimo lucs: yeah, we have something™
sergot moritz: what stops us from making it dynamic? I remember there was an issue with p6 speed, is it still the thing?
moritz: I mean, writing dynamic framework or something 14:04
moritz sergot: speed and stability matter, yes
lucs timotimo: "something™", right :) Any details?
timotimo i ... don't know details :o
sergot moritz: oh, ok, thanks :)
AlexDaniel lucs: what do you need exactly?
wollmers jnthn: bitops with uint64 work with my module LCS::BV, using bit vectors and carry.
timotimo i never work with files, you know ...
we have things like .e for exists, though
moritz sergot: and one of the main things: writing it is not enough; it needs to maintained
lucs AlexDaniel: Get a file's owner user/group. 14:05
sergot moritz: right
sounds like a good GSoC project, hehe :)
moritz sergot: and since I seem to be the one who runs most of the *.perl6.org infrastructure and thus end up maintaining it, I don't want anything clever
jnthn wollmers: Is there a reason you're telling me this? :) (Note, I didn't backlog...)
AlexDaniel lucs: ehhh I don't see how could you retrieve those, but you can change it: doc.perl6.org/type/IO::Path#routine_chmod
jnthn wollmers: Or is the point that your module is doing something right that core is doing wrong? 14:06
sergot moritz: right, is it a matter of "no one else wants to do this", or something else?
14:06 itaipu left
sergot moritz: I mean, maintaining *.perl6.org 14:06
wollmers jnthn: I submitted a bug long ago. But only sprintf has the problem.
moritz sergot: seems like
jnthn wollmers: Ah, OK
sergot moritz: well, I think I can give you a pair of hands... I guess.. 14:07
jnthn I think there are other issues with uint64
moritz sergot: whenever there's problem with the infrastructure side, nothing happens until I do it; I'd be happy to have help with it though :-)
[Coke] Given how slow it is to generate static pages, I am leery that a dynamic site is going to be usable, speed wise.
sergot moritz: I'm offering you my help then :)
lucs AlexDaniel: Hmm... Not quite what I need, eh.
[Coke] In theory, however, I want the site to be dynamic so we can do more clever stuff.
moritz sergot: please /msg me your ssh public key(s)
sergot moritz: oki :) 14:08
moritz [Coke]: well, it'd need to be a hybrid; parse the .pod, generate HTML snippets and graphs etc. and an index
[Coke]: and then at run time, combine and serve these snippets
[Coke] htmlify.p6 declares %*POD2HTML-CALLBACKS and assigns to them, but never reads them back out. 14:11
moritz [Coke]: Pod::To::HTML does that 14:12
sergot tadzik++ started to work on tadzik/Bailador, it's something
AlexDaniel sergot: by started to work you mean? 14:13
masak question for everyone: now that Rakudo has precompilation built in, is it time to retire ufo?
[Coke] RT: 1197; GLR: 6; NOM: 7; JVM: 57; WEIRD: 13; LHF: 1; LTA: 117 14:15
jnthn masak: I'd considered using it in the past (but was too lazy) for speeding up my module development
sergot AlexDaniel: he started the project, made it work, and ... it's not so fresh right now
jnthn masak: But I get that for free now
sergot AlexDaniel: but it's easy to continue the work actually
jnthn masak: And I "panda --force install ." for testing installed versions of my modules
AlexDaniel sergot: well, atm it is pretty dead…
sergot AlexDaniel: yep :( 14:17
PerlJam masak: I don't know if this is a good data point for you or not, but the fact that ufo still exists always catches me by surprise :) 14:20
moritz PSA: sergot has now joined the ranks of web server administrators for perl6.org et al; if something goes wrong, please ping him as well as me 14:21
_nadim How do I pass a pair to a sub and get it "parsed' by the capture? for %h {my_sub($_) } ; my sub ($k, $v) {}
sergot moritz++ 14:22
14:22 virtualsue joined, TEttinger joined
hoelzro I always felt that Pairs should destructure to two element lists 14:22
moritz _nadim: my_sub(.key, .value)
hoelzro but I never really spent time thinking about the pros and cons, and that may just be P5 habits carrying over 14:23
jnthn %h.kv.map(&my_sub) # also cute
_nadim OK, can you please explain hte mechanism behind the .something?
moritz _nadim: .foo is short for $_.foo
m: sub f( $ (:$key, :$value) ) { say "$key: $value" }; f "a" => "x" 14:24
camelia rakudo-moar 5ed58f: OUTPUT«a: x␤»
moritz that's with a sub-signature
14:24 pmurias joined, cdg joined
_nadim I kinda like tha more 14:25
But I can't seem to be able to type the lements of the pair, and it doesn't matter which way i use 14:28
PerlJam _nadim: show code. 14:29
moritz m: sub f( $ (:$key, Int :$value) ) { say "$key: $value" }; f "a" => "x"
camelia rakudo-moar 5ed58f: OUTPUT«cannot stringify this␤ in sub f at /tmp/3IV7exB7jb line 1␤ in block <unit> at /tmp/3IV7exB7jb line 1␤␤»
_nadim m: sub f( $ (Str :$key, Str :$value) ) { say "$key: $value" }; f "a" => "x"
camelia rakudo-moar 5ed58f: OUTPUT«a: x␤»
moritz m: sub f( $ (:$key, Int :$value) ) { say "$key: $value" }; f "a" => Any 14:30
camelia rakudo-moar 5ed58f: OUTPUT«cannot stringify this␤ in sub f at /tmp/3PKdPXISCn line 1␤ in block <unit> at /tmp/3PKdPXISCn line 1␤␤»
moritz huh, the error message sucks
_nadim m: multi sub f( $ (Str :$key, Str :$value) ) { say "$key: $value" }; multi sub f( $ (Str :$key, Int :$value) ) { say "$key: $value" }; f "a" => "x" ; f "a" => 1 ;
camelia rakudo-moar 5ed58f: OUTPUT«a: x␤a: 1␤»
_nadim OK, works here, I check again in my code 14:31
14:32 xyf left
[Coke] m: my $b; { my $_ = 5; $b = { .say } }; $_ = 42; $b() 14:33
camelia rakudo-moar 5ed58f: OUTPUT«Potential difficulties:␤ Redeclaration of symbol $_␤ at /tmp/WS71v3CtJJ:1␤ ------> 3my $b; { my $_7⏏5 = 5; $b = { .say } }; $_ = 42; $b()␤42␤»
[Coke] masak: ^^ How does this impact RT #78278 ?
14:33 molaf joined 14:34 RabidGravy joined 14:36 wamba left 14:38 skids joined
dalek p: 75bd5c2 | (Pawel Murias)++ | src/vm/js/ (2 files):
[js] Implement nqp::readlink.
14:39
p: 3e8aa5b | (Pawel Murias)++ | t/nqp/19-file-ops.t:
Test nqp::readlink.
14:41 xpen joined
AlexDaniel Hm. Change all . to . and all / to / or something like that. Allow these in Perl 6 and there you go, no problem with static files. 14:45
.oO( a minute of crazy ideas ↑ )
masak m: my $b; { $_ = 5; $b = { .say } }; $_ = 42; $b()
camelia rakudo-moar 5ed58f: OUTPUT«42␤»
masak [Coke]: I'm on a bad connection -- can't load the ticket. is the above good enough?
[Coke] .ask TimToady if he can decide on the right behavior for rt.perl.org/Ticket/Display.html?id=112216 14:46
masak [Coke]: I'm unsure whether the redeclation error is bogus or not.
yoleaux [Coke]: I'll pass your message to TimToady.
_nadim moritz: is the subsignature way of doing it very new? I get error: Cannot call declare(Pair); none of these signatures match: ($ (Str :$variable, Hash :$value)) ... ($ (Str :$variable, List :$value)) ...
[Coke] masak: the ticket is years old and the behavior has changed.
moritz _nadim: not new
_nadim: but the names matter; a Pair has attributes 'key' and 'value', so you must use those names 14:47
[Coke] masak: no rush, deal with it later.
_nadim moritz: argggg!
and thanks
14:47 Ch0c0late joined
moritz _nadim: you can rename, however: ($ Str :key($variable), Hash :$value) 14:47
_nadim beautiful! I looked at the name and thought "noooo, can't be that"
14:49 pmurias left, rurban1 left, _Vi joined
_nadim hmm, it seems that 80% of P5::Text::Template can be re-written in 10 lines of code! I guess I have to package it now. 14:50
14:51 AlexDaniel left, Zoffix joined
_nadim moritz: you said that imports are scoped, which I tried of course, but is MONKEY-SEE-NO-EVAL also scoping? 14:51
Zoffix Should this DWIM?
yoleaux 08:01Z <nine> Zoffix: very nice blog post :)
Zoffix m: ^10 .Seq.say
camelia rakudo-moar 5ed58f: OUTPUT«Method 'Seq' not found for invocant of class 'Range'␤ in block <unit> at /tmp/lFXq92JWFI line 1␤␤»
Zoffix m: ^10 .List.Seq.say
camelia rakudo-moar 5ed58f: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
Zoffix Thanks.
JimmyZ where is Zoffix's post? 14:52
Zoffix JimmyZ, blogs.perl.org/users/zoffix_znet/20...erl-6.html
JimmyZ oh, I saw it yesterday evening. 14:53
moritz _nadim: dunno; try it and see?
masak [Coke]: yeah, I read through rt.perl.org/Ticket/Display.html?id=78278 -- the observable seems to be defunct under the new semantics, so the ticket might be moot. my guess is that doing `my $_` clashes nowadays with the (implicit) `$_` parameter. that's fine. 14:55
[Coke]: the thing I can't answer easily is whether the ticket points to an issue or faulty semantics that we still have, and that can be expressed in some other way.
[Coke]: someone smarter than me might be able to see that.
14:57 domidumont left
[Coke] m: say 3½ # wonder if there's any way to sanely make this work. 14:58
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/H6cy4Qq__D␤Bogus postfix␤at /tmp/H6cy4Qq__D:1␤------> 3say 37⏏5½ # wonder if there's any way to sanely ␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ s…»
14:59 itaipu joined
Zoffix Yeah, I had a working code for that a month or so ago :) 15:00
Zoffix tries again
m: sub postfix:<½> { $^a+½ }; say 3½ + ½ 15:01
15:01 pjscott left
camelia rakudo-moar 5ed58f: OUTPUT«4␤» 15:01
Zoffix Well. Not sure if that qualifies as "sanely", since you'd have to introduce like a dozen of ops ^_^
15:02 uruwi_ left, nowan left
Zoffix m: sub postfix:('½', '⅓') { $^a+&?ROUTINE.name.substr(9,1).Int }; say 3½ 15:03
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SDQrthc4Ki␤Bogus postfix␤at /tmp/SDQrthc4Ki:1␤------> 3+&?ROUTINE.name.substr(9,1).Int }; say 37⏏5½␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ state…»
15:06 nowan joined
andreoss m: say ¼ 15:07
camelia rakudo-moar 5ed58f: OUTPUT«0.25␤»
15:08 sortiz joined, pmurias joined
pmurias how can I test nqp::gethostname? 15:08
yoleaux 11 Jan 2016 19:12Z <[Coke]> pmurias: we have no stats on that sort of thing, but we've never had a java-based christmas. 15:09
dalek p: f500636 | (Pawel Murias)++ | src/vm/js/ (2 files):
[js] Implement nqp::gethostname.
15:10 _Gustaf_ left, wamba joined
sortiz morning #perl6 15:10
Zoffix m: sub postfix:{$_} { $^a+$_ } for '½'; say 3½ + ½
camelia rakudo-moar 5ed58f: OUTPUT«===SORRY!===␤Internal error: find_var_decl could not find $_␤»
Zoffix Interesting error :}
15:10 harrison_ joined
Zoffix m: use MONKEY-SEE-NO-EVAL; EVAL "sub postfix:{$_} \{ \$^a+$_ \}" for '½'; say 3½ + ½ 15:11
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Val39a41LL␤Bogus postfix␤at /tmp/Val39a41LL:1␤------> 3stfix:{$_} \{ \$^a+$_ \}" for '½'; say 37⏏5½ + ½␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
Zoffix Hm. What's :context on EVAL? I see it used here github.com/rakudo/rakudo/blob/nom/...t.pm6#L447 but it's not in the docs docs.perl6.org/routine/EVAL 15:12
15:12 FROGGS joined
Zoffix From the name I can surmise the meaning, but... is there a way to make that EVAL "sub ..." sub be available in the outer context? 15:12
mspo that LOC is crazy 15:13
Skarsnik hm, how do I get the script directory?
mspo EVAL $code, context => CALLER::CALLER::CALLER::CALLER::;
15:13 rurban joined
moritz Zoffix: context => OUTER:: 15:15
timotimo Zoffix: there is not. lexical scopes are compile-time constructs.
andreoss m: EVAL 'my sub foo { say q{bae} }', context => OUTER::; foo
mspo m: say %*ENV{_}
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tr7rmhl2qc␤Undeclared routine:␤ foo used at line 1␤␤»
rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3dg_YJvTtL␤Undeclared name:␤ _ used at line 1␤␤»
moritz Zoffix: BUT I think it's intentional that it's undocumented, because it's a rather hacky feature
15:15 ruoso joined
moritz right, it gives EVAL the outer lexical context, but you can't add to it 15:15
andreoss m: EVAL 'my sub foo { say q{bae} }', context => CALLER::CALLER::CALLER::CALLER::; foo
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zBqrrGaI2F␤Undeclared routine:␤ foo used at line 1␤␤»
mspo m: say %*ENV<_> 15:16
Zoffix m: say $*SPEC.catpath: ($*SPEC.splitpath: $?FILE)[0 .. *-1]
camelia rakudo-moar 5ed58f: OUTPUT«/home/camelia/perl5/perlbrew/perls/perl-5.20.1/bin/perl␤»
rakudo-moar 5ed58f: OUTPUT«Too few positionals passed; expected 4 arguments but got 2␤ in block <unit> at /tmp/XiZwELls1j line 1␤␤»
Zoffix m: use MONKEY-SEE-NO-EVAL; EVAL "sub postfix:{$_} \{ \$^a+$_ \}", context => OUTER:: for '½'; say 3½ + ½ 15:17
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tuGLp3A5Bd␤Bogus postfix␤at /tmp/tuGLp3A5Bd:1␤------> 3_ \}", context => OUTER:: for '½'; say 37⏏5½ + ½␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
Skarsnik m: say $*PROGRAM.perl;
camelia rakudo-moar 5ed58f: OUTPUT«"/tmp/lyJ676iZYJ".IO(:SPEC(IO::Spec::Unix),:CWD("/home/camelia"))␤»
Zoffix Ah
15:17 harrison_ left, rurban1 joined, rurban left
Skarsnik m: say $*PROGRAM.CWD; 15:18
camelia rakudo-moar 5ed58f: OUTPUT«/home/camelia␤»
Skarsnik m: say $*PROGRAM.basedir;
camelia rakudo-moar 5ed58f: OUTPUT«Method 'basedir' not found for invocant of class 'IO::Path'␤ in block <unit> at /tmp/4NiJdbXu9N line 1␤␤»
[Coke] dd 15:19
... weird. Sorry about that.
Skarsnik Oh it's dirname x)
andreoss m: $*PROGRAM.CWD.IO.chmod(0x000) 15:20
camelia ( no output )
_nadim moritz: MONKEY-SEE-NO-EVAL is also scoped.
Skarsnik m: say $*PROGRAM.dirname;
Zoffix m: use MONKEY-SEE-NO-EVAL; &::($_) = EVAL "sub postfix:<$_> \{ \$^a+$_ \}" for '½';
camelia rakudo-moar : OUTPUT«Permission denied»
15:20 pierre-vigier left
Zoffix haha 15:20
andreoss lol
15:20 rurban joined
camelia rakudo-moar : OUTPUT«(timeout)» 15:20
Zoffix m: say "what have you done!"
camelia rakudo-moar : OUTPUT«Permission denied»
Skarsnik xD
Zoffix andreoss, lol. You're bad, bad boy :P 15:21
camelia rakudo-moar : OUTPUT«(timeout)»
andreoss m: $*PROGRAM.CWD.IO.chmod(0x775)
camelia rakudo-moar : OUTPUT«Permission denied»
Skarsnik whelp
Zoffix pokes moritz to a fix :)
[Coke] so when someone deliberately breaks camelia, that's, what, a 24 hour ban?
camelia rakudo-moar : OUTPUT«(timeout)»
moritz is inclined to wait and see if a rebuild fixes it
Zoffix Nah, we'd have to connect to the box and change the mode manually
Hm
Maybe
15:22 rurban1 left
Zoffix gets an idea 15:22
Zoffix 's idea didn't work
15:23 domidumont joined
masak :) 15:23
moritz m: say 42
camelia rakudo-moar 5ed58f: OUTPUT«42␤»
moritz andreoss-- 15:24
Zoffix :D
moritz FTR it was manual intervention that fixed it, not a rebuild
15:24 pmurias left, rurban1 joined
moritz m: say m: $*PROGRAM.CWD 15:24
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/JwTbjxNBOA␤Colons may not be used to delimit quoting constructs␤at /tmp/JwTbjxNBOA:1␤------> 3say m:7⏏5 $*PROGRAM.CWD␤ expecting any of:␤ colon pair (restricted)␤»
Zoffix So... What is that "restricted setting" thing? Is that something that comes with Perl 6 or is it something that's configured manually?
moritz m: say $*PROGRAM.CWD
camelia rakudo-moar 5ed58f: OUTPUT«/home/camelia␤»
15:24 sena_kun joined 15:25 joydon joined
Zoffix Asking for whether the .chmod thing is a whole in a general restricted setting mode.. 15:25
s/whole/hole/;'
moritz Zoffix: it comes with rakudo, and you can invoke it with --setting=restricted or something
15:25 rurban left, pmurias joined
Skarsnik m: say $*PROGRAM.dirname; 15:27
camelia rakudo-moar 5ed58f: OUTPUT«/tmp␤»
Skarsnik hm, evalbot in not in /home/camelia?
Zoffix Skarsnik, it is, but it spawns a temp program for each eval
moritz Skarsnik: evalbot != the program being executed
Skarsnik Oh right
Zoffix Um, how do I go through all unicode characters? I've see it evaled here... Like I want to grep all .uninames for something 15:28
15:28 Fleurety joined
Skarsnik damn that sucks, I need to upgrade my perl6 install on my dedicated server 15:28
Could not find MONKEY-SEE-NO-EVAL in any of:
moritz m: for 1..65536 { try say .chr if uniname($_) =~ /GREEK/ }
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/14f_RtPCK6␤Unsupported use of =~ to do pattern matching; in Perl 6 please use ~~␤at /tmp/14f_RtPCK6:1␤------> 3..65536 { try say .chr if uniname($_) =~7⏏5 /GREEK/ }␤»
moritz m: for 1..65536 { try say .chr if uniname($_) ~~ /GREEK/ }
camelia rakudo-moar 5ed58f: OUTPUT«͂␤̓␤̈́␤ͅ␤Ͱ␤ͱ␤Ͳ␤ͳ␤ʹ␤͵␤Ͷ␤ͷ␤ͺ␤ͻ␤ͼ␤ͽ␤;␤Ϳ␤΄␤΅␤Ά␤·␤Έ␤Ή␤Ί␤Ό␤Ύ␤Ώ␤ΐ␤Α␤Β␤Γ␤Δ␤Ε␤Ζ␤Η␤Θ␤Ι␤Κ␤Λ␤Μ␤Ν␤Ξ␤Ο␤Π␤Ρ␤Σ␤Τ␤Υ␤Φ␤Χ␤…»
nine moritz: is it that EVAL really can't add to the outer context, or that the surrounding code can't use those additions at compile time because they're not there yet?
15:28 pjscott joined
Zoffix Thanls 15:29
moritz nine: you can't add keys to a lexpad at runtime
15:29 dj_goku joined
timotimo Zoffix: camelia isn't on p6c.org; it's on nine's server 15:31
Zoffix ? 15:32
[Coke] Is there a way to list the unicode properties on a character?
moritz m: say uniprop('a')
camelia rakudo-moar 5ed58f: OUTPUT«Ll␤»
Skarsnik so does --prefix still work (in rakudo) with all the precomp stuff?
Zoffix m: '4'.uniprop.say 15:33
camelia rakudo-moar 5ed58f: OUTPUT«Nd␤»
[Coke] moritz: that gets the value of a prop. how do you get all the available props to get?
moritz [Coke]: dunno
[Coke] m: uniprop("Z", "OTHERPROP").say
camelia rakudo-moar 5ed58f: OUTPUT«0␤»
15:33 pjscott left
timotimo know it from the unicode specs? :\ 15:33
15:34 ParsonsNose joined
[Coke] m: uniprop("Z", "GeneralCategory").say 15:34
camelia rakudo-moar 5ed58f: OUTPUT«Lu␤»
15:34 xpen left
Zoffix Is there a way to use a variable for an op? 15:36
m: my $x = sub foo {say $^a.Int + 42}; my $op = '—'; my &postfix:<$op> = $x; '1'—
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0S8u1B4YOH␤Bogus postfix␤at /tmp/0S8u1B4YOH:1␤------> 3y $op = '—'; my &postfix:<$op> = $x; '1'7⏏5—␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ …»
timotimo Zoffix: you can't declare a lexical variable with a run-time-dependent name 15:38
[Coke] m: my $x = sub foo {say $^a.Int + 42}; my $op = '—'; my &postfix:($op) = $x; '1'—
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7dSIKdjWql␤You can't adverb &postfix␤at /tmp/7dSIKdjWql:1␤------> 3t + 42}; my $op = '—'; my &postfix:($op)7⏏5 = $x; '1'—␤»
Zoffix can't -_-
Zoffix tries anyway
[Coke] m: my $x = sub foo {say $^a.Int + 42}; my $op = '—'; sub postfix:($op) = $x; '1'—
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WFW5k6LVm2␤Missing block␤at /tmp/WFW5k6LVm2:1␤------> 3t + 42}; my $op = '—'; sub postfix:($op)7⏏5 = $x; '1'—␤ expecting any of:␤ new name to be defined␤»
[Coke] maybe if you separated out the "use a variable in the name" and the "use a variable for the body", you'd have better luck. :) 15:39
15:40 ambs joined
Skarsnik wait, why the build process use the prefix before a make install 15:40
15:43 rurban joined 15:45 rurban1 left 15:46 rurban1 joined
Skarsnik Is that a bug or it's normal? 15:46
ilmari define "use"? write to? 15:47
15:47 rurban left 15:48 _Vi left
Hotkeys It's snowing 15:48
Skarsnik well after running configure, I use make and it use /opt/nqp and /opt/moar (/opt was empty)
Hotkeys Does p6 have a way to stop it from snowing here
15:48 rdleon joined
Skarsnik well /opt/bin/ 15:48
mspo Skarsnik: the rakudo star build isn't DESTDIR-friendly
Zoffix m: CORE::{"&prefix:<+++>"} = CORE::{"&prefix:<++>"}; my $x = 42; +++$x; say $x 15:49
camelia rakudo-moar 5ed58f: OUTPUT«Cannot modify an immutable Nil␤ in block <unit> at /tmp/0E5v4Phztg line 1␤␤»
Zoffix tsk tsk.
Skarsnik I git clone rakudo
mspo Skarsnik: it builds and installs its dependencies in order since they depend on eachother
Skarsnik: it should be updated to intsall the build-time dependencies somewhere else and then installed as a big unit 15:50
ilmari Skarsnik: rakudo depends on nqp, which depends on moar
Skarsnik that what I was expecting, build the dep in a dir and only install on make install
ilmari so these need to be installed in the same prefix first
mspo Skarsnik: I think it's complicated by 'use' directives in some files being fully qualified 15:51
grondilu iirc that's how big projects like GCC do things. Build must be done in a ./build directory first.
Skarsnik That how... everything does it?
grondilu not everything 15:52
mspo read about it here: www.gnu.org/prep/standards/html_no...STDIR.html
grondilu from what I remember of buiding linux from scratch, only GCC and the standard C lib require a ./build directory.
mspo grondilu: most oss software supports DESTDIR building (especially if it uses autoconf) 15:53
Zoffix m: class Foo::Bar is Int {}; say GLOBAL::.keys 15:54
camelia rakudo-moar 5ed58f: OUTPUT«(Foo)␤»
Zoffix How come
mspo in perl6- nqp supports DESTDIR but then the other builds break down
15:54 wollmers left
Skarsnik but that should be the default when using gen-nqp and gen-moar 15:54
nine Skarsnik: that rakudo builds nqp and even MoarVM is a convenience feature. It's as if gcc's build script had an option to first install binutils and libz system wide before continuing.
Zoffix How can I get the name of all use-defined classes? It doesn't seem to be in GLOBAL
m: class Foo::Bar is Int {}; say GLOBAL::.perl 15:55
camelia rakudo-moar 5ed58f: OUTPUT«{:Foo(Foo)}␤»
ilmari Skarsnik: external dependencies tend to have to be actually installed first
mspo or maybe it's moar and not nqp, I forget
Skarsnik Yes, but I expect to only install on make install if I use gen-xxx 15:56
mspo Skarsnik: rakudo star is like a *brew script more than a single project, is the best way to think of it 15:57
Skarsnik: you should use the components individually
Skarsnik I don't use rakudo star x)
15:57 jack_rabbit left
mspo okay 15:57
anyway I agree that it's not a very friendly build :) 15:58
Zoffix Hm. I've no idea what to suggest this person (small module to convert from P5 to P6). Any suggestions? twitter.com/nomadovich/status/6869...0149495808
Skarsnik "Don't" 15:59
mspo Skarsnik: also, weirdly, nqp is actually a shell script that calls moar
Skarsnik I would like a complete Zip (or any archive) module, but it's only me x)
dalek p: 7d2b53b | (Pawel Murias)++ | src/vm/js/ (2 files):
[js] Implement nqp::bitxor_s, nqp::bitand_s, nqp::bitor_s.
p: 0bc35f4 | (Pawel Murias)++ | t/nqp/59-nqpop.t:
Test nqp::bitand_s, nqp::bitor_s, nqp::bitxor_s.
Zoffix Skarsnik, nah, I think that's too categorical. It's perfectly fine to convert small things, especially to try Perl 6 out. 16:00
arnsholt mspo: Not that weird, really. The result of compiling NQP (or Rakudo, for that matter) is just a pile of Moar bytecode
pmurias jnthn: hi
Skarsnik I stoppped doing perl5 seriously like 10 years ago, so I don't know what small p5 module could be cool to have
mspo arnsholt: it seems to imply that the build *could* be more destdir-friendly :)
arnsholt Then to run the program, you just want run that bytecode, which you do with the moar program
nine Getting rid of that shell script wrapper is really mostly an exercise in build system wrangling. Unfortunately we do seem to have a lack of qualified and interested people in that area. 16:03
sortiz Zoffix, seen doc.perl6.org/language/5to6-nutshel...ranslation ?
RabidGravy Zoffix, maybe it's look on the most wanted list. Or alternatively, my thing would be, try making an actual software to use and see what modules it needs and start with the ones that aren't there :)
Zoffix sortiz, yes, and IMHO, that stuff is largely a footgun.
mspo does "rakudo" produce any artifacts on its own? 16:04
or is it all nqp code
arnsholt I think there a shared lib as well
mspo libmoar is the only one i found
why it's not statically linked by default? nfi :)
can I produce my own binaries in perl6, linked with libmoar, and not need to install perl6 to run them?
16:05 _Vi joined
jnthn pmurias: hi o/ 16:05
RabidGravy yeah, the "automated translation" can work if you already understand well how the code works and have a basic idea how it should work in P6 but only to save some typing :)
Zoffix There's no easy way to get the reverse of .^parents, is there? I want to get all class names that inherit from class $x 16:06
jnthn mspo: Not statically linked 'cus Rakudo also compiles some small VM extensions.
Zoffix is still unclear why m: class Foo::Bar is Int {}; say GLOBAL::.perl doesn't have a 'Bar' anywhere in the output
jnthn Zoffix: No, otherwise we'd struggle to GC 'em...unless we introduced weak references, which may yet happen. :)
nine ./install/share/perl6/runtime/dynext/libperl6_ops_moar.so
Zoffix \o/
jnthn m: class Foo::Bar { }; say GLOBAL::.keys; 16:07
camelia rakudo-moar 5ed58f: OUTPUT«(Foo)␤»
jnthn m: class Foo::Bar { }; say GLOBAL::Foo::.keys;
camelia rakudo-moar 5ed58f: OUTPUT«(Bar)␤»
jnthn There's the Bar
Zoffix Ah
pmurias jnthn: do you want to be suggested as the grant manager for the javascript backend grant?
ilmari has anyone submitted a signature for moarvm bytecode to file(1)?
Zoffix m: class Foo::Bar { }; say GLOBAL::Foo::.perl
camelia rakudo-moar 5ed58f: OUTPUT«{:Bar(Foo::Bar)}␤»
ilmari aka libmagic
Zoffix wtf
Ah
m: class Foo::Bar { }; say GLOBAL::.perl
camelia rakudo-moar 5ed58f: OUTPUT«{:Foo(Foo)}␤»
Zoffix m: class Foo::Bar { }; say dd GLOBAL:: 16:08
camelia rakudo-moar 5ed58f: OUTPUT«{:Foo(Foo)}␤Nil␤»
Zoffix I kinda expected those last two evals to go all the way.
16:08 sena_kun left
jnthn pmurias: I probably can, if there's nobody else up for it :) 16:09
16:10 sena_kun joined, CIAvash left
_nadim Is there a "do $file_name" a la P5? 16:10
Skarsnik hm
jnthn m: EVALFILE 'foo' 16:11
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Undeclared routine:␤ bar used at line 1. Did you mean 'VAR', 'bag'?␤␤»
16:11 domidumont left
Zoffix _nadim, EVALFILE 16:11
jnthn hah, what, there's a file called foo? :D
Zoffix m: 'foo'.IO.slurp.say
camelia rakudo-moar 5ed58f: OUTPUT«bar␤»
Zoffix heh
jnthn lol
nine Now that's obvious
jnthn m: sub bar() { say 'mmm...a pint' }; EVALFILE 'foo' 16:12
camelia rakudo-moar 5ed58f: OUTPUT«mmm...a pint␤»
RabidGravy :)
_nadim Zoffix: thanks. it's not in the documentation
Zoffix _nadim, well volunteered! :D
_nadim, there's a one-sentence blurb here: design.perl6.org/S29.html#Context 16:13
sena_kun Do we have in perl6 something like tuple type? To quickly wrap and unwrap things together without constructing new type.
_nadim Man, if you knew how much I'd prefer do that. I have 4 more weeks of hell, then I can.
Indeed there is documentation :)
nine sena_kun: List
Juerd sena_kun: Lists, arrays, hashes... 16:14
jnthn sena_kun: Lists are immutable so server fine as that, and are easily unpacked
*serve
_nadim sena_kun: Captures work too
sena_kun Thanks, I'll try list firstly.
nine
.oO(progressive loading of answers)
_nadim But but .... all answers are pretty wrong. Well, no they are right but the problem is wrong. Looks like "I don't like types, give me a hammer" 16:16
jnthn Sometimes you need the hammer to work out which types you should have.
_nadim jnthn: I didn't say that I don't use hammers ;) 16:17
Skarsnik m: class Foo{ has Str @.t}; my %h; %h<t> = ["hello"]; say Foo.new(|%h); #Bug? 16:18
camelia rakudo-moar 5ed58f: OUTPUT«Type check failed in assignment to @!t; expected Str but got Array␤ in block <unit> at /tmp/UIPMaHUORj line 1␤␤»
16:19 FROGGS left
Skarsnik It was working before x-mas :( 16:19
m: class Foo{ has @.t}; my %h; %h<t> = ["hello"]; say Foo.new(|%h); #Bug?
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [["hello"],])␤»
16:20 dwarring left
jnthn Skarsnik: No 16:20
Skarsnik: Made attribute assignment intialization consistent with normal assignment
(Which was a bug fix)
And that worked by accident before the fix
Hashes are a bunch of Scalar values if assigned to 16:21
And that itemizes
16:21 hankache joined
Skarsnik The issue I have a sub that return me a Str @; that I put in a hash and if I give the hash to new it fail like that 16:22
RabidGravy m: class Foo{ has @.t}; my %h; %h<t> := ["hello"]; say Foo.new(|%h);
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => ["hello"])␤»
jnthn Can bind it into the hash instead.
16:22 lostinfog joined
RabidGravy jnthn++ pointed that out to me a few momths agio when the change went in :) 16:22
Skarsnik class Foo{ has Str @.t}; my %h; %h<t> = ("hello"); say Foo.new(|%h) 16:23
m: class Foo{ has Str @.t}; my %h; %h<t> = ("hello"); say Foo.new(|%h)
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => Array[Str].new("hello"))␤»
Skarsnik I don't get it really
why this work
jnthn m: my @a = "hello"; say @a.perl 16:24
camelia rakudo-moar 5ed58f: OUTPUT«["hello"]␤»
jnthn m: my @a = ("hello",); say @a.perl
camelia rakudo-moar 5ed58f: OUTPUT«["hello"]␤»
jnthn m: my @a = $("hello",); say @a.perl
camelia rakudo-moar 5ed58f: OUTPUT«[("hello",),]␤»
jnthn m: my @a = $["hello",]; say @a.perl
camelia rakudo-moar 5ed58f: OUTPUT«[["hello"],]␤»
16:24 poga left
jnthn And the $ is implied by hash values being Scalar containers. 16:24
Skarsnik so I need to write %h<k> = foo().list then?
jnthn No, you'd need to bind 16:25
%h<k> := foo()
Skarsnik why? my sub does not return a scalar
16:26 khw joined, jeek joined
dalek p: d667c8e | (Pawel Murias)++ | src/vm/js/ (2 files):
[js] Stub getcodelocation the same way the JVM backend does it.
16:27
jnthn Skarsnik: Yes, but hash values are *by definition* scalars
That's how assignment to arrays/hashes works 16:28
Skarsnik I still think it's weird. if I do say %h<k>.WHAT it give me Array[Str]
It should tell me it's a scalar or a Str if it's not the case 16:30
16:30 _nadim left
hankache hello * 16:31
Skarsnik m: class Foo{ has Str @.t}; my Array %h; %h<t> = ["hello"]; say Foo.new(|%h); 16:32
camelia rakudo-moar 5ed58f: OUTPUT«Type check failed in assignment to @!t; expected Str but got Array␤ in block <unit> at /tmp/WmVnBx9ol0 line 1␤␤»
sortiz m: my %h = :k; say %h<k>.VAR.WHAT 16:33
camelia rakudo-moar 5ed58f: OUTPUT«(Scalar)␤»
timotimo unless you type your list to be of Str, that on't ever work
Skarsnik m: class Foo{ has @.t}; my Array %h; %h<t> = ["hello"]; say Foo.new(|%h); 16:34
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [["hello"],])␤»
Skarsnik m: class Foo{ has @.t}; my Any %h; %h<t> = ["hello"]; say Foo.new(|%h); 16:35
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [["hello"],])␤»
Skarsnik hm, Any did not worked for me
16:36 sena_kun left
timotimo m: class Foo { has @.t }; my Any %h; @(%h<t>) = ["hello"]; say Foo.new(|%h) 16:37
camelia rakudo-moar 5ed58f: OUTPUT«Cannot modify an immutable Any␤ in block <unit> at /tmp/4R3U2DPJts line 1␤␤»
timotimo m: class Foo { has @.t }; my Any %h; %h<t> = flat ["hello"]; say Foo.new(|%h)
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [("hello",).Seq,])␤»
timotimo ugh, even worse :) 16:38
Zoffix m: my $type = 'Array'; say $type.^parents: :all 16:44
camelia rakudo-moar 5ed58f: OUTPUT«((Cool) (Any) (Mu))␤»
Zoffix Is there a way to list parents of a type when its name is stored in a variable?
m: use MONKEY-SEE-NO-EVAL; my $type = 'Array'; say EVAL "$type.^parents: :all"
camelia rakudo-moar 5ed58f: OUTPUT«((List) (Cool) (Any) (Mu))␤»
Zoffix Guess that'll do
timotimo better use ::($foo) instead of EVAL 16:45
Zoffix Ah. Thanks
timotimo m: my $cn = 'Array'; say ::($cn).^parents(:all)
camelia rakudo-moar 5ed58f: OUTPUT«((List) (Cool) (Any) (Mu))␤»
16:50 sena_kun joined
Skarsnik hm 16:50
funrep how do i pass an argument to a named parameter? 16:51
Skarsnik This array issue in hash make me wonder if I should fix pgarray in dbiish
PerlJam funrep: :name($value) or name => $value 16:52
Skarsnik or :name<value>
Zoffix funrep, for numerics :42param also works
s/numerics/ints/;
sena_kun Is 'subst' method is the best replace for "=~ s///" for now?
Zoffix funrep, for booleans :foo and :!foo work 16:53
sena_kun, that's what I use yes. There's also subst-mutable
PerlJam sena_kun: or just use s/// ?
Zoffix :)
jnthn m: my $foo = 'bear'; $foo ~~ s/a/e/; say $foo; # can also use this form
camelia rakudo-moar 5ed58f: OUTPUT«beer␤»
jnthn m: my $foo = 'bear'; $foo ~~ s/a/ = 'e'; say $foo; # or this form 16:54
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/S9oy6T3ZDG␤Malformed replacement part; couldn't find final /␤at /tmp/S9oy6T3ZDG:1␤------> 3 ~~ s/a/ = 'e'; say $foo; # or this form7⏏5<EOL>␤ expecting any of:␤ postfix␤»
Zoffix tries to remember how to use S/// and fails
jnthn oh, right
m: my $foo = 'bear'; $foo ~~ s[a] = 'e'; say $foo; # or this form
camelia rakudo-moar 5ed58f: OUTPUT«beer␤»
sena_kun Oh wow.
funrep PerlJam, Zoffix: thanks!
PerlJam sena_kun: you're going to be saying that quite often about Perl 6 if you keep using it ;)
jnthn m: my $foo = "The answer is 21"; $foo ~~ s[\d+] *= 2; say $foo # showing off :)
camelia rakudo-moar 5ed58f: OUTPUT«The answer is 42␤»
Zoffix :)
Man, that's awesome 16:55
m: class Foo::Bar is Int {}; class Meow is Foo::Bar {}; say Meow.^parents: :all
camelia rakudo-moar 5ed58f: OUTPUT«((Bar) (Int) (Cool) (Any) (Mu))␤»
Zoffix Bar??
RabidGravy so if have an object which has a Supplier which it may emit stuff on, is it better to give a single Supply to all interested tappers or a new one for each?
Skarsnik m: class Foo{ has @.t}; sub bar() {my %h; my $p = "hello".comb; %h<t> = $p; %h} my %h; %h = bar(); say Foo.new(|%h);
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/RtKKOm8Q4D␤Strange text after block (missing semicolon or comma?)␤at /tmp/RtKKOm8Q4D:1␤------> 3h; my $p = "hello".comb; %h<t> = $p; %h}7⏏5 my %h; %h = bar(); say Foo.new(|%h);␤ expecting any o…» 16:56
Skarsnik m: class Foo{ has @.t}; sub bar() {my %h; my $p = "hello".comb; %h<t> = $p; %h}; my %h; %h = bar(); say Foo.new(|%h);
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [("h", "e", "l", "l", "o").Seq,])␤»
16:56 uruwi_ joined
Skarsnik m: class Foo{ has @.t}; sub bar() {my Any %h; my $p = "hello".comb; %h<t> = $p; %h}; my %h; %h = bar(); say Foo.new(|%h); 16:57
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [("h", "e", "l", "l", "o").Seq,])␤»
jnthn RabidGravy: It depends on the semantics you want around done/quit
Zoffix m: class Foo::Bar is Int {}; class M::Me::Mew is Foo::Bar {}; class Meow is M::Me::Mew {}; say Meow.^parents: :all
camelia rakudo-moar 5ed58f: OUTPUT«((Mew) (Bar) (Int) (Cool) (Any) (Mu))␤»
16:57 rurban1 left
Zoffix This looks like a bug to me :( 16:57
jnthn RabidGravy: If you will only emit then it's equivalent.
Zoffix: It's 'cus .WHAT gives you the shortname
RabidGravy e.g. should I do "method foo-supply() { $!supplier.Supply }" or "method foo-supply() { state $supply = $!supplier.Supply; $supply }" 16:58
Skarsnik m: class Foo{ has @.t}; sub bar() {my Any %h; my $p = "hello".comb; %h<t> = $p; %h}; my %h; %h := bar(); say Foo.new(|%h);
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [("h", "e", "l", "l", "o").Seq,])␤»
jnthn Beware of state there, it's not per instance
Skarsnik Err, I think that screw me with DBIish
Zoffix m: class Foo::Bar is Int {}; class M::Me::Mew is Foo::Bar {}; class Meow is M::Me::Mew {}; my $x = M::Me::Mew.new; say $x.WHAT
camelia rakudo-moar 5ed58f: OUTPUT«(Mew)␤»
jnthn Zoffix: Use .WHO for all of it
Zoffix m: class Foo::Bar is Int {}; class M::Me::Mew is Foo::Bar {}; class Meow is M::Me::Mew {}; my $x = M::Me::Mew.new; say $x.WHO
camelia rakudo-moar 5ed58f: OUTPUT«M::Me::Mew␤»
Skarsnik I want to return a hash with array that are array x)
Zoffix m: class Foo::Bar is Int {}; class M::Me::Mew is Foo::Bar {}; class Meow is M::Me::Mew {}; my $x = M::Me::Mew.new; say $x.WHAT.WHO 16:59
camelia rakudo-moar 5ed58f: OUTPUT«M::Me::Mew␤»
Zoffix Thanks
RabidGravy yeah, in this case done / quit don't matter
jnthn RabidGravy: Each call to .Supply gives you something that separately enforces the supply grammar (emit* [done|quit])
Skarsnik m: class Foo{ has @.t}; sub bar() returns Hash[Any] {my Any %h; my $p = "hello".comb; %h<t> = $p; %h}; my %h; %h := bar(); say Foo.new(|%h);
camelia rakudo-moar 5ed58f: OUTPUT«Foo.new(t => [("h", "e", "l", "l", "o").Seq,])␤»
jnthn OK, then it won't matter for you.
It's more intersting if you have a Supplier that you may feed more things into after an error, provided a fresh Supply is obtained. 17:00
17:00 hankache left
jnthn Zoffix: A straight $x.WHO will do it, you don't need to .WHAT first 17:00
Zoffix: There's also .^name
Zoffix jnthn, but I'm using .^parents. Basically, I'm writing a sub that'll give me all of the descendants of a class. So what I'm doing is this: gist.github.com/zoffixznet/fa955e2ff7142d05b08f which is recursing over ::GLOBAL and trying to call .^parents on everything I find, and then grep the results for the original class name 17:02
m: class Foo::Bar is Int {}; class M::Me::Mew is Foo::Bar {}; class Meow is M::Me::Mew {}; say Meow.^parents(:all).map: {.WHO}
camelia rakudo-moar 5ed58f: OUTPUT«(M::Me::Mew Foo::Bar Int Cool Any Mu)␤» 17:03
RabidGravy ah! the "state not per instance" thing just answered a completely unrelated mystery I had earlier (assigning a Proxy to a state variable in an accessor,) duh
jnthn Zoffix: .^parents gives you back type objects, not names 17:04
Zoffix I see now :)
17:05 Khisanth left, Khisanth joined
Zoffix Ah, right, I don't need a .WHO at all then. I was just confused by my .say output 17:05
17:11 kjs_ joined
Zoffix FWIW, the colours in "Interp / Spesh / JIT" column of the profiler output not colourblind-friendly 17:13
Zoffix notices the use of bootstrap classes and files this under "not important enough to bother fix"
b2gills m: my $false-str = 'False'; say Bool::{$false-str}
camelia rakudo-moar 5ed58f: OUTPUT«False␤»
17:16 Ch0c0late left 17:17 peter4 is now known as alpha123 17:22 zakharyas left
dalek Iish: 0633711 | (Sylvain Colinet)++ | lib/DBDish/Pg/StatementHandle.pm6:
To have array in a hash we need to bind with :=
17:22
Iish: 12e2212 | Skarsnik++ | lib/DBDish/Pg/StatementHandle.pm6:
Merge pull request #48 from Skarsnik/master

To have array in a hash we need to bind with :=
Skarsnik I should add test for Pg array xD 17:23
17:24 telex left 17:26 telex joined
funrep what is a consise way of dropping the first 3 elements of an array? 17:27
jnthn @foo[3..*]
17:28 brachtmax left
funrep (y) 17:28
ilmari ?
17:33 andreoss left, _Dave_ left
jast probably some kind of emoticon in new-fangled IRC clients 17:35
Skarsnik gah, I need to force to get ride of ==> Installing DBIish 17:36
DBIish:ver<*>:auth<>:api<> already installed
?
moritz yes, need force
17:37 joydon left
Zoffix Use the force, Luke! 17:37
RabidGravy I think (y) comes out as 👍some place 17:38
that is THUMBS UP SIGN 17:39
sortiz so much FB? 17:41
17:41 alber joined
alpha123 *twitch* 17:43
17:47 jabus joined
mspo splice? 17:47
17:48 itaipu left, sftf left
jabus oi 17:50
17:50 xinming_ joined, dakkar left
mspo m: @x = <a b c d e f>; @x.splice(3,*); 17:53
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ZodD6vGhWC␤Variable '@x' is not declared␤at /tmp/ZodD6vGhWC:1␤------> 3<BOL>7⏏5@x = <a b c d e f>; @x.splice(3,*);␤»
mspo m: my @x = <a b c d e f>; @x.splice(3,*);
camelia ( no output )
mspo weird
17:53 xinming left
ilmari m: my @x = <a b c d e f>; say @x.splice(3,*); say @x 17:53
camelia rakudo-moar 5ed58f: OUTPUT«[d e f]␤[a b c]␤»
mspo anway it worked in my repl :)
oh right
ilmari camelia only captures stdout/stderr 17:54
not return values
17:55 Actualeyes left 17:56 Calibellus left 17:57 Calibellus joined 17:59 abraxxa left 18:01 itaipu joined, firstdayonthejob joined, kjs_ left
daxim p6: "hello world".say 18:02
camelia rakudo-moar 5ed58f: OUTPUT«hello world␤»
18:03 domm_ joined
Skarsnik is there a way to type an array after its 'declaration'? 18:03
like my @t; @t is of Str; ?
funrep how do i add 2 strings?
Skarsnik ~ 18:04
funrep nice thanks
Skarsnik m: say "Hello" ~ "World"
camelia rakudo-moar 5ed58f: OUTPUT«HelloWorld␤»
frew does perl6 specify a standard JSON decoder, and if not, does rakudo star ship with one? 18:05
someone at work was asking and I realized I don't even konw how to look that up
Skarsnik JSON::Tiny/JSON::Fast are commonly used 18:06
I think panda install one of them and Star have one of them too x)
frew any idea how I can look that up?
18:07 SHODAN left
Skarsnik perl6 -MJSON::Tini -e 'say "foo"' 18:08
18:08 SHODAN joined
tony-o frew: rakudo does ship with a json decoder 18:10
yoleaux 7 Jan 2016 07:28Z <nine> tony-o: the one and only reason why I don't want to read the log is because it's a huge waste of time to read through thousands of lines of chatter when you already know what you want to tell me. If you have useful input, please just give it.
7 Jan 2016 07:28Z <nine> tony-o: nothing would make me happier than someone coming up with a good plan where we don't have to recompile modules for every user.
Skarsnik the internal json decoder is private now I think 18:11
tony-o frew: the decoder ops in ::Tiny and ::Fast are both the same, too fwiw
frew tony-o: can you point me to a doc about that? like a page listing stuff included in star or something?
tony-o m: from-json('{ "test": "value" }').perl.say;
camelia rakudo-moar 5ed58f: OUTPUT«${:test("value")}␤»
PerlJam m: say to-json(<a b c>);
camelia rakudo-moar 5ed58f: OUTPUT«[␤ "a",␤ "b",␤ "c"␤]␤»
PerlJam (just checking) 18:12
Skarsnik Cannot put a type constraint on an 'our'-scoped variable
:(
tony-o frew: i only know that from reading the source and writing a decoder to make it faster :-) PerlJam might have something, he usually schools me on the docs
PerlJam frew: there's from-json and to-json built in (but they might be slow) 18:13
tony-o they're significantly slower than using ::Fast
frew PerlJam: why aren't those listed on doc.perl6.org?
PerlJam frew: dunno. No one got around to it I guess
tony-o I'm partial to ::Fast because i wrote at least one of the iterations of it
frew: it's meant to only be used internally as Skarsnik was getting at
frew huh 18:14
tony-o it was, at least. unsure about the general feeling towards it now
it was being used in CUR a long time ago for a MANIFEST file
so it was used for module loading at one point
nine it still is
tony-o there it is :-)
PerlJam yeah, that was the primary reason they exist in core
s/was/is/
18:15 sjoshi joined
tony-o so it was meant to be used internally and not meant to be GA 18:15
18:15 sena_kun left
tony-o but, it does happen to be GA currently 18:15
GA = generally available
jnthn frew: Modules are generally located through modules.perl6.org/ and docs.perl6.org is really language docs. 18:17
tony-o frew: there isn't likely to be any docs on it
frew jnthn: ok, well fwiw my initial thought was that maybe the lang would specify that JSON decoding would be included
not saying it should be, but it didn't seem infeasable
hah, 2% of perl6 modules are related to json 18:18
Skarsnik nine, I need to test futher, but I think precomp on 32bits does not work well comparing to 64bits 18:19
jnthn On documentation: is there documented somewhere how to set up Travis builds for Perl 6 modules? I hoped the "not set up" on modules.perl6.org would link to instructions on how... :)
tony-o frew: ::Fast is different from ::Tiny in the decoding realm. ::Tiny is similar to core and ::Fast is a PP6 decoding mechanism, ::Fast was significantly faster last time i benchmarked but that was several months ago
jnthn oh, the Travis link right at the top :) 18:20
18:20 leont joined
tony-o ::Tiny is technically more interesting, though 18:20
18:20 jabus left
frew fwiw I want my JSON as boring as it gets :) 18:20
tony-o lol
PerlJam jnthn: having "not set up" link there too sounds like a nice enhancement 18:21
Zoffix jnthn, yeah, it should: github.com/perl6/modules.perl6.org/issues/47
And the instructions are here: docs.travis-ci.com/user/languages/perl6
tony-o Zoffix: it's on my list to look at all the bug reports you've sent me over the last week 18:22
jnthn Cool, should do it for some of my modules :)
Zoffix And speaking of JSON modules... I'm quite amazed most of the encoded JSON has about 40% of its size in useless spaces. I'd think the "default" mode for encoded JSON would be for it to be transmitted somewhere for computers to read, not for humans to read.
m: say to-json [<foo bar ber>] 18:23
camelia rakudo-moar 5ed58f: OUTPUT«[␤ "foo",␤ "bar",␤ "ber"␤]␤»
Zoffix shakes head
m: say to-json "foo"
camelia rakudo-moar 5ed58f: OUTPUT«"foo"␤»
18:23 espadrine left
Zoffix JSON::Tiny fares better, but still can be trimmed quite a bit. 18:26
tony-o how does ::Fast get on?
18:27 vendethiel joined
uruwi_ JSON::Fast is the example that Zoffix typed here 18:28
Zoffix Seems to have the exact number of extraneous whitespace as core; unless I'm calling the wrong function: gist.github.com/zoffixznet/78064c45fe9619e5063f
tony-o isn't that using the built in?
ah, they could be exactly the same
18:29 domidumont joined, milwen joined 18:30 jack_rabbit joined
milwen Hey everyone. I'm new to perl6 and IRC. 18:30
Zoffix Hm. This is weird. There is a `pretty` named arg, github.com/timo/json_fast/blob/mas...ast.pm#L13 but $ perl6 -MJSON::Fast -e 'say to-json [<foo bar ber>, { :meow<foo>, :foo([<bar>, {:2ber, :moor([<foo>])}]) }] :!pretty' gives me Unexpected named parameter 'pretty' passed
milwen, hai :)
timotimo welcome, milwen!
PerlJam milwen: greetings!
18:30 psy joined
Zoffix Ah, needs a comma 18:31
yeah, disabling :pretty works. That's good then
Zoffix makes a doc PR
Skarsnik jnthn, I am confused with this array in hash business. I try to put an Array on the (Array or Hash) returned by DBish like in github.com/perl6/DBIish/blob/maste....pm6#L121; but I still get something I can't pass to new 18:32
18:36 theorb left 18:37 itaipu left
nine Skarsnik: can you give a smaller example for this ? 18:37
milwen I have a question: why does {if @nums.elems > 0 {return @nums.pop + mul(@nums);} work for adding array elements but trying to multiply the same elements always returns 0? 18:39
Hotkeys can you do an example on camelia 18:41
Zoffix milwen, one of the elements is zero?
milwen no tested with [1,2,3,4] 18:42
Zoffix milwen, what's mul()?
milwen oh sorry that's my multiplication sub. its add() for adding.
Hotkeys m: my @nums = [1,2,3,4]; I have a question: {if @nums.elems > 0 {say @nums.pop + mul(@nums);}
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xio9Dl2XhV␤Missing block (taken by some undeclared routine?)␤at /tmp/xio9Dl2XhV:1␤------> 3.elems > 0 {say @nums.pop + mul(@nums);}7⏏5<EOL>␤»
Hotkeys m: my @nums = [1,2,3,4]; if @nums.elems > 0 {say @nums.pop + mul(@nums)} 18:43
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0JU6sDK79H␤Undeclared routine:␤ mul used at line 1␤␤»
Hotkeys what does the sub do
Zoffix milwen, please shown an example program that demonstrates the problem
s/shown/show/;
milwen
sub mul(@nums)
{
if @nums.elems > 0
{
return @nums.pop * mul(@nums); 18:44
Hotkeys oh dear
milwen }
}
Hotkeys just so you know
you can do a reduction with an operator
m: say [*] [1,2,3,4]
camelia rakudo-moar 5ed58f: OUTPUT«24␤»
Hotkeys like so
if you're just trying to multiply the elements of an array 18:45
Zoffix milwen, on IRC, it's generally frowned upon to paste large chunks of text like that. It's disruptive, hard to read, and we can't copy-paste it into something to place with it. Generally people use a pastebin, like fpaste.scsys.co.uk/
PerlJam milwen: in the future use gist.github.com or some other paste site to show code please
milwen well that's alot easier. haha thanks
Hotkeys :D
18:45 itaipu joined, itaipu left
Hotkeys there might be a product function too 18:45
not sure
PerlJam milwen: what does mul() return when @nums.elems == 0 ?
Hotkeys m: say product([1,2,3,4]) 18:46
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/lqbHpFw_i_␤Undeclared routine:␤ product used at line 1. Did you mean 'produce'?␤␤»
Hotkeys m: say prod([1,2,3,4])
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_4ld379tue␤Undeclared routine:␤ prod used at line 1␤␤»
Hotkeys darn
milwen it just returns () with no args
Hotkeys m: say 3 * ()
camelia rakudo-moar 5ed58f: OUTPUT«0␤»
Hotkeys that's why
m: say ().Int 18:47
camelia rakudo-moar 5ed58f: OUTPUT«0␤»
Zoffix m: say from-json "foo" 18:48
camelia rakudo-moar 5ed58f: OUTPUT«Invalid JSON: foo␤ in block <unit> at /tmp/O8Vl21MN6s line 1␤␤»
Zoffix This is an error. Modern JSON spec allows non-object top-level things
(same issue's in JSON::Fast)
Hotkeys time to make JSON::Modern 18:49
Zoffix :P 18:50
18:50 leont left
Hotkeys jk I'm already set on contributing to the Lingua::* part of the ecosystem 18:50
mspo JSON, YAML, BSON, and the rest should all be grammars, right? 18:51
Zoffix mspo, why should? Grammars are slow
PerlJam grammars should be fast :)
mspo well maybe not bson; idk 18:52
Zoffix PerlJam++
Hotkeys grammars are a big talking point of p6 I'd think they'd be quick :p
18:52 pi4 left
Zoffix Hm, we should look into adding Perl 6 into the implementations list here www.json.org/ 18:52
mspo Zoffix: json is a sublangauge of javascript so it feels like a natrual fit
Hotkeys is that what the js stands for in json 18:53
PerlJam Hotkeys: grammars are *awesome*; but they are also not super optimized yet.
Hotkeys They are pretty awesome
mspo is a grammar the correct way to, say, parse out a network protocol?
Hotkeys Let's make them speedy quick how can I help
Zoffix mspo, huggable does it with IRC
huggable, say hello
huggable Zoffix, nothing found
PerlJam mspo: it's *a* way. "correct" requires a longer conversation :)
Zoffix :D
Hotkeys it would definitely be a cool way 18:54
mspo what about a non-text protocol, like HTTP/2
I just made a directory for Grammar::Memcached in my local dev box
maybe I'm misguided
Zoffix Well. My response to that would be: start doing it. If you curse a lot during the process, perhaps it's not the right tool :P 18:55
flussence Grammars can only parse Strs right now; there were provisions in the synopses for handling binary as 7-bit ascii but that was never implemented
Hotkeys lol
PerlJam mspo: grammars are meant to "parse" non-text things, but right now it would be a little clunky I think.
Hotkeys brb heading to class and such
mspo I didn't see a clear way in a grammar to say "read X bytes", for example 18:56
Skarsnik nine, something like? class Foo{ has Str @.t}; sub bar() returns Hash[Any] {my Any %h; my $p = "hello".comb; %h<t> = $p; %h}; my %h; %h := bar(); say Foo.new(|%h); 18:57
mspo I guess that would all be done in the blob type?
18:58 kjs_ joined
milwen *Just testing the pastebin thing* gist.github.com/anonymous/fa62cd2f1fd32277dcd8 18:58
mspo yeah, with pack and unpack 18:59
Zoffix milwen, test successful! :) Camelia can also eval those
m: gist.github.com/anonymous/fa62cd2f1fd32277dcd8
camelia rakudo-moar 5ed58f: OUTPUT«1␤»
19:00 FROGGS joined
PerlJam milwen: why parens around @*ARGS? 19:00
Zoffix Rakudobugged the from-json thing: rt.perl.org/Ticket/Display.html?id=127252 19:01
milwen simple answer. I tried running it, didn't work, put the parens around, and THEN realized I didn't save the file the first time. haha
Skarsnik I wonder how many bugs open you have Zoffix x) 19:02
Zoffix Skarsnik, 24 open 19:03
Hotkeys Okay hello I made it to class
And I remembered to bring my clicker
Go me
Zoffix Skarsnik, which pales in comparison to the 223 open Issue I have created on GitHub :) 19:04
Hotkeys Zoffix is a reporting machine
19:04 jabus joined, lnrdo_ joined 19:05 AlexDaniel joined 19:08 lnrdo left
mspo wasn't udp support added recently? 19:08
19:09 lnrdo_ left
jnthn mspo: Yes, went in shortly before the release 19:10
mspo: github.com/perl6/roast/blob/master...sync-UDP.t # tests 19:11
19:11 domm_ is now known as audience
daxim audience asks: is it possible to autothread your own operators? 19:11
audience I did not ask that
Zoffix :o 19:12
19:12 audience is now known as domm_
nine Skarsnik: use a Map instead of a Hash 19:12
Skarsnik ?
mspo jnthn: didn't make it to docs
Zoffix mspo, I see some UDP mentioning docs.perl6.org/type/IO::Socket::Asy...method_udp 19:13
mspo but not IO::Socket::INET?
Zoffix *shrug*
jnthn mspo: No, not implemented for sync sockets
UDP is inherently async anyway. 19:14
mspo and "low level" Sockets just doesn't exist?
19:14 lnrdo joined
mspo for RAW, for example 19:14
flussence sure they do: just use nativecall
nine m: class Foo{ has @.t; method gist() { dd @.t; } }; sub bar() returns Map {my %h := Map.new((t => my @ = "hello".comb)); %h}; my %h; %h := bar(); dd %h; say Foo.new(|%h);
camelia rakudo-moar 5ed58f: OUTPUT«Map.new((:t(["h", "e", "l", "l", "o"])))␤Array @!t = ["h", "e", "l", "l", "o"]␤Cannot unbox a type object␤ in block <unit> at /tmp/TwfMqM99pM line 1␤␤»
nine Skarsnik: ^^^
mspo flussence: I wonder 19:15
Zoffix timotimo, sent you a PR for docs for JSON::Fast. I didn't document the :level arg to to-json, because it seems like most an internal thing. github.com/timo/json_fast/pull/10 19:17
19:19 psy left 19:20 psy_ joined
Skarsnik nine, for me the initial code should work. I can write class Foo{ has @.t}; my %h; %h<t> = ("hello"); say Foo.new(|%h) 19:20
or even %h<t> := ["Hello"] 19:21
nine Skarsnik: a Hash itemizes the values, just like Array itemizes the values.
Map and List don't
timotimo Zoffix: oh, sweet! 19:22
yeah, :level is internal indeed
19:23 virtualsue left, leont joined
mst Zoffix: I want to replace the background of every commenter on www.reddit.com/r/perl/comments/40m...se_perl_6/ with trout.me.uk/you.jpg 19:23
Zoffix: except chromatic, who would get trout.me.uk/hopper.jpg instead 19:24
Zoffix lol
I've not seen any of that yet
Zoffix reads
19:24 jabus left
timotimo that's a ... huge bag of dicks 19:24
isn't it?
El_Che Hi Zoffix, I saw your post 19:25
flussence it's a factory of 'em
19:25 sjoshi left
Skarsnik nine, I still don't get it really, it just confusing why it work outside a sub but not when the hash is returned 19:25
Zoffix mst, well, I fully agree with what you said lol :) 19:26
El_Che, hi 19:27
timotimo is afk for watching star wars! o/
El_Che timotimo: as a wookie? 19:28
19:28 virtualsue joined 19:29 pat_js left
El_Che Zoffix: 5 comments on your post (incl your answer) isn't really a sign of a huge hostility, imho 19:31
El_Che now reading virtualsue's take 19:32
Zoffix El_Che, yeah, those comments are fine :)
El_Che Zoffix: there have been longer flames there in the past 19:33
19:33 _Vi left
leont would rather work on creating cool stuff than argue with idiots on the internet 19:33
Zoffix leont++ good point
PerlJam leont++ indeed
Zoffix proceeds to continue working on Class::Descendant and then Evil.pm6 19:34
El_Che leont: didn't you know someone is somewhere wrong on the internet!!
flussence leont++ # that's why I'm here, not there
El_Che today, I amused myself adding return types to my methods. That was something I liked about java
In my perl5 code I put the expected return type in comments, but sometimes I forget :) 19:35
19:36 virtualsue left
leont Sometimes I'd like a Void return type though 19:36
(Or Sink, I suppose)
El_Che that would make it explicit indeed 19:37
gfldex you can explicitly return Nil, what happens to be the absense of a value
El_Che mm 19:38
m: sub s returns Nil { say 'foo' }; s
camelia rakudo-moar 5ed58f: OUTPUT«foo␤Type check failed for return value; expected Nil but got Bool␤ in sub s at /tmp/4uXkQno5Bl line 1␤ in block <unit> at /tmp/4uXkQno5Bl line 1␤␤»
El_Che (I know why, but still) 19:39
19:39 kjs_ left
leont Something likse sub s is void {} could work 19:39
nine m: class Foo{ has @.t; method gist() { dd @.t }; }; my %h; sub bar() { my %h; %h<t> := ["hello"]; %h }; %h := bar; say Foo.new(|%h) 19:40
camelia rakudo-moar 5ed58f: OUTPUT«Array @!t = ["hello"]␤Cannot unbox a type object␤ in block <unit> at /tmp/1bOVn8TiRs line 1␤␤»
nine Skarsnik: ^^^
gfldex setting a return type doesn't really get you anything unless you use introspectoon on ther caller side against that return type 19:41
the return type is merely a runtime check of the returned value
what will move the line nr. in the error message around
El_Che gfldex: I like it as documentation (part of the signature)
nine It may also help uncover bugs more quickly. 19:42
moritz it documents that the error in the callee side, not on the caller side
19:42 jnap left
gfldex El_Che: please don't like it in a function that is called in a tight loop. Those 5% can add up quickly. 19:42
El_Che gfldex: because it's runtime 19:43
I see
Skarsnik err, 19:44
gfldex i know that it's 5% because that dropped out of a benchmark i did today
Skarsnik that should be an optimisation? since it know what to expect from the sub
gfldex sadly i'm very sleepy or i would tell you more
moritz Skarsnik: do submit a patch
19:45 zakharyas joined
Zoffix whoa... "WARNING: unhandled Failure detected in DESTROY: Type Signal does not support associative indexing." :P 19:45
19:46 virtualsue joined, cdg left, cdg joined
Skarsnik nine, how I can have this work? (than my issue with DBIish, since I affect $value var that is put in the hash later) class Foo{ has @.t}; sub bar {my %h; my $p = "hello".comb; %h<t> = $p; %h}; my %h = bar(); say Foo.new(|%h) 19:47
I mean it work if I do %h<t> := $p
Zoffix m: CORE::IterationEnd ~~ Signal 19:48
camelia rakudo-moar 5ed58f: OUTPUT«Cannot call ACCEPTS(Signal: ); none of these signatures match:␤ (Mu:U $: \topic, *%_)␤ (Mu:U $: Mu:U \topic, *%_)␤ (Any:D $: Mu:D \a, *%_)␤ (Any:D $: Mu:U \a, *%_)␤ (Any:U $: \topic, *%_)␤ (Numeric:D $: \a, *%_)␤ in block <…»
19:48 jabus joined
Zoffix m: CORE::IterationEnd.WHAT.say 19:48
camelia rakudo-moar 5ed58f: OUTPUT«(Mu)␤»
El_Che .seen tadzik
yoleaux I saw tadzik 7 Jan 2016 20:18Z in #perl6: <tadzik> huh
nine Skarsnik: Even if you do %h<t> := $p; the point where it goes wrong is the %h = bar(); It would also go wrong if it was my %h = %o; Think of it like you're assigning the list of key-value pairs to this new %h. The benefit of binding gets lost there.
Zoffix What's a sane way to get all types/roles from CORE::? This is my attempt so far, but lines 17/18 are choking on some values (like the example above) gist.github.com/zoffixznet/4a623b529d2f52e833e3 19:50
19:50 peter__ joined
flussence open a repl and hold down tab? :D 19:51
nine Zoffix: I'm curious. What do you need them for?
Zoffix :( programmatically
mst write a small expect script that opens a repl and holds down tab
Zoffix nine, I want to know all descendants of a class.
Skarsnik well nine my goal is to have Array as value in my hash x) 19:52
Zoffix nine, and I want those so I could recompose them after I augment the parent
flussence (last time this came up, I used /usr/bin/script...)
19:52 cdg left
mst oh, my, you're doing 'muck with a superclass, then re-init all subclasses thereof' 19:52
I almost implemented that in perl5 once then thought better of it
Zoffix mst, :D
19:52 lnrdo left
Zoffix Nah, it sounds like fun :) 19:52
FWIW, the module is called Evil :P 19:53
nine Zoffix: that won't give them anyway, since there may be anonymous classes or lexically scoped ones
Zoffix aww :(
19:53 yurivish joined, rurban joined, lnrdo joined, rurban1 joined
mst Zoffix: you're going to have to invent padwalker 19:54
masak here's a first: in developing a really cute DSL, I find myself passing variable declarations into a constructor. like so: `Board::OctagonalTiling.new(octagon => my $octagon, diamond => my $diamond)`
AlexDaniel m: sub foo($x = foo) { 42 }; say test;
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ABanGGSF5o␤Undeclared routine:␤ test used at line 1␤␤»
19:54 rurban2 joined
AlexDaniel m: sub foo($x = foo) { 42 }; say foo; 19:54
masak I guess the same technique is possible in Perl 5 (so someone likely already did this), but in Perl 5 you'd have to pass a reference, like \my $octagon
mst masak: no you wouldn't
camelia rakudo-moar 5ed58f: OUTPUT«Memory allocation failed; could not allocate 14597464 bytes␤»
mst masak: @_ is aliases
masak ooh 19:55
yes, indeed
Skarsnik fun one AlexDaniel
Zoffix mst, hm. Then I'll stow this until I'm smarter.
mst I have auto-immolating proxy objects with an AUTOLOAD that sets $_[0]
Zoffix My plans for world domination will have to wait.
masak mst: does this technique have a name? I'm basically passing variables in so that I can refer to "the same thing" later. like gensyms, but not for macros.
Zoffix AlexDaniel, I wonder whether that should generate a "deep recursion" warning, like you'd get in P5 19:56
19:56 jameslenz joined, peter__ left
mst masak: not that I can think of, I tend to describe it via a simile to 'open my $fh, ...' 19:56
AlexDaniel Zoffix: well, is there any recursion limit at all? 19:57
m: sub foo() { return foo }; say foo
camelia rakudo-moar 5ed58f: OUTPUT«Memory allocation failed; could not allocate 37888 bytes␤»
llfourn is there any way to tell you are in the last iteration of a for loop other than having a counter? or kv -> $val,$i?
moritz masak: in p5, you need references if arrays or hashes are to be passed in and modified, because they'd be flattened out otherwise
19:57 lnrdo left, rurban1 left, rurban left
Zoffix AlexDaniel, doesn't seem to be, but I'd imagine it'd be more helpful to get an error with a line number than an "Out of memory" thing (or just getting killed by the OS) 19:58
Skarsnik llfourn, do something on LAST ? 19:59
Zoffix m: for ^5 { LAST { say "$_" } }
camelia rakudo-moar 5ed58f: OUTPUT«4␤»
AlexDaniel Zoffix: yeah, it is less than awesome. That's what I'll submit, I guess
llfourn Skarsnik, Zoffix Ah ha! Is there a do something on not last :P
if last { } else { }
AlexDaniel Zoffix: though I'm not sure if there is any easy way to make it better
LAST { } 20:00
Skarsnik hm
good question
ugexe LAST does not always work 20:01
m: sub foo() { for ^5 { LAST { say $_; }; return if $_ == 2; }; }; foo()
camelia ( no output )
Zoffix m: for ^5 { LAST { last }; .say }
camelia rakudo-moar 5ed58f: OUTPUT«0␤1␤2␤3␤4␤»
Zoffix hm
AlexDaniel ugexe: noooo. Whyy?
llfourn what ugexe shows makes sense to me
jnthn ugexe: Yes, it only fires if you reach the end of the loop by normal means.
Zoffix ugexe, seems to have worked just fine there. You exited before you got to the last element
jnthn Worth noting that in general we can't know in advance if we're at the last element. 20:02
llfourn m: for ^5 { LAST { say "LAST RAN" }; .say }
camelia rakudo-moar 5ed58f: OUTPUT«0␤1␤2␤3␤4␤LAST RAN␤»
jnthn Until we ask for the next one
moritz you seem to want a "finally" clause or so
Skarsnik m: sub foo() { for ^5 { END { say $_; }; return if $_ == 2; }; }; foo()
camelia rakudo-moar 5ed58f: OUTPUT«2␤»
moritz Skarsnik: END is a bit extreme :-)
Skarsnik Oh END it end of script? 20:03
20:03 Celelibi left
moritz Skarsnik: aye :-) 20:03
m: sub foo() { for ^5 { END { say $_; }; return if $_ == 2; }; }; foo(); say "I'm done here";
camelia rakudo-moar 5ed58f: OUTPUT«I'm done here␤2␤»
llfourn it makes sense to me that in general cases we can't know if we're at last beforehand. I suppose it would be icky adding something to tell you in the specific cases you do. 20:04
ugexe really you should do `last if $_ == 2`, but im just saying that someone might think LAST { } should fire when its the last item actually iterated, not if its the expected last item to be iterested 20:05
i know `why` it works that way, but it should be clear how that example could confuse someone 20:06
20:06 prammer joined, rurban joined 20:07 domidumont left 20:08 jabus left, rurban2 left 20:09 rurban1 joined, darutoko left 20:10 Celelibi joined, rurban left
RabidGravy gosh I really got myself in a tiz with a Proxy there 20:10
PerlJam Zoffix++ (just read your reply to jnap. Well said IMHO)
Skarsnik nine, what I don't really understand is why the Array became an Array of Array 20:13
20:13 M-eternaleye left, M-eternaleye joined 20:14 M-eternaleye is now known as eternaleye 20:15 yurivish left 20:17 kaare_ left
masak where's the part of spec that tells how to distinguish a block from a hash again? 20:18
S02? S04? I can't find it
m: say { bar => 42 }.^name; say { bar => my $bar }.^name # and currently I'm surprised that the second one is a Block
camelia rakudo-moar 5ed58f: OUTPUT«Hash␤Block␤»
flussence m: say %(bar => my $bar).^name # does this parse...? 20:19
camelia rakudo-moar 5ed58f: OUTPUT«Hash␤»
jnthn masak: S06-other/anon-hashes-vs-blocks.t
[Coke] S06-other/anon-hashes-vs-blocks.t ?
... dammit. :)
jnthn masak: Block because it declares symbols.
masak aha. 20:20
Skarsnik Oh
flussence forcing {} as a block is easy for me to remember, you just stick a ; in there. Same works in perl5
masak should I use hash(bar => my $bar) or something if I want a Hash but also want to declare symbols?
Skarsnik m: my %hash = Any;
camelia rakudo-moar 5ed58f: OUTPUT«Odd number of elements found where hash initializer expected␤ in block <unit> at /tmp/CU8FDzfDUo line 1␤␤»
jnthn Or %(...)
masak flussence: that wasn't really enough for Perl 6, in practice
Skarsnik I need to return Hash for 'undef' % ?
masak flussence: largely because .map et al. aren't special-cased 20:21
jnthn: ooh, %(...) is a good idea
jnthn Yeah, only one char longer than {...} if that matters :)
masak m: class C { has %.x }; say C.new( x => (foo => my $foo) )
camelia rakudo-moar 5ed58f: OUTPUT«C.new(x => {:foo(Any)})␤»
flussence @(...) is the one I usually need-and-forget-it-exists most often :)
masak nice, I don't even need the % in my case :)
Zoffix m: my %hash = %(); 20:22
camelia ( no output )
jnthn Time for rest... o/ #perl6
20:23 jabus joined
skids m: sub a (|c) { c.perl.say }; a(1) :d; # Heh. You learn something every time you open the design docs. 20:24
camelia rakudo-moar 5ed58f: OUTPUT«\(1, :d)␤»
20:27 _Vi joined 20:29 pmqs left, lnrdo joined
AlexDaniel rest? I thought jnthn will have another non-stop year long coding session :) 20:29
skids: you mean that you can put adverbs outside of the brackets? 20:30
nine Skarsnik: it's the difference between $[1, 2] and [1, 2]
skids That adverbs were interpreted that way by .()
nine Skarsnik: m: my @a := [1, 2]; dd @a; my $b = @a; dd $b; my %h = t => @a; dd %h 20:31
m: my @a := [1, 2]; dd @a; my $b = @a; dd $b; my %h = t => @a; dd %h
camelia rakudo-moar 5ed58f: OUTPUT«[1, 2]␤Array $b = $[1, 2]␤Hash %h = {:t($[1, 2])}␤»
20:32 grondilu left
Skarsnik m: my %h = Any; # is that a bug? 20:33
camelia rakudo-moar 5ed58f: OUTPUT«Odd number of elements found where hash initializer expected␤ in block <unit> at /tmp/vVQbE1CjjA line 1␤␤»
dalek on: 9888329 | moritz++ | / (4 files):
Implement RFC7159. Closes #22
skids m: my %h = Nil
camelia rakudo-moar 5ed58f: OUTPUT«Odd number of elements found where hash initializer expected␤ in block <unit> at /tmp/8_1ieR2IGw line 1␤␤»
20:33 grondilu joined
skids More arguably buglike 20:33
20:33 jabus left 20:35 maettu left
llfourn I don't get it why are %h = Nil, or %h = Any bugs? 20:36
RabidGravy m: %h = Empty 20:37
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BBP4AhNfCq␤Variable '%h' is not declared␤at /tmp/BBP4AhNfCq:1␤------> 3<BOL>7⏏5%h = Empty␤»
RabidGravy m: my %h = Empty
camelia ( no output )
Zoffix :o
Skarsnik I am curious was DBIish pass some tests x)
*why
llfourn m: say Empty 20:38
camelia rakudo-moar 5ed58f: OUTPUT«()␤»
moritz because if they didn't, we'd iterate until they do
skids llfourn: %h = Any is not a bug. %h = Nil could be argued to be one because Nil has special uses in that capacity.
Skarsnik m: say "foo" if Empty;
20:38 zakharyas left
camelia ( no output ) 20:38
llfourn skids: ah ok gotcha thanks 20:39
skids Empty.perl.say
m: Empty.perl.say
camelia rakudo-moar 5ed58f: OUTPUT«slip()␤»
moritz note that Empty isn't a type anymore
dalek Iish: e998b51 | (Sylvain Colinet)++ | lib/DBDish/ (2 files):
Return Hash instead of Any when no result left
20:40
20:40 zakharyas joined 20:41 spider-mario joined 20:50 FROGGS left 20:51 Zoffix left, FROGGS joined 20:53 kjs_ joined
hoelzro is there a builtin Str method to pad a string on the left or right side? it seems indent can do it, but only with spaces 20:55
20:56 skids left
moritz hoelzro: fmt/sprintf? 20:56
for special cases, such as padding with space or numbers with 0
hoelzro ah, that would work
20:57 daotoad joined
hoelzro it seems a little wordy, but it gets the job done 20:57
thanks moritz
20:59 rurban joined, pmqs joined 21:01 rurban1 left 21:04 rurban1 joined 21:06 rurban left 21:14 pmurias left 21:16 pmurias joined 21:18 cdg joined 21:19 pi4 joined, jnap joined 21:20 znpy joined 21:23 daotoad left
jnap newbie question of the day, those of you using rakudobrew, you add export PATH=~/.rakudobrew/bin:$PATH to .bashrc or something else? just spent a silly 5 minutes trying to figure out why 'which perl6' was giving me nothing :) 21:24
21:24 daotoad joined, virtualsue left
alpha123 jnap: yes 21:24
21:26 espadrine joined
RabidGravy i's definitely there for me 21:26
jonathan@coriolanus Tinky]$ which perl6
~/.rakudobrew/bin/perl6
jnap cool, I've not used Perlbrew in ages but now I am remembering it was sorta the same way 21:28
moritz iirc perlbrew gives you a perlbrewrc file which you can source from your .bashrc, and which sets up $PATH for you 21:29
RabidGravy yeah, I've looked in the other rakudobrewy dirs in my path and no perl6
sortiz jnap: I use in .bashrc: eval "$(/home/sog/.rakudobrew/bin/rakudobrew init -)" 21:30
prammer if [ -x ~/.rakudobrew/bin/rakudobrew ]; then eval "$(~/.rakudobrew/bin/rakudobrew init -)"; fi 21:31
21:31 virtualsue joined 21:33 rindolf left
jnap basically like how perlbrew was, cool. 21:36
21:37 mohae_ is now known as mohae
masak interesting. I knew about six, but I never thought about this problem: astrofrog.github.io/blog/2016/01/12...ible-code/ 21:40
moritz masak: my main reaction was "YAGNI" 21:41
worrying now about compatibility with yet another incompatible major python version seems like overkill
jnap awesome I can run my failing tests! by my reckoning that's a step up from yesterday ;)
moritz I hope that the python dev community is still in enough shock from the slow python 3 uptake that they don't consider a python 4 any time soon 21:42
jnap its just perl6 -Ilib .... for testing? I didn't see a prove6
moritz jnap: you can use p5's prove
jnap: prove -e 'perl6 -Ilib' t
jnap ah, because its just tap right 21:43
moritz jnap: there's also a Perl 6 prove being worked on (or two even), but I don't know the current status
right
protocols++
leont Install TAP::Harness, and you have a prove6 ;-)
It's fully functional, except the parallelism 21:44
jnap its still better than what we had for perl5 back in the early days. I still maintain some test code that has "print 'ok 1' " crap all over
21:44 rparks99 joined 21:45 zakharyas left
masak 'night, #perl6 21:46
leont I've came across that too 21:47
TimToady that was how Perl 1 was tested :) 21:49
yoleaux 14:46Z <[Coke]> TimToady: if he can decide on the right behavior for rt.perl.org/Ticket/Display.html?id=112216
AlexDaniel
.oO(Stop writing code that will break on Perl 7!)
21:50
[Coke] there are some test tests in roast that look like that to this day.
moritz [Coke]: those that test say() and print(), iirc 21:51
TimToady it makes sense in some cases
21:51 prammer left 21:52 prammer joined 21:53 virtualsue left 21:56 _nadim joined
TimToady [Coke]: I guess in the absence of strong arguments to the contrary, I'm okay with the current behavior of #112216 21:56
[Coke] TimToady++ danke. 21:58
only 1199 tickets to go. :|
m: say 1199.is-prime
camelia rakudo-moar 5ed58f: OUTPUT«False␤»
lizmat feels empty and goes to bed 21:59
[Coke] lizmat: g'nite! 22:00
[Coke] was feeling very down earlier today but is now in a goodish mood.
22:01 revhippie joined
FROGGS m: { use Test }; say Test # why does this work? I thought even 'use' is lexical? 22:04
camelia rakudo-moar 5ed58f: OUTPUT«(Test)␤»
[Coke] m: say Test; 22:05
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4iVo44sVAX␤Undeclared name:␤ Test used at line 1␤␤»
llfourn FROGGS: that's a good question. I thought it didn't.
[Coke] (just checking)
FROGGS I mean, sure, we do global merging and stuff with these symbol... it is just that I ask myself if this is right or not
llfourn yes but shoudn't it merge it into the GLOBALish of the lexpad
not the UNIT 22:06
is lexpad GLOBALish even a thing?
22:06 ZoffixWin joined, ZoffixWin left, ZoffixWin joined
FROGGS I think so 22:06
ZoffixWin What's the process for making changes to the rakudo.org/how-to-get-rakudo/ ? I think this comment definitely raises a good point, if you're coming in as a Windows user. www.reddit.com/r/perl/comments/40m..._6/cyvu4yp 22:09
nine It may be just a straight forward bug caused by my lack of understanding of those things when I did the refactor.
llfourn it seems from World.nqp that load_module is being passed $*GLOBALish when 'use' is parsed 22:11
and I think $*GLOBALish might be UNIT::GLOBALish hence the behaviour
22:11 linuxuser9000 joined 22:12 frankjh joined 22:13 rparks99 left
nine Ok, so not my bug. 22:13
llfourn I think maybe lexpad GLOBALish is not a thing, and it wouldn't be very GLOBALish if they did exist in lexpads. 22:18
22:18 prammer left
llfourn though someone thinks they should be because of the '$cur_GLOBALish' arg to load_module so maybe it's a NYI 22:19
AlexDaniel segfault! Hooray!
m: my $x := (my $y := $x); say $x.^methods;
camelia rakudo-moar 5ed58f: OUTPUT«(signal SEGV)»
AlexDaniel m: my $x := (my $y := $x); say $y.^methods; 22:20
camelia rakudo-moar 5ed58f: OUTPUT«(signal SEGV)»
Skarsnik that cute
AlexDaniel Yeah, I feel recursive today
ZoffixWin m: my $x := (my $y := $x); say $y.first
camelia rakudo-moar 5ed58f: OUTPUT«Cannot call method 'first' on a null object␤ in block <unit> at /tmp/Cfxl0RUwCS line 1␤␤»
ZoffixWin interesting
AlexDaniel m: my $x := (my $y := $x); say $y.WHAT; 22:21
camelia rakudo-moar 5ed58f: OUTPUT«(signal SEGV)»
AlexDaniel m: my $x := (my $y := $x); say $y.perl;
camelia rakudo-moar 5ed58f: OUTPUT«Cannot call method 'perl' on a null object␤ in block <unit> at /tmp/RppiK6fAM1 line 1␤␤»
frankjh Hi, In NativeCall: I have a native C routine foo(char* buf, unsigned long long* len). The native routine writes the length of a buffer into that memory location. sub foo(CArray[int8], ???) How do I express that correctly? 22:22
Skarsnik Pointer[size_t]? 22:23
Could be Pointer[size_t] is rw maybe 22:24
this unsigned long long is suspcious, it's really the C route signature? 22:25
*routine
FROGGS sub foo(CArray[int8], CArray[ulonglong]) { * }; my $buf = CArray[int8].new; my $len = CArray[ulonglong].new; $len[0] = 0; foo($buf, $len); say $len 22:26
frankjh: something like that^^ 22:27
frankjh yes, I think: typedef unsigned long long u64; int crypto_sign(u8 *sm,u64 *smlen,const u8 *m,u64 n,const u8 *sk)
ulonglong exists?
FROGGS m: say NativeCall; say ulonglong
camelia rakudo-moar 5ed58f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/STwz9xgvrT␤Undeclared routine:␤ ulonglong used at line 1␤␤»
FROGGS :o(
m: say NativeCall; say uint64
camelia rakudo-moar 5ed58f: OUTPUT«NativeCall is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in method gist at src/RESTRICTED.setting line 33␤ in block <unit> at /tmp/gdgAETEEIe line 1␤␤» 22:28
FROGGS m: use NativeCall; say uint64
camelia rakudo-moar 5ed58f: OUTPUT«(uint64)␤»
FROGGS m: use NativeCall; say ulonglong
camelia rakudo-moar 5ed58f: OUTPUT«(ulonglong)␤»
FROGGS there you go
22:29 lokien_ joined
frankjh Ah Cool. I seems missing in the doc doc.perl6.org/language/nativecall. Many Thanks! 22:30
Skarsnik u64 are uint64 probably 22:31
frankjh Unfortunately not: typedef unsigned long long u64;
lokien_ hey, I want to be a unix hax0r, but I only know clojure. few guys told me that I have to learn c, awk, sed etc. c is too spooky for me. can I learn perl instead?
AlexDaniel lokien_: Perl 5 or Perl 6? 22:32
Skarsnik frankjh, yes, but I mean if it's call u64 it mean something that is always a 64 bits unsigned on every plateform, so a uint64 will be perl6 type 22:33
lokien_ AlexDaniel: I don't know, honestly. I'm writing here because perl 6 looks better
Skarsnik huggable, module App::GPTrixie
huggable Skarsnik, Link to module: modules.perl6.org/repo/App::GPTrixie
Skarsnik if you want to not write too much NC code
*definition
AlexDaniel lokien_: if we are speaking about language design, then yes, it is better. But Perl 5 is currently faster (most of the time) for crunching stuff 22:34
lokien_ AlexDaniel: much faster?
AlexDaniel lokien_: depends
lokien_ AlexDaniel: oh, well. so.. can I learn perl instead of these other tools? I think I'd go with 6 22:35
22:35 kjs_ left
AlexDaniel lokien_: also there is much more stuff written in Perl 5, but this is not necessarily a good argument because you can use all that from Perl 6 with Inline::Perl5 22:35
lokien_: well, it is a joy to code in Perl 6 so you wont regret it for sure 22:36
lokien_ AlexDaniel: much better than with python
AlexDaniel: perl syntax spooks me to the bone though 22:37
frankjh Skarsnik: But he typedef is from the native lib, so it looks like u64 notes there something with is at least 64bit or, do I miss something? Probably a bad name for the u64 type...
AlexDaniel lokien_: but it is not that some tool will outperform every other tool in all scenarios, so you always have to keep your eyes open anyway :) 22:38
lokien_ AlexDaniel: I just want something for quick and dirty scripts
AlexDaniel lokien_: try it and see if it works for you :) 22:39
lokien_ AlexDaniel: can I ask my foolish questions here?
AlexDaniel lokien_: yes, although they are not considered stupid here 22:40
or foolish
Skarsnik frankjh, I mean it's a common thing to have a typedef for 64bits stuff. Like sqlite has a sqlite_int64 and I pretty sure it defined according to your system. It's pretty common on code not using C99 standard
AlexDaniel lokien_: I think that we actually want to see more questions like this here (because it is easier to improve the docs) 22:41
22:42 kjs_ joined
lokien_ AlexDaniel: sorry, I was on #lisp for a little while, I'm still feeling foolish. I'll try my best in the next days 22:42
Skarsnik but since perl6 offert int64/num64 it's pretty safe to translate sqlite_int64 to int64, instead of figuring the type behind the sqlite_int64 typedef
22:43 yqt joined
lokien_ AlexDaniel: anyway, do you guys write any full-blown programs with perl? or is it a string processing, "domain specific" language 22:43
llfourn with perl5 yes, with perl6 I mostly just experiment so far :) 22:44
Skarsnik FROGGS, btw, CArray[uint8] give me signed int8 when getting the value x) 22:45
AlexDaniel lokien_: people do all sorts of things with it, though perhaps not enterprise-grade big-ass programs yet
lokien_: I like using it as teaching aid for example (you can show almost anything in Perl 6) 22:46
FROGGS Skarsnik: yes, I got a similar bug report just a few days ago
AlexDaniel lokien_: I also write tests for C programs in Perl 6… :)
lokien_ llfourn: well, I hope I won't have to switch to 5
frankjh Skarsnik: It looks like it is here unsigned long long on all plattforms, so it might be larger on some of them. 22:47
Skarsnik it's not a generated header?
22:47 vendethiel left
lokien_ AlexDaniel: umm, I'll grab a book tomorrow and try to do some advent of code with it. or "perl introduction", we'll see 22:47
llfourn lokien_: I hope you won't either, but it depends what you are trying to do
22:48 wamba left
lokien_ thanks for being polite and helpful, I like you already 22:48
AlexDaniel llfourn: by the way, are there any reasons to switch to 5 besides performance?
lokien_ llfourn: have fun :^)
PerlJam AlexDaniel: CPAN
22:48 kjs_ left
AlexDaniel PerlJam: Inline::Perl5 ? 22:48
PerlJam AlexDaniel: doesn't work with all modules on CPAN. 22:49
AlexDaniel PerlJam: uh! Okay
llfourn AlexDaniel: well, Mojolicious is still the most excellent thing that exists for web glue stuff
dalek osystem: 97f3c33 | FROGGS++ | META.list:
add "pragma" if
llfourn right what PerlJam said :)
AlexDaniel lokien_: not sure which book you are mentioned but a good way to start is doc.perl6.org/language.html
frankjh Skarsnik: Maybe, it is an unusal library: tweetnacl.cr.yp.to/20140427/tweetnacl.c, line 8 or so.
PerlJam lokien_: adventofcode is a good choice. I did some of the problems myself this year while waiting in an airport. 22:50
AlexDaniel llfourn: yeah, that makes sense.
PerlJam lokien_: (in perl 6)
lokien_ AlexDaniel: I was talking about this perl6intro.com 22:51
AlexDaniel lokien_: there is also learnxinyminutes.com/docs/perl6/
lokien_: both are great resources, indeed 22:52
Skarsnik frankjh, Oh yeah. Well have fun with that x)
lokien_ PerlJam: I've done like 4 in clojure and 1 in go, they are pretty fun. I was waking in the dark writing go code though, I copied one third of it from SO
s/waking/walking 22:53
frankjh :)
timotimo o/
llfourn AlexDaniel: For the things I use Mojo for Inline::Perl5 is not appropriate, I don't need any specific module I need the IOLoop, combined with ...yes speed.
lokien_ AlexDaniel: thanks, I'll read it tomorrow
AlexDaniel lokien_: by the way, if you find that something is missing, your contributions are welcome 22:54
RabidGravy right, toodles people
22:54 virtualsue joined
Skarsnik good night RabidGravy 22:54
PerlJam lokien_: P6 does suffer a speed impediment on some of the problems though.
AlexDaniel lokien_: because since you are just starting out you probably know better what could be improved
lokien_ AlexDaniel: where can I search for useful functions? 22:55
AlexDaniel lokien_: hmmm, what do you mean?
lokien_ PerlJam: is it *that* slow? 22:56
PerlJam lokien_: doc.perl6.org is the first place to look
lokien_: for some of the problems, yes. Perl 6 isn't highly optimized yet.
lokien_ AlexDaniel: like, I want to open a text file, I don't know how, I go into "files" bookmark on some website and there is this function I was looking for 22:57
PerlJam lokien_: For instance, I think I killed my run for part 2 of Day 4 because it was taking so long.
lokien_ AlexDaniel: sth like clojuredocs.org
PerlJam: it was like 5 seconds in clojure.. damn. 22:58
AlexDaniel lokien_: doc.perl6.org/language.html see Input/Output
22:59 RabidGravy left
lokien_ AlexDaniel: thanks 22:59
22:59 cpage_ left, frankjh left
lokien_ perl 5 is similar/a bit faster than python 3? oh, well. I've always thought it was fast 23:01
PerlJam lokien_: I was using an unoptimized Perl 6 implementation of MD5. If I'd used NativeCall to get at a C lib for it, it would have gone *much* quicker
leont MD5 isn't the sort of thing dynamic languages are good at 23:02
lokien_ PerlJam: I've had md5s taking 100% from 4 cores, so.. it's a bit unfair
PerlJam leont: one day Perl 6 will be good at it ;) 23:03
leont remembers implementing biological alignment algorithms in perl5, it was about 100 times slower than the C implementation :-/ 23:05
lokien_ leont: 100 times slower than c isn't that slow, actually
23:05 AlexDaniel left, kjs_ joined
lokien_ some golang's crypto function was 340 times slower than c 23:06
Skarsnik I am curious how far native type + SMIT + shapped Array will push the perf
PerlJam dinner time for me. See you guys later
PerlJam &
leont SMIT?
Skarsnik I probably get this one wrong, the cpu instruction to do the same instruction on a multiple value on one cycle 23:11
23:11 kjs_ left, FROGGS left
lokien_ I'm going to sleep, see you tommorow, I'll be asking a lot of silly questions. 23:11
leont SIMD?
Skarsnik Yes SIMD
I used them one to convert yuv to rgb once x) 23:12
23:15 newbie joined, newbie is now known as Guest86427 23:16 yqt left 23:19 AlexDaniel joined, zwu joined
AlexDaniel please delete RT 127250 23:22
AlexDaniel wishes that some day he will be able to do that himself 23:23
23:24 kid51 joined 23:26 lostinfog left, llfourn left 23:27 ribasushi joined 23:28 cpage_ joined 23:31 zwu left
_nadim In a heredoc, a code block output is added, s there something tha can be returned by the block to not add a line? 23:33
Nil work the same as the empty string, it adds an ampty line
AlexDaniel m: subset Int of Int where * >= 0; my Int $x = 5 23:34
camelia rakudo-moar 5ed58f: OUTPUT«===SORRY!===␤You cannot create an instance of this type␤»
AlexDaniel m: subset Str of Int where * >= 0; my Int $x = 5
camelia ( no output )
23:35 Skarsnik left 23:42 daotoad left, daotoad joined
tadzik El_Che: I'm around now :) 23:42
23:46 atweiden joined, pmurias left 23:55 ribasushi left, pierre-vigier joined 23:59 rindolf joined