»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | YAPC::NA talk submissions due end of Month. Have you submitted your talk?
Set by toddr_ on 18 March 2013.
00:00 cognominal left 00:02 cognominal joined
cognominal listening Pinker's talk... he is talking of subject and verb. I am hearing invocant and multimethods. 00:03
masak :) 00:06
00:15 cognominal left 00:17 cognominal joined 00:24 armitage left, armitage81 joined 00:25 armitage81 left, armitage81 joined 00:31 Chillance left 00:33 xinming_ joined
masak 'night, #perl6 00:35
00:36 xinming left 01:00 anuby joined 01:04 rking joined 01:10 cognominal__ joined 01:11 cognominal left 01:15 tgt joined 01:18 Targen joined 01:19 hypolin joined 01:28 araujo joined, araujo left, araujo joined 01:31 tgt left 01:44 japhb_ left 01:53 cognominal__ left 02:03 cognominal__ joined 02:05 pecastro left 02:15 djvijay joined 02:19 djvijay left 02:23 Targen left
hoelzro jnthn: are you around? I have a quick question about NativeCall 02:23
02:30 cognominal joined 02:31 cognominal__ left 02:34 census left 02:35 lustlife joined
hoelzro needs to figure out how to make a copy of a char * in an OpaquePointer so he can free() it 02:35
02:38 dwoldrich joined, FROGGS_ joined 02:42 FROGGS left 02:45 census joined 02:52 pecastro joined 02:57 census left 03:05 orafu left, orafu joined 03:18 preflex_ joined, preflex left, preflex_ is now known as preflex 03:30 arlinius joined 03:40 Targen joined 03:43 fgomez left 04:08 armitage81 left
japhb r: say so nqp::iscont(0i); say so nqp::iscont(-0i); say so nqp::iscont(+0i); 04:15
p6eval rakudo b972ca: OUTPUT«True␤False␤False␤»
japhb Wait, what? 04:16
Anyone have any ideas on this one? ^^
FWIW, I expect nqp::iscont on any numeric constant to be false.
sorear hmm 04:19
probably something in the implementation of postfix:<i> is causing it to return a container
whereas prefix:<-> and prefix:<+> decontainerize anything passed to them 04:20
r: say so nqp::iscont((-0)i)
p6eval rakudo b972ca: OUTPUT«True␤»
diakopter /msg japhb help. 04:26
/msg japhb help. 04:27
ergh.
.oO( try to hit backspace, hit space instead )
04:28 lustlife left 04:31 lustlife joined
japhb sorear, ah, good analysis, thank you. 04:36
04:43 kurahaupo left 05:07 kurahaupo joined, kurahaupo left 05:23 SamuraiJack joined 05:59 dwoldrich left 06:12 kaare_ joined, Heather joined
Heather good morning #perl6 06:13
nqp --> /usr/include/parrot/5.1.0/parrot/parrot.h:94:19: fatal error: ffi.h: No such file or directory ?
sorear good morning Heather
Heather blogged about perl6 :3
cynede.net 06:14
sorear sounds like parrot.h *thinks* you have libffi installed
i have no idea why, but you might be able to work around this by fixing reality to match parrot's preconceptions
Timbus i did that once. parrot compiles, but now i have crab hands?? 06:15
sorear a blog that requires js. fun.
Heather crab hands? 06:16
Timbus literal crabs for hands. i hover them over the keyboard and they wiggle their tiny feet to kick all the correct keys 06:17
Heather sorear you must be happy it's not using silverlight :D
o_O
diakopter Timbus: we're not sure over here whether you actually perceive your hands as crabs 06:19
Heather sorear but I've got libffi installed
diakopter
.oO( Timbus' hand-free must be tired )
06:21
hand-feet
06:24 census joined
Heather ffi is in /usr/lib/libffi-3.0.13/include/ffi.h 06:28
06:40 kaare_ left
Heather is building git parrot 06:47
07:06 fgomez joined 07:08 sizz joined 07:24 wk joined 07:26 domidumont joined 07:28 Targen left 07:49 FROGGS_ left 07:50 aindilis left 07:52 ironcamel joined 07:55 domidumont left, domidumont joined 08:13 sunnavy left 08:14 daxim joined 08:16 sunnavy joined 08:30 SamuraiJack_ joined 08:31 SamuraiJack left 08:36 FROGGS joined, thou left
FROGGS hoelzro: you need to copy something within C or within Perl 6? 08:54
Heather I need parsing help I guess :) 08:57
09:04 gcole_ joined 09:05 gcole left
Heather How to get run result? 09:07
2>&1 ? 09:09
09:09 gcole_ left 09:10 gcole joined
Heather $*OUT ? 09:11
tadzik result of what? 09:12
Heather tadzik of shell execution (run)
tadzik qx// 09:13
Heather tadzik ah?
FROGGS r: say qx/hello/ 09:14
p6eval rakudo b972ca: OUTPUT«qx, qqx is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:2␤ in sub QX at src/RESTRICTED.setting:9␤ in block at /tmp/FBjqUxouQd:1␤␤»
FROGGS perl6 -e 'say qx/hello/' 09:15
/bin/sh: 1: hello: not found
Heather r: say qqx { say "qq" } 09:16
p6eval rakudo b972ca: OUTPUT«qx, qqx is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:2␤ in sub QX at src/RESTRICTED.setting:9␤ in block at /tmp/Ljtie6YVqQ:1␤␤»
Heather it works ) 09:17
thanks
09:19 sivoais left, sivoais joined
Heather how to split by new line ) 09:22
.split(\n) ?
FROGGS right
err, .split("\n")
09:23 kresike joined
FROGGS or .split(/\n/) 09:23
kresike hello all you happy or unhappy perl6 people
Heather hey !
FROGGS hello all you kresike or not kresike :P
kresike FROGGS, o/ :P 09:24
Heather FROGGS how to edit and concat what I splitted again ? )
FROGGS r: my @parts = "first\nsecond\nthird".split("\n"); @parts[1] = "huh?"; say @parts.join("\n") 09:26
p6eval rakudo b972ca: OUTPUT«first␤huh?␤third␤»
Heather FROGGS maybe less verbose ?
FROGGS with edit I need add = to all 09:27
FROGGS Heather: what exactly do you wanna change?
... within the original string
09:28 sivoais left
Heather your example is fine but I need "map" all with cnage $m to "=$m" 09:28
is there some kind of .map ?
FROGGS ohh yes 09:29
09:29 sivoais joined
FROGGS yo you want to prepend '=' to all substrings? 09:29
Heather r: my @parts = "first\nsecond\nthird".split("\n").map($m -> "=$m").join("\n"); say @parts
p6eval rakudo b972ca: OUTPUT«===SORRY!===␤Variable '$m' is not declared␤at /tmp/tjKNGR2JVv:1␤------> first\nsecond\nthird".split("\n").map($m⏏ -> "=$m").join("\n"); say @parts␤ expecting any of:␤ postfix␤»
Heather FROGGS yes
FROGGS Heather: you can't just invent a variable $m out of thin air 09:30
Heather so how map works ? :)
FROGGS r: my @parts = "first\nsecond\nthird".split("\n").map("=$_").join("\n"); say @parts
p6eval rakudo b972ca: OUTPUT«use of uninitialized value of type Any in string context in block at /tmp/gxkeWFTo4y:1␤␤No such method 'count' for invocant of type 'Str'␤ in method reify at src/gen/CORE.setting:5609␤ in method reify at src/gen/CORE.setting:5532␤ in method reify at src/gen/CO…
FROGGS r: my @parts = "first\nsecond\nthird".split("\n").map({"=$_"}).join("\n"); say @parts
p6eval rakudo b972ca: OUTPUT«=first␤=second␤=third␤»
Heather aha
cool
FROGGS there you go
Heather thank you
FROGGS np
masak: I guess that's an LTA error msg? 09:31
Heather FROGGS also I need to cut of last element, it's empty string... 09:34
.drop[-1] ? )
FROGGS no, better do: 09:35
r: my @parts = "first\nsecond\nthird".split("\n").map({ $_ ?? "=$_" !! () }).join("\n"); say @parts
p6eval rakudo b972ca: OUTPUT«=first␤=second␤=third␤»
FROGGS this will filter all empty elements, even if they are in between
Heather hm...
FROGGS yes, it works, cool 09:36
09:37 sivoais left 09:39 sivoais joined 09:43 dakkar joined
Heather FROGGS I also need remove all the ' synbols :D 09:46
e.g. in begin and end...
I don't understand where is it added
09:47 sivoais left
FROGGS r: say "'abc'".subst("'", '', :g) 09:48
p6eval rakudo b972ca: OUTPUT«abc␤»
09:48 sivoais joined
FROGGS Heather: you can call that (the .subst...) on the "=$_" within the .map 09:48
or you do that after the last join 09:49
or before split
:o)
Heather .substr("'","") ? 09:51
FROGGS no, subst
like substitution
method subst( <search patter>, <replacement>, <options> ) 09:52
09:53 fhelmberger joined
Heather doesn't work... 09:53
FROGGS you should add the option :g to replace all occourences, not just the first one found
well, I'm bad at guessing, can't you paste an example? 09:54
Heather same
ok
FROGGS gist.github.com/Heather/5253103
FROGGS it adds ' ' to my final string 09:55
I don't understand why 09:56
FROGGS hmmmm
maybe we have to do something else within the map to ignore an element...
09:56 sivoais left
FROGGS r: my @parts = "first\nsecond\nthird\n".split("\n").map({ $_ ?? "=$_" !! () }).join("\n"); say @parts 09:57
p6eval rakudo b972ca: OUTPUT«=first␤=second␤=third␤»
FROGGS r: my @parts = "first\nsecond\nthird\n".split("\n").map({ $_ ?? "=$_" !! () }).join("#"); say @parts
p6eval rakudo b972ca: OUTPUT«=first#=second#=third␤»
FROGGS r: my @parts = "'first\nsecond\nthird\n'".subst("'",'',:g).split("\n").map({ $_ ?? "=$_" !! () }).join("#"); say @parts
p6eval rakudo b972ca: OUTPUT«=first#=second#=third␤» 09:58
FROGGS I'd say it works well
09:58 sivoais joined
Heather FROGGS well it still wants ' ' 10:00
or not... 10:01
wiat
10:05 hypolin left
Heather FROGGS I can't understand where ' comes from 10:06
r: say <a b>
p6eval rakudo b972ca: OUTPUT«a b␤»
Heather r: say ('a','b')
p6eval rakudo b972ca: OUTPUT«a b␤»
10:06 sivoais left 10:07 sivoais joined
Heather if I just use say there is no ' ' 10:09
but with run ...
FROGGS seems like run adds ' ' to it o_O 10:10
why ? 10:11
10:13 anuby left
Heather r: run <ls> 10:15
p6eval rakudo b972ca: OUTPUT«run is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:2␤ in sub run at src/RESTRICTED.setting:8␤ in block at /tmp/eCT4nFUHUr:1␤␤»
Heather seems like bash runs 'ls' as ls.. 10:16
10:16 sivoais left
Heather maybe in run ' ' is default ... 10:16
10:17 sivoais joined 10:21 sqirrel joined
masak top o' the morning to you, #perl6 10:22
Heather: I liked your blog post: heather.cynede.net/2013/03/perl-6.html -- Heather++ 10:23
the only thing I reacted to was -- just at the beginning -- "Why the hell you need readable script?" 10:24
I tend to value readability quite a lot, even when I code Perl 5/6 and write scripts.
10:25 sivoais left
masak Heather: it's like, I understand what you mean but I think people will misread it when you put it like that. 10:26
10:26 sivoais joined 10:32 Gruu_ joined
Heather masak ) 10:33
masak it's general point of script
masak script must be most easier to write then to read 10:34
*than
masak yes. like I said, I understand what you wanted to say.
Heather masak well, I also get your point. suggest me something if you get what I wanted to say in mind :P 10:35
10:35 sivoais left
masak but "Why the hell you need readable script?" is a bit too strong -- I *do* need a readable script, and not just six months later when I forgot what I was thinking when I wrote it, but five seconds later to see that stuff is correct. 10:35
ok, let me think about it.
Heather people give to much objection to readabilty 10:36
10:36 sivoais joined
masak "I never liked python and I desired to replace it with Perl because: Why the hell should I put readability ahead of hackability when I'm writing a 30-line script." 10:36
er, "...?"
something like that?
Heather so yes...
masak it's not either-or, it's a balance of the two. 10:37
Heather imagine you will work in bash
daxim I give you objection to calling python elegant. I've only (tribal) python programmers say that about their own language
Heather and there will be listallthefilesinthisdir instead of ls
pretty readable huh?
masak Heather: no :)
especially as "files" and "this dir" are debatable.
and "list" too, I guess :P 10:38
and "all".
basically what you have going for you is "the" :P
and "in"
Heather masak -_-' I suggest you must just replace spaces with '' in ls man page :D
and call it that way :D
thein 10:39
-_-'
masak hehe.
in other news, I found this newbie story charming: blog.michellebu.com/2013/03/21-nested-callbacks/
Heather pretty logical
masak help me to run stuff without '' 10:40
r: run "this string wrapped by \'"
p6eval rakudo b972ca: OUTPUT«run is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:2␤ in sub run at src/RESTRICTED.setting:8␤ in block at /tmp/xWLdO1GZcj:1␤␤»
Heather btw I always lazy to blog :) 10:41
masak updated post :) 10:43
10:44 sivoais left
masak \o/ 10:46
Heather++
10:46 sivoais joined
masak Heather: another thing. I like your reason for choosing Perl 6 directly instead of learning Perl 5 first and then moving to Perl 6. I'm willing to put much energy into letting you remain a happy customer. so let me/us know if there is anything you need or if anything is less than optimal. 10:48
(because there will be missing features or less-than-optimal situations)
Heather masak cool 10:51
it sounds ultra friendly -_-' 10:52
masak well, I need run and 3d party tool with argument without ' ' for argument
run <x b> will run 'x' 'b'
and for now it fails because 'x' expects b and not 'b' 10:53
masak doesn't understand
won't a shell simply treat those as quotes and throw them away?
Heather masak not for arguments
10:54 sivoais left 10:55 sivoais joined
Heather masak let make failing test 11:01
11:04 sivoais left 11:05 sivoais joined
Heather or ... I think I get where is my trouble... 11:05
masak I need to merge lists instead of concat arguments to string 11:06
cognominal r: my \a = 1; say "a()" 11:07
p6eval rakudo b972ca: OUTPUT«a()␤»
cognominal r: my \a = 1; say "{a}" 11:08
p6eval rakudo b972ca: OUTPUT«1␤»
cognominal r: sub a { 1 } ; say "{a()}"
p6eval rakudo b972ca: OUTPUT«1␤»
cognominal r: say "{b()}" 11:09
p6eval rakudo b972ca: OUTPUT«===SORRY!===␤Undeclared routine:␤ b used at line 1␤␤»
Heather masak no, it's still being trouble with ' ' :( 11:10
cognominal r: say "b()"
p6eval rakudo b972ca: OUTPUT«b()␤»
11:10 Gruu_ left
Heather I got it 11:11
masak ping
cognominal sub a { 1 } ; say "a()"
r: sub a { 1 } ; say "a()"
p6eval rakudo b972ca: OUTPUT«a()␤»
cognominal r: sub a { 1 } ; say "a.()" 11:12
p6eval rakudo b972ca: OUTPUT«a.()␤»
cognominal r: sub a { 1 } ; say "&a()"
p6eval rakudo b972ca: OUTPUT«1␤»
cognominal r: my \a = 1 ; say "&a()" 11:13
p6eval rakudo b972ca: OUTPUT«===SORRY!===␤Undeclared name:␤ &a used at line 1␤␤»
11:13 sivoais left 11:14 sivoais joined
cognominal Somehow, I wish that a sigiless variable would behave like a function when interpolated in a string. I prefer that than braces. 11:15
braces break the left to write reading because it somehow refers to the opening brace. 11:16
*s/write/right/ # "right" because it's wrong 11:17
11:22 sivoais left 11:24 sivoais joined 11:26 SamuraiJack_ left 11:32 arlinius left 11:33 sivoais left 11:34 sivoais joined
masak Heather: pong 11:37
Heather: yes, a failing test would be excellent.
Heather masak I fixed it via removing " " 11:39
masak it's if you run ls "." it will work
masak but if you run('ls', '\".\"') it will fail 11:40
because it will run ls '"."'
and bash can't deal with it
masak Heather: I'm with you so far -- bash can't deal with that -- but I don't see anything wrong on Rakudo's end yet.
huf bash can deal with that. if the file were literally called ".", it'd list that 11:41
11:43 sivoais left
moritz fwiw you can say shell('ls "."'), and it'd do what Heather exepected 11:43
11:43 sivoais joined
Heather moritz seems like yes :) 11:44
masak yeah, I think that's why we have both &shell and &run 11:50
to be honest, I still haven't gotten used to having both. I don't really know when to use one and when the other.
moritz you use shell() whenever you want the shell to do something for you (like globbing, redirects, pipes)
and you use run() when you don't want to escape your arguments (which is usually "in every other case") 11:51
11:51 sivoais left
tadzik PLPW status update: act.yapc.eu/plpw2013/newsedit?news_id=1006 11:52
oops, rong link
act.yapc.eu/plpw2013/news/1006 that's the one :)
11:53 sivoais joined
masak moritz: "use &shell when you want the shell to do something" -- gotcha. 11:53
Heather how to check if custom parameter is set ot no 11:55
moritz Heather: example?
Heather moritz I've got Str :$overlay = '/usr/home/gentoo-perl6' how will I know if user override it? 11:56
masak Heather: compare it to the default? 11:57
Heather masak bad way
masak I always dislike string comparsion, sql habit
masak rn: constant overlay_default = '/usr/home/gentoo-perl6'; sub foo(:$overlay = overlay_default) { say $overlay eq overlay_default ?? "not overridden" !! "overridden" }; foo; foo(:overlay</usr/local/bin/mwhahaha/perl6>) 11:58
p6eval rakudo b972ca, niecza v24-35-g5c06e28: OUTPUT«not overridden␤overridden␤»
cognominal moritz++ # explaining the diff between &run and &shell
masak Heather: there's no meta-layer by which you can ask "was this parameter passed from the outside?". I sometimes miss that too. 11:59
something like a small MOP but for the binding of a capture to a signature, accessible from inside the routine.
12:01 sivoais left
moritz Heather: then apply the default inside the subroutine, not in the signature 12:01
for example
r: sub f(Str :$overlay) { if $overlay.defined { #`[ was provided by the user ] } else { $overlay = '/usr/home/gentoo-perl6' } } 12:02
Heather moritz and check if !$ ?
p6eval rakudo b972ca: ( no output )
12:02 sivoais joined
Heather moritz righ, that's more clever 12:02
moritz but it's readon;y 12:04
*readonly
moritz Heather: then add an 'is copy' to the param
Heather moritz oh, nice to know thing. Thank you 12:05
masak there's 'is copy' when you want to treat it as a completely new variable. 12:07
and there's 'is rw' for when you want a live link between the caller variable and the callee variable.
r: sub crazy-action-at-a-distance($foo is rw) { $foo = 42 }; my $bar = 5; say $bar; crazy-action-at-a-distance $bar; say $bar 12:08
Heather I see
p6eval rakudo b972ca: OUTPUT«5␤42␤»
moritz 'is rw' should be used with caution, because it often violates the principle of least surprise
Heather how to lowercase string? 12:09
masak it's a code smell, because it hinders composability and thus scalability.
moritz lc
masak r: say lc "OMG KITTENS"
p6eval rakudo b972ca: OUTPUT«omg kittens␤»
Heather oh... that easy
masak r: say "OMG KITTENS".lc
p6eval rakudo b972ca: OUTPUT«omg kittens␤»
masak it's meant to be easy! :)
Heather: there's also .uc and .tc -- the latter gives you title-case
r: say "OMG KITTENS".tc 12:10
p6eval rakudo b972ca: OUTPUT«No such method 'tc' for invocant of type 'Str'␤ in block at /tmp/4sTM6NalhI:1␤␤»
masak oh :/
n: say "OMG KITTENS".tc
p6eval niecza v24-35-g5c06e28: OUTPUT«OMG KITTENS␤»
masak n: say "omg kittens".tc
p6eval niecza v24-35-g5c06e28: OUTPUT«Omg kittens␤»
masak n: say "omg kittens".words>>.tc.join(' ')
p6eval niecza v24-35-g5c06e28: OUTPUT«Omg Kittens␤»
12:10 sivoais left
pmichaud r: say tc "omg kittens" 12:10
p6eval rakudo b972ca: OUTPUT«===SORRY!===␤Undeclared routine:␤ tc used at line 1. Did you mean '&lc', '&uc'?␤␤»
pmichaud hmmm. 12:11
12:11 sivoais joined
masak submits TODO rakudobug 12:12
moritz r: say tclc 'omg kittens' 12:13
p6eval rakudo b972ca: OUTPUT«Omg kittens␤»
moritz r: say tclc 'OMG KITTENS'
p6eval rakudo b972ca: OUTPUT«Omg kittens␤»
moritz r: say capitalize 'OMG KITTENS'
p6eval rakudo b972ca: OUTPUT«Omg Kittens␤»
pmichaud r: 'OMG KITTENS'.tclc.say 12:14
p6eval rakudo b972ca: OUTPUT«Omg kittens␤»
pmichaud r: 'omg rakudobugs'.uc.say
p6eval rakudo b972ca: OUTPUT«OMG RAKUDOBUGS␤»
Heather moritz if !$overlay.defined { is it correct for not defined? 12:17
or.. not
12:18 cognominal left
moritz Heather: yes 12:19
though if you don't have an 'else' block, you can also say
unless $overlap.defined { }
Heather ah
there is unless
right
forget it )
12:19 sivoais left 12:20 skids left 12:21 sivoais joined, census left 12:22 stevan_ joined
masak generally prefers 'if !' (for the statement form), but found to his own surprise that he wanted 'unless' in the Nomic code: gist.github.com/masak/5237570 12:24
'unless $vote.was_registered_by($player)' just reads incredibly well.
moritz: my brain is now actively trying to hack the rules, by the way. it keeps running through situations like "what if someone leaves the game during his turn?" :) 12:25
12:29 sivoais left 12:30 cognominal joined, sivoais joined
moritz masak: I'm tempted to model it as a state machine :-) 12:30
hoelzro FROGGS: ping
good *, #perl6! 12:31
cognominal good ** 12:33
12:33 census joined
masak moritz: well, it is, in a very real sense. the fun comes from the fact that it's a self-modifying state machine. 12:33
states come and go as the machine runs. 12:34
and transitions.
Heather now I do deps trakcing \o/
so now we need license stuff for META.info 12:35
tadzik uh, I don't think anyone uses it there :)
Heather tadzik licensing? :) 12:36
masak moritz: though having things end up in an "unexpected state" maked it even more interesting to thing about. 12:37
hoelzro nqp::p6box_s boxes a Parrot string -> Str, right?
12:37 Liz_ is now known as lizmat
masak moritz: for example, a player could accidentally fall out of the voters queue due to some hastily applied patch. which would be pretty bad, but could be fixed with a one-off patch adding the player back. :) 12:38
tadzik Heather: in META.info
masak moritz: or a player could end up in the queue several times. which, assuming being the proposer is a good thing in that stage of the game, would be a potentially big advantage.
12:39 sivoais left
moritz Heather: yes 12:39
masak: aye
12:40 sivoais joined
Heather tadzik I need additional flag for meta... 12:40
there are not much versions but when there is version I expect I can use static source tarball
but mostly there are no tags on git for it or tags named wrong
hoelzro for anyone who's interested: github.com/hoelzro/perl6-posix
my first Perl 6 module on GH! \o/ 12:41
Heather so that will be good to check if there is tag that satisfy version name
pmichaud hoelzro++
looks like it needs tests :)
masak moritz: I just realized I need an API primitive saying "run this code un patch-time, and then never again".
hoelzro pmichaud: yeah, it's in the TODO =)
testing individual POSIX calls is tricky, though...
tadzik hoelzro++ :) 12:42
pmichaud certainly worth looking at p5 posix's tests as a guide there, I think 12:43
hoelzro oh, good call!
I have two roadblocks at the moment
one is EXPORT
the other (more urgent) is implementing getcwd
masak .oO( I have 99 problems, but roadblocks ain't one )
hoelzro get_current_dir_name in C returns a malloc'd string 12:44
so I need to call it from Perl 6, create a Str copy, and free the original
and I don't know how to do the copying part =/
Heather hoelzro = hoelzro + 1
moritz Heather: arnsholt has a proposal to make the memory owner of NCI stuff clearer and controllable 12:46
pmichaud on Parrot at least, there's the OS.cwd method.
moritz erm, meant hoelzro
sorry
r: say cwd
p6eval rakudo b972ca: OUTPUT«/home/p6eval␤»
hoelzro pmichaud: right, I'm just adding it to be thorough =)
12:46 tgt joined
hoelzro but it will serve as a good testing point! 12:46
arnsholt hoelzro: ATM, just make function return a Str 12:47
hoelzro arnsholt: but then how does NativeCall know how to free() the return value after copying it?
arnsholt Zavolaj will marshal the char* into a Parrot string, and then promptly not do anything at all with the pointer afterwards =) 12:48
It can't know when to free it, so it never frees it =)
hoelzro so then getcwd has a memory leak =)
arnsholt Unfortunate, I know. But better than randomly segfaulting because we're overzealous about the free()ing
hoelzro right
so we need a way to handle this situation 12:49
12:49 sivoais left
Heather ok, time to move to another base 12:49
hoelzro it could be getcwd is native('get_current_dir_name) returns Str is free_the_string
12:49 Heather left
hoelzro it could be a way to create a Perl 6 Str copy 12:49
12:49 sivoais joined
moritz returns copy(Str) 12:51
hoelzro but get_current_dir_name needs to return an OpaquePointer =) 12:53
pmichaud also, fwiw, get_current_dir_name isn't POSIX. :-)
hoelzro hmm
tricky
12:56 yeltzooo6 left
arnsholt hoelzro: Yeah, slightly longer term, I'm working on providing the operations needed to handle this kind of thing 12:57
hoelzro ok
is getcwd(Str $buf is rw, int $size) is native possible right now? 12:58
arnsholt Nope
hoelzro dang
12:58 sivoais left
hoelzro well, I'll skip getcwd for now then 12:58
arnsholt I'm not sure is rw ever will be supported in Zavolaj
For that, you'll need to allocate a CArray[int8] and fill it with the appropriate amount of zeroes
12:59 sivoais joined
hoelzro I see 13:01
13:02 yeltzooo joined
masak moritz: fwiw, I stared at 'return copy(Str)' for several seconds, going "wh..." :) 13:08
13:08 sivoais left
masak then I noticed the 's' in 'returns' :P 13:08
13:09 sivoais joined 13:10 bluescreen10 joined
[Coke] (raTODObug) 13:12
13:15 SmokeMachine joined 13:17 sivoais left 13:19 sivoais joined
hoelzro considers SuShee's list of criteria for modules regarding Perl 6 13:23
masak hoelzro: url? 13:24
hoelzro su-shee.tumblr.com/post/46416661551...ou-equally
daxim AMEN in 128pt, bold, red, blinking 13:27
13:27 sivoais left
moritz automatically ignores red, bold text 13:28
daxim and since I, too, am an equal opportunity hater: panda, you hateful software, get a --prefix installer
13:29 sivoais joined 13:32 sivoais left 13:36 sivoais joined
hoelzro so yesterday I tried the following: const Int E_ACCES = -1 13:40
s/const/constant/
do constant and type constraints not mix?
masak should do. 13:44
rn: constant Int E_ACCES = -1
p6eval rakudo b972ca: OUTPUT«===SORRY!===␤Missing initializer on constant declaration␤at /tmp/fC0bCEIezv:1␤------> constant Int ⏏E_ACCES = -1␤ expecting any of:␤ statement list␤ prefix or term␤ prefix or meta-prefix␤»…
..niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Missing initializer on constant declaration at /tmp/d2gqPoC9K1 line 1:␤------> constant Int ⏏E_ACCES = -1␤␤Confused at /tmp/d2gqPoC9K1 line 1:␤------> constant Int ⏏E_ACCES = -1␤␤Parse f…
masak hm.
masak checks le spec
the spec doesn't seem to directly address type constraints. 13:46
Because it can declare names in "type" space, the C<constant>
declarator may not declare using the signature, which would be
ambiguous.
that's the closest I find.
S03:4919 13:47
but I can kinda see the probelm. you go 'constant', the parser goes "yeah, what's its name", then you go 'Int', the parser goes "uh, ok!", and then you go 'E_ACCES', and the parser goes "eh?" 13:50
13:51 skids joined
arnsholt I think I managed to get Rakudo to type my constants at some point 13:51
nr: my int constant FOO = 1 # Perhaps?
p6eval niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Malformed my at /tmp/P1VgExYSj1 line 1:␤------> my⏏ int constant FOO = 1 # Perhaps?␤␤Parse failed␤␤»
..rakudo b972ca: ( no output )
arnsholt Yup.
[Coke] r: my Int constant FOO = 4; say FOO; 13:54
p6eval rakudo b972ca: OUTPUT«4␤»
[Coke] r: my Int constant FOO = "4"; say FOO;
p6eval rakudo b972ca: OUTPUT«4␤»
[Coke] r: my Int constant FOO = "d"; say FOO; 13:55
p6eval rakudo b972ca: OUTPUT«d␤»
[Coke] it may not be doing what you think it's doing. ;)
14:04 drbean left 14:06 drbean joined 14:09 xilo left
hoelzro so what's the right way to do it? 14:16
according to spec?
14:17 jerome left
[Coke] Sounds like there isn't a way to do it according to spec. 14:19
hoelzro =( 14:20
imo, there should be =)
[Coke] looks at RT#117373 and wonders what the bug is. 14:21
14:23 Psyche^ joined
[Coke] oooh: capitalize isn't spec'd. 14:23
is that it? ;)
14:26 philroc joined, Patterner left, Psyche^ is now known as Patterner
colomon bug is tc / .tc NYI in rakudo 14:27
rn: say "this is a test".tc
p6eval niecza v24-35-g5c06e28: OUTPUT«This is a test␤»
..rakudo b972ca: OUTPUT«No such method 'tc' for invocant of type 'Str'␤ in block at /tmp/hMHNBY6IRx:1␤␤»
colomon rn: say tc "this is a test"
p6eval rakudo b972ca: OUTPUT«===SORRY!===␤Undeclared routine:␤ tc used at line 1. Did you mean '&lc', '&uc'?␤␤»
..niecza v24-35-g5c06e28: OUTPUT«This is a test␤»
colomon (if tc isn't spec'd, that's probably also a bug.) 14:28
[Coke] r: say capitalize "lower" # where is this spec'd?
p6eval rakudo b972ca: OUTPUT«Lower␤»
14:28 xilo joined
[Coke] .tc is spec'd. I don't see where tc() is, though perhaps it's some implicit "because it's a method on Str" thing. 14:28
colomon .... never heard of capitalize before. 14:30
[Coke] If so, perhaps we could make that implicit at the top of the Str spec.
er, explicit.
14:32 cognominal left 14:36 philroc left
pmichaud [Coke]: tc() exists by virtue of the "is export" clause on the method definition in S32/Str.pod 14:38
multi method tc ( Str $string: --> Str ) is export
14:38 cognominal joined
hoelzro found a type in Rakudo; pull request submitted! 14:44
14:44 jerome joined
masak [Coke]: the title of #117373 is "[TODO] &tc and .tc in Rakudo" 14:44
[Coke]: I could repeat that information in the body... but I submit a lot of tickets. I tend to streamline away redundancy. generally, if I filed the ticket, the subject line will contain (summarized) information about the observable. 14:46
[Coke] masak - in that case, the subject was fine. the 30 lines of output obfuscated the issue. 14:47
hoelzro++ 14:48
pmichaud: (is export) Thanks. Should we note what that implies in S32*/Str.pod ? 14:49
masak [Coke]: yeah, I couldn've trimmed that down more. it's still edited, mind. this time I went with showing the surrounding context, in order to demonstrate that all of the other subs and methods are in place, in Rakudo and Niecza.
[Coke] masak: so, another bug: capitalie is either missing from the spec, or not-missing from raudo. 14:50
*capitalize
dalek kudo/nom: 48447d4 | (Rob Hoelz)++ | src/core/traits.pm:
Fix typo
kudo/nom: a23458f | (Tobias Leich)++ | src/core/traits.pm:
Merge pull request #118 from hoelzro/nom

Fix typo
masak [Coke]: I'm wary of such bug reports. if you ask me, it's perfectly fine for an implementation to have unspec'd methods and subs. 14:51
[Coke]: but I agree it could well be a spec issue in this case. feel free to file one.
[Coke] ah. method capitalize() is DEPRECATED 14:52
(says rakudo) - IWBNI we warned about that.
(perhaps by default in evalbot.)
14:54 shinobicl joined
masak ah, that sounds familiar. 14:54
yes, we went through a few iterations in that part of the spec.
turned out OK, but the intermediate stages were painful-ish :) 14:55
shinobicl hi... what's the meaning of the '\' sigil? 14:56
masak shinobicl: assign-once variable. 14:57
shinobicl like a constant?
masak shinobicl: and it also conveys a "raw" context, either item context or list context, depending on where it came from.
yes, like a constant, but at runtime.
shinobicl oh, ok
15:01 daxim left
[Coke] do we need to announce the removal of capitalize before we remove it? (I assume we're removing it.) 15:01
masak ISTR a deprecation period or something like that. 15:03
15:04 jaldhar left
hoelzro callsame from method in a role will call the original method from the class, won't it? 15:05
I'm trying to create a routine trait for doing something after the original routine has returned 15:07
masak hoelzro: no, I think methods in classes hide methods in roles.
hoelzro dang 15:08
well, my role's method *is* being called
but the original is not
masak r: role R { method foo { say "whee!" } }; class C does R { method foo { say "squash'd!" } }; C.new.foo
p6eval rakudo b972ca: OUTPUT«squash'd!␤»
PerlJam hoelzro: show us? 15:09
hoelzro incoming gist
gist.github.com/hoelzro/5254952 15:10
masak ah, but that's a trait. :) different situation than just a role :) 15:12
hoelzro right
so how do I do this? =)
masak (because a trait causes the class to subclass anonymously)
looks compeltely right what you're doing.
hoelzro hmm
well, it doesn't work =(
masak runs code locally
huh. 15:13
hoelzro doesn't work for you either? 15:14
masak r: class C { method foo { say "there"; 17 } }; my $x = C.new but role { method foo { my $result = callsame; say "after $result" } }' $x.foo
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/2ueFZr78SF:1␤------> sult = callsame; say "after $result" } }⏏' $x.foo␤ expecting any of:␤ postfix␤ statement end␤ statement modifier␤ statement modifier loo…
masak r: class C { method foo { say "there"; 17 } }; my $x = C.new but role { method foo { my $result = callsame; say "after $result" } }; $x.foo
p6eval rakudo a23458: OUTPUT«there␤after 17␤»
masak I postulate that the trouble is with postcircumfix:<( )> somehow. 15:15
hoelzro I see...
masak it doesn't seem that 'callsame' in your code even calls the original sub.
hoelzro it doesn't 15:16
that's the issue =/
PerlJam hoelzro: have you run the rakudo debugger to see if it could help figure out what's going on?
hoelzro I have not
this will be my first time using it 15:17
timotimo_ you have been missing out :)
hoelzro heh
it just skips over the line with callsame
masak submits rakudobug 15:18
hoelzro so, I saw that my NQP patch made it in, but there was some fuss about installing nqp_const.pir? 15:21
is that still outstanding?
if so, I can fix it right now
15:22 PacoAir joined 15:24 shinobicl left
pmichaud hoelzro: I think it was taken care of already. 15:28
(nqp_const.pir)
hoelzro oh, ok
pmichaud since it broke nqp for people building Rakudo :-)
(imcc complains and stops compiling if it cannot find a .include'd file) 15:29
hoelzro ah ha!
grr 15:32
building NQP keeps coredumping =/
pmichaud [Coke]: (is export) .... well, a lot of the sections of the spec use 'is export' to show methods that get exported as subs, and it's documented in S12, so I'm not sure it needs a special callout in Str. 15:33
ack 'is export' S32-setting-library # gives a list 15:34
hoelzro is anyone else having problems building NQP on parrot 5.1.0? 15:41
I can't get it to build all of a sudden
15:41 cognominal left
PerlJam still uses Parrot 4.10.0 15:42
hoelzro hmm
maybe that's why
that's what I get for using Arch's official parrot package 15:43
moritz hoelzro: fwiw I had lots of trouble with build NQP when old parrot's and NQPs are lying around
hoelzro oh
interesting
I do have NQP installed
15:45 telex left 15:46 telex joined
moritz my theory is that the changes of include paths in parrot have made NQP more fragile with respect to such problems 15:49
but I haven't tested that theory yet
15:50 cognominal joined
hoelzro well, I uninstall nqp, and now it builds =/ 15:52
15:55 cognominal left, kivutar joined
xilo does perl6 have some sort of #typedef or alias or something? 16:05
masak r: constant FunnyInt = Int; say FunnyInt === Int 16:06
p6eval rakudo a23458: OUTPUT«True␤»
masak r: class Way::Too::Long::Typename::To::Type::Each::Time {}; constant X = Way::Too::Long::Typename::To::Type::Each::Time; say X.new 16:07
p6eval rakudo a23458: OUTPUT«Way::Too::Long::Typename::To::Type::Each::Time.new()␤»
16:07 kivutar left
xilo ah neat 16:10
ty
16:11 kivutar joined
masak pzh 16:13
moritz but don't use X for that, it makes exception users unhappy :-) 16:14
masak oops. 16:16
FROGGS should this be an error? because symbol X already exists 16:17
r: say X.WHAT
p6eval rakudo a23458: OUTPUT«(X)␤»
masak FROGGS: you're free to declare constants in your scope that hide things in the setting.
FROGGS okay 16:18
masak moritz: how do I see the things that the X package "contains"?
masak tried for like 10 seconds and couldn't figure it out
moritz r: say X.WHO.keys 16:19
p6eval rakudo a23458: OUTPUT«Inheritance Export Composition Import Redeclaration AdHoc OutOfRange Eval Constructor Method Bind Routine Str Range Item Hash Buf IO Numeric Comp ControlFlow OS Syntax Pod NYI Signature Placeholder Undeclared Attribute Phaser Obsolete Parameter Value Does Role Decl…
FROGGS r: say X::
p6eval rakudo a23458: OUTPUT«("Inheritance" => Inheritance, "Export" => Export, "Composition" => Composition, "Import" => Import, "Redeclaration" => X::Redeclaration, "AdHoc" => X::AdHoc, "OutOfRange" => X::OutOfRange, "Eval" => Eval, "Constructor" => Constructor, "Method" => Method, "Bind" =>…
16:22 cognominal joined
PerlJam that's still only one level deep into X 16:22
FROGGS r: say X::Inheritance::
p6eval rakudo a23458: OUTPUT«("Unsupported" => X::Inheritance::Unsupported, "UnknownParent" => X::Inheritance::UnknownParent, "SelfInherit" => X::Inheritance::SelfInherit).hash␤»
FROGGS PerlJam: there is no other way currently
moritz PerlJam: but you know how to program, no? :-) 16:23
PerlJam :-)
kresike bye folks
16:23 kresike left
masak PerlJam: I'm already working on it :) 16:23
PerlJam masak++
16:25 denisboyun_ joined 16:26 dmol joined
moritz it's just like nested hashes, except that you have to call .WHO on all the values 16:26
masak r: sub traverse(Str $name, Stash $s) { say $name; for $s.pairs { traverse $name ~ "::" ~ .key, .value.WHO } }; traverse "X", X:: 16:28
p6eval rakudo a23458: OUTPUT«X␤X::Inheritance␤X::Inheritance::Unsupported␤X::Inheritance::UnknownParent␤X::Inheritance::SelfInherit␤X::Export␤X::Export::NameClash␤X::Composition␤X::Composition::NotComposable␤X::Import␤X::Import::MissingSymbols␤X::Import::Redeclaration␤X::Import::OnlystarProto␤…
masak that does it.
locally, it produces 181 lines of output.
cognominal: I found fr.wikipedia.org/wiki/Mort_aux_cons helpful :) 16:33
(and I'm also very surprised that I can read that straight off, without any digital augmentation)
timotimo_ masak: that traverse sub outputs exactly one line locally for me o_O 16:37
masak my rakuodo may be slightly out-of-date. 16:38
16:38 dmol left 16:39 dmol joined 16:40 cognominal left
timotimo_ interestingly, $s.pairs works fine when i use X::. interesting. 16:40
16:48 cognominal joined
cognominal masak: you mean google glasses that google translate? :) I will add a link to HLM to fr.wikipedia.org/wiki/Habitation_%...%A9r%C3%A9 16:50
masa: At this hour, the connexion of my iPhone hotpoint is even less reliable than average :(
I retaliate by loading again and again the irc log.
masak :) 16:51
no, I meant any computerized means by which to understand French.
apparently, I'm slightly better at it than I remember. 16:52
cognominal I am reading esperanto wp pages. Because it uses some common features of common languages, I hope it will help me to learn other languages 16:55
masak in my experience, yes.
it puts grammar into a framework which is easy to understand and easy to reason about. 16:56
not just Esperanto, but all well-designed auxlangs.
cognominal indeed 16:57
17:04 FROGGS left 17:05 Chillance joined 17:11 denisboyun_ left 17:13 denisboyun_ joined 17:18 FROGGS joined
dalek : 1c3d8bb | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
allow list declaration and assignment
17:34
17:35 mmcleric joined 17:37 cognominal left 17:38 bluescreen10 left 17:39 SamuraiJack_ joined 17:41 MAAF604 joined, pupoque joined 17:43 pupoque left, pupoque joined
japhb S06 has several places that it uses 'sub (|$args)' syntax, but Rakudo reports this: 17:50
r: sub (|$args) { }
p6eval rakudo a23458: OUTPUT«Obsolete use of | or \ with sigil on param $args␤»
japhb Is Rakudo correct and the spec out of date, or is Rakudo's behavior a snapshot in the middle of changes? 17:51
moritz japhb: spec needs updating 17:52
japhb moritz, OK, thank you.
Hmmm. 17:54
moritz, Is that just for use in sub signature?
17:54 dakkar left
japhb What about: my (|$capture) := $func(); 17:54
17:55 fhelmberger left
japhb Actually, I see that both with and without parentheses on the left. 17:55
Sheesh: -> \$_ = OUTER::<$_> { . mumble } 17:56
Now what the heck is that supposed to turn into?
er, '.mumble' there, with no space. Finger fumble 17:57
17:59 moukeddar joined
moritz probably the now-gone 'is parcel' 18:03
ah, not gone
so it becomes -> $_ is parcel = OUTER::<$_> { .mumble } 18:04
dalek rlito: 31d8cd9 | (Flavio S. Glock)++ | src5/lib/Perlito5/X64/Assembler.pm:
Perlito5::X64::Assembler - movq fix
18:05
japhb moritz, OK, gotcha. So with my declarators, is |$ valid or invalid at this point? (I would *guess* the latter to remain parallel with sub syntax, but ...) 18:08
18:12 kivutar left 18:14 SmokeMachine left, SmokeMachine joined 18:15 SmokeMachine left, SmokeMachine joined, SmokeMachine left 18:16 SmokeMachine joined
dalek rlito: 217fdd3 | (Flavio S. Glock)++ | / (2 files):
Perlito5::X64::Assembler - add the "Immediate" type
18:18
japhb It looks like Rakudo recognizes but complains about this syntax: 18:25
r: sub foo(|args) { return args }; my (|$cap) := foo(1, 2, :bar, :baz(12)); say $cap;
p6eval rakudo a23458: OUTPUT«Obsolete use of | or \ with sigil on param $cap␤1 2 "bar" => Bool::True "baz" => 12␤»
japhb But removing the $ causes trouble: 18:26
r: sub foo(|args) { return args }; my (|cap) := foo(1, 2, :bar, :baz(12)); say cap;
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling op call: Error while compiling block : Error while compiling op call: Null PMC access in find_method('handle')␤»
[Coke] t/spec/S32-temporal/Date.t has a bogus test:
isa_ok Date.new(2010, 01, 01), Date, 'Date.new() returns a Date'; #OK octal
r: say Date.new(2010, 01, 01);
p6eval rakudo a23458: OUTPUT«Potential difficulties:␤ Leading 0 does not indicate octal in Perl 6; please use 0o1 if you mean that␤ at /tmp/VbWmf_FOHR:1␤ ------> say Date.new(2010, 01⏏, 01);␤ Leading 0 does not indicate octal in Perl 6; please use 0o1 if you mean…
[Coke] it has an "OK octal" but I'm not sure that's the right way to "fix" that. 18:28
timotimo_ arnsholt: i'd like to add Net::ZMQ to the package list, that okay with you? 18:33
18:37 moukeddar_ joined 18:39 census left, sahadev left
arnsholt timotimo_: Go ahead 18:39
18:39 moukeddar left
dalek ecs: eb862b2 | (Geoffrey Broadwell)++ | S (3 files):
Banish |$ and \$ in more places
18:40
rl6-roast-data: d56a953 | coke++ | / (3 files):
today (automated commit)
18:41
rlito: bedce48 | (Flavio S. Glock)++ | src5/lib/Perlito5/X64/Assembler.pm:
Perlito5::X64::Assembler - add the "Operand" type
osystem: 991583f | timo++ | META.list:
Add the Net::ZMQ module to the ecosystem.
18:44
18:46 rurban joined
timotimo_ arnsholt: hm, any low hanging fruit in zmq? 18:47
18:50 census joined 18:52 fgomez left 18:59 denisboyun_ left 19:01 denisboyun joined 19:02 fgomez joined 19:04 pupoque left
arnsholt timotimo_: More tests would be nice, I guess. Or just trying to use it for something 19:09
Using it is bound to shake out some bugs, I think
lue hello world o/ 19:10
masak lue! \o/ 19:11
19:13 pupoque joined 19:14 pupoque left
lue was my $*IN the trick to limit reassignment of a global variable to just that scope? (I realized some example code in my slangs gist may be incorrect) 19:16
19:17 pupoque joined
masak yes. that dynamic scope. 19:17
see github.com/sergot/IO-Capture-Simple/
sorear lue! \o/ 19:18
lue I realized the $~MAIN = HappyMAIN; module in my example at the end would've stayed that way outside of the module :) 19:19
19:19 am0c left 19:20 arlinius joined
dalek rlito: d3f8972 | (Flavio S. Glock)++ | src5/lib/Perlito5/X64/Assembler.pm:
Perlito5::X64::Assembler - add the "Operand" type - more
19:21
19:23 SamuraiJack_ left
dalek pan style="color: #395be5">perl6-examples: 3518ada | (David Warring)++ | parsers/CSSGrammar.pm:
use '||' to indicate parsing preference
19:27
lue Added some thoughts on the ~ twigil: gist.github.com/lue/5241230
(I'll likely be leaving slangs (mostly) dormant until TimToady's around to help figure out the details) 19:28
tadzik hello hello 19:31
lue hello tadzik o/
masak tadzik! \o/ 19:33
tadzik \o/ 19:34
19:36 SmokeMac_ joined 19:38 SmokeMachine left
dalek rlito: 7029a53 | (Flavio S. Glock)++ | src5/lib/Perlito5/X64/Assembler.pm:
Perlito5::X64::Assembler - add emit_operand
19:46
[Coke] wonders if he can get access to a new sparc machine for rakudo threading (esp. concurrency testing) 19:48
19:58 fgomez left 19:59 tgt left
timotimo_ the test failures from zavolaj unsettle me a bit 20:11
lue masak: ooc, how's the rest of p6cc coming? 20:14
20:15 fgomez joined 20:16 domidumont left
masak lue: meant to dig into t2 reviewing in the weekend that was. got distracted by resting. 20:17
lue ah.
masak lue: kind of distracted by $work in the week, but going to give it another shot the upcoming weekend.
I'm eager to get to the t2 reviews.
lue OK. Just wondering where the reviews have been is all :)
moritz four file found cabin 20:18
a celebrity causality
engulfed elapsed girl
masak that's beautiful. 20:19
but the second line has 9 syllables by my count :)
moritz oh well, counting was never my strength :-) 20:20
let's try again
two glove endorses
many elects emoted
bare elapsed fancy
lue (it goes to 8 if you pronounce causality "causal-ty") 20:21
PerlJam lue++ I was just thinking the exact same thing :)
lue (then if you remove the "a" at the beginning, you win!) 20:22
moritz meh, ilbot6 died :( 20:23
Connection error. in method run at /home/moritz/p6/prod/Net--IRC/lib/Net/IRC/Bot.pm:86
20:23 ilbot6 joined
masak moritz: 20:25
these haikus are fine
indescribably we have
done really nice work
moritz masak++ # though it looks cheated, ie not computer generated 20:26
20:26 fgomez left
lue
.oO(ilbot6 has died/logging this awesome channel/let's send him wishes)
20:26
masak it wasnät.
wasn't*
though I should have made it this:
these haikus are fine
inexplicably you have
done really nice work
;)
moritz now it's inexplicable that i do nice work? :-) 20:27
anocelot explicitly inexplicably is indubidably excellent.
masak moritz: I was aiming for subtle snarkiness. apparently I succeeded. 20:28
moritz aye :-)
masak I would love a snarky haiku generator, though.
masak is put in mind of the Cyberiad
moritz you mean it snarks at you when you try to make it generate a haiku? :-) 20:29
mst moritz++
masak by the way, I order anyone in here who hasn't read the Cyberiad to go read it at the earliest opportunity.
timotimo_ i still can't get my custom Perl6::Compiler to take a -M argument like the debugger does 20:30
japhb masak: I tried, years ago. Then I tried again, years after that. I couldn't finish it. 20:31
masak huh.
lue
.oO($ snarku --fast\n "Oh, I suppose this is urgent, then?")
moritz bald frighten canyon 20:32
governor elected cap
bald dancer daughter
masak *lol*
japhb So I've been away from #perl6 for two weeks. What's new and improved? :-)
anocelot japhb: The quantity of snark and haiku have increased significantly in the near past. 20:33
FROGGS japhb: Perl 6 is dead, Perl 5 will be the new upcoming Perl 7 :P
moritz japhb: say hello to ilbot6 (which currently logs to a test database) 20:34
lue FROGGS: I completely forgot! I guess I should go to #perl7 soon then :P
FROGGS hehe
yeah >.<
japhb moritz, awesome! 20:35
anocelot Quick - someone cybersquat that channel. XD
japhb anocelot, on which network? :-)
lue anocelot: done
(on freenode)
xilo r: my int8 $num = 65535; say $num; 20:36
p6eval rakudo a23458: OUTPUT«65535␤»
sorear masak: have not yet located a copy
xilo why does this work :|
japhb moritz, am I to assume that the Great Parrot IO Pains of Winter 2012-2013 are now over?
moritz japhb: I'm not sure yet
xilo: it seems that sized ints are only available for the purpose of nativecall, and don't do anything else in rakudo yet :( 20:37
xilo ah
sorear xilo: parrot-rakudo only supports four types - num, int, Str, Mu
xilo kinda silly not to enforce the limits
i see 20:38
sorear r: my str $s = 65535; say $s.perl
p6eval rakudo a23458: OUTPUT«"65535"␤»
sorear r: my int $p = pi; say $p.perl
p6eval rakudo a23458: OUTPUT«This type cannot unbox to a native integer␤ in block at /tmp/w_u0d3k1TX:1␤␤»
moritz well, it supports four native types, but many more composite types :-)
xilo yeah 20:39
20:39 moukeddar_ left
[Coke] is sad, his haikuinator would be much better with github.com/coke/p6-lingua-en-syllable 20:47
japhb Don't feel bad, [Coke] -- my haikuinator would be much better if it existed. ;-) 20:48
xilo so use it?
20:49 cognominal joined
[Coke] xilo - an early (buggier) version of it was included in my t2 submission which is now locked. 20:49
xilo ah
i see
[Coke] in retrospect I should have released it first and then used the released version as part of the submission! 20:50
r: raw.github.com/coke/p6-lingua-en-s...yllables.t 20:52
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/ukwI7h_EYu:1␤------> https⏏://raw.github.com/coke/p6-lingua-en-syll␤ expecting any of:␤ argument list␤ postfix␤ infix stopper␤ infix or meta-infix␤ st…
20:52 pupoque left 20:53 pupoque joined
timotimo_ is there a good reason for not implementinga REPL in pure perl6? rather than overriding Perl6::Compiler for it? 20:57
could i handle variables properly if i just used eval?
[Coke] I think if you can rewrite a chunk of rakudo in Perl 6, that's probably a good thing. What's it written in now? 20:58
timotimo_ nqp 20:59
the point is doing the ipython-compatible repl 21:00
hm, it's probably very possible with regcomp 21:01
21:01 dmol left, dmol joined
dalek osystem: f4f5956 | coke++ | META.list:
add Lingua::EN::Syllable to the ecosystem
21:01
[Coke] ah. if it's already in nqp, your returns go down a bit. Certainly worth trying in a branch, though.
timotimo_ don't know why i should? 21:02
[Coke] use a branch, or rewrite in Perl 6? 21:03
timotimo_ the latter
[Coke] yah, me either. ;) 21:04
timotimo_ r: my $p6 := pir::compreg__Ps('perl6'); say $p6.^methods; 21:05
p6eval rakudo a23458: OUTPUT«No such method 'dispatch:<.^>' for invocant of type 'Perl6::Compiler'␤ in block at /tmp/KZDlS2rj6l:1␤␤»
timotimo_ i guess i have exactly the methods i see in HLL::Compiler and Perl6::Compiler
[Coke] r: my $p6 := pir::compreg__Ps('perl6'); $p6.compile("say 3"); 21:06
p6eval rakudo a23458: ( no output )
timotimo_ r: my $p6 := pir::compreg__Ps('perl6'); say $p6.eval("say 3");
p6eval rakudo a23458: OUTPUT«3␤True␤»
timotimo_ r: my $p6 := pir::compreg__Ps('perl6'); say $p6.eval("3"); 21:07
p6eval rakudo a23458: OUTPUT«3␤»
timotimo_ well, seems good so far
21:07 rindolf joined
[Coke] r: my $p6 := pir::compreg__Ps('perl6'); $p6.barf("!"); 21:07
p6eval rakudo a23458: OUTPUT«No such method 'barf' for invocant of type 'Perl6::Compiler'␤ in block at /tmp/cbdbY07NeA:1␤␤»
pmichaud "haikuinator" sounds like something Dr. Doofenshmirtz would create. :-)
and with it I could take over the entire TRI LANGUAGE AREA! 21:08
[Coke] I will conquer all \ of the tristate area \ haikuinator !
21:09 cognominal left
timotimo_ huh. locally in a file i get "Nominal type check failed for parameter '$got'; expected Any but got Perl6::Compiler instead" 21:11
pmichaud timotimo_: using := and not = ?
r: my $p6 = pir::compreg__Ps('perl6'); say $p6
p6eval rakudo a23458: OUTPUT«Nominal type check failed for parameter '$got'; expected Any but got Perl6::Compiler instead␤ in block at /tmp/Pp9a2RJVwB:1␤␤»
timotimo_ oh, i didn't bind.
pmichaud the 'perl6' compiler isn't derived from Any.
lue
.oO("Iambic pentameter?" (beat) "Perry the Iambic Pentameter‽")
21:13
pmichaud 20:57 <timotimo_> could i handle variables properly if i just used eval?
21:13 pupoque left
pmichaud it gets tricky, because eval("my $a = 5"); eval("say $a"); doesn't quite do what you want. 21:14
21:14 pupoque joined
masak which is a *feature*. 21:15
[Coke] is TPF signed up for GSOC this year?
masak JavaScript leaks lexicals from eval. in Perl 6, the idea seems almost preposterous.
timotimo_ r: my $p6 := pir::compreg__Ps('perl6'); $p6.eval('my $var = 3'); $p6.eval('say $var'); 21:17
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Variable '$var' is not declared␤at /tmp/eXHhbpPijE:1␤------> say $var⏏<EOL>␤ expecting any of:␤ postfix␤»
pmichaud JavaScript leaks vars
seems almost preposterous 21:18
timotimo_ so, how do i do it? :(
pmichaud Perl 6 does not
21:19 cognominal joined, skids left
pmichaud timotimo_: the nqp repl keeps track of the lexical context created by the previous eval, and uses that as the outer context of the next eval. 21:19
timotimo_ r: my $outer_ctx; my $p6 := pir::compreg__Ps('perl6'); $p6.eval('my $var = 3', :$outer_ctx); $p6.eval('say $var', :$outer_ctx); 21:20
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Variable '$var' is not declared␤at /tmp/clM3sbbI69:1␤------> say $var⏏<EOL>␤ expecting any of:␤ postfix␤»
timotimo_ r: my $outer_ctx; my $*MAIN_CTX; my $p6 := pir::compreg__Ps('perl6'); $p6.eval('my $var = 3', :$outer_ctx); if $MAIN_CTX { $outer_ctx := $*MAIN_CTX }; $p6.eval('say $var', :$outer_ctx); 21:22
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Variable '$MAIN_CTX' is not declared. Did you mean '$*MAIN_CTX'?␤at /tmp/FlHA_FLxF7:1␤------> my $var = 3', :$outer_ctx); if $MAIN_CTX⏏ { $outer_ctx := $*MAIN_CTX }; $p6.eval(␤ expecting any of:␤ postfix␤»…
21:22 wk left
timotimo_ r: my $outer_ctx; my $*MAIN_CTX; my $p6 := pir::compreg__Ps('perl6'); $p6.eval('my $var = 3', :$outer_ctx); if $*MAIN_CTX { $outer_ctx := $*MAIN_CTX }; $p6.eval('say $var', :$outer_ctx); 21:22
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Variable '$var' is not declared␤at /tmp/YvuGj1sx45:1␤------> say $var⏏<EOL>␤ expecting any of:␤ postfix␤»
timotimo_ hm. what?
pmichaud you have to get the context created by the eval. 21:23
timotimo_ i don't see where the current code does that
21:24 fgomez joined
timotimo_ oh, is $*CTXSAVE responsible for that? 21:24
pmichaud seems right. You'd need to look at CTXSAVE / MAIN_CTX handling in Perl6::Actions to see the rest of the magic. 21:25
I have to pick up kids from school... bbl
timotimo_ ah, ok 21:27
xilo how do you change the starting value of an enum? 21:28
timotimo_ hm. but i can't store nqp::ctxcaller(nqp::ctx()) in a perl6 variable :| 21:32
21:32 kaare_ joined 21:36 pmurias joined
pmurias masak: re leaks vars, that is turned of by "use strict"; (yes with quotes ;) 21:37
timotimo_ wat? 21:38
masak pmurias: indeed.
pmurias: introduced in ES5, which is great for developers.
timotimo_ where do you put that?
masak timotimo_: you can put it at the top of your program, or at the top of a function.
timotimo_: the quotes are there for backwards compatibility, something that's very important in JavaScript. 21:39
timotimo_ m)
21:39 thou joined
timotimo_ masak: an idea how to do the nqp::ctxcaller(nqp::ctx()) thing? or a workaround? i don't even know what that's supposed to do :\ 21:41
masak timotimo_: 'fraid not :/
21:42 pupoque_ joined, kurahaupo joined 21:44 pupoque left 21:46 spider-mario joined
[Coke] woot, I have a module up on the board. 21:49
21:53 abth joined 22:00 BenGoldberg joined 22:01 BenGoldberg left, BenGoldberg joined, cognominal left 22:02 lustlife left 22:03 xilo left 22:08 cognominal joined
cognominal about "use strict". Perl has been good to steal from another language and languages retaliated by doing the same. 22:10
Somehow, for unknown reason that reminds me of Voltaire who said "Dieu a créé l'homme à son image et l'homme le lui a bien rendu" 22:12
mask, you get that one?
A loaded sentence, difficult to translate. 22:15
arnsholt "God created Man in his image, and Man returned the favour", or something like that?
cognominal yes 22:16
arnsholt Yay. It's been a while since I was happy with my French =)
cognominal Indeed, "returned the favour" is often used in a Voltarian ironic way. 22:17
somehow the way languages stole perl ideas to deface them made me think of that. 22:19
masak cognominal: yes, I get that one :) 22:20
cognominal: you can say "render someone a favor" in English too, I believe.
cognominal: I like that quote, by the way. 22:21
cognominal "le lui a bien rendu" is obviously ironic.
22:22 xilo joined
cognominal Voltaire was very sarcastic, Candide can be read as a phamplet against the insupportable Leibniz optimist. 22:23
masak yep.
that "bien" sounds like it means "and Man sure returned the favor" or something like that. 22:24
cognominal yup 22:25
masak \o/
cognominal overemphasis is often some form of sarcastic negation, like "yea, right!" 22:27
22:28 abth left
masak you can say that again. 22:28
cognominal overemphasis is common in extremist site, which makes them almost indistinguishable from "the onion"` caricature 22:29
:)
FROGGS std: use v5; print $OSNAME
p6eval std 86b102f: OUTPUT«ok 00:01 52m␤»
FROGGS std: use v5; use strict; print $OSNAME
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
22:33 dmol left
BenGoldberg perl6: say 'Japh,' 22:34
p6eval rakudo a23458, niecza v24-35-g5c06e28: OUTPUT«Japh,␤»
pmurias FROGGS: ? 22:35
FROGGS pmurias: ? 22:37
[Coke] Dr. Scott? 22:38
dalek : 8368bfa | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
dispatch $^O to $*OS and tell the boys we are v5.10.0
hoelzro where are the various dispatchers (ie. like the one for callsame) set up? 22:40
I'm trying to debug this callsame issue I'm seeing
FROGGS hoelzro: well, if this has something todo with the multi dispatcher, this is happening in nqp's C land
hoelzro I see 22:41
22:41 fgomez left
hoelzro well, I have an issue with callsame and sub traits 22:41
and I'm trying to fix it myself =)
example code: gist.github.com/hoelzro/5254952
FROGGS ++hoelzro 22:42
22:43 skids joined
hoelzro I'm just trying to figure out where pir::perl6_find_dispatcher__Ps('callsame'); ends up =) 22:46
FROGGS ya, currently doing the same
22:49 fgomez joined
FROGGS hoelzro: maybe here? rakudo/src/ops/perl6.ops:1279 22:51
pmurias FROGGS: I was wandering why do you pass use v5;print $OSNAME to std:
FROGGS pmurias: because I've not seen that it knows about that variable within the grammar 22:52
std: use v5; use strict; say $PMURIAS 22:54
p6eval std 86b102f: OUTPUT«ok 00:00 53m␤»
FROGGS but it looks like it just ignores uppercase vars
std: use v5; use strict; say $pmurias
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
hoelzro FROGGS: right, that's where the dispatcher is located
FROGGS hmmm
hoelzro but I'm wondering where it's set up
oh, I think I may understand 22:56
ok
it just finds $*DISPATCHER or something
raiph xilo: did you figure out how to set the starting value of an enum?
FROGGS hoelzro: nqp/src/guts/multi_dispatch.c line 89 22:57
hoelzro \o/
FROGGS++
xilo raiph: yea, but can you do it without having to specify the value of every enum after?
raiph xilo: feather.perl6.nl/syn/S09.html#User-...y_indexing
FROGGS hoelzro: but no warranty :P
raiph xilo: but that may be NYI (not yet implemented) 22:58
xilo ah
if i changed the starting value, i had to do it for every value after
unlike c/c++, etc where it would auto increment based off previous enum value 22:59
raiph r: my enum Months «:Jan(1) Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec»;
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Method 'returns' not found for invocant of class 'Parcel'␤»
raiph hmm
22:59 kaare_ left
FROGGS r: my enum Months <:Jan(1) Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec>; say Feb 23:00
p6eval rakudo a23458: OUTPUT«Feb␤»
FROGGS r: my enum Months <:Jan(1) Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec>; say Jan
p6eval rakudo a23458: OUTPUT«===SORRY!===␤Undeclared name:␤ Jan used at line 1␤␤»
FROGGS O.o
xilo yeah i tried all that lol
raiph xilo: well, the design is such that you can set up a user defined index, then...
xilo: set up a positional type that uses that index, then...
xilo: create arrayish objects that use that type or a subtype 23:01
xilo: or something like that
xilo lot of complication for something that (should) be relatively simple/standard :| 23:02
masak FROGGS: that does not mean what you think it means. :)
xilo or maybe because it allows strings as enum values
raiph and you could presumably have a slang in which @foo always uses that
xilo: i hear that you think it is complicated; i think it will appear very simple to users 23:03
xilo would need example
raiph xilo: but only when all the pieces are in place 23:04
xilo gotcha
raiph i'm thinking that, with all the pieces in place, you would prolly set some slang as the "standard" slang for your org or yourself; then when you write my @foo you'd get *your* preferred sort of array 23:05
xilo did you find that stuff on some NYI list? 23:06
hoelzro ok, found it 23:08
rakudo/src/Perl6/Metamodel/Dispatchers.pm
raiph xilo: no. it's all there in the spec. i have the advantage of having watched it evolve over the last decade. 23:11
xilo ah i see
raiph xilo: and rereading that bit of the spec (that i linked) i see i forgot a much more immediate path to what you want. 23:12
xilo: do you see the bit that says @dwarves{1} ------> @dwarves[0] ? 23:13
xilo yessir
raiph i think that looks simple 23:14
23:15 cognominal left
xilo how does that apply to enums tho 23:15
23:15 cognominal joined
raiph heh. it doesn't. so back to enums... :) 23:17
23:19 Gruber joined, baest_ joined 23:20 bruges_ joined, rindolf left, rindolf joined, apejens left
xilo heh 23:21
what i got works
just could be cleaner
23:21 colomon left, baest left, Grrrr left, spider-mario left 23:22 mtk left, bruges left, LoRe_ left, apejens joined, LoRe joined
raiph xilo: also, i'm confident that macros will have a big impact this year or next on how clean and sweet code can become 23:24
23:24 mtk joined
cognominal I agree with raiph 23:27
masak I hope you are right :)
there's some work to get there, espcially spec work.
23:29 rindolf left, rindolf joined 23:36 rindolf left, raiph left, Chillance left 23:39 raiph joined, denisboyun left 23:41 denisboyun_ joined
dalek : c0ad07c | (Tobias Leich)++ | lib/Perl6/P5Grammar.pm:
allow uppercase base markers
23:44
23:45 pupoque_ left
dalek : 09ec2c3 | (Tobias Leich)++ | t/spectest.data:
we pass num.t even if some tests are skipped
23:45
23:55 dmol joined