»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
tony-o n: my $x := 5; my $y := '$x'; say(nqp::getlexdyn(self,$y)); 00:01
camelia niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤'self' used where no object is available at /tmp/QHGAhgyx6m line 1:␤------> ; my $y := '$x'; say(nqp::getlexdyn(self⏏,$y));␤␤Potential difficulties:␤ $x is declared but not used at /tmp…»
tony-o n: my $x := 5; my $y := '$x'; say(nqp::getlexdyn($y));
camelia niecza v24-109-g48a8de3: OUTPUT«Potential difficulties:␤ $x is declared but not used at /tmp/RFHqJ6I3bs line 1:␤------> my ⏏$x := 5; my $y := '$x'; say(nqp::getlexd␤␤Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Any␤ at /t…»
TimToady niecza has no nqp
tony-o oh oops
nqp-m: my $x := 5; my $y := '$x'; say(nqp::getlexdyn($y)); 00:02
camelia nqp-moarvm: OUTPUT«␤»
00:02 Mouq left
tony-o hm 00:02
TimToady that's not what the 'dyn' means
00:02 Mouq joined
TimToady it's looking up the call stack for variables marked 'is dynamic' 00:04
00:04 jfredett joined
TimToady typically a $*foo variable 00:04
tony-o ahh 00:05
TimToady normal lexicals are considered invisible to the dynvar mechanism
or we'd never be able optimize anything
Mouq second Supply request: Supply.first()
tony-o im trying to use v5 as a guide, trying to slang sql statements 00:06
nqp-m: my $x := 5; my $y := '$x'; say(nqp::getlex($y));
camelia nqp-moarvm: OUTPUT«expected QAST constant; didn't get one␤ at gen/moar/stage2/QAST.nqp:5354 (/home/camelia/rakudo-inst-1/languages/nqp/lib/QAST.moarvm:as_mast_constant:6)␤ from gen/moar/stage2/QAST.nqp:5342 (/home/camelia/rakudo-inst-1/languages/nqp/lib/QAST.moarvm:as_mast_c…»
TimToady nqp-m: my $x := 5; my $y := '$x'; say(::($y)); 00:07
camelia nqp-moarvm: OUTPUT«Confused at line 2, near "say(::($y)"␤ at gen/moar/stage2/NQPHLL.nqp:485 (/home/camelia/rakudo-inst-1/languages/nqp/lib/NQPHLL.moarvm:panic:105)␤ from gen/moar/stage2/NQP.nqp:913 (/home/camelia/rakudo-inst-1/languages/nqp/lib/nqp.moarvm:comp_unit:872)␤ f…»
TimToady I guess nqp doesn't support ::() notation
00:08 jfredett left 00:15 ab5tract left 00:18 grondilu joined
Mouq Hmm, actually it looks like using .first on a Supply is a bit of a smell 00:18
TimToady sort of a heavy-duty promise 00:20
except for the async notification 00:21
really more of a heavy-duty callback 00:22
why not just use a callback in that case?
00:24 cognominal left, cognominal joined
timotimo tadzik: i don't remember if i have an account on feather ... though i probably do 00:25
TimToady but yeah, it's also a bit like using (1..*)[0] to calculate 1 :)
timotimo oh 00:29
the benchmarks don't look terribly favourable for my recent optimizations >_<
00:33 exixt_ is now known as exixt 00:34 jfredett joined 00:38 BenGoldberg joined, jfredett left 00:40 quarkie68 joined 00:44 KCL_ joined 00:52 dayangkun joined 00:54 dayangkun left
Mouq TimToady: Well, it's from a Supply.categorize and I wanted to do something like .first({.key eq "whatevs"}) ... 01:05
(which in this case is equivalent to .map, except that .map would keep matching against each new value) 01:07
01:12 quarkie68 left 01:13 yoleaux left
TimToady so it's really more of a map/reduce sort of behavior that is designed to do parallel search for early results 01:14
yes, it's smelly, but as implemented by Google, it's disruptive technology :) 01:15
TimToady hates to think how many electrons Google wastes every year... 01:16
01:18 tinyblak left 01:19 tinyblak joined, raiph left 01:21 raydiak joined, regreg left, raydiak left 01:22 raydiak joined, user_4692 joined
Mouq m: my $s = Supply.new; $s.map({say "mapped1"}).act({say "tap"}, :done{ say "done"} ); $s.emit(3); $s.done 01:23
camelia rakudo-moar f8f6fe: OUTPUT«mapped1␤tap␤done␤»
Mouq m: my $s = Supply.new; $s.map({say "mapped1"}).map({say "mapped2"}).act({say "tap"}, :done{ say "done"} ); $s.emit(3); $s.done
camelia rakudo-moar f8f6fe: OUTPUT«Memory allocation failed; could not allocate 120832 bytes␤»
Mouq Or timeout if you have enough mem :/ 01:24
01:24 user_4692 left
timotimo t.h8.lv/p6bench/2014-11-14-futile_o...tions.html - all the optimization work for no visible improvement :\ 01:30
Mouq benchmarks !=== real-world code 01:31
timotimo yeah, well ... 01:36
not even in our flawed microbenchmarks i can see a difference :S
01:41 telex left 01:42 telex joined 01:49 xenoterracide joined 01:51 KCL_ left 01:55 xenoterracide left
tony-o Mouq: gist.github.com/tony-o/501440a2e7182db2beb3 01:56
timotimo tony-o: --ll-exception shall be your tool of choice 01:58
could be from your method sql needing a $/ argument
tony-o timotimo: thank you 01:59
it's from the method statement_control:sym<with> but i'm not sure why i get that problem but v5 has similar signatures and no problems 02:00
timotimo dunno :\ 02:03
well, v5 also defines its own proto token statement_control, but i don't see a reason why it shouldn't work when you mix in your role to Perl6::Grammar like that
japhb TimToady: We waste fewer electrons than you might expect ... because when you start talking about many, many megawatts, saving a few REALLY makes a difference. So we do. :-)
Mouq tony-o: Found it 02:04
nqp::bindkey(%*LANG, 'MAIN', %*LANG<MAIN>.HOW.mixin(%*LANG<MAIN>, SQL::Actions));
Try s:g/MAIN/MAIN-actions
timotimo oh 02:05
hehe.
good catch
tony-o Mouq++
japhb timotimo: It may just be that your optimizations are being either defeated (not actually used for any of these tests) or drowned out by things that are more expensive. Nevertheless, currently invisible improvements may "pop out" at a later date when they are exposed by other changes. 02:07
timotimo thank you for those encouraging words :) 02:08
and now i remember i had said i'd turn that formula-evaluation-benchmark thingie into a perl6-bench, too!
japhb Which is a wordy way of saying: Don't get discouraged. Heck, after all these years SQLite got 50% faster in a single release with a whole bunch of optimizations, some only worth 0.05%
timotimo: yes please!
*whole bunch of tiny optimizations 02:09
And I quote: "Each of these optimizations is unmeasurable
on a real-world system (we have to use cachegrind to get repeatable
run-times) but if you do enough of them, they add up."
timotimo fair enough 02:11
we do still have a whole bunch of huge performance stupidities we ought to get rid of
Mouq timotimo++ 02:12
timotimo Mouq: not the kind of thing i can do :S 02:14
when we get free register selection for our jit, we'll be able to produce a crapton fewer loads and stores in there
japhb Yep, that's true. But I kinda like to look at the converse of Amdahl's law. If the best single improvement could make the program twice as fast, but it's really hard to do, then do the second or third best improvement now, and when you finally figure out how to make that #1 fix, it will make the program faster by 3x, 4x, or more. Which will make all that super hard work feel WAY better. :-) 02:15
japhb makes mental lemonade 02:16
Mouq No, no. timotimo++ for many tiny optimizations 02:17
02:20 cognominal left
Mouq third Supply request: when a .tap's :done gets called, call it with Supply.list as the argument 02:25
(Of course, I could be misunderstanding Supply again) 02:27
tony-o so many little things to go wrong with this mixing
timotimo "many"? :S 02:29
Mouq: Supply.list will give you the following events as a lazy list, won't it? 02:30
tony-o yea i think i'm fried for today..even little things like seeing $<sym> in the -actions stuff isn't working for me and i'm just not seeing it
timotimo does it make sense to call the :done with that?
Mouq Ahh, yeah, I think I should be using .grab
timotimo iirc :done is called on a tap when the tappee is done, so the list would be empty? 02:31
Mouq This stuff is weird
timotimo supplies don't store all the generated values that they have seen in the past
i'd think you'd only ever want supply to store all your stuff if you explicitly ask for it
i suppose you can introspect the :done callable to see if it accepts a parameter or not, but that seems a bit smelly in that position
Mouq Well, the list would still be lazy anyway and block. I want to .join the Supply.. but I think I've figured it out 02:32
timotimo don't forget that we want supplies also for things like keyboard and mouse events in a gui or something like that
imagine you're moving your mouse across a window and it generates a few kilobytes of mouse position history data per second...
jnthn: just now i'm seeing that an in-lined frame doesn't really get handled WRT the dominance tree 02:33
Mouq Right, and I was actually making my head hurt trying to figure out how to do something that .grab is made for 02:34
timotimo in this case of DIVIDE_NUMBERS, the infix:<<> gets inlined (and the lit_s(&infix:<<>) survives for some reason) by having an unconditional goto to bb 34 and from bb 34 back to the original successor of 8, which is simply 9 02:35
9's only predecessor is 34, 8's only successor is 34, but it's not in the dominance tree
is that very hard to get right?
02:36 jfredett joined
timotimo because in that case i ought to do the unbox skipping optimization as well, but it crosses bb borders quite a ways 02:36
i suppose it could be enough to just check if there's only a single predecessor
anyway, it's quite a bit past bedtime here 02:37
o/
02:37 jimmy_ joined, jimmy_ is now known as JimmyZ
JimmyZ good morning, #perl6 02:37
colomon \o 02:39
02:39 Mouq left 02:40 jfredett left, kjs_ left 02:49 xenoterracide joined 03:04 leont left 03:11 Mso150 joined, espadrine` left 03:14 datums_nb joined 03:16 Mouq joined 03:37 JimmyZ left 03:38 jimmy_ joined, jimmy_ is now known as JimmyZ 03:41 robinsmidsrod left 03:42 adu joined 03:43 robinsmidsrod joined 03:44 hugme left 03:45 Ulti joined, hugme joined, ChanServ sets mode: +v hugme 03:46 revdiablo left 03:47 haroldwu left, haroldwu joined, revdiablo joined 03:49 labster left, Mso150 left 03:50 tinyblak_ joined
TimToady long time, no dalek 03:52
03:52 bjz_ joined 03:53 tinyblak left 04:01 datums_nb left 04:04 rmgk is now known as Guest13057, rmgk_ joined, Guest13057 left, rmgk_ is now known as rmgk 04:11 raiph joined 04:12 kaleem joined 04:18 xenoterracide left 04:19 xenoterracide joined 04:20 erkan left 04:21 xenoterracide_ joined, xenoterracide left 04:28 zakharyas joined 04:32 kaleem left, kaleem joined 04:36 raiph left 04:38 raiph joined 04:44 labster joined 04:49 xenoterracide_ left 04:52 bjz_ left 04:55 xenoterracide_ joined 04:58 xenoterracide_ left, xenoterracide_ joined 05:01 bjz joined 05:05 kaare_ joined 05:14 xenoterracide_ left 05:17 xenoterracide_ joined 05:18 BenGoldberg left 05:22 xenoterracide_ left 05:23 raiph left 05:26 kaleem_ joined 05:30 kaleem left 05:33 xenoterracide_ joined 05:38 xenoterracide_ left 05:39 zakharyas left
ugexe panda install XML::Query 05:46
t/basic.t .. | Default constructor for 'Query' only takes named arguments
panda look XML::Query
prove -v -e 'perl6 -Ilib' t/ | All tests successful.
so panda install is affecting the testing in some way to make it fail? 05:48
05:52 kaare_ left 06:11 kjs_ joined 06:14 xenoterracide_ joined 06:15 kaare_ joined 06:31 tinyblak_ left, tinyblak joined 06:35 telex left 06:36 telex joined 06:44 xenoterracide_ left 06:45 esaym153 left 06:48 adu left
tony-o it happens for some of my modules too - 06:53
Mouq Maybe precompilation issues? 06:54
tony-o Mouq: im totally stumped on the $<sym> thing for my slang 06:55
whenever i try using thatbit tells me that $<whatever> is not defined
07:04 anaeem1_ joined, yoleaux joined, ChanServ sets mode: +v yoleaux, anaeem1_ left 07:05 anaeem1_ joined
Mouq What? 07:06
as in nqp::atkey($/, 'sym') is undefined? 07:07
07:16 rurban joined 07:17 FROGGS joined 07:18 kjs_ left 07:23 rurban1 joined 07:27 rurban left 07:28 kaleem_ left 07:29 smls joined
smls o/ 07:31
Today I discovered that $( ) allows interpolating arbitrary code in a string, without creating a block!
Which is great if you want to reference $_ from the outside:
m: say "$_ truncated to zero decimal places is $(.Int), not {.Int}!" given pi
camelia rakudo-moar f8f6fe: OUTPUT«3.14159265358979 truncated to zero decimal places is 3, not 0!␤»
smls :) 07:33
07:42 woolfy joined 07:52 erkan joined, erkan left, erkan joined
TimToady the bracket form is also supposed to work 07:53
is is a known bug 07:54
*it
smls oh 07:58
ok
08:02 tinyblak left, tinyblak joined
masak mornings, #perl6 08:06
moritz \o masak 08:09
\o #perl6
masak "But in the end, I expect you to act like a group of friends who care about each other" -- +1 -- blog.codinghorror.com/what-if-we-co...e-empathy/ 08:10
08:10 regreg joined
masak of course a blog post titled "What if we could weaponize empathy?" would appeal to someone who once wrote a blog post titled "How can we scale kindness?" 08:11
sergot hi o/ 08:12
masak sergocie++! \o/ 08:13
08:15 darutoko joined
jnthn morning, #perl6 08:16
sergot masaku++! \o/
jnthn o/
jnthn o/ sergot
08:17 woolfy left
JimmyZ morning, masak && jnthn ! 08:17
jnthn .tell timotimo Yes, we don't merge the dominance trees when inlining
yoleaux jnthn: I'll pass your message to timotimo.
jnthn .tell timotimo It's rather possible we should...EA will need it, at least... 08:18
yoleaux jnthn: I'll pass your message to timotimo.
08:18 tinyblak_ joined
jnthn Of course, since I guess we'd EA as a separate pass, the cheat is just to re-compute the dominance before that pass :) 08:18
Oh, though we may not need it since the inlined form is still an SSA form... :) 08:20
08:20 zakharyas joined
masak jnthn: you do realize that we have another week of EA hacking coming up...? :) 08:21
08:21 tinyblak left
jnthn masak: Um...mixed in with 2 longhaul flights? :P 08:21
masak aka "design sessions" :P 08:22
jnthn aka "Trying to write EA patches at the BJ airport Starbucks" :)
masak hey! it almost worked!
jnthn It SEGV /o\
masak right. "almost" :)
JimmyZ at least it builds! 08:23
jnthn There is that :) 08:25
masak right. a SEGV is just C's way of saying "you forgot something somewhere".
jnthn Hm, I should probably go to work... :)
Fun as it would be to stay home and hack native array stuffs instead... 08:26
commute &
JimmyZ Where is the broken EA branch? 08:29
nwc10 JimmyZ: probably on the way to the train 08:32
JimmyZ :) 08:33
nwc10 (ie I'm guessing "jnthn's laptop")
masak yeah. IIRC, the commit that caused things to SEGV was never pushed to the 'esc' branch.
JimmyZ
.oO( There was also a NFG branch in the secret repo)
nwc10 but it was NFG? 08:34
JimmyZ a year ago :P
masak nwc10: :P 08:35
smls wonders if Match should have a more reader-friendly shortcut for ".list>>.Str" - maybe ".captures-list"? (Considering in Perl 5 it was as easy as putting the match operation in list context, and quite a common thing to do...) 08:38
moritz smls: the main difference is that named captures aren't second class citizens in p6 regexes (and that the matches are actually trees) 08:40
smls: it's much easier to visualize a one-dimensional list than a two-dimensional tree
smls Still, many common regex (not grammar) use-cases will only deal with a one-dimensinal sequence of positional capture groups, and want to get them into an array or a list of variables easily. 08:44
Mouq smls: Well, there is ~«@()
:P 08:45
m: $_ = "abcd"; m/a(b)c(d)/; say ~«@()
camelia rakudo-moar f8f6fe: OUTPUT«b d␤»
smls I didn't know prefix operators could be hyper'ed too! 08:46
Mouq :) 08:47
smls Although your solution won't exactly disabuse people of the notion that Perl is line noise... :S
sergot ~«@() looks like a Cyclops with a mohawk, doesn't it? 08:48
and a scar on his forehead
moritz you can always say @()>>.Str if you like :-)
smls pretty much :)
moritz @()>>.Str looks like a fish pushing a Str :-) 08:49
sergot now it is a Cyclops with a beard
08:49 molaf__ joined
sergot fishes like Strs 08:50
:)
08:53 molaf_ left 08:55 virtualsue joined
lizmat commute to Helsinki& 08:56
08:56 lizmat left 08:57 ghostlines joined
masak .oO( lizmat in Helsinki context ) 09:04
09:08 abraxxa joined 09:10 Exodist left
masak wow, Perl 5, you horrible wonderful language. :) 09:11
masak is using it at $work
JimmyZ guess which language is used at my work :P 09:12
masak hopes it's not Perl 4 09:13
09:13 Exodist joined
JimmyZ No, it's modern language 09:13
masak I can't believe no-one ever bothered to implement variable-length lookbehind in the Perl 5 regex engine. 09:14
I mean, it's not *every* day I need it... but when I need it, I really need it.
and the workarounds are painful.
nwc10 masak: have you looked at the source code?
I don't think that "bothered" is the right word
masak heh. 09:15
I have looked at the source code. but it's been a while.
09:17 rindolf joined 09:24 fhelmberger joined
moritz masak: not always, but often \K is a good workaround 09:26
(available in 5.10+)
masak checks out K
moritz p5's \K is like p6's <(
masak ooh
09:30 |Tux| left 09:32 TuxCM joined
moritz very handy in substitutions and the like 09:32
09:35 ab5tract joined 09:36 ab5tract left
smls masak: the (*SKIP)(*FAIL) backtracking control verbs can also be used in Perl 5 for solving *some* usecases that one would ideally use variable-length-lookbehind for 09:36
09:36 Mouq left
timotimo o/ 09:45
yoleaux 08:17Z <jnthn> timotimo: Yes, we don't merge the dominance trees when inlining
08:18Z <jnthn> timotimo: It's rather possible we should...EA will need it, at least...
JimmyZ morning, timotimo :) 09:47
timotimo hello JimmyZ 09:48
09:50 kaleem_ joined
JimmyZ timotimo: Eliminating stack allocations in C/C++ is done with an 09:51
sorry 09:52
09:52 tinyblak_ left, Mso150 joined 09:54 tinyblak joined
smls $ perl -E 'say join ",", "foo11 22 bar33 !44" =~ /[a-z]+ \K \d+/xg' # only numbers that are preceded by a word 09:54
11,33
$ perl -E 'say join ",", "foo11 22 bar33 !44" =~ /[a-z]+ \d+ (*SKIP)(*FAIL) | \d+/xg' # only numbers that are NOT preceded by a word 09:55
22,44
^^ masak: poor-man's variable-length lookbehind (positive & negative) in Perl 5
moritz it might become more complicated if the look-behind is supposed to overlap with something that should match 09:59
10:03 espadrine` joined 10:06 exixt is now known as exixt_ 10:08 ptc_p6 joined 10:09 zakharyas left 10:14 pecastro joined 10:15 ptc_p6 left, ptc_p6 joined
masak in my case it isn't, so the above might work. 10:16
still, the above solutions might be adequate workarounds, but they still feel like a "poor man's Perl 6 regexes". 10:17
timotimo i'm glad we have better features than pcre in basic stuff ... our performance ought to improve a bit still ... i think i'm starting to sound like a broken record :)
masak it's fine to repeat stuff that's important :) 10:19
masak .oO( <ballmer>performance performance performance</ballmer> )
timotimo yeah, kinda :)
10:23 someanon joined
someanon guys help me pls 10:23
hi to all
perl6 -v: This is perl6 version 2014.09 built on MoarVM version 2014.09
> my @c = map { { input => $_, asd => 123 } }, 0..2 10:24
does not works as expcted
*work
moritz m: my @c = map { { input => $_, asd => 123 } }, 0..2; say @c.perl
camelia rakudo-moar f8f6fe: OUTPUT«Array.new("input" => 0, "asd" => 123, "input" => 1, "asd" => 123, "input" => 2, "asd" => 123)␤»
moritz yes, that looks wrong to me 10:25
timotimo should be itemized, right?
moritz m: my @c = map {; { input => $_, asd => 123 } }, 0..2; say @c.perl
camelia rakudo-moar f8f6fe: OUTPUT«Array.new("input" => 0, "asd" => 123, "input" => 1, "asd" => 123, "input" => 2, "asd" => 123)␤»
moritz timotimo: aye
someanon i expect list of hashes
timotimo yes
moritz m: my @c = map {; %( input => $_, asd => 123 ).item }, 0..2; say @c.perl
camelia rakudo-moar f8f6fe: OUTPUT«Array.new({"input" => 0, "asd" => 123}, {"input" => 1, "asd" => 123}, {"asd" => 123, "input" => 2})␤»
moritz someanon: that's a workaround
someanon las one? 10:26
moritz yes
someanon *last
timotimo m: (map { { input => $_, asd => 123 } }, 0..2).perl.say
camelia rakudo-moar f8f6fe: OUTPUT«(("input" => 0, "asd" => 123), ("input" => 1, "asd" => 123), ("input" => 2, "asd" => 123)).list␤»
moritz %( ... ).item instead of { }
someanon oh shee
timotimo that doesn't create hashes either?
jnthn wonders if it's treated as a bare block
moritz timotimo: list of parcel
jnthn: me too
timotimo could be
someanon this question for me?
timotimo { } with $_ inside is a strong sign for "this is a block"
someanon: for everybody 10:27
jnthn m: (map { ({ input => $_, asd => 123 }) }, 0..2).perl.say
someanon ha
camelia rakudo-moar f8f6fe: OUTPUT«(-> ($_? is parcel) { #`(Block|82458752) ... }, -> ($_? is parcel) { #`(Block|82458816) ... }, -> ($_? is parcel) { #`(Block|82458880) ... }).list␤»
jnthn Yes, it is.
Oh
$_ forces the block interpretation
That's even spec.
someanon i saw block
timotimo right, i seem to recall that
someanon we need to fix this!
jnthn Uh
someanon or
jnthn Well, it seems like Rakudo is following spec as far as I can see.
someanon at first i was need to use zip in map 10:28
timotimo m: my @c = map -> $a { { input => $a, asd => 123 } }, 0..2; say @c.perl
camelia rakudo-moar f8f6fe: OUTPUT«Array.new({"input" => 0, "asd" => 123}, {"asd" => 123, "input" => 1}, {"input" => 2, "asd" => 123})␤»
10:28 JimmyZ left
someanon so this hash creation - it is just workaround for zip 10:28
wow
camelia, good
jnthn someanon: What's the original problem, out of curiosity? 10:29
moritz idly wonders if %{ ... } could be used to force hash and &{...} to force block
someanon i need somthing like this
map -> $a, $b { ... } <== @a Z @b 10:30
moritz or maybe {% ... } and {& ... } to not give the impression that it de-itemizes
someanon or maybe zipBy function like in haskell
it will be greate if perl6 will implement most of haskell list operations 10:31
jnthn, so dat list of hashes it is just workaround for zipBy 10:32
jnthn m: my @a = 1..10; my @b = 'a'..'j'; (@a Z @b).for(-> $a, $b { say "$a $b" })
camelia rakudo-moar f8f6fe: OUTPUT«1 a␤2 b␤3 c␤4 d␤5 e␤6 f␤7 g␤8 h␤9 i␤10 j␤»
timotimo m: my @a = <one two three four>; my @b = <eins zwei drei vier>; say (@a Z=> @b).perl
camelia rakudo-moar f8f6fe: OUTPUT«("one" => "eins", "two" => "zwei", "three" => "drei", "four" => "vier").list␤»
someanon can for return list?
jnthn Sure
timotimo yes, you often have to write "do" before it
jnthn m: my @a = 1..10; my @b = 'a'..'j'; (@a Z @b).for(-> $a, $b { ($b, $a) }).flat.say 10:33
camelia rakudo-moar f8f6fe: OUTPUT«a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10␤»
someanon nice!
and i have one more question
10:34 kaleem_ left
someanon why can't i do sub (Int :$int-param) { ... } 10:34
?
10:34 kaleem joined
timotimo someanon: write "anon sub" or "sub :: (...)" 10:34
someanon no
jnthn m: sub (Int :$int-param) { }
camelia ( no output )
jnthn Can you be a bit clearer on what exactly you can't do? :) 10:35
someanon jnthn, you got it?
i need typed named parameter
not just typed or named
jnthn m: sub foo(Int :$int-param) { }; foo(int-param => 42)
camelia ( no output )
jnthn m: sub foo(Int :$int-param) { }; foo(int-param => 'omg')
camelia rakudo-moar f8f6fe: OUTPUT«Type check failed in binding $int-param; expected 'Int' but got 'Str'␤ in sub foo at /tmp/rA1ffNPJif:1␤ in block <unit> at /tmp/rA1ffNPJif:1␤␤»
someanon hm 10:36
m: sub foo(Int :$int-param=10) { say $int-param }; foo()
camelia rakudo-moar f8f6fe: OUTPUT«10␤»
someanon m: sub foo(Int :$int-param=10) { say $int-param }; foo(); foo(123) 10:37
camelia rakudo-moar f8f6fe: OUTPUT«10␤Too many positionals passed; expected 0 arguments but got 1␤ in sub foo at /tmp/xakB9Bcpvn:1␤ in block <unit> at /tmp/xakB9Bcpvn:1␤␤»
someanon m: sub foo(Int :$int-param=10) { say $int-param }; foo(); foo(int-param => 123)
camelia rakudo-moar f8f6fe: OUTPUT«10␤123␤»
someanon m: sub foo(Int :$int-param=10) { say $int-param }; foo(); foo(:int-param(123))
camelia rakudo-moar f8f6fe: OUTPUT«10␤123␤»
someanon hmhmhmh
what version of your perl6?
jnthn Note that named params are optional by default... If you wnat foo() to complain, write it as sub foo(Int :$int-param!) { } 10:38
someanon yes, i know
jnthn someanon: The f8f6fe is the git sha-1 of the running version
someanon how to get my sha-1?
jnthn Looks like from yesterday
Try --version 10:39
someanon This is perl6 version 2014.09 built on MoarVM version 2014.0
i already wrote at top
jnthn Ah, it's a relesae build, so no sha-1
But still, a recent one.
timotimo 2014.0 is so old! ;)
someanon maybe it is better to use most last? 10:40
jnthn Well, recenter is usually better. but 2014.09 is less than 2 months old.
timotimo in some ways, development happens very fast and changes between monthly releases are big
someanon jnthn, timotimo sad that moarvm too old
timotimo that was a stupid joke 10:41
someanon whats your moarvm version?
timotimo because the 9 from the very end was cut off
jnthn someanon: Yes, I think you missed a digit :)
someanon ah ok
ok, i have one more question
jnthn I don't know exactly which version the but is running..but probably a pretty recent one (like, within last days)
timotimo m: say $*VM<version>.perl 10:42
camelia rakudo-moar f8f6fe: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "postcircumfix:<\{ }> not defined for type VM"))␤»
someanon i will try ot make code right away
timotimo m: say $*VM.perl
camelia rakudo-moar f8f6fe: OUTPUT«VM.new(config => {"staticdir" => "lib", "nul" => "/dev/null", "ccswitch" => "-c", "versionmajor" => "2014", "shaobjects" => "3rdparty/sha1/sha1.o", "dcobjects" => "", "static_inline" => "static __inline__", "dlobjects" => "", "uvlib" => "3rdparty/libuv/lib…»
timotimo m: say $*VM.config.keys
camelia rakudo-moar f8f6fe: OUTPUT«ccdef moarlib ccwarnflags name dlllocal ldrpath cflags moar shaobjects ldimp ldmiscflags dllib auxclean sharedlib lddebugflags cincludes cppswitch prefix ldinstflags ccshared ldlibs tomclean ldusr obj arout osname nul platform ccout ld dllexport ccmiscflag…»
timotimo so many things in that hash
jnthn m: say $*VM.config.keys.grep(/ver/) 10:43
camelia rakudo-moar f8f6fe: OUTPUT«osvers versionpatch versionmajor versionminor version␤»
someanon m: my $a = sub (Num $b) { say $b }; $a(0.1)
camelia rakudo-moar f8f6fe: OUTPUT«Type check failed in binding $b; expected 'Num' but got 'Rat'␤ in sub at /tmp/aOQmyBdzox:1␤ in block <unit> at /tmp/aOQmyBdzox:1␤␤»
timotimo ah
someanon wow
timotimo m: say $*VM.config<version>
camelia rakudo-moar f8f6fe: OUTPUT«2014.10-17-g05b25a6␤»
someanon do you see bug?
timotimo someanon: you may want to use Real rather than Num?
someanon maybe
m: my $a = sub (Real $b) { say $b }; $a(0.1)
camelia rakudo-moar f8f6fe: OUTPUT«0.1␤»
someanon hm
jnthn Num = floating point
m: say 0.1.WHAT
camelia rakudo-moar f8f6fe: OUTPUT«(Rat)␤»
timotimo m: sub a(Cool(Num) $b) { say $b.perl }; a(0.1)
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/UK16G8u3Nc␤coercive type declarations not yet implemented. Sorry. ␤at /tmp/UK16G8u3Nc:1␤------> sub a(Cool(Num)⏏ $b) { say $b.perl }; a(0.1)␤» 10:44
jnthn m: say 0.1e0.WHAT
camelia rakudo-moar f8f6fe: OUTPUT«(Num)␤»
timotimo m: sub a(Cool as Num $b) { say $b.perl }; a(0.1)
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/aGdwVCBBCp␤Missing block␤at /tmp/aGdwVCBBCp:1␤------> sub a(Cool as Num ⏏$b) { say $b.perl }; a(0.1)␤ expecting any of:␤ statement list␤ prefix or t…»
timotimo i thought we had that by now
jnthn 0.1 isn't floating point in Perl 6, but rather a rational number
timotimo: Cool $b as Num
timotimo ah
so that's how you spell that
someanon jnthn, i guessed
jnthn But yeah, Real or Numeric are the more general numeric types
someanon Cool means cast? 10:45
jnthn Roles, to be specific.
timotimo Cool means "things that will cast themselves for you with most methods"
m: say String ~~ Cool
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/afUlussBP4␤Undeclared name:␤ String used at line 1. Did you mean 'Stringy'?␤␤»
timotimo m: say Str ~~ Cool
camelia rakudo-moar f8f6fe: OUTPUT«True␤»
someanon timotimo, nice
timotimo so there are methos on Str that make sense only for numbers
m: say "100".sin
camelia rakudo-moar f8f6fe: OUTPUT«-0.506365641109759␤»
timotimo m: say "100".conj 10:46
camelia rakudo-moar f8f6fe: OUTPUT«100␤»
timotimo m: say "100+5i".conj
camelia rakudo-moar f8f6fe: OUTPUT«100-5i␤»
someanon m: my $a = sub (Array Real @b) { say @b }; $a([0.1, 0.2])
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/g7v5Ecg2_g␤A parameter may only have one prefix type constraint␤at /tmp/g7v5Ecg2_g:1␤------> my $a = sub (Array Real ⏏@b) { say @b }; $a([0.1, 0.2])␤ expecting any of…»
someanon how to make typed array?
timotimo if you require a parameter to "be Cool", you'll get a value that you can treat as many different things without casting manually
write just "Real @b"
m: my Real @a; say @a.perl 10:47
camelia rakudo-moar f8f6fe: OUTPUT«Array[Real].new()␤»
timotimo the "Array of TheTypeGiven" is done for you when you choose the @sigil
someanon one more question=) 10:50
timotimo sure, go ahead :)
moritz (but don't use typed arrays, they only cause sorrow) 10:51
someanon moritz, why? 10:52
moritz m: sub f(Int @a) { say @a.perl }; f [1, 2, 3]
camelia rakudo-moar f8f6fe: OUTPUT«Type check failed in binding @a; expected 'Positional[Int]' but got 'Array'␤ in sub f at /tmp/JcKPHhWHJJ:1␤ in block <unit> at /tmp/JcKPHhWHJJ:1␤␤»
timotimo correct, the "type check" doesn't implicitly "distribute"
moritz this fails, because [] just returns an Array, not Array[Int]
jnthn Well, if you're going to use typed arrays, you need to use them consistently...
someanon f(Cold(Int) @a) { say @a.perl }; f [1, 2, 3]
m: f(Cold(Int) @a) { say @a.perl }; f [1, 2, 3]
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/re5FXmeFQE␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/re5FXmeFQE:1␤------> f(Cold(Int) ⏏@a) { say @a.perl }; f [1, 2, 3]␤ expecting…»
moritz and this makes working with them quite unpleasant 10:53
someanon m: f(Int @a) { say @a.perl }; f Int([1, 2, 3])
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/h9UQTvufUv␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/h9UQTvufUv:1␤------> f(Int ⏏@a) { say @a.perl }; f Int([1, 2, 3])␤ expecting …»
timotimo true ... and in rakudo you don't even get better performance if your stuff is typed thoroughly
jnthn Well, you do for native types...
timotimo definitely true
jnthn But you can't do those on arrays *yet*. :)
timotimo and with native shaped arrays... yeah!
someanon i just lazy to validate myself
timotimo looking forward to that :)
someanon m: my @a[10;10] 10:54
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/DnS_cL6_TM␤Shaped variable declarations not yet implemented. Sorry. ␤at /tmp/DnS_cL6_TM:1␤------> my @a[10;10]⏏<EOL>␤»
someanon =(
look here
pastebin.com/ZdhqF1EZ
class declaration
timotimo jnthn: just to be clear, "Native Shaped Arrays" means both native arrays and shaped arrays and the combination of both?
someanon do you big constructor
can i make it less? 10:55
timotimo yes
someanon *do you see
timotimo you get a constructor for free when you build a class
you can get pretty error messages by setting a default value that'll throw when evaluated
like this:
m: class Something { has $.required = die "you have to supply the required parameter" }; Something.new 10:56
camelia rakudo-moar f8f6fe: OUTPUT«you have to supply the required parameter␤ in method at /tmp/XbBbrwslp5:1␤ in block at src/gen/m-CORE.setting:1000␤ in method BUILDALL at src/gen/m-CORE.setting:955␤ in method bless at /home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.…»
timotimo m: class Something { has $.required = die "you have to supply the required parameter" }; Something.new(required => "here you go").perl.say
camelia rakudo-moar f8f6fe: OUTPUT«Something.new(required => "here you go")␤»
timotimo you don't have to write "is readonly", because that's the default
if you write has &.activation-function instead of has $.activation-function, you get the proper type check for free
and you can use "where" clauses to do the range checking, too 10:57
let's see ..
someanon timotimo, i have one in declaration -> look at Code
timotimo someanon: well, i'm going to show you how to completely get rid of the 'new' method :) 10:58
someanon yes yes
that is what i want
timotimo m: class HasProbability { has Real $.prob where 0..1 = die "give me a probability please" }; HasProbability.new(prob => 0.5).perl.say
camelia rakudo-moar f8f6fe: OUTPUT«HasProbability.new(prob => 0.5)␤»
someanon i spend around 3 hours to make this constructor work
timotimo m: class HasProbability { has Real $.prob where 0..1 = die "give me a probability please" }; HasProbability.new(prob => 1.5).perl.say
camelia rakudo-moar f8f6fe: OUTPUT«HasProbability.new(prob => 1.5)␤»
timotimo oh, i seem to recall we don't use these where clauses yet >_< 10:59
but
someanon and i'm sure, that there is one more way to that
timotimo m: subset Probability of Real where 0..1; class HasProbability { has Probability $.prob = die "give me a probability please" }; HasProbability.new(prob => 1.5).perl.say
camelia rakudo-moar f8f6fe: OUTPUT«Type check failed in assignment to '$!prob'; expected 'Probability' but got 'Rat'␤ in block at src/gen/m-CORE.setting:972␤ in method BUILDALL at src/gen/m-CORE.setting:955␤ in method bless at /home/camelia/rakudo-inst-1/languages/perl6/runtime/CO…»
timotimo m: subset Probability of Real where 0..1; class HasProbability { has Probability $.prob = die "give me a probability please" }; HasProbability.new(prob => 0.5).perl.say
camelia rakudo-moar f8f6fe: OUTPUT«HasProbability.new(prob => 0.5)␤»
timotimo m: subset Probability of Real where 0..1; class HasProbability { has Probability $.prob = die "give me a probability please" }; HasProbability.new().perl.say
camelia rakudo-moar f8f6fe: OUTPUT«give me a probability please␤ in method at /tmp/ATATQPhKLU:1␤ in block at src/gen/m-CORE.setting:1000␤ in method BUILDALL at src/gen/m-CORE.setting:955␤ in method bless at /home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarv…»
timotimo there we go.
Ulti is there not a version of slurp that has no arguments like lines?
timotimo with a subset type you can do that properly
Ulti: like "slurp all argfiles"? 11:00
m: say slurp
camelia rakudo-moar f8f6fe: OUTPUT«set encoding requires an object with REPR MVMOSHandle␤ in method encoding at src/gen/m-CORE.setting:15837␤ in method slurp-rest at src/gen/m-CORE.setting:15792␤ in sub slurp at src/gen/m-CORE.setting:16540␤ in block <unit> at /tmp/gkbVnMN_RF:1…»
Ulti yeah
timotimo oh my
Ulti yeah thats what I get locally
timotimo this seems new
Ulti yeah
timotimo star: say slurp
camelia star-{m,p} 2014.09: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
Ulti :'[
guess going through helping to improve these perl6 one liners was worth it
timotimo yes! 11:01
why we don't have a test for that I do not know
we really ought to
Ulti actually I get a deprecation message posted on the end of that timotimo
someanon you guys are best 11:02
thanx
Ulti slurp($handle,...) now going to slurp($path,...)
so might be it's calling another form of slurp with a handle and that's been changed
11:04 ggoebel111111119 joined
timotimo ah 11:06
i remember about that
yeah, we were saying "slurp on an open file handle doesn't make sense"
but we didn't think of argfiles yet
(at that point)
Ulti why doesnt slurp on an open file handle make sense? you might want to move past a few bytes then slurp the rest 11:07
11:07 ggoebel111111118 left
timotimo because: does it close the file handle at the end? does it move the file pointer back to where it was if it does not close it? 11:08
Ulti I'd assume it would move the pointer and not close the file
timotimo well, slurp on a path opens, reads and closes
so is that inconsistent? :) 11:09
Ulti yeah because one of them I am handing it a path and expecting a lot more magic
dunno
also what does slurp do on a socket or a pipe anyway? 11:10
timotimo collapse your world view into a smolding heap of ash
Ulti :3 Perl6 does that a lot
"Failed to seek in filehandle: 29" is what happens when an argfile is a named pipe :S 11:15
11:15 telex left
timotimo yeah, you can't seek ... and we probably shouldn't rely on that 11:15
if we can't seek, that just means we have to re-allocate our buffer every now and then to make sure the new incoming data fits 11:16
Ulti yeah it explodes in a nasty way rather than saying something kind
perl6 -ne 'say "$_ is prime" if $_.Int.is-prime' <( echo 7)
11:16 telex joined
timotimo 7 is prime 11:17
oh, wait
that's not what my code does
11:20 Mouq joined 11:25 Mouq left 11:31 bbkr_ joined 11:55 leont joined 12:02 Ugator joined 12:03 beastd joined 12:04 Mso150 left
moritz Failed to stat in filehandle: no such file or directory 12:09
that's what I get 12:10
timotimo then your shell does something different :)
smls I get the same error as moritz - both with bash and zsh - using Rakudo+Moar 2014.09. 12:17
12:21 JimmyZ joined
timotimo oh 12:21
someanon what does perl6 have for testing purposes? Only Test module? 12:26
12:26 ghostlines left 12:27 ghostlines joined
timotimo there is Test::Utils or what's it called? 12:27
oh, that's only inside the spec test suite
there's a few modules for testing on modules.perl6.org
someanon thanx
m: use Test; ok 1 12:28
camelia rakudo-moar f8f6fe: OUTPUT«ok 1 - ␤»
12:28 raiph joined
timotimo don't forget plan and/or done 12:28
someanon does perl6 have something similar to perl-doc?
timotimo we do have p6doc, but it's not as grand as perl-doc yet
someanon would it have? 12:29
I saw throw function and Exception class 12:31
will the be implemented in Rakudo? 12:32
*they
jnthn Exception class is
throw is a method on exceptions
someanon and catch and similar things
timotimo that has been implemented for a very long time already
jnthn m: try { die 'OH NO I WAS STABBED'; CATCH { default { say 'phew!' } } }
camelia rakudo-moar f8f6fe: OUTPUT«phew!␤»
someanon so i should use CATCH to catch now? 12:33
jnthn That's untyped (ad-hoc) exception
Yes, and it goes inside the scope where you're catching.
Not outside of it
someanon but if i want outside?
jnthn and doesn't actually have to be paired with try
someanon it just shortcut to perl5 eval { .. }; if($@) { } yeah? 12:34
timotimo no
at least: i don't think so 12:35
someanon i tried to make custom Exception class
should i use Exception before?
m: use Exception;
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!===␤Could not find Exception in any of: /home/camelia/rakudo-inst-1/languages/perl6/lib, /home/camelia/rakudo-inst-1/languages/perl6␤»
timotimo custom exception classes are often favorable
12:36 tinyblak left
timotimo m: class MyExplosion is Exception { }; die MyExplosion.new; CATCH { say $_.perl } 12:36
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/9GvRhE9qlp:1␤␤»
someanon hm
timotimo or something
12:36 tinyblak joined
timotimo :P 12:36
someanon i tried yesterday
it dies
timotimo m: class MyExplosion is Exception { }; MyExplosion.new.throw; CATCH { say $_.perl }
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/sTOAVJxaM5:1␤␤»
someanon very strange
timotimo m: class MyExplosion is Exception { }; MyExplosion.new.throw; CATCH { default { say $_.perl } } 12:37
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/LECbzzpvAo:1␤␤»
timotimo oh
maybe exception handling is a bit weird in the REPL?
someanon m: class MyExplosion is Exception { }; MyExplosion.new.throw('babah'); CATCH { say $_ }
camelia rakudo-moar f8f6fe: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at /tmp/4wWgyAS72e:1␤␤»
12:37 kaleem left
jnthn m: class MyExplosion is Exception { }; MyExplosion.new.throw; CATCH { default { say "caught {$_.WHAT}" } } 12:38
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/ZSjXAwDwQj:1␤␤»
someanon m: class MyExplosion is Exception { }; MyExplosion.new.throw(message => 'babah'); CATCH { say $_ }
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/BsZtSjHxQe:1␤␤»
jnthn m: { class MyExplosion is Exception { }; MyExplosion.new.throw; CATCH { default { say "caught {$_.WHAT}" } } }
camelia rakudo-moar f8f6fe: OUTPUT«use of uninitialized value of type MyExplosion in string context in block at /tmp/cfptdkvQNG:1␤␤caught ␤»
jnthn m: { class MyExplosion is Exception { }; MyExplosion.new.throw; CATCH { default { say "caught {.^name}" } } }
camelia rakudo-moar f8f6fe: OUTPUT«caught MyExplosion␤»
someanon wow
this like interpolation works now
jnthn Note you can look for special-case exceptions too
someanon didn't know
jnthn m: { class MyExplosion is Exception { }; MyExplosion.new.throw; CATCH { when MyExplosion { say "caught" } } } 12:39
camelia rakudo-moar f8f6fe: OUTPUT«caught␤»
timotimo outermost scope is a bit weird, eh?
jnthn m: { class MyExplosion is Exception { }; die 'something else'; CATCH { when MyExplosion { say "caught" } } }
camelia rakudo-moar f8f6fe: OUTPUT«something else␤ in block <unit> at /tmp/xaY41i_FVo:1␤␤»
jnthn timotimo: Yeah, seems so...I know that was is ticketed too
someanon so not working outer CATCH - it is a bug? 12:40
jnthn Yes
someanon m: class MyExplosion is Exception { }; MyExplosion.new.throw(message => 'babah'); CATCH { say $_ } 12:41
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/3khEltLxTC:1␤␤»
someanon m: class MyExplosion is Exception { }; MyExplosion.new.throw(message => 'babah'); CATCH { default { say $_ } }
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/Nkyh6IRb0J:1␤␤»
timotimo i suppose we install CATCH handlers on blocks, and if there's no { } around your program there's no block to install the handler on?
(random idea) 12:42
someanon m: { class MyExplosion is Exception { }; MyExplosion.new.throw(message => 'babah'); CATCH { MyExplosion { say $_ } } }
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/KpiZPqulCQ␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?)␤at /tmp/KpiZPqulCQ:1␤------> essage => 'babah'); CATCH { MyExplosion ⏏…»
someanon m: { class MyExplosion is Exception { }; MyExplosion.new.throw(message => 'babah'); CATCH { when MyExplosion { say $_ } } }
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/t4Cyen83AU:1␤␤»
jnthn Think the message => needs to go to new 12:44
timotimo yes
someanon m: { class MyExplosion is Exception { }; MyExplosion.new(message => 'babah').throw(); CATCH { when MyExplosion { say $_ } } }
camelia rakudo-moar f8f6fe: OUTPUT«␤ in block <unit> at /tmp/XwH9KtDXzB:1␤␤»
someanon nothing
do you see www.perl8.org/ 12:45
now it starts to converge
timotimo m: class MyExplosion is Exception { }; say MyExplosion.^attributes 12:46
camelia rakudo-moar f8f6fe: OUTPUT«Mu $!ex␤»
moritz m: { class MyExplosion is Exception { method message() { 'Dead, Jim' } }; MyExplosion.new(message => 'babah').throw(); CATCH { when MyExplosion { say $_ } } }
camelia rakudo-moar f8f6fe: OUTPUT«Dead, Jim␤ in block <unit> at /tmp/9ataeGRANf:1␤␤»
moritz someanon: Exception doesn't have an attribute 'message'
timotimo message is not an attribute by default, you are expected to give your exception meaningful attributes and generate a message from them with a "message" method
someanon oh, i got 12:47
i saw that attribute in example that i found in google
moritz someanon: do you still have the link? 12:48
(maybe it's something we can update)
someanon www.perl6.org/archive/rfc/63.html 12:50
i think you can't
>This file is part of the Perl 6 Archive
12:50 kaleem joined
moritz I could, but I won't :-) 12:50
someanon haha 12:51
i tried like in example with MyDB
moritz github.com/perl6/perl6.org/blob/ma...fc/63.html # here are the sources 12:52
someanon so now it is not special syntax, just Classes on top of die
moritz yes 12:54
I wasn't creative enough for anything else :-)
12:56 anaeem1_ left
someanon so classes everywhere now 12:56
i'm not perl6 spec expert, is there something like rich type system like in haskell? 12:57
we have classes now like in java
so we need types like in haskell
and currying 12:58
implicit ones
timotimo we have parameterized roles
and type captures
someanon parameterize roles looks interesting 13:01
type captures means multi keyword?
*using multi subs
JimmyZ rfc 88 is so loooooooong 13:03
13:27 brrt joined 13:29 kaleem_ joined, guru joined
daxim arxiv.org/pdf/1302.2837v2.pdf # Benchmarking Usability and Performance of Multicore Languages (via hn) 13:29
13:29 guru is now known as Guest25891, Guest25891 is now known as ajr_
jnthn someanon: No, probably ::T syntax 13:30
m: sub foo(::T $x) { say "$x is a {T.^name}" }; foo(1); foo('lol')
camelia rakudo-moar f8f6fe: OUTPUT«1 is a Int␤lol is a Str␤»
someanon hm 13:31
later in perl5 there was ref
i can't see any think cool in this
jnthn, but i found solution for my first question 13:32
m: map -> $a, $b { say $a~$b }, (1..5 Z 'a'..'e')
camelia rakudo-moar f8f6fe: OUTPUT«1a␤2b␤3c␤4d␤5e␤»
jnthn m: say (1..5 Z~ 'a'..'e')
camelia rakudo-moar f8f6fe: OUTPUT«1a 2b 3c 4d 5e␤»
moritz you can have that even shorter: .say for 1..5 Z~ 'a'..'e'
moritz too slow
jnthn m: .say for 1..5 Z~ 'a'..'e'
camelia rakudo-moar f8f6fe: OUTPUT«1a␤2b␤3c␤4d␤5e␤»
someanon it is just example
concat
13:32 kaleem left
someanon i need to do more complex things 13:33
-> $a, $b - is it sugar for sub ($a, $b) ? 13:34
moritz nearly 13:36
smls m: say (-> $a, $b {...}).WHAT; say (sub ($a, $b) {...}).WHAT
camelia rakudo-moar f8f6fe: OUTPUT«(Block)␤(Sub)␤»
moritz the difference is that -> ... introduces a block, and sub a routine
and blocks are transparent to return()
m: sub f() { my $block = -> { return 42 }; $block(); return 23 }; say f
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
moritz notices that's an FAQ 13:37
smls m: say Sub.^mro
camelia rakudo-moar f8f6fe: OUTPUT«(Sub) (Routine) (Block) (Code) (Any) (Mu)␤»
someanon wow, cool
block more generic 13:39
it's logical
13:44 lucas__ joined
smls Another thing I'm finding more elegant in Perl 6 (compared to Perl 5): Inflecting words when printing output. 13:45
m: for 0..2 -> $n { say "Wrote $n line{"s" if $n != 1} so far." }
camelia rakudo-moar f8f6fe: OUTPUT«Wrote 0 lines so far.␤Wrote 1 line so far.␤Wrote 2 lines so far.␤»
lucas__ m: say yes => True
camelia rakudo-moar f8f6fe: OUTPUT«Unexpected named parameter 'yes' passed␤ in sub say at src/gen/m-CORE.setting:16447␤ in block <unit> at /tmp/vZ4_m_s3DY:1␤␤»
lucas__ m: my $x = yes => True; say $x 13:46
camelia rakudo-moar f8f6fe: OUTPUT«"yes" => Bool::True␤»
lucas__ m: say :yes;
camelia rakudo-moar f8f6fe: OUTPUT«Unexpected named parameter 'yes' passed␤ in sub say at src/gen/m-CORE.setting:16447␤ in block <unit> at /tmp/5aN4beHXTN:1␤␤»
someanon it's almost html templates like interpolation 13:47
smls,
smls, ione can just overload coma string constructor so, that it will work on top of Mojo::Template, i guess 13:49
13:50 zakharyas joined
smls It's made possible by the fact that in Perl 6, {...} provides pretty interpolation of expression inside strings (In Perl 5 one can use @{[...]} but that's ugly), and that «if» statements can be used as expressions (the result of which stringifies to ""). 13:50
You know what would be cool? If the Perl 6 port of Lingua::EN::Inflect would extend the quoting language to allow us to write it along the lines of: 13:51
use Lingua::EN::Inflect <:pl>; say qq:pl"Wrote $n line[s] so far."
and it would automatically inflect the marked word based on the preceding interpolated variable... 13:52
"$n cat[s] ha[s|ve] a total of {$n * 7} li[fe|ves]."
or maybe:
"$n cat@ has@ a total of {$n * 7} life@." 13:53
13:54 ptc_p6 left
lucas__ S32/IO says: sub say(*@text): Before printing, call the .gist method on any non-Str objects. But it doesn't looks to happen if you pass a pair literal. 13:56
someanon i think "cats status:\n\tcount: $n\n\ttotal lives: {$n * 7}\n" is simple and compromise solution 13:57
smls,
brrt but we should make perl6 cool, though
smls I don't like to make compromises when it comes to the user interface 13:58
I usually rather accept less elegant code
14:00 lucas__ left
someanon smls, your example reminds me php db::simple module 14:03
similar problem, similar solution 14:04
[Coke] stares into his coffee mug.
someanon github.com/DmitryKoterov/DbSimple 14:05
[Coke] (www.amazon.com/Creature-Cups-CRC-00...offee+mug)
(it's staring back)
someanon haha 14:06
smls lucas__: To pass a literal pair to a function, you have to quote the key. Otherwise it's interpreted as a named parameter. 14:10
14:10 zakharyas left
moritz ... or put parens around the pair 14:10
14:18 JimmyZ left
colomon new failures overnight: host08.perl6.com:8080/report 14:21
14:23 denis_boyun joined 14:24 kaare_ left 14:28 lizmat joined, cognominal joined 14:38 abraxxa left
cognominal S03:2458 reads "[...] (except that empty C<$()> means C<< $<?> // Str($/) >>, while empty C<item()> yields C<Failure>)." 14:41
14:41 woolfy joined
lizmat is seeing a dark Helsinki city center outside 14:41
cognominal That would mean that $<?> is a short for $/.made 14:42
but it is still different from S05-regex.pod:2963:C<$()> is a shorthand for C<$($/.made // ~$/)>. 14:43
jnthn lizmat: Glad you made it to the devil's titanic...
cognominal comments from enlighted minds? 14:44
lizmat well, we arrived at HEL just fine :-)
14:45 JimmyZ joined
someanon why can't i break feed chain by new line 14:49
?
Ulti am I right in thinking if you wanted a random order for a list this is an ok way to do it? .sort({rand > 0.5}) 14:50
PerlJam Ulti: uh ... .pick(*) is way better. 14:51
Ulti in the situation I dont have a variable name to use to get the elems at the same time as doing pick
ahh pick(*)
cool
14:52 xenoterracide_ joined
PerlJam someanon: Dunno. Seems like you should be able to. 14:52
moritz pick(*) will a fisher-yates shuffle, which is both efficient and fair 14:53
PerlJam someanon: can you show the code that breaks when you try it? 14:54
14:54 xenoterracide_ left, xenoterracide_ joined
someanon PerlJam, pastebin.com/PDCrbkYw 14:55
PerlJam, do you see two maps?
14:56 synopsebot joined
PerlJam aye 14:56
someanon this about i ask
error 14:57
Sorry, do not know how to handle this case of a feed operator yet.
PerlJam someanon: are you making an artificial neural net?
someanon yep
PerlJam cool
someanon perceptron
just copy of my another one on haskell 14:58
github.com/someanon/fluffy-perceptron
in perl oop way
*perl6 14:59
masak someanon: I know what you're problem is
someanon: you have a '}' at the end of a line
someanon i know it can't handle big data, it just learning for
lizmat moritz: I'm not sure a gather/take in pick(*) would really constitute a fisher/yates shuffle...
masak someanon: and that's messing up your statement
someanon aah 15:00
masak someanon: writing it as '}\' should fix it
someanon it replaced by ;
} -> };
masak yeah, "}\n" means "};\n", kinda
someanon i read it somethere
masak see S02 for details.
PerlJam masak++ 15:01
arnsholt Ooh, perceptrons!
masak having fallen down that hole myself a couple times with feed operators, I needed only glance at the code... :)
we should probably write that down as a FAQ somewhere. 15:02
someanon masak, can u make exception in } -> }; logic for feed operators?
it is the way expected behavior for feed operator i think 15:03
15:03 xenoterracide_ left
someanon PerlJam, in haskell, i wonder in how i had to construct infinite list of neural network weights that converge to optimal values 15:05
masak someanon: it's all fine if you put the '==>' on the same line as the '}', after it
someanon PerlJam, so train function is just take first element in this list that satisfy minimal error
15:06 [Sno] left
masak someanon: I think there should definitely be a good error message for catching such situations, yes. 15:06
lizmat wonders whether masak will rakudobug this
masak I'm busy at $work :/ 15:07
someanon masak, not error message but not to replace } to }; if there is feed operator after
*after whitespaces
masak someanon: that feels... inconsistent.
someanon but expected
masak someanon: and also relies on term lookahead.
token* 15:08
15:08 ennnio joined
someanon you think this can leads to bug in another situations? 15:09
lizmat waits for a bit before rakudobugging
masak someanon: no, in all other situations I like the braces-and-semicolons rule. 15:10
someanon >and also relies on term lookahead
this means bad?
masak yeah, we try to be one-pass and avoid lookahead.
doing lookahead for an error message is fine, though.
someanon i'm not expert in compilation theory so, you right i think 15:11
one of the solution use comma instead feed op 15:12
15:13 [Sno] joined
someanon looks cute, like lodash.js chains in js 15:13
masak :) 15:14
that kind of puts the finger on why it fails for '==>': because people like to put it on the next line.
with commas, they probably wouldn't. 15:15
we have different preconceptions about different infix operators.
especially the comma.
lizmat goes for some sightseeing& 15:23
someanon i wrote @.output <== map &.activation-function <== map { [+] @input >>*<< @$_ } <== @.weights;
got error 15:24
Sorry, do not know how to handle this case of a feed operator yet.
at lib/Perceptron/Layer.pm6:49
------> p { [+] @input >>*<< @$_ } <== @.weights⏏;
what is wrong?
masak, 15:25
15:27 kaleem_ left
moritz someanon: what you're trying to so seems to be not implemented yet 15:28
someanon: likely it can only handle lexical arrays as endpoints
someanon: not @.weights, which is really a method call
someanon lvalue
i got 15:29
15:29 tinyblak left, ajr_ left
someanon in that way works @.output = map &.activation-function, (map { [+] @input >>*<< @$_ }, @.weights); 15:30
15:30 guru joined, telex left, guru is now known as Guest35197
someanon i will left like this 15:31
49 @.output = map &.activation-function,
50 map { [+] @input >>*<< @$_ },
51 @.weights;
15:31 tinyblak joined
Ulti wow the DateTime::TimeZone install o___O 15:31
I had no idea there were so many locale
15:32 telex joined 15:33 Diederich-away is now known as Diederich, kjs_ joined 15:34 Guest35197 is now known as ajr_, kaare_ joined 15:35 Util joined 15:37 rurban1 left
masak someanon: looks good to me. 15:37
15:37 wtw left
masak someanon: very readable. 15:37
15:37 wtw joined
masak someanon: sorry about the parsing bumps still left on the road, resulting in a less-than-smooth driving experience. 15:37
[Coke] r: for 1900..2100 -> $year { say $year if Date.new($year, 2, 1).day-of-week %% 7; } # rectangular months. 15:38
camelia rakudo-{parrot,moar} f8f6fe: OUTPUT«1903␤1914␤1920␤1925␤1931␤1942␤1948␤1953␤1959␤1970␤1976␤1981␤1987␤1998␤2004␤2009␤2015␤2026␤2032␤2037␤2043␤2054␤2060␤2065␤2071␤2082␤2088␤2093␤2099␤»
someanon masak, thanks for sorry, thanks for work=)
[Coke] huh. what's with the ?? after 1998? 15:39
moritz [Coke]: I see no ?? after 1998
[Coke] doesn't show up in the clogs. must just be me.
moritz [Coke]: might be an artefact of your client 15:40
moritz too slow today
smls someanon: You don't like the method form of 'map'? 15:41
@.output = @.weights.map({ [+] @input >>*<< @$_ }).map(&.activation-function); 15:42
someanon hm, i used to perl5 maps
smls, maybe i should try 15:44
[Coke] so, anyway, rectangular february coming up. :) 15:45
someanon what is the best way to transpose two dimensional array? My solution is my @transposed-weigths = map { [ @.weights[0..$.output-size; $_] ] }, 0 .. $.input-size;
FROGGS Ulti: yeah, it takes ages >.< 15:46
moritz someanon: doesn't Z have the right structure for a transposition? 15:47
someanon moritz, don't know
moritz m: say (<a b c> Z <1 2 3>).tree.perl
camelia rakudo-moar f8f6fe: OUTPUT«("a", "1"; "b", "2"; "c", "3").item␤»
someanon i saw one example in the internets but they not worked
moritz m: say (<a b c> Z <1 2 3>).tree.map(*.item).perl 15:48
camelia rakudo-moar f8f6fe: OUTPUT«(("a"; "1").item, ("b"; "2").item, ("c"; "3").item).list␤»
moritz m: say (<a b c> Z <1 2 3>).tree.map([@$_]).perl
camelia rakudo-moar f8f6fe: OUTPUT«No such method 'count' for invocant of type 'Array'␤ in method reify at src/gen/m-CORE.setting:8253␤ in block at src/gen/m-CORE.setting:8161␤ in method reify at src/gen/m-CORE.setting:8137␤ in method gimme at src/gen/m-CORE.setting:8648␤ in…»
moritz m: say (<a b c> Z <1 2 3>).tree.map({[@$_]}).perl
camelia rakudo-moar f8f6fe: OUTPUT«(["a", "1"], ["b", "2"], ["c", "3"]).list␤»
Ulti FROGGS: the antarctica time zone file is very interesting reading whilst you wait though :D
someanon moritz, how it works? 15:49
moritz m: my @orig = [<a b c>], [<d e f>], [1, 2, 3]; say ([Z] @orig).perl
camelia rakudo-moar f8f6fe: OUTPUT«((["a", "b", "c"],), (["d", "e", "f"],), ([1, 2, 3],)).list␤»
moritz hm, no
m: my @orig := (<a b c>, <d e f>, (1, 2, 3)); say ([Z] @orig).perl
camelia rakudo-moar f8f6fe: OUTPUT«(("a",), ("b",), ("c",), ("d",), ("e",), ("f",), (1,), (2,), (3,)).list␤»
moritz nope :(
smls Will the .tree become unnecessary after the GLR? 15:50
FROGGS Ulti: indeed :o)
moritz smls: I have no idea
someanon =)
15:51 perltricks joined
JimmyZ Where is dalek :) 15:51
[Coke] It's a week to the release; good time to double check the changelog.
someanon moritz, will perl6 have usable typed arrays? 15:52
moritz someanon: I dearly hope so
perltricks hey are .subst() captures implemented? www.perlmonks.org/?node_id=855251
jnthn m: 'omg'.subst(/(\w)/, { $0.uc }, :g).say 15:53
camelia rakudo-moar f8f6fe: OUTPUT«OMG␤»
jnthn Sure looks like it...
moritz m: my $v = "test"; $v ~~ s/(\w)/X/; 15:54
camelia ( no output )
moritz m: my $v = "test"; $v ~~ s/(\w)/X/; say $0
camelia rakudo-moar f8f6fe: OUTPUT«「t」␤␤»
moritz perltricks: looks like that one is implemented too
masak we still want for a December release manager. 15:55
moritz I should update my answer
perltricks jnthn: thanks! 15:57
someanon in haskell where type declaration like [Double] or [[Double]] means list of doubles or list of list of doubles
[Coke] if we don't get a December manager before the November release, I'll take it. but then someone has to take another month in 2015! ;) 15:58
someanon so u can always know what is in input and output
16:01 brrt left
FROGGS [Coke]: :P 16:04
hoelzro ahoy #perl6
FROGGS hi
perltricks m: my %hex = ('%20' => ' '); 'a%20hard%20life'.subst(/\%<[0..9A..Fa..f]>** 2/, { %hex{$0} }, :g).say
camelia rakudo-moar f8f6fe: OUTPUT«use of uninitialized value of type Any in string context in block <unit> at /tmp/neCIdoDuL8:1␤␤use of uninitialized value %hex of type Any in string context in block <unit> at /tmp/neCIdoDuL8:1␤␤use of uninitialized value of type Any in string co…»
moritz perltricks: in the closure form, you still need to say -> $/ { ... } 16:05
perltricks think I was missing the capture too
moritz or
m: my %hex = ('%20' => ' '); $_ = 'a%20hard%20life'; s['%' (<[0..9A..Fa..f]>** 2)] = %hex{$0}; .say # curious if that works 16:06
camelia rakudo-moar f8f6fe: OUTPUT«use of uninitialized value %hex of type Any in string context in block <unit> at /tmp/KDTkQIrnbd:1␤␤ahard%20life␤»
timotimo m: say "foo bar baz. 0xabdf1532".comb(/ <xdigit>+ /).perl
camelia rakudo-moar f8f6fe: OUTPUT«("f", "ba", "ba", "0", "abdf1532").list␤»
perltricks m: my %hex = ('%20' => ' '); 'a%20hard%20life'.subst(/(\%<[0..9A..Fa..f]>** 2)/, { %hex{$0} }, :g).say
camelia rakudo-moar f8f6fe: OUTPUT«a hard life␤»
perltricks yay
and ... my uri decoder is ready for production ;)
timotimo m: say "f00".unbase(16)
camelia rakudo-moar f8f6fe: OUTPUT«No such method 'unbase' for invocant of type 'Str'␤ in block <unit> at /tmp/acEGhjzZck:1␤␤»
timotimo m: say "f00".base(16)
camelia rakudo-moar f8f6fe: OUTPUT«No such method 'base' for invocant of type 'Str'␤ in block <unit> at /tmp/Kn9bErw5Vr:1␤␤»
timotimo how do i do this again? 16:07
oh, right
moritz m: 'a%20hard%20life'.subst(/\%*<[0..9A..Fa..f]>** 2)/, { :16(~$0).chr }).say
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/FJEZPtDmpe␤Unable to parse regex; couldn't find final '/'␤at /tmp/FJEZPtDmpe:1␤------> d%20life'.subst(/\%*<[0..9A..Fa..f]>** 2⏏)/, { :16(~$0).chr }).say␤ expecting a…»
timotimo m: say :16("f00")
camelia rakudo-moar f8f6fe: OUTPUT«3840␤»
timotimo a ) too much, moritz
or rather, lacking a ( before the <[
moritz m: 'a%20hard%20life'.subst(/\%(<[0..9A..Fa..f]>** 2)/, { :16(~$0).chr }).say
camelia rakudo-moar f8f6fe: OUTPUT«a hard%20life␤»
timotimo and a :g?
moritz m: 'a%20hard%20life'.subst(:g, /\%(<[0..9A..Fa..f]>** 2)/, { :16(~$0).chr }).say
camelia rakudo-moar f8f6fe: OUTPUT«a hard life␤»
moritz timotimo: yes, thanks
timotimo :)
moritz this URI decoder brought to you by timoritz :-) 16:08
timotimo m: 'a%20hard%20life'.subst(:g, /'%' <( <xdigit>** 2/, { :16(~$/).chr }).say
camelia rakudo-moar f8f6fe: OUTPUT«a% hard% life␤»
16:08 anaeem1_ joined
timotimo ah, oops :) 16:08
hmm 16:09
we have chop to remove a char from the end
should we also have nibble tor emove a char from the front? :)
m: 'a%20hard%20life'.subst(:g, /\% <xdigit> ** 2/, { :16(~$<xdigit>).chr }).say
camelia rakudo-moar f8f6fe: OUTPUT«Cannot convert string to number: malformed ':16' style radix number, expecting '>' after the body in ':16<2⏏ 0>' (indicated by ⏏)␤ in method <anon> at src/gen/m-CORE.setting:13720␤ in any find_method_fallback at src/gen/m-Metamodel.nqp:2725␤ i…»
jnthn .substr(1) :P
timotimo m: 'a%20hard%20life'.subst(:g, /\% <xdigit> ** 2/, { :16($<xdigit>.join).chr }).say
camelia rakudo-moar f8f6fe: OUTPUT«a hard life␤»
timotimo not much prettier :(
16:10 treehug88 joined
hoelzro this is kind of interesting: github.com/github/linguist#overrides 16:11
timotimo oh, helpful!
16:11 denis_boyun left
hoelzro very! 16:13
I wish I had known that months ago =/
16:14 kjs_ left 16:16 treehug8_ joined 16:17 KCL_ joined
perltricks boom it's done github.com/sillymoose/URI-Encode 16:18
16:19 treehug88 left
perltricks how can I add this to the modules list? 16:19
Diederich hah
nice
16:21 JimmyZ left
hoelzro lizmat: I was digging into src/core/Grammar.pm a bit last night and found this awesome method wemusthavethishereotherwiserakudowontcompile 16:22
do you think that would be safe to get rid of now?
16:24 kurahaupo joined
someanon rosettacode.org/wiki/Matrix_transposition#Perl_6 16:25
Ulti perltricks I just sent you some extra one liners ;3 16:27
16:27 Mouq joined
perltricks Ulti: thanks! 16:28
Ulti perltricks you need to add your repo to heregithub.com/perl6/ecosystem/blob/ma.../META.list
afaik it is that simple
you need a META.info file in your repo though 16:29
perltricks Ulti: thanks very much for the PR, you nailed loads of them 16:30
16:32 Mouq left
Ulti is there a nicer way to do DateTime.now.earlier(:14months).earlier(:9days).earlier(:7seconds) ? like just give a list of :14months, :9days, 7seconds 16:32
perltricks only have 31 perl 5 one liners left to convert, hurry before they're gone! 16:35
arnsholt I seem to remember something similar being discussed, but not taken in since it would make ordering of the argument list very important
16:36 anaeem1_ left 16:37 anaeem1_ joined
timotimo m: say :16(2f).chr 16:37
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/NOOHvBbP7X␤Missing semicolon.␤at /tmp/NOOHvBbP7X:1␤------> say :16(2⏏f).chr␤ expecting any of:␤ whitespace␤»
timotimo m: say :16<2f>.chr
camelia rakudo-moar f8f6fe: OUTPUT«/␤»
16:38 lucas_ joined
timotimo perltricks: E.g. " " becomes % not % ← what? 16:38
Ulti arnsholt true 16:41
but that's still true for chaining the methods?
timotimo Ulti: yes, but when you have named arguments, you don't get a guarantee for the order 16:42
Ulti even in a list of pairs?
or is it magically a hash then
smls Why do we have all of «DateTime.now» [--> DateTime], «now» [--> instant], «time» [--> Int]? Seems excessive... 16:43
timotimo er, no
lists of pairs are lists of course
and thus ordered
Ulti smls I like those :P 16:44
lucas_ smls, moritz: Thanks for answering my question!
BTW, is this error necessary? The compiler already knows by say()'s signature that it won't be handling any named parameters, doesn't it? Could'nt it just treat it like a normal value and pass it along?
smls Couldn't «+now» replace «time»?
timotimo m: say now; say time; 16:45
camelia rakudo-moar f8f6fe: OUTPUT«Instant:1415983553.264402␤1415983518␤»
timotimo m: say now - time
camelia rakudo-moar f8f6fe: OUTPUT«Instant:35.114134␤»
16:45 sqirrel_ joined
timotimo now gives you a monotonic clock, time gives you leap-seconds and such 16:45
16:46 kaleem joined
lucas_ m: my $x = :foo; say $x 16:47
camelia rakudo-moar f8f6fe: OUTPUT«"foo" => Bool::True␤»
lucas_ m: say :foo
camelia rakudo-moar f8f6fe: OUTPUT«Unexpected named parameter 'foo' passed␤ in sub say at src/gen/m-CORE.setting:16447␤ in block <unit> at /tmp/DCX9xD2kVC:1␤␤»
lucas_ How do I unpack $x in "say $x" to make it give the same error as in "say :foo"?
jnthn m: my $x = :foo; say |%$x # mebbe 16:50
camelia rakudo-moar f8f6fe: OUTPUT«Unexpected named parameter 'foo' passed␤ in sub say at src/gen/m-CORE.setting:16447␤ in block <unit> at /tmp/n9eGuxZzDX:1␤␤»
lucas_ jnthn: thanks!!
now... is this necessary to happen?
jnthn What else would you want to have happen? 16:51
lucas_ m: say ~:foo
camelia rakudo-moar f8f6fe: OUTPUT«foo True␤»
16:52 zakharyas joined
lucas_ well, not an error. since say's signature already says that it doesn't handle named params. 16:52
jnthn The error is precisely because say's signature says it does'nt handle named parameters :)
[Coke] .seen pmichaud 16:53
yoleaux I saw pmichaud 10 Nov 2014 15:02Z in #perl6: <pmichaud> good morning, #perl6
16:53 kjs_ joined
smls m: say reduce { $^a.earlier(|$^b) }, (DateTime.now, :14months, :9days, :7seconds) 16:54
camelia rakudo-moar f8f6fe: OUTPUT«2013-09-05T17:54:20Z␤»
smls ^^ Ulti: Not necessarily nicer, but works... :)
16:55 bjz left
Ulti yeah that would very much fall into the too clever and less readable section of works :P cool though! 16:56
16:57 bjz joined
tony-o does QAST get executed at runtime? 17:02
17:02 ghostlines left
timotimo QAST gets compiled to the backend-specific bytecode before it is run 17:03
17:05 smls left 17:09 Mouq joined
moritz lucas_: downgrading a named param to a positional one seems to just ask for trouble 17:09
17:10 bbkr_ left
tony-o timotimo: if i'm writing a slang, is QAST the correct path to explore if i want to perform some action at runtime or am i going down the wrong path? 17:11
timotimo you'll have to do a fair bit of QAST, i believe
masak is currently throwing macro ideas around, one of the important ideas is that we want to have a more high-level, less backend-dependent AST for macros to use 17:12
that would probably also be what slangs are expected to use
AFK for a bit
lucas_ moritz: thanks. I understand it is safer, but maybe not so much DWIM. 17:18
With "sub f(:$foo)" or "sub f(*%h)", "f :foo" is ok. With "sub f($x)", "sub f(@a)" or "sub f(*@a)", "f :foo" dies instead of DWIM, which is to insert the pair in the variable. 17:19
moritz lucas_: the problem with "DWIM" is that it depends on the "I" 17:20
lucas_ moritz: You are very right :D 17:21
17:30 guru joined, ajr_ left 17:31 guru is now known as Guest29341 17:32 rurban joined 17:34 panchiniak joined, panchiniak left 17:35 FROGGS left 17:40 Guest29341 left 17:42 ghostlines joined, lucas_ left, perltricks left 17:44 fhelmberger left 17:45 fhelmberger joined
someanon how to write into stderr? 17:46
i googled
moritz m: $*ERR.say: 42
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
moritz m: note 42
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon only through the method?
m: say $*ERR: 42 17:47
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon m: say $*ERR, 42
camelia rakudo-moar f8f6fe: OUTPUT«IO::Handle<<STDERR>>(opened, at line 0 / octet 0)42␤»
tony-o any clue what 'Cannot find method 'package_at_key': no method cache and no .^find_method
someanon m: say $*ERR 42
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/Lu7bnq9brM␤Two terms in a row␤at /tmp/Lu7bnq9brM:1␤------> say $*ERR ⏏42␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤…»
17:47 KCL_ left
someanon say $*ERR: 42 -is this sugar for method call? 17:47
jnthn for convenience there's also note
tony-o any clue what 'Cannot find method 'package_at_key': no method cache and no .^find_method' means in regards to QAST? even going off of QAST 'say' examples i'm getting that error in the slang
someanon i mean can method $obj: 'arg-1'; 17:48
?
*can i
jnthn m: class A { method yes($x) { say $x } }; yes A: 42;
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon nice 17:49
17:49 fhelmberger left
someanon m: class A { method yes($x) { say $x } }; my $a = A.new(); yes $a: 42 17:49
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon m: class A { method yes($x) { say $x } }; my $a = new A
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/NTSv7h798n␤Undeclared routine:␤ new used at line 1 (in Perl 6 please use method call syntax instead)␤␤»
someanon aha
m: class A { method yes($x) { say $x } }; my $a = new A:
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/Uv32vd_mVu␤Two terms in a row␤at /tmp/Uv32vd_mVu:1␤------> thod yes($x) { say $x } }; my $a = new A⏏:␤ expecting any of:␤ postfix␤ infix stopper␤ …»
someanon new isn't method?
tony-o A.new 17:50
someanon m: class A { method yes($x) { say $x } }; my $a = new A: ()
camelia rakudo-moar f8f6fe: OUTPUT«Default constructor for 'A' only takes named arguments␤ in method new at src/gen/m-CORE.setting:931␤ in block <unit> at /tmp/8k8xumzzpd:1␤␤»
17:50 KCL_ joined
someanon why can i yes A: 42; but cant new A: 42; 17:50
tony-o m: class A { method yes($x) { say $x } }; my A $a = .new;
camelia ( no output )
tony-o m: class A { method yes($x) { say $x } }; my A $a = .new; yes $a: $a.yes;
camelia rakudo-moar f8f6fe: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in method yes at /tmp/4IAUAnWNSA:1␤ in block <unit> at /tmp/4IAUAnWNSA:1␤␤»
17:51 sqirrel__ joined
someanon m: class A { multi method new($arg) { say $arg; self.new() } method yes($x) { say $x } }; my $a = new A: 42 17:51
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/PUd1Zd8sPS␤Two terms in a row␤at /tmp/PUd1Zd8sPS:1␤------> thod new($arg) { say $arg; self.new() } ⏏method yes($x) { say $x } }; my $a = new␤ expecting any of:␤ …»
someanon m: class A { multi method new($arg) { say $arg; self.new() }; method yes($x) { say $x } }; my $a = new A: 42
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon wow
17:51 kurahaupo left
someanon so i can't call method with two dots if there is no arguments? 17:51
tony-o you don't need the colon if there are no arguments 17:52
someanon m: class A { method yes() { say 42 } }; my $a = A.new(); yes $a
17:52 kurahaupo joined
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/Elg0GszzDK␤Undeclared routine:␤ yes used at line 1␤␤» 17:52
someanon m: class A { method yes() { say 42 } }; my $a = A.new(); yes $a:
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/kAsoOzWix4␤Two terms in a row␤at /tmp/kAsoOzWix4:1␤------> () { say 42 } }; my $a = A.new(); yes $a⏏:␤ expecting any of:␤ postfix␤ infix stopper␤ …»
someanon m: class A { method yes() { say 42 } }; my $a = A.new(); yes $a: ;
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon ha
tony-o $a.yes ^^
someanon m: class A { method yes($x) { say $x } }; my $a = new A: ; yes A: 42
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
someanon m: class A { method yes($x) { say $x } }; my $a = new A: ; yes $a: 42
camelia rakudo-moar f8f6fe: OUTPUT«42␤» 17:53
someanon nice syntax perl6:3
17:53 kaleem left
someanon why do you do two dots method call style? 17:53
why do we need it? 17:54
when we need it?
17:54 kaleem joined, virtualsue left
[Coke] "two dots" is "colon" 17:54
17:54 sqirrel_ left
someanon ok colon 17:54
17:55 kaleem left
someanon when colon is good to use? 17:55
ugexe named arguments
jnthn someanon: I basically never use it :) 17:56
I sometimes use the $obj.meth: ... form.
hoelzro I find myself using that a lot
someanon m: class A { method yes(:$x) { say $x } }; my $a = new A: ; yes A :x(42)
camelia rakudo-moar f8f6fe: OUTPUT«===SORRY!=== Error while compiling /tmp/BEnthadPf9␤You can't adverb that␤at /tmp/BEnthadPf9:1␤------> ay $x } }; my $a = new A: ; yes A :x(42)⏏<EOL>␤»
someanon m: class A { method yes(:$x) { say $x } }; my $a = new A: ; yes A: :x(42)
camelia rakudo-moar f8f6fe: OUTPUT«42␤»
jnthn I dont really like the meth obj: args syntax, tbh. 17:57
hoelzro only the parentheses-less form for method calls; never the invocant specifier version
same here
17:57 zakharyas left
someanon moritz, whats the idea of colon method call style? When it good to use? 17:58
ugexe speaking of: multi method new (XML::Element $xml, *%opts) { self.new(:$xml, |%opts); } whats the point of the : before $xml?
hoelzro ugexe: it's shorthand for xml => $xml 17:59
someanon named arg
tony-o timotimo: is QAST being run at compile time? I'm getting the following error even with just trying to call 'say' with latest nqp/moar: 'Cannot find method 'package_at_key': no method cache and no .^find_method
someanon this code will not work i guess
hoelzro perlcabal.org/syn/S02.html#Adverbial_Pair_forms
ugexe: ^
someanon ah
m: my $x = 10; :$x 18:00
camelia ( no output )
ugexe im confused because the method signature doesn't explicitly take a named argument
someanon m: my $x = 10; { :$x }
camelia ( no output )
tony-o QAST: QAST.Op.new(:op('say'), QAST::SVal.new( :value('Hi') ))
someanon m: my $x = 10; say { :$x }.perl
camelia rakudo-moar f8f6fe: OUTPUT«{"x" => 10}␤»
someanon haha
leont ugexe: yeah, good point
timotimo tony-o: you need QAST::Op.new
ugexe someanon: @somearray.map: { code block }; 18:01
leont No wait, it does make sense
tony-o for the SVal?
18:01 pecastro left
tony-o timotimo: QAST.Op.new(:op('say'), QAST::SVal.new( :value('Hi') )) 18:01
jnthn QAST::Op, not QAST.Op
tony-o oops - i typed it wrong, i do actually have QAST::Op
someanon ugexe, just for map/grep/etc functional style methods?
ugexe someanon: not sure, im fairly new to this too :) Thats just where i've found myself using it 18:02
18:02 FROGGS joined
hoelzro someanon: I find myself using that form for things like @array.push: $element as well 18:03
someanon m: my @a = 1..3; say @a.map({ $_** 2 })
camelia rakudo-moar f8f6fe: OUTPUT«1 4 9␤»
someanon m: my @a = 1..3; say @a.map({ $_** 2 }).perl; say @a.map: { $_ ** 2 }; say map { $_ ** 2 }, @a;
camelia rakudo-moar f8f6fe: OUTPUT«(1, 4, 9).list␤1 4 9␤1 4 9␤»
someanon m: my @a = 1..3; say @a.map({ $_** 2 }); say @a.map: { $_ ** 2 }; say map { $_ ** 2 }, @a;
camelia rakudo-moar f8f6fe: OUTPUT«1 4 9␤1 4 9␤1 4 9␤»
ugexe dont forgoet ==> 18:04
someanon m: my @a = 1..3; say @a.map({ $_** 2 }) ~~ @a.map: { $_ ** 2 } ~~ map { $_ ** 2 }, @a;
camelia rakudo-moar f8f6fe: OUTPUT«No such method 'count' for invocant of type 'Bool'␤ in method reify at src/gen/m-CORE.setting:8253␤ in block at src/gen/m-CORE.setting:8161␤ in method reify at src/gen/m-CORE.setting:8137␤ in method gimme at src/gen/m-CORE.setting:8648␤ in …»
someanon m: my @a = 1..3; say (@a.map({ $_** 2 })) ~~ (@a.map: { $_ ** 2 }) ~~ (map { $_ ** 2 }, @a);
camelia rakudo-moar f8f6fe: OUTPUT«False␤»
someanon not same
tony-o timotimo: jnthn: github.com/tony-o/perl6-slang-sql/...QL.pm6#L22
18:05 rurban left
gtodd is .comb just slightly different version of .split ? 18:05
m: "my whole string".split("")[1,7,9] ; "my whole string".comb[13,5]
camelia ( no output )
jnthn tony-o: It'd need to be $/.make(QAST::Op.new(...)) I guess
tony-o: Or just "make ..." 18:06
gtodd m: say "my whole string".comb[13,5] ;
camelia rakudo-moar f8f6fe: OUTPUT«n o␤»
jnthn Otherwise it won't associated it with the match object.
gtodd: .comb with args is you telling it what things you want
s/args/arg/
.split with arg is you telling it what things you don't want
gtodd ahh ok
doh!
of course 18:07
tony-o jnthn: those both + the original result in the same error :/ gist.github.com/tony-o/aa3f33c5f3f709d32ec3
ugexe m: my @a = 1..3; say @a.map({ $_** 2 }).perl ~~ (@a.map: { $_ ** 2 }).perl ~~ (map { $_ ** 2 }, @a).perl; 18:08
camelia rakudo-moar f8f6fe: OUTPUT«False␤»
ugexe m: my @a = 1..3; say @a.map({ $_** 2 }).perl; say (@a.map: { $_ ** 2 }).perl; say (map { $_ ** 2 }, @a).perl;
camelia rakudo-moar f8f6fe: OUTPUT«(1, 4, 9).list␤(1, 4, 9).list␤(1, 4, 9).list␤»
ugexe ah 18:09
m: say [1,2,3] ~~ [1,2,3];
camelia rakudo-moar f8f6fe: OUTPUT«True␤»
ugexe m: say [1,2,3] ~~ [1,2,3] ~~ [1,2,3]; 18:10
camelia rakudo-moar f8f6fe: OUTPUT«False␤»
ugexe someanon: ^
timotimo m: my $foo; 100 R= $foo; say $foo
camelia rakudo-moar f8f6fe: OUTPUT«100␤»
timotimo this works <3
ugexe nice 18:11
jnthn tony-o: Odd. I'm not sure what's going on there... 18:12
tony-o jnthn: the other thing that has been confusing me is that $<sym> is not declared at that point either
i talked with mouq a little yesterday and he had me rebuild nqp from source (instead of gen from the rakudo source) and that fixed a few things so i'm on moar with nqp-m at the most recent origin/master version 18:14
18:15 guru joined, kjs_ left, guru is now known as ajr_ 18:16 sqirrel__ left
PerlJam tony-o: Is this something for Advent? (an SQL slang is exactly what I was hoping someone would do :) 18:17
18:17 PZt joined
tony-o PerlJam: it's something for the masses :-) yea i planned to write about it if i can get it to work 18:18
PerlJam tony-o++
18:19 ennnio left
tony-o i think it makes sql nicer to work with in the language 18:19
github.com/tony-o/perl6-slang-sql/...01_basic.t
that parses fine so far as long as i don't write any QAST 18:20
timotimo tony-o: why did you write my @a = 5? 18:23
tony-o i want to pass perl6 variables into the syntax 18:24
ugexe but you are storing the value of 5 into the array right? 18:25
tony-o in perl6, yes 18:26
timotimo well, how do you write your QAST?
do you set it on the $/ using "make"?
someanon ugexe, ok 18:27
tony-o i've tried it that way: $/.make(QAST::Op.new(:op('say'), QAST::SVal.new(:value('val'))));
timotimo make(QAST::Op.new( :op('say'), QAST::SVal.new( :value('Str') ) )); ← this should work like that
tony-o that produces the error in the gist i posted^^ 18:28
18:28 dwarring joined
timotimo hm, how does v5 do it? 18:30
may need some extra precautions to hllize stuff 18:31
tony-o make QAST::Op.new( :op('call'), :name('&die'), QAST::SVal.new( :value('Unimplemented'), :node($/) ) )
ah,, i'll try :node
meh, same error 18:32
timotimo :node is for giving errors from the generated low-level code line numbers and stuff
tony-o maybe a hint, not sure. if i change the signature to method statement_control:sym<with>($/) #instead of Mu $/ then i get a different error including when the method is empty, v5 has sigs without the Mu specification 18:35
18:35 KCL_ left
timotimo ah 18:36
sometimes you need to use Mu defined variables because nqp-space objects don't derive from Any 18:37
and Any is the default
tony-o Method 'item' not found for invocant of class 'NQPMatch'
but, still, I'm getting the QAST errors with Mu $/ 18:38
timotimo has 0 experience with slang writing ;( 18:39
tony-o i have 0.01 at this point haha
18:43 virtualsue joined
tony-o FROGGS: any eggs of knowledge to crack ? 18:44
18:48 kjs_ joined, virtualsue left, Mso150 joined 18:51 gfldex joined, Alula left, virtualsue joined 18:52 Alula joined, virtualsue left 18:56 telex left 18:58 telex joined, espadrine` left
arnsholt Such Python variable model, much annoy, such amaze. Wow! 19:02
timotimo %) 19:05
19:10 bartolin left, oetiker left 19:12 kurahaupo left, bartolin joined 19:16 kjs_ left
arnsholt I thought I had a solution to the "for over empty list" problem, but it doesn't generalise to if blocks that define variables >.< 19:19
19:20 kjs_ joined
timotimo god damn it ;( 19:20
arnsholt Yeah. Time to create a GitHub issue about the variable model in general, I think 19:22
19:26 ghostlines left, itz_ joined, Mouq left 19:28 itz left
FROGGS tony-o: since $/ is an NQPMatch, you cannot just postcircumfix:<{ }> it... 19:52
tony-o: look at atkeyish in Tuxic.pm 19:53
timotimo oh, is that the reason? 19:55
that's surprisingly simple >_<
FROGGS I'm not sure what the reason is... I don't know the code or error message yet 19:56
19:57 darutoko left 19:58 lucas_ joined
tony-o FROGGS: does that affect doing a .make from it? 19:58
from $/ 19:59
FROGGS tony-o: probably not
lucas_ m: class A{};class B{};class C{};multi f(A) {"a"};multi f(B) {"bad"};multi f(C) {"cat"}; say (A,B,C).map: {f $_}
camelia rakudo-moar f8f6fe: OUTPUT«a bad cat␤»
tony-o FROGGS: i copied your atkeyish and i was getting the variables and i'm parsing pretty well that way, I'm trying to implement the functionality now :-) 20:00
FROGGS tony-o: can you point me to your code?
tony-o QAST::Op.new (or really any QAST::*.new) is giving me problems
github.com/tony-o/perl6-slang-sql/...ng/SQL.pm6
20:00 Alina-malina left
tony-o uncomment line 22 and that's what my local repo looks like 20:00
20:01 Alina-malina joined
FROGGS ohh 20:01
m: use QAST:from<NQP>
camelia ( no output )
FROGGS tony-o: try that
tony-o 🍻🍻 20:02
how do i buy you beer
FROGGS :P
20:03 regreg left
tony-o now i need to figure out how to make that thing actually execute my QAST :-) 20:03
20:07 exixt_ is now known as exixt 20:08 BenGoldberg joined 20:17 colomon left
tony-o jnthn: lol'd at page 51 of your yapceu-jvm paper (ministry of silly walks) 20:18
20:18 colomon joined 20:25 lucas_ left 20:27 pecastro joined, pochi_ left 20:28 anaeem1_ left, anaeem1_ joined 20:29 raiph left 20:31 kaare_ left 20:33 anaeem1_ left 20:38 kjs_ left
tony-o FROGGS: jnthn: am i reading this right? do i need to compile QAST to something in order to run this? 20:42
FROGGS tony-o: no, you don't
tony-o how do i actually invoke the QAST that i wrote? 20:43
FROGGS you 'make' it, that's all
then it will be part of the AST that gets executed
copy&pasto: github.com/tony-o/perl6-slang-sql/...QL.pm6#L33 20:44
tony-o huh?
FROGGS it should read: %*LANG<MAIN-actions>.HOW.mixin...
tony-o good catch 20:45
FROGGS :o)
tony-o dos biers
FROGGS hehe
tony-o can i make the Op or do i need to make a CompUnit?
FROGGS the op should do 20:46
do not create a new CompUnit
tony-o i'm erroring with make Op - P6opaque: no such attribute $!made
FROGGS tony-o: would be nice if you pushed your changes
tony-o FROGGS: done 20:47
FROGGS I'd try: ...<with>(Mu $/ is rw)
and perhaps: my Mu $block :=... 20:48
tony-o both changes made, still the same error
FROGGS let me clone it...
tony-o it's pushed
20:52 KCL_ joined
FROGGS that works: $/.'!make'($block); 20:52
20:52 psch joined
FROGGS and the two changes I mentioned before are not needed 20:52
psch hey #perl6 \o 20:53
FROGGS hi psch
20:53 oetiker joined
tony-o FROGGS: wow, tyvm 20:53
FROGGS tony-o: it is a pleasure :o)
20:56 Ven joined 20:58 Krabbe_ joined
Krabbe_ where are the pps? 20:59
psch i think jvminterop used to work more than it does now
although maybe that's just something on my machine right now, for some reason
gist.github.com/peschwa/0158083bc4...ff12785eef this bit used to work but doesn't anymore
FROGGS o/
i am aware that it was still far from what it should be, when it worked 21:00
FROGGS Krabbe_: what is 'pps'? 21:01
Krabbe_ i’ve been thinking of changing to meteor.js, because Perl sucks. What are your thoughts?
21:01 anaeem1_ joined 21:02 anaeem1_ left
FROGGS Krabbe_: that you should perhaps join #meteor.js 21:02
21:03 perltricks joined 21:05 Mso150 left 21:06 kjs_ joined 21:07 Ven left
lizmat FROGGS: fwiw, a CompUnit object for a given path is a singleton 21:08
in other words, creating a new CompUnit object with the same path, will just give you the original object
Krabbe_ slaps FROGGS around a bit with a large trout 21:09
FROGGS lizmat: are you referring to what we said half an hour ago?
21:09 rindolf left
FROGGS Krabbe_: :P 21:09
lizmat eh, yes?
FROGGS lizmat: it was about QAST::CompUnit :o)
lizmat oops
lizmat shuts up
FROGGS *g*
lizmat still catching up on backlog of the past days 21:10
and keeping an eye on what's going on now
(well, half an eye, obviously)
Krabbe_ I had been hoping for more advice… Please note I know the beast (not sure what his nick is) 21:12
psch Krabbe_: fwiw, 'perl sucks' is kinda of a shitty way to ask for advice
FROGGS Krabbe_: I have no advice... thing is, you usually use javascript and Perl for quite different things 21:13
and since I don't know meteor.js well I can't compare in the areas where intersections actually exist
i.e., their templates look pretty much like ours, but that does not mean much 21:14
Krabbe_ you guys are the cutest
FROGGS (I don't know any beast here)
totally, not to mention smartest
lizmat
.oO( woolfy ? )
tony-o Krabbe_: switching for what reason, what are you doing with meteor|perl?
21:16 anaeem1 joined
PerlJam
.oO( please don't feed the trolls )
21:17
tony-o haha
FROGGS
.oO( please don't <=== the trolls )
ohh, does meteor.js actually have feeds?
BenGoldberg Is there a troll rss? 21:18
Krabbe_ so while we’re making serious cash, you’re going to save a lot of money on condems 21:19
21:20 anaeem1 left 21:21 kjs_ left
FROGGS hehe 21:21
Krabbe_ I didn’t mean that. I’m very aware of that people that are coding perl doesn’t know the noun condoms
FROGGS Krabbe_++
Krabbe_ let me explain what they are
FROGGS you are funny :o)
BenGoldberg We use the word prophylactics.
Krabbe_ it’s like
a sort of birth control
PerlJam Krabbe_: I think you really wanted something other than #perl6
woolfy Somebody mentioned beast? Awooooooo!!!! 21:22
FROGGS ohh noes /o\
Krabbe_ so if you can accept the concept of sexual intercourse between two human people of different sex
FROGGS somebody left her door open
tony-o krabbs 21:23
Krabbe_ the condoms would be a barrier of pleasure and bringing a child into a world where you would have to explain a perl syntax 21:24
colomon wonders if the alleged lack of knowledge of condoms is why so many #perl6ers have children…
Krabbe_ du you guys know the BEAST
hes very good at tha PERL game 21:25
PerlJam Krabbe_: woolfy? Yeah, we know her.
FROGGS Krabbe_: did you just read that in your comic book?
BenGoldberg Krabbe_, This is the size of condom you wear: cds.a9t2h4q7.hwcdn.net/main/store/2...ge/CAP.jpg
Krabbe_ im seeing BEAST on the side, hes quite a man
large and a little to the left 21:26
FROGGS Krabbe_: but he has condoms, right?
Krabbe_ and in charge
well he’s using food film. He’s qiuite the man
woolfy feels a bit silly watching this confusing "discussion" 21:27
Krabbe_ do you like onions
BenGoldberg Oops, my mistake, Krabbe_, that link is the size of condom this "beast" you speak of wears.
Krabbe_ i like onions
and crap cakes
PerlJam woolfy: it's the first time I can recall wanting op on #perl6.
Krabbe_ i like the christmas time, its classy 21:28
woolfy PerlJam: ack
tony-o clAssy 21:29
Krabbe_ you guys are redicu******************* 21:32
scuuute
moritz hugs Krabbe_ 21:33
labster hugs moritz
PerlJam hugme: hug Krabbe_
hugme hugs Krabbe_
PerlJam hugs by proxy
labster Hey, are we still collecting for a new Perl 6 community server? I can make a donation. 21:34
hoelzro I am also happy to donate 21:35
Krabbe_ I love this community. This is my besT way to express it: www.youtube.com/watch?v=_xAjt64AoD0 song says it all 21:36
ugexe lol if you wear condoms 21:37
PerlJam Krabbe_: do you have one that features butterflies instead? 21:39
21:42 KCL_ left
Krabbe_ Sorry PerJam. In Denmark we mostly do crawl, so this is the best I can do: www.youtube.com/watch?v=xwyj5cKMGWk 21:43
lizmat m: my $a = Inf; say $a ~~ Inf; say $a == Inf; say $a === Inf # jnthn, what would be the best from a performance point of view?
camelia rakudo-moar 9f76c2: OUTPUT«True␤True␤True␤» 21:44
tony-o FROGGS: what should i be looking at if i want to be able to handle anonmyous variable/values? IE how do i handle a value of '[1,2,3]' in my match if i want to pass it to a sub? 21:46
moritz perltricks: factorial: perl6 -e 'say [*] 1..5'
perltricks mortiz: nice, thanks will add it 21:47
moritz: *I mean moritz
moritz perltricks: most IRC clients allow you tab-complete nick names 21:48
tony-o should i bind to QAST::Var and then pass that to my sub?
FROGGS tony-o: I'd guess you just want to pass the .made of that as a positional... but I am not sure I understand the question correctly
tony-o: no, a QAST::Var is for a lexical variable
tony-o in my syntax i want to say with (1,2,3) do ... but i want to pass '1,2,3' as an array to my sub to actually perform the action 21:49
FROGGS tony-o: what exactly parses the '[1,2,3]' ?
tony-o FROGGS: i'm wondering how to handle github.com/tony-o/perl6-slang-sql/...asic.t#L11 that in my QAST 21:50
github.com/tony-o/perl6-slang-sql/...QL.pm6#L32
trying to handle it there and pass it to #3 as $args
FROGGS tony-o: do $args.made instead of line 32 21:51
ugexe $args.Str stringifies the list you expect no? 21:54
psch it stringifies the capture 21:56
which i think would be '[1,2,3]'
FROGGS ugexe: $args is a Match object (NQPMatch in this case), that has an AST attached to its 'made' attribute 22:03
and the AST contains usually a list (QAST::Op.new( :op<call>, :name('&infix:<,>') ), with variables (QAST::Vars) or values (QAST::IVal, QAST::SVal, ...) 22:05
psch or more Ops! 22:07
vendethiel o/, #perl6! 22:08
psch vendethiel \o
FROGGS psch: yes, of course :o) 22:09
hi ven
22:13 perltricks left
lizmat just pushed github.com/rakudo/rakudo/commit/e2...6af38226c2 22:35
22:37 raiph joined, esaym153 joined 22:38 raiph left
vendethiel lizmat++ 22:40
At some point, at APW, we talked about how "lately", the core/settings were started to get "unidiomatic" to actually be... fast and usable. 22:41
People mentioned the idea of having an "idiomatic prelude", that'd be slow, but very interesting for people to read and understand p6's power.
Kind of like what rosettacode is
22:43 espadrine` joined
vendethiel 's up for it, because he loves having perl6 core being perl6, eh 22:43
lizmat: what's that startup loss from, btw? 22:44
lizmat from changes in moarvm
if I recall correctly: some optimization that sometimes failed, has been reverted by timotimo and/or hoelzro 22:45
timotimo hoelzro did, yes
vendethiel oh
lizmat bringing rakudo on moar startup time from .21 to .37
timotimo it's about lazily deserializing something
lizmat (at least on my machine)
vendethiel timotimo: github.com/MoarVM/MoarVM/commit/c8...0ec10e2acd that might deserve a comment? :)
timotimo hm? 22:46
a comment in the source code?
vendethiel yes
22:46 rurban joined, rurban left
timotimo i can do that 22:46
i just added another little piece of code there anyway
i'll put a comment in as well 22:47
lizmat vendethiel: wrt to settings being idiomatic p6 code: that would be nice in an ideal world
vendethiel lizmat: no no no
lizmat: I mean, have two versions. One we're *shipping*; one we're *showing off*.
lizmat and *who* would keep those in sync ???
vendethiel they don't *really* need to be.
Nobody's going to "use" the show-off version, like for the RC tasks
lizmat also: some places in the settings are real old in P6 time 22:48
tony-o FROGGS: can i pm
FROGGS tony-o: you can
lizmat they were from a time when a lot of things weren't as possible or as clear as they are now
psch jakudo builds too slowly for my fiddle-compile-test cycle :/ 22:53
22:53 exixt is now known as exixt_
psch as for a show-off setting, i think rosettacode does that pretty well already, as does the learnxinyminutes 22:54
BenGoldberg Is there any easy (automatic) way of finding how old code is, so it can be reviewed from oldest to newest? 22:55
timotimo well, git blame will give you a date for each line 22:58
BenGoldberg Of course, I realize that "old" doesn't automatically mean "slow" or "bad" ... just that it might be. 22:59
timotimo of course 23:00
psch is off to sleep o 23:01
timotimo gnite psch
23:02 raiph joined 23:06 psch left 23:08 j4janicej is now known as j4jackj 23:09 j4jackj is now known as j4janicej
FROGGS gnight #perl6 23:10
23:10 treehug8_ left
lizmat gnight FROGGS 23:11
lizmat just committed github.com/rakudo/rakudo/commit/f5...c2fab25999 23:12
lizmat also misses Dalek
vendethiel
.oO( but he's a daaaaalek )
23:14
FROGGS lizmat: I'm not sure that patch is a good idea... if someone implements ACCEPTS for his/her type, it won't get called for the :U case
lizmat FROGGS:?? how would grep and friends influence ACCEPTS ? 23:15
FROGGS lizmat: foo ~~ Bar will results in Bar.ACCEPTS(foo) 23:16
vendethiel lizmat: class A { method ACCEPTS{} }; [].grep(A)
FROGGS m: class A { method ACCEPTS(\a) { a == 42 } }; say 42 ~~ A; 21 ~~ A 23:17
camelia rakudo-moar 9f76c2: OUTPUT«True␤»
23:17 j4janicej is now known as JaniceTheGreat
FROGGS m: class A { method ACCEPTS(\a) { a == 42 } }; say 42 ~~ A; say 21 ~~ A 23:17
camelia rakudo-moar 9f76c2: OUTPUT«True␤False␤»
lizmat ah, I see what you mean...
23:17 JaniceTheGreat is now known as j4janicej
FROGGS ~~ it does not just compile to an istype check 23:17
lizmat well, if it is a literal type, it can 23:18
23:18 travis-ci joined
travis-ci Rakudo build errored. Elizabeth Mattijsen 'Make grep/-index/first/-index/last-index(:T) fastr 23:18
travis-ci.org/rakudo/rakudo/builds/41053151 github.com/rakudo/rakudo/compare/e...b0bd903dcd
23:18 travis-ci left
lizmat que? 23:18
lizmat looks
FROGGS like truthness is also a hot thing, which can result in a call to .Bool, which makes it hard to spesh
lizmat so you're saying my other nqp::istype changes are suspect as well ? 23:19
23:19 anaeem1 joined
FROGGS and you can also implement a 'defined' method for your type, which should (but NYI) influence :D and :U 23:19
lizmat travis problem seems unrelated to my commit 23:20
FROGGS lizmat: travis has just noticed that github is downish
ohh, I was meant to be in bed...
lizmat good night again, :-) 23:21
colomon o/
23:24 anaeem1 left
tony-o PerlJam: check out what FROGGS mouq and ugexe helped me get working: github.com/tony-o/perl6-slang-sql/...01_basic.t 23:25
timotimo helped me out too ^
timotimo nice :) 23:28
23:29 araujo left, araujo joined 23:30 travis-ci joined
travis-ci Rakudo build passed. Elizabeth Mattijsen 'FROGGS++ pointed out this may be a bad idea 23:30
travis-ci.org/rakudo/rakudo/builds/41054166 github.com/rakudo/rakudo/compare/f...37564f2c48
23:30 travis-ci left
lizmat just committed github.com/rakudo/rakudo/commit/2e...b26b339f06 23:33
23:43 telex left 23:44 telex joined
timotimo facepalm facepalm facepalm 23:47
gist.github.com/timo/de0ef5d3f5e159117d2b
23:50 JimmyZ joined
lizmat timotimo: sorry, don't see the facepalm :-( 23:52
timotimo well
the specialized code looks like this: 23:53
get the argument, get the dispatcher for good measure, unpack the boxed Int from the Bool object
then check if it's true or false
if it's true, grab a value (i suspect True) from the World
23:53 anaeem1 joined
timotimo if it's false, grab a different value from the World 23:53
then the code reconvenes in the last BB
where we decontainerize the thing we just got out of the World 23:54
check if it's true or false
make a p6bool from that and return that
lizmat ah, yes, that seems a bit roundabout :-) 23:55
timotimo well, yeah
23:55 virtualsue joined
timotimo the fact that we definitely get a Bool in makes it all that much more ridiculous 23:55
oh 23:56
in fact, the objects we get from World are pre-built Int instances
multi prefix:<!>(Bool \a) { nqp::p6bool(a ?? 0 !! 1) }
JimmyZ github.com/tony-o/perl6-slang-sql/...QL.pm6#L43 # We don't have a Perl6 yet to do bindkey? 23:57
Perl 6 way..
timotimo these objects are not perl6 objects
23:58 anaeem1 left