»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by moritz on 25 December 2014.
masak what a nice person. 00:07
00:13 robinsmidsrod left 00:15 robinsmidsrod joined
vendethiel masak: wow, that was a length discussion :P 00:19
00:24 Peter_R joined
vendethiel oh, he's the guy that issue'd on the learnx 00:26
dalek c: f75b7a3 | skids++ | lib/Type/Capture.pod:
Expand on Capture documentation
00:29
vendethiel masak: realized your blog post can now get rid of the "our $sum" :P 00:41
(I mean -- it can be lax) 00:42
00:49 agentzh joined 00:52 risou_ left 00:53 risou joined
japhb I forget -- what's the idiom for re-exporting in imported thing? (In this case, an imported sub, but I'm also thinking of Enums and constants and such.) 00:53
00:54 araujo joined, araujo left, araujo joined 00:58 gfldex left 01:03 fwilson left, fwilson joined 01:08 agentzh left
masak vendethiel: $ perl6 -ne '/^\d+/ or die; $sum += $/; END say $sum' input 01:17
vendethiel: I got this working.
vendethiel if you don't need it to die, /^\d+/ && $sum += $/ is good as well
masak (a) END doesn't need the block, (b) like you said, can skip the `our`, (c) need to explicitly separate out the number in the beginning
vendethiel ignores empty lines 01:18
masak troo
vendethiel however, lines.grep(^(\d+)/) might be faster
masak that doesn't use -n at all, though 01:19
which was the point of the post :)
'night, #perl6
vendethiel right :P 01:20
01:31 Ben_Goldberg left 01:50 vendethiel left 01:51 KCL joined 01:53 KCL_ left 01:55 adu joined 01:58 telex left 02:00 telex joined 02:07 adu left, adu joined, adu left 02:09 panchiniak joined, panchiniak left, adu joined 02:19 virtualsue_ joined 02:20 virtualsue left, virtualsue_ is now known as virtualsue 02:24 atta left, atta joined 02:27 chenryn joined 02:42 petercom1and left, petercom1and joined, petercom1and is now known as petercommand 02:45 ilbot3 left 02:46 chenryn left, ilbot3 joined 02:47 gr33n7007h joined 02:48 chenryn joined 03:12 virtualsue left
dalek ecs: e315952 | util++ | S (10 files):
Fix typos.
03:20
03:22 chenryn left 03:26 chenryn joined 03:34 renormalist left, renormalist joined 03:45 zhanggong joined 03:46 zhanggong left, yeahnoob joined 03:47 dj_goku_ joined 03:48 dj_goku left 03:49 noganex_ joined 03:52 noganex left 03:53 chenryn left 03:59 chenryn joined
flussence m: say q:to{EOT}.perl;␤ foo␤EOT␤ 04:05
camelia rakudo-moar 243c16: OUTPUT«" foo\n"␤»
flussence didn't that have an implied .indent(*) at some point?
skids Maybe with an adverb? 04:06
04:06 Peter_R left
flussence oh! never mind, I'm wrong. 04:08
m: say q:to{EOT}.perl;␤ foo␤ EOT␤
camelia rakudo-moar 243c16: OUTPUT«"foo\n"␤»
flussence that makes sense :)
04:17 Mouq left
dalek kudo/nom: 2def0ea | moritz++ | src/core/Proc/Async.pm:
Revert "One more use of CLONE-LIST-DECONTAINERIZED"

This reverts commit 371434faeb22ec668d3d0e7744b1cb52158a2b91.
  $args-without is initialized with $!path.Str, which this patch dropped,
rending Proc::Async unusable.
04:29
04:30 chenryn left 04:36 agentzh joined
dalek c: 3d7e48a | skids++ | lib/Language/functions.pod:
Fill in "arguments" section, and link to Capture
04:54
05:01 chenryn joined 06:11 [Sno] left
dalek ast: 0821592 | moritz++ | S17-supply/categorize.t:
RT #123674: Test that sub-supplies from categorize get .done
06:21
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123674
TimToady "rending X unusable" :) 06:33
moritz argl 06:36
TimToady it seemed apt
moritz "ranting X unusable" was what I meant, obviously :-)
TimToady it's the accidental puns that are the best ones
06:42 zby_home joined 06:43 zby_home left 06:48 rindolf joined 06:58 FROGGS__ left 07:10 araujo left 07:16 [Sno] joined 07:31 Rounin joined 07:36 chenryn left 07:38 xfix joined 07:39 adu left 07:52 agentzh left 07:55 regreg joined 07:58 zakharyas joined 08:04 darutoko joined, prime left 08:05 blackbolt joined
blackbolt msg NickServ identify blackbolt opl321 08:07
lol
moritz hopes blackbolt has changed his password by now :-) 08:11
blackbolt you can try ;-) 08:12
08:14 Sqirrel left 08:16 prime joined, pecastro left 08:25 FROGGS joined 08:26 chenryn joined 08:27 Maddingu1 is now known as Maddingue 08:28 dj_goku_ left 08:31 dj_goku joined 08:35 Kristien joined
Kristien hola 08:35
moritz good morning Kristien 08:39
08:49 yeahnoob left 08:50 xfix left 08:51 xfix joined 09:07 virtualsue joined 09:12 blackbolt left
lizmat good *, perl6! 09:17
FROGGS hi lizmat 09:18
lizmat moritz: good catch
I guess I missed the failure because the procasync/basic test is a flapper (for me, at least) 09:19
test 28 always fails for me 09:22
dalek kudo/nom: 88b2d14 | lizmat++ | src/core/ (2 files):
Attempt #2 at using CLONE-LIST-DECONTAINERIZED
lizmat it gets Nil instead Proc::Status 09:23
moritz lizmat: then please fudge the test
09:25 dakkar joined, petercommand is now known as petercommand_, petercommand_ is now known as petercommand
ab5tract anyone have a thought on way we have invisible characters, and what to do about it? 09:26
FROGGS ab5tract: you mean control characters?
ab5tract FROGGS: i found them while mucking with control characters 09:27
dalek ast: 1064f23 | lizmat++ | S17-procasync/basic.t:
Fudge failing test
FROGGS ab5tract: what do you wanna do with them?
ab5tract m: my @a = ('55x55' ~~ /(\d\d)(x)(\d\d)/).values>>.Str; @a.join.say; @a.join.comb.elems.say 09:28
camelia rakudo-moar 243c16: OUTPUT«55x55␤5␤»
09:28 tgt joined
ab5tract hmm, that's not incorrect 09:28
FROGGS: if you have a chance to run the code in this gist, it will show you what i am confused about: gist.github.com/ab5tract/4961802803d3e5fb489d 09:29
09:31 molaf_ joined
ab5tract basically the escape sequence that i get from tput and process will output the correct sequence, but it does nothing. if i manually print that sequence, it moves the cursor 09:31
if you ask for elems on the processed sequence, it is greater than the number of characters
FROGGS ahh 09:33
09:34 rindolf left, molaf__ left
dalek ast: beea0a8 | lizmat++ | S32-str/sprintf.t:
Fix/Unfudge tests
09:35
FROGGS ab5tract: the problem is that the escape sequences that you get back (that are in @parts), are not interpolated 09:36
ab5tract: so, that prints 'True': say @parts.join('') eq '\x[1b][24;36H'; 09:37
ab5tract: note the single quotes
ab5tract: and it does that because you call .perl on $raw... but you should only call .perl in case you want to EVAL it (or you just want readable debugging output) 09:38
ab5tract: so, this would work: say qq:x{ tput cup $y $x } 09:40
and btw, this: [~] @parts.map(*) is the same as @parts.join('')
moritz didn't know about map(*) 09:41
m: say <a b c>.map(*)
camelia rakudo-moar 243c16: OUTPUT«a b c␤»
ab5tract FROGGS: i note that similarity in that paste 09:44
and there is absolutely no way to regex over an escape sequence without calling .perl 09:45
FROGGS then either EVAL the resulting string, or don't use a regex
ab5tract FROGGS: the idea is not to have to call tput for every cursor movement 09:46
09:46 virtualsue left
ab5tract but to grab the correct escape sequence, grok it, and use it later 09:47
moritz ab5tract: .perl uses regexes internally 09:49
so it's possible
ab5tract: I haven't followed your quest very closely, but it seems to me that regexes work, but the output from "say $/" and the likes confuses use, because it doesn't escape the control sequences 09:50
FROGGS ab5tract: I commented on your gist: gist.github.com/ab5tract/496180280...nt-1380204 09:52
ab5tract thanks! 09:54
gist.github.com/ab5tract/4961802803d3e5fb489d
FROGGS you're welcome :o)
ab5tract this shows more clearly what i meant about "invisible" characters. the joined version, which has no visible difference from the manual version, has 13 elems when combed. the manual has 8. but again, no visual differences, nor (it seems) any escape codes 09:55
m: my @a = ('55x55' ~~ /(\d\d)(x)(\d\d)/).values>>.Str; @a.perl.say 09:56
camelia rakudo-moar 243c16: OUTPUT«Array.new("55", "x", "55", "")␤»
FROGGS so, the .perl'd string has of course more chars, since it converts a single byte/char (like "\1b") to '\x[1b]'
ab5tract (and here was my example of extra characters from last night)
ah, you mean because it is escaped in order to avoid interpolation?
09:56 Tux__ left
FROGGS hmmm no 09:57
moritz m: say "foo\x[1b]bar"
camelia rakudo-moar 243c16: OUTPUT«foobar␤»
moritz m: say "foo\x[1b]bar".perl
camelia rakudo-moar 243c16: OUTPUT«"foo\x[1b]bar"␤»
FROGGS .perl escapes strings, so they only contain printable characters that round-trip properly
Kristien hmm I just realised
moritz ... and don't confuse the poor user
ab5tract gotcha, that's a bit what i meant but i like your way of saying it better :)
Kristien you can use subsets for D-like contract programming in Perl 6 :D
FROGGS *g* 09:58
09:58 tgt left
ab5tract Kristien: looking forward to seeing an example ;) 09:58
10:00 TuxCM joined
FROGGS m: say ('55x55' ~~ /(\d\d)(x)(\d\d)/).values.elems # ooc, why does that tell 4 instead of 3? 10:00
camelia rakudo-moar 243c16: OUTPUT«4␤»
ab5tract FROGGS: i thought it had to do with my issue, but that seems like an actual bug (rather than me just not grokking properly) 10:02
m: my @a = ('55x55' ~~ /(\d\d)(x)(\d\d)/).values>>.Str; @a.perl.say; @a[*-1].ord.say
camelia rakudo-moar 243c16: OUTPUT«Array.new("55", "x", "55", "")␤(Int)␤»
Kristien ab5tract: gist.github.com/rightfold/1767997aea04c38385dc 10:03
Class invariants are more interesting, though, as they require post-method-call hooks.
but since it's Perl that can probably be achieved as well :P
ab5tract hehe. yeah, that's really nice! 10:05
sergot hi o/ 10:07
Kristien is there already a weak map functionality in the perl 6 library? 10:09
they're needed for implementing class invariants
10:09 espadrine_ joined
psch hi #perl6 \o 10:10
m: ([1,2,3], :{}).values.say 10:11
camelia rakudo-moar 243c16: OUTPUT«1 2 3 ␤»
psch m: ([1,2,3], :{}).values.elems.say
camelia rakudo-moar 243c16: OUTPUT«2␤»
psch m: ([1,2,3].values, :{}.values).values.elems.say 10:12
camelia rakudo-moar 243c16: OUTPUT«3␤»
psch ^^^ that was my theory for the 4 instead of 3 elems in Match.values
m: ([1,2,3].values, :{}.values).flat.values.elems.say
camelia rakudo-moar 243c16: OUTPUT«3␤»
10:15 regreg left
psch m: my EnumMap $hashpart .= new; my $arraypart = 1,2,3; say ($arraypart.values, $hashpart.values).flat.elems 10:15
camelia rakudo-moar 243c16: OUTPUT«WARNINGS:␤Useless use of "," in expression "my $arraypart = 1,2,3" in sink context (line 1)␤1␤»
psch m: my EnumMap $hashpart .= new; my $arraypart = [1,2,3]; say ($arraypart.values, $hashpart.values).flat.elems
camelia rakudo-moar 243c16: OUTPUT«3␤»
psch m: my EnumMap $hashpart .= new("" => []); my $arraypart = [1,2,3]; say ($arraypart.values, $hashpart.values).flat.elems 10:16
camelia rakudo-moar 243c16: OUTPUT«4␤»
psch there it is
10:16 regreg joined
psch Match.list has 3 elems, Match.hash has 1 elem 10:16
m: say ('55x55' ~~ /(\d\d)(x)(\d\d)/).hash.values.elems
camelia rakudo-moar 243c16: OUTPUT«1␤»
10:17 pecastro joined
psch m: say ('55x55 foo' ~~ /(\d\d)(x)(\d\d)\s$<foo>=foo/).hash.perl # definitely not quite right 10:17
camelia rakudo-moar 243c16: OUTPUT«EnumMap.new("foo" => Match.new(orig => "55x55 foo", from => 6, to => 8, ast => Any, list => ().list, hash => EnumMap.new()), "" => [])␤»
FROGGS ahh 10:18
10:19 pecastro left
ab5tract i can sort of see it ;) 10:21
10:22 rurban_ joined
FROGGS m: say ('55x55 foo' ~~ /(\d\d)(x)(\d\d)\s{}$<foo>=foo/).hash.perl # definitely not quite right 10:23
camelia rakudo-moar 243c16: OUTPUT«EnumMap.new("" => [], "foo" => Match.new(orig => "55x55 foo", from => 6, to => 8, ast => Any, list => ().list, hash => EnumMap.new()))␤»
10:25 virtualsue joined
Kristien > No such method 'gist' for invocant of type 'NQPRoutine' 10:27
:F
is that a bug?
10:28 broquain1 is now known as broquaint
ab5tract FROGGS: your comment on my gist makes me wish for a comprehensive guide to p6 regexes 10:28
i will attempt to document the experience of writing Terminal::Print once it is finished 10:29
moritz Kristien: it's mostl likely bootstrapping showing through
ab5tract but on the way, it's been a bit of a slog when it comes to finding examples and documentation (which i'm sure #perl6 is already well aware of)
psch m: ("abc" ~~ /.+/).CAPS.say 10:31
camelia rakudo-moar 243c16: OUTPUT«No such method 'CAPS' for invocant of type 'Match'␤ in block <unit> at /tmp/vEsH6BKnSz:1␤␤»
10:32 espadrine_ is now known as espadrine
FROGGS ab5tract: yes, we know that docs is something we need to work on :/ 10:33
Kristien m: sub f { say CALLER.HOW.^methods; }; class C { f; } 10:34
camelia rakudo-moar 243c16: OUTPUT«No such method 'gist' for invocant of type 'NQPRoutine'␤ in method gist at src/gen/m-CORE.setting:8098␤ in sub say at src/gen/m-CORE.setting:16907␤ in sub f at /tmp/39AIOPyUfL:1␤ in block <unit> at /tmp/39AIOPyUfL:1␤␤»
FROGGS good thing is that vendethiel++ and moritz++ did a good bit in the last weeks/months
p: sub f { say CALLER.HOW.^methods; }; class C { f; } 10:35
camelia rakudo-parrot 243c16: OUTPUT«No such method 'gist' for invocant of type 'NQPRoutine'␤ in method gist at gen/parrot/CORE.setting:8046␤ in method gist at gen/parrot/CORE.setting:1168␤ in sub say at gen/parrot/CORE.setting:16815␤ in sub say at gen/parrot/CORE.setting:16811…»
Kristien not quite gist
Moritz in your blog post about traits with the memoization example shouldn't you use my %cache{Any}; instead of my %cache;? 10:43
moritz Kristien: I probably should, but when I wrote it, that wasn't implemented 10:47
Kristien OK
psch m: "a" ~~ /(.)/; say $/.values.elems; "ab" ~~ /(.)(.)/; say $/.values.elems # uhh 10:48
camelia rakudo-moar 243c16: OUTPUT«1␤3␤»
psch so having more than one positional capture gives you an empty, anonymous named capture for free
that's how i interpret that at least :) 10:49
10:49 jack_rabbit left, virtualsue left
moritz m: "ab" ~~ /(.)(.)/; say $/.values.perl 10:50
camelia rakudo-moar 243c16: OUTPUT«(Match.new(orig => "ab", from => 0, to => 1, ast => Any, list => ().list, hash => EnumMap.new()), Match.new(orig => "ab", from => 1, to => 2, ast => Any, list => ().list, hash => EnumMap.new()), []).list␤»
moritz m: "ab" ~~ /(.)(.)/; say $/.values.flat.perl
camelia rakudo-moar 243c16: OUTPUT«(Match.new(orig => "ab", from => 0, to => 1, ast => Any, list => ().list, hash => EnumMap.new()), Match.new(orig => "ab", from => 1, to => 2, ast => Any, list => ().list, hash => EnumMap.new()), []).list␤»
moritz m: "ab" ~~ /(.)(.)/; say $/.values.flat.elems
camelia rakudo-moar 243c16: OUTPUT«3␤»
moritz psch: yes, that looks wrong
psch m: "ab" ~~ /(.)(.)/; say $/.hash.perl 10:51
camelia rakudo-moar 243c16: OUTPUT«EnumMap.new("" => [])␤»
psch m: "ab" ~~ /(.)./; say $/.hash.perl 10:52
camelia rakudo-moar 243c16: OUTPUT«EnumMap.new()␤»
psch moritz: i'm looking if i can find where that might happen, but the whole Regex stuff looks rather complicated from my vantage point
nqp-m: my $match := "ab" ~~ /(.)./; say(nqp::elems(($match)) 10:54
camelia nqp-moarvm: OUTPUT«Confused at line 2, near "say(nqp::e"␤ at gen/moar/stage2/NQPHLL.nqp:485 (/home/camelia/rakudo-inst-2/languages/nqp/lib/NQPHLL.moarvm:panic:105)␤ from gen/moar/stage2/NQP.nqp:921 (/home/camelia/rakudo-inst-2/languages/nqp/lib/nqp.moarvm:comp_unit:872)␤ f…»
psch nqp-m: my $match := "ab" ~~ /(.)./; say(nqp::elems($match))
camelia nqp-moarvm: OUTPUT«1␤»
psch nqp-m: my $match := "ab" ~~ /(.)(.)/; say(nqp::elems($match))
camelia nqp-moarvm: OUTPUT«2␤»
10:56 vendethiel joined 10:58 jack_rabbit joined, jack_rabbit left
FROGGS ab5tract: btw, I'd like to write a Perl 6 regexes/grammar tutorial, though, time is limited these days 11:06
11:09 virtualsue joined, salv00 joined
moritz there are several incomplete ones 11:10
might sense to start from them
ab5tract FROGGS: my plan is to definitely give back as much of the knowledge as i have gained from #perl6 as possible 11:12
even just the "proper" way to get the group captures into an array felt trickier than it seemed it should be.. which implies that i wasn't doing it properly 11:13
11:14 fhelmberger joined, xfix left 11:19 chenryn left 11:27 dayangkun joined 11:36 jack_rabbit joined 11:41 jack_rabbit left
ab5tract m: my @a = ('55x55' ~~ /(\d\d)(x)(\d\d)/).values>>.Str # is this really idiomatic? 11:43
camelia ( no output )
11:45 chenryn joined 11:51 [ptc] joined 11:52 jack_rabbit joined 11:58 [ptc] is now known as ptc, ptc is now known as [ptc] 12:00 rindolf joined 12:05 grep0r joined 12:09 jack_rabbit left 12:10 [ptc] left, [ptc] joined 12:11 [ptc] left
psch gist.github.com/peschwa/a74aba56552314223ea0 # this does fix the .values.elems bug from earlier and spectests clean, but i suspect the bug should be fixed earlier 12:17
12:17 mvuets joined
psch as in, the captures should be correct, instead of ignoring probably-incorrect captures... :) 12:18
but i don't see through the regex engine atm
12:21 Kristien left 12:22 jack_rabbit joined 12:24 rindolf left 12:25 skids left, rindolf joined 12:27 rindolf left, rindolf joined 12:29 rindolf left 12:30 rindolf joined 12:31 rindolf left, rindolf joined 12:32 rindolf left 12:33 rindolf joined, rindolf left, Guest25813 joined, Guest25813 is now known as [ptc], rindolf joined 12:34 rindolf left, jack_rabbit left, rindolf joined 12:37 rindolf left, rindolf joined, rindolf left 12:38 rindolf joined, rmgk is now known as Guest86863, rmgk_ joined, Guest86863 left, rmgk_ is now known as rmgk 12:40 chenryn left 12:43 rindolf left, rindolf joined 12:44 rindolf left 12:45 RPu joined, rindolf joined 12:47 rindolf left 12:48 rindolf joined 12:49 pyrimidi_ joined 12:50 rindolf left, rindolf joined, [particle]1 joined, rindolf left 12:51 rindolf joined, [particle] left, telex left, rindolf left, stux|RC left, pyrimidine left 12:52 telex joined, darutoko- joined 12:53 stux|RC-only joined, kjs_ joined 12:54 prevost joined 12:55 darutoko left 12:58 Peter_R joined 13:00 dayangkun left 13:16 kaare_ left 13:32 mvuets left 13:33 araujo joined, araujo left, araujo joined 13:34 rindolf joined, guru joined, guru is now known as Guest47001, Guest47001 is now known as ajr_
dalek kudo/nom: d1b1f1b | lizmat++ | src/core/Any.pm:
Make adverbed slices up to 2x as fast

By using an nqp level hash for adverb checking instead of a Perl6 hash.
13:42
13:46 salv0 left 13:47 salv0 joined
dalek kudo/nom: 270303f | lizmat++ | src/core/control.pm:
Streamline CLONE-HASH-DECONTAINERIZED a bit
13:47
13:50 dayangkun joined 13:51 KCL_ joined 13:54 KCL left 13:59 Kristien joined 14:05 darutoko joined 14:07 darutoko- left 14:12 brrt joined
brrt the perl jam ccc presentation is quite lousy 14:14
'ha ha let's make fun of perl because we don't understand a bit of it'
14:19 Kristien left
brrt literally not one bit of it 14:21
b2gills I especially found it funny that he didn't know that $a[0] is to access an array named @a 14:24
brrt oh, born in 1994
he is forgiven
just barely
b2gills forgiven, but not forgotten 14:25
vendethiel brrt: is that supposed to be rude for us 1994 kids? :p
brrt (although the my $scalar = (1,2,3,'a',b','c'); print $scalar; did surprise me)
14:25 [Sno] left
brrt no, not at all 14:25
just that you're not yet expected to understand every detail of a language which you clearly haven't used because it was popular when you were playing with lego 14:26
b2gills I think I started messing around with DOS batch files around '94
brrt (by 'you' i mean 'the speaker and everybody laughing so hard')
if i were too make a presentation about fortran 77 with funny wat's, i suppose that would be annoying to fortran programmers. but on the other hand, how would i know better 14:27
b2gills I wouldn't give a presentation about fortran 77 WATs without consulting a fortran 77 programmer 14:28
Peter_R brrt: That scalar thing... damn you Perl! 14:30
psch the presentation style was just bad imo
Peter_R Was this the presentation about context being a "bug" in Perl? 14:31
psch Peter_R: no, it was about a few vulnerabilities introduced by programmers not understanding context
moritz Peter_R: the framing was "we owned perl, and can break any web app written in it"
Peter_R: at least that's how the talk teaser sounded like 14:32
so, 80% trolling, 20% useful information
brrt 'if you program perl and don't understand context, you're going to have a bad time'
Peter_R psch: That's what I meant. To me it is a bit like ripping on C for code that doesn't pay any attention to bounds 14:33
brrt also, database input 'cleaning' is ... very much obsolete, no matter what you do
and i'm fairly sure that taint fixes this
psch Peter_R: right, my misunderstanding then :)
vendethiel brrt: sometimes people do that on purpose. for example, gary berndhat's js wat 14:35
psch events.ccc.de/congress/2014/Fahrpla...n-31c3.pdf the slides, if anyone wants to look at them
14:35 pecastro joined 14:36 brrt left
psch there's a few transitional slides missing iirc 14:37
media.ccc.de/browse/congress/2014/3...html#video the actual talk has a few more transitional slides, mostly with the caption "WAT" 14:38
14:44 Kristien joined
muraiki if i looked at the slides, does the talk add anything? I posted a bit of a rebuttal to the horrible slides, only to get a response of "you need to watch the video" 14:47
but I'm not terribly interested in wasting 30 minutes of my life if the video doesn't add any useful clarification
ab5tract right.. if you pass an array, and expect an arrayref, you are not a perl programmer 14:48
muraiki yeah, that's what I tried to explain to a non perl programmer. everything in the slides was totally misinformed 14:49
they're all labeled as as unexpected, but they should be labeled as 'unexpected to a non-perl programmer' 14:50
Peter_R muraiki: Don't bother, Perl isn't Python so you're wasting your time
muraiki hey, I passed an array to a function in python and when I changed the array in the function it changed the original array! why isn't perl like haskell?!?! 14:51
so dangerous! heh
psch muraiki: i don't think the talk actually adds anything except cheap humor and a little bit of backpedaling in the end by the speaker after Q&A
muraiki yeah, I mean I want to be charitable to another programmer, but it seems like he spent more time finding weird pictures of camels than he did reading the documentation that comes with perl or any perl tutorial 14:53
btyler yeah, it was not a good talk at all. kind of a shame that it had such a big audience and reach on the internet
psch the worst part is that what he found could easily stand on its own as a good discovery
muraiki yeah, the actual problem is a bit subtle and good to know about 14:54
psch but it turned into a lolperl talk
muraiki so that gives the rest of the talk an air of legitimacy
Peter_R I wonder if Python will be so hated in another 10 years? 14:55
geekosaur likely. people are noticing the ugly parts. but if anything I think python doomed itself differently by mishandling python3 14:57
vendethiel admits he doesn't like call flattening :-) 14:58
Peter_R I noticed people slag off the object system in Perl, but aside from first class objects the early Python system is very similar 14:59
geekosaur yes
that's one of the warts I am seeing people notice more 15:00
Peter_R It is odd for such an OO language to by design use such a bare metal approach, IMO
geekosaur (as for objects in perl, I think the problem is that there's the weak native stuff on one end and slow Moose on the other and nothing in the middle aside from various attempts to mitigate Moose's weight)
Peter_R Yeah, I think Moo is pretty performant? 15:01
geekosaur (I see a *lot* of grouching about how to get sensible OO you need to go the Moose/Moo/Mouse/etc. route which is pretty heavyweight for smaller things)
Peter_R I am just using Moose atm since I don't care about performance
I don't think the whole Perl 5 vs 6 naming does any favours towards people understanding the Perl situation either :P 15:03
masak heh, and the penultimate slide says 'At least know your language "features"' -- this message is approved by both Dunning and Kruger. 15:05
15:06 KCL_ left
muraiki I used Moo for a project at work and liked it. I remember asking in #perl about moo/moose and at least in terms of startup time, which from what I understand used to be the main objection, is that they add barely any overhead anymore 15:09
15:09 gcole joined, Kristien left
Peter_R Moose definitely has a perceptible start up time, still only ~1 second though 15:12
15:12 espadrine left
b2gills In addition to Moo/Moose/Mouse there is also Mite, which to my knowledge does all the things Moo does, except at release or install time 15:14
15:15 agre joined
lizmat Perl 6 Weekly draft: p6weekly.wordpress.com/?p=342&...65a09545aa # comments welcome! 15:16
15:16 dayangkun left 15:17 Kristien joined, skids joined 15:18 spollei joined
rurban_ jnthn: I found the cause for the parrot crash on win64. long = 4 byte, I changed it for --intval=int. all nci calls failed. 15:18
15:19 agre left 15:21 sqirrel joined
ab5tract lizmat: not sure if my work on getting mixes to behave as expected in quanthash ops has been mentioned (or deserves to be mentioned) in a p6 weekly yet 15:23
lizmat ab5tract: I think I mentioned that a few weeks ago? 15:24
2015.02: " ab5tract did a lot of work for properly handling Mixes: there’s still some debate whether the currently implemented behaviour is correct." 15:25
ab5tract didn't see it when it happened!
thanks :)
yeah, i need to finish my "set/mix/bag makeover" so that the real debate on behavior can begin 15:26
though TimToady already co-signed the "set operators are more like arithmetic ops than equality ops"
15:26 xfix joined 15:27 brrt joined
brrt lizmat - looks good to me 15:28
15:29 TuxCM left, Peter_R left
timotimo lizmat: wow, 2x improvement just by using a nqp-level hash :S 15:29
i wonder how much faster .exists used to be compared to our current :exists and the :exists before this improvement 15:30
15:30 TuxCM joined
[Coke]_ m: say "hi from the airport" 15:31
camelia rakudo-moar 243c16: OUTPUT«hi from the airport␤»
FROGGS hi [Coke]_
15:32 silug_ left, ajr_ left
lizmat timotimo: you can still check that, as .exists was just renamed to .exists_key (and .exists_pos) 15:33
15:33 ajr joined, ajr is now known as Guest82605 15:34 Guest82605 is now known as ajr_
timotimo oh! 15:34
i didn't know that :)
dalek rl6-roast-data: 351b87e | coke++ | / (5 files):
today (automated commit)
15:37
15:37 espadrine joined
ab5tract lizmat: are we ready for '.exists-key' and '.exists-pos' ? :) 15:38
lizmat personally, I think so, yea
ab5tract i remember reading you mention that you would like to see a change like that before 6.0
lizmat I would like to see all public and semi-public facing API to be kebab-cased 15:39
but I don't think we have consensus on that yet
timotimo don't make me hungry pls 15:40
15:45 pmurias joined
pmurias hi 15:45
15:46 Sysaxed joined
masak \o 15:47
hoelzro o/ #perl6
[Coke]_ m: say (243-219)/2
camelia rakudo-moar 243c16: OUTPUT«12␤»
Sysaxed Hi! Is it possible to specify the return type of a sub?
FROGGS m: sub foo($a) returns Str { "bar" }; say foo 15:48
camelia rakudo-moar 243c16: OUTPUT«===SORRY!=== Error while compiling /tmp/DBu3rDUzf0␤Calling 'foo' requires arguments (if you meant to operate on $_, please use .foo or use an explicit invocant or argument)␤ Expected: :(Any $a --> Str)␤at /tmp/DBu3rDUzf0:1␤----…»
FROGGS m: sub foo($a) returns Str { "bar" }; say foo 42
camelia rakudo-moar 243c16: OUTPUT«bar␤»
FROGGS Sysaxed: ^^
Sysaxed oh that's how
psch m: sub foo($a --> Str) { "bar" }; say foo 42 15:49
camelia rakudo-moar 243c16: OUTPUT«bar␤»
FROGGS m: sub foo($a --> Str) { "bar" }; say foo 42
camelia rakudo-moar 243c16: OUTPUT«bar␤»
FROGGS right
:o)
TIMTOWTDI
Sysaxed oh so the --> thing is an alternative to 'returns' word?
FROGGS yes
Sysaxed okay, cool 15:50
thanks
FROGGS though, I guess I prefer the returns trait
Sysaxed well, 'returns' is too long to type...
FROGGS because it is self explaining, and I like code that a non-professional can read also 15:51
(my colleagues are not the best hackers, maybe that's why)
Sysaxed an arrow explains itself as well (turn these parameters into this)
FROGGS yeah, probably 15:52
psch is reminded of "x goes to zero"
15:52 ajr_ left
skids I seem to rememeber a difference between "returns" and "-->" in that one or the other validated inside the brackets? 15:52
psch the C WAT that is, i.e. "while ( x --> 0 ) { }" 15:53
timotimo haha
Sysaxed psch: wtf?
FROGGS nice one :o)
timotimo that gets parsed as x-- > 0
psch Sysaxed: the arrow explains itself, x goes to 0 ;)
Sysaxed aaah yeah
that one 15:54
FROGGS m: sub foo($a --> Str) { 42 }; say foo 42
camelia rakudo-moar 243c16: OUTPUT«Type check failed for return value; expected 'Str' but got 'Int'␤ in any return_error at src/vm/moar/Perl6/Ops.nqp:649␤ in block <unit> at /tmp/WUm7n3SHxe:1␤␤»
[Coke]_ wanders around to find something he can eat before the flight.
FROGGS m: sub foo($a) returns Str { 42 }; say foo 42
camelia rakudo-moar 243c16: OUTPUT«Type check failed for return value; expected 'Str' but got 'Int'␤ in any return_error at src/vm/moar/Perl6/Ops.nqp:649␤ in block <unit> at /tmp/l2gXktRq2p:1␤␤»
15:54 [Coke]_ is now known as [Coke]
FROGGS skids: seems it is doing the same 15:54
vendethiel lizmat++ weekly
Sysaxed is there any reason why --> is used? Instead of, uhm -> ? 15:55
lizmat -> is tainted by Perl 5
Sysaxed lizmat: and who cares? 15:56
sorry, I'm just trying to understand
timotimo this tainted -> you've given / i give you all a programmer could give you
Sysaxed this stuff is interesting
timotimo take my syntax and that's not nearly all 15:57
psch m: sub foo($t, &x :(Str --> Int)) { x($t) }; say foo("abc", &postfix:<++>) # NYI :(
camelia rakudo-moar 243c16: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
psch skids: returns doesn't fit there
skids: aside from that i don't know of any difference
lizmat m: say 42->Int # Sysaxed: this is why
camelia rakudo-moar 243c16: OUTPUT«===SORRY!=== Error while compiling /tmp/Plo_TazU_J␤Unsupported use of -> as postfix; in Perl 6 please use either . to call a method, or whitespace to delimit a pointy block␤at /tmp/Plo_TazU_J:1␤------> say 42->⏏Int …»
psch ah nvm, whiespace 15:58
timotimo m: sub foo($t, &x (Str --> Int)) { x($t) }; say foo("abc", &postfix:<++>) # isn't this the syntax you need?
camelia rakudo-moar 243c16: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub-signature of parameter &x␤ in sub foo at /tmp/_ZMYWJqroL:1␤ in block <unit> at /tmp/_ZMYWJqroL:1␤␤»
psch also mistyping for &x..
15:58 gcole left
psch m: sub foo($t, &x:(Str --> Str)) { x($t) }; say foo("abc", &postfix:<++>) # NYI :( 15:58
camelia rakudo-moar 243c16: OUTPUT«Constraint type check failed for parameter '&x'␤ in sub foo at /tmp/9QwK3R1tgp:1␤ in block <unit> at /tmp/9QwK3R1tgp:1␤␤»
psch huh
oh &postfix:<++> doesn't returns
timotimo "returns" currently just mostly uses up more memory and makes the core setting bigger
psch m: sub bar(Str $in) { $in++ }; sub foo($t, &x:(Str --> Str)) { x($t) }; say foo("abc", &bar)
camelia rakudo-moar 243c16: OUTPUT«Cannot modify an immutable Str␤ in sub postfix:<++> at src/gen/m-CORE.setting:2158␤ in sub bar at /tmp/t8HEL4znDZ:1␤ in sub foo at /tmp/t8HEL4znDZ:1␤ in block <unit> at /tmp/t8HEL4znDZ:1␤␤»
psch harumpf
timotimo fi you have something trivial like ++, i don't think it's worth much
psch timotimo: i agree, actually 15:59
skids There's an "as" and an "of" trait for subs. I forget what forms/placement of '-->' and 'returns' did which. But if there is no "as" it defaults to "of".
psch m: sub bar(Str $in) { $in x 2 }; sub foo($t, &x:(Str --> Str)) { x($t) }; say foo("abc", &bar) # there we go
camelia rakudo-moar 243c16: OUTPUT«abcabc␤»
timotimo ah
psch S06:Subroutine traits 16:00
synopsebot Link: perlcabal.org/syn/S06.html#Subroutine_traits
psch huh 16:01
m: sub Int foo($x) { 42 };