Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-02-20

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 * grondilu just fixed his Digest library which could not be compiled.
00:02 grondilu r: my \primes = grep &is-prime, 2 .. *; say primes[^100]
00:02 p6eval rakudo 8e6fa0: OUTPUT«2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 37…
00:05 jerome joined #perl6
00:14 alec__ joined #perl6
00:34 gdey joined #perl6
00:34 rprajapa quit
00:35 shinobicl joined #perl6
00:38 gdey joined #perl6
00:53 gdey joined #perl6
00:55 shinobicl left #perl6
00:59 anuby joined #perl6
01:09 hypolin joined #perl6
01:13 cognominal joined #perl6
01:19 mberends joined #perl6
01:26 diakopter mberends: howdy!
01:31 lustlife joined #perl6
01:42 benabik joined #perl6
01:42 cognominal__ joined #perl6
02:04 Vlavv_ joined #perl6
02:04 telex joined #perl6
02:15 shinobicl joined #perl6
02:17 grondilu joined #perl6
02:21 raiph__ joined #perl6
02:21 raiph_ joined #perl6
02:21 raiph joined #perl6
02:35 cognominal__ joined #perl6
02:43 shinobicl left #perl6
02:48 FROGGS_ joined #perl6
02:51 Yappo__ joined #perl6
03:12 cognominal joined #perl6
03:28 orafu joined #perl6
04:06 anuby joined #perl6
04:08 anuby joined #perl6
04:28 xinming joined #perl6
04:45 preflex_ joined #perl6
05:44 kaleem joined #perl6
06:06 TimToady http://rosettacode.org/wiki/Problem_of_Apollonius#Perl_6
06:07 timotimo oh, $.foo won't interpolate in strings?
06:08 timotimo (i suppose because it really is a method call)
06:08 hypolin joined #perl6
06:10 sorear it will.
06:10 TimToady hmm, maybe it should
06:10 sorear also, method calls interpolate in strings
06:11 sorear n: my $foo = "hello"; say "$foo.flip() world"
06:11 p6eval niecza v24-23-g0520c7c: OUTPUT«olleh world␤»
06:11 TimToady yeah, works fine without the brackets
06:13 TimToady fixed, timotimo++
06:19 TimToady incidentally, it's almost a requirement to use the mathematical unicode chars for sigilless names, because v21 is parsed as a version number...
06:21 Tedd1 joined #perl6
06:21 sqirrel joined #perl6
06:22 moritz \o
06:23 TimToady o/
06:24 sorear o/
06:27 lue Quick question: why were sigilless variables introduced? (I know it was possible before for constants, why extend to variables?)
06:28 moritz lue: to allow storing non-constant stuff without forcing a context on it
06:29 TimToady it only incidentally also made it really easy to introduce new terms to the grammar
06:29 TimToady (that won't be parsed as functions requiring arguments)
06:30 TimToady but since some people carp about all the sigils, it also kinda defuses that criticism
06:30 lue So, it's like leaving off the Int in C<my Int $a>, only instead of not caring about the value's type, you're not caring about the container type, correct?
06:33 TimToady it's the rawest form of binding we have
06:33 TimToady what used to be called "is ref", then "is parcel"
06:34 lue [ also, the Perl 6 solution for Apollonius looks the prettiest :) ]
06:34 TimToady well, that's mostly because of the the postfix:<²>
06:35 lue makes a world of difference though (** can get very noisy when it occurs many many times)
06:35 TimToady and the trick of defining a constructor sub outside of the class
06:36 TimToady it was originally translated from the python, which is full of x*x and such
06:36 FROGGS joined #perl6
06:36 FROGGS morning
06:37 TimToady o/
06:37 TimToady the next goal is to pass Mathematica; 20 more will do it...
06:38 TimToady well, assuming a non-moving target... :)
06:39 japhb All you need is greater velocity, equal acceleration, and enough time ...
06:40 TimToady we've always gone for greater acceleration regardless of the current velocity, which will always win eventually
06:43 sorear o/ FROGGS
06:44 sorear .oO( greater jerk is still better )
06:44 benabik joined #perl6
06:44 diakopter :)
06:45 FROGGS morning TimToady, japhb, sorear, diakopter
06:45 diakopter g'day
06:47 sorear o/ diakopter
06:48 FROGGS TimToady: have you seen the discussion about $/ and Str.subst? http://irclog.perlgeek.de/perl6/2013-02-19#i_6474949
06:48 quester joined #perl6
06:50 TimToady yes, been thinking about it
06:50 FROGGS k, thanks
06:50 TimToady wondering whether there should be an optional argument to the method forms with an "out" parameter that defaults to $/
06:51 TimToady so /foo/ is equivalent to .match(/foo/, :set($/)) or some such
06:51 TimToady or :set would set $/ by default
06:52 TimToady name negotiable, of course
06:53 sorear doesn't match already set $/ ?
06:53 TimToady but have to consider how it might also work with future changes to binding ops to solve the ~~ s/// problem
06:53 FROGGS nr: "abc".match(/a/); say $/
06:53 p6eval rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«「a」␤␤»
06:53 FROGGS nr: "abc".match("a"); say $/
06:53 p6eval rakudo 8e6fa0: OUTPUT«「a」␤␤»
06:53 p6eval ..niecza v24-23-g0520c7c: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Str␤  at /home/p6eval/niecza/lib/CORE.setting line 537 (Cool.match @ 24) ␤  at /tmp/fVZrgy0prq line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4233 (ANON @ 3) ␤…
06:53 sorear what is the ~~ s/// problem?
06:53 TimToady sorear: currently, but we might simplify that
06:53 TimToady the argument of using the methods as hypers is rather strong
06:54 moritz nr: my $x = "abc"; say $x ~~ s/a/A/;
06:54 TimToady you really don't want 100 methods trying to set $/ in parallel
06:54 p6eval rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«True␤»
06:54 moritz nr: my $x = "abc"; say $x ~~ s/x/A/;
06:54 TimToady so setting $/ is probably a bad default
06:54 p6eval rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«False␤»
06:54 moritz huh, it even kinda works
06:55 sorear TimToady: might be relevant: niecza's .subst supports an undocumented flag :inplace
06:55 FROGGS moritz: I did that in january or so
06:55 sorear n: my $x = "abc"; $x.subst(/a/,'A',:inplace); say $x
06:55 p6eval niecza v24-23-g0520c7c: OUTPUT«Abc␤»
06:55 TimToady um, why wouldn't that just be a .= instead?
06:56 moritz because we want to return a different value than we assign to $x
06:57 TimToady not that it matters in sink context, but I getcha
06:57 clkao joined #perl6
06:58 sorear I suppose I could have spelled it :$p = True
07:01 TimToady it almost feels to me like :inplace should just be a different method name
07:01 rindolf joined #perl6
07:01 TimToady it's an argument that does violence to the API
07:02 TimToady usually that's a smell that an option is doing too much work
07:02 Jimmy joined #perl6
07:03 rindolf Hi all.
07:03 rindolf TimToady: hi.
07:03 FROGGS are there other pieces in the spec that allow one to say that a method has side effects or not?
07:03 FROGGS hi rindolf
07:04 sorear there are two reasons :inplace couldn't easily be a different method:
07:04 TimToady otoh, setting $/ is subst is how we were hoping to set $0 for the replacement
07:04 sorear 1. subst doesn't ordinarily return a boolean "did this match?" flag
07:04 sorear 2. it would capture the $/ set
07:05 rindolf FROGGS: hi.
07:06 TimToady 1 is what I'm complaining about, doing violence to the contract
07:06 TimToady 2 can be worked around, methinks
07:08 FROGGS nr: my $x = "abc"; $x.subst(/(a)/,'A'); say $0
07:08 p6eval rakudo 8e6fa0: OUTPUT«「a」␤␤»
07:08 p6eval ..niecza v24-23-g0520c7c: OUTPUT«Any()␤»
07:09 FROGGS hmmm, if $/ should not be set, then $0 isnt allowed too
07:09 TimToady right, not without a :set or whatever we call it
07:09 FROGGS n: my $x = "abc"; say $x.subst(/(a)/,{ "$0$0" }, :inplace); say $x
07:09 p6eval niecza v24-23-g0520c7c: OUTPUT«True␤aabc␤»
07:10 FROGGS interesting
07:10 TimToady but that is going to break down with ».subst as someone pointed out
07:11 TimToady it may be cleaner to go back to the -> $/ {} mileau
07:12 TimToady or something macro-y for the replacement
07:16 diakopter r: macro marco { /hi/ }; marco
07:16 p6eval rakudo 8e6fa0: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
07:21 b1rkh0ff joined #perl6
07:26 alec__ joined #perl6
07:29 labster joined #perl6
07:33 lustlife joined #perl6
07:39 rindolf joined #perl6
07:48 diakopter phenny: ask masak known? r: macro marco { /hi/ }; marco
07:48 phenny diakopter: I'll pass that on when masak is around.
07:49 rindolf joined #perl6
07:50 domidumont joined #perl6
07:50 nebuchadnezzar joined #perl6
07:56 arnsholt Has masak presented a talk called Macro Polo yet?
07:58 nebuchadnezzar joined #perl6
07:58 rindolf joined #perl6
08:04 SamuraiJack joined #perl6
08:07 rindolf joined #perl6
08:15 rindolf joined #perl6
08:21 domidumont joined #perl6
08:21 dvj r: <a b c>.shift
08:21 p6eval rakudo 8e6fa0: OUTPUT«No such method 'shift' for invocant of type 'Parcel'␤  in block  at /tmp/HQQqSlfPZm:1␤␤»
08:21 dvj r: shift <a b c>
08:21 p6eval rakudo 8e6fa0: OUTPUT«No such method 'shift' for invocant of type 'Parcel'␤  in sub shift at src/gen/CORE.setting:6186␤  in block  at /tmp/m1GIvU3okv:1␤␤»
08:22 dvj how do I shift/pop from a list?
08:22 FROGGS r: say <a b c>.flat.shift
08:22 p6eval rakudo 8e6fa0: OUTPUT«a␤»
08:22 sorear r: my @list = <a b c>; say @list.shift
08:22 p6eval rakudo 8e6fa0: OUTPUT«a␤»
08:22 sorear r: my @list = <a b c>; say shift @list
08:22 p6eval rakudo 8e6fa0: OUTPUT«a␤»
08:23 sorear <a b c> is an immutable list literal (of type Parcel)
08:23 dvj r: say <a b c>.flat.perl
08:23 p6eval rakudo 8e6fa0: OUTPUT«("a", "b", "c").list␤»
08:23 rindolf joined #perl6
08:23 dvj r: say <a b c>.perl
08:23 p6eval rakudo 8e6fa0: OUTPUT«("a", "b", "c")␤»
08:24 dvj ok
08:25 TimToady <a b c>.shift is kind of like 42--
08:28 FROGGS nr: say 42--
08:28 p6eval rakudo 8e6fa0: OUTPUT«Cannot assign to a non-container␤  in sub postfix:<--> at src/gen/CORE.setting:3161␤  in block  at /tmp/VHMcVwVC9K:1␤␤»
08:28 p6eval ..niecza v24-23-g0520c7c: OUTPUT«Unhandled exception: Writing to readonly scalar␤  at /tmp/kpdqqXVX2A line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4233 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4234 (module-CORE @ 580) ␤  at /home/p6eval/niecza/li…
08:29 FROGGS rakudo's message could be better
08:30 TimToady agreed
08:31 TimToady Attempt to modify a readonly value
08:31 TimToady or so
08:32 TimToady and niecza should avoid the word "scalar"
08:33 SamuraiJack joined #perl6
08:33 rindolf joined #perl6
08:34 TimToady especially if <a b c>.shift ever throws that error, since it's a value, but not a scalar
08:34 TimToady well, except in the sense that everything is a scalar when viewed as an object...
08:35 moritz why does a Parcel even have a .shift method?
08:35 moritz nr: say so Any.^can('shift')
08:35 p6eval rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«False␤»
08:35 moritz nr: say so Parcel.^can('shift')
08:35 p6eval rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«False␤»
08:35 moritz rn: <a b c>.shift
08:35 p6eval niecza v24-23-g0520c7c: OUTPUT«Unhandled exception: Unable to resolve method shift in type Parcel␤  at /tmp/hGcM0NJzFT line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4233 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4234 (module-CORE @ 580) ␤  at /ho…
08:35 p6eval ..rakudo 8e6fa0: OUTPUT«No such method 'shift' for invocant of type 'Parcel'␤  in block  at /tmp/sHfeBW41yH:1␤␤»
08:36 mtk joined #perl6
08:36 moritz ok, I think I mis-backlogged something
08:37 cotto If I've got an nqp fix, should push to a perl6/nqp branch and submit a pull request?
08:37 moritz cotto: depends on the fix. If you don't want/need extra review, simply push to master
08:37 moritz (I can give you a commit bit if you don't have one)
08:37 moritz if you want review, then yes, a pull request
08:38 cotto I'm half-asleep.  I'll push to a branch.
08:38 dalek nqp/ops-fixes: f802b49 | cotto++ | src/ops/nqp (3 files):
08:38 dalek nqp/ops-fixes: clean up some ops definitions
08:38 dalek nqp/ops-fixes: review: https://github.com/perl6/nqp/commit/f802b49b20
08:40 moritz the missing semicolon are no-brainers
08:40 cotto so am I right now
08:40 cotto ;)
08:41 cotto knight
08:43 rindolf joined #perl6
08:44 moritz good knight, cotto
08:50 grondilu joined #perl6
08:51 grondilu rn: my ($k, $m) = -3, 10; .say for $a % $m, %a mod %m;
08:51 p6eval niecza v24-23-g0520c7c: OUTPUT«[31m===[0mSORRY![31m===[0m��Variable $a is not predeclared at /tmp/m5ZizPlvom line 1:�------> [32mmy ($k, $m) = -3, 10; .say for [33m�[31m$a % $m, %a mod %m;[0m��Variable %a is not predeclared at /tmp/m5ZizPlvom line 1:�------> [32mmy ($k, $m) = -…
08:51 p6eval ..rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$a' is not declaredâ�¤at /tmp/l1di5QpUzz:1â�¤------> [32mmy ($k, $m) = -3, 10; .say for $a[33mâ��[31m % $m, %a mod %m;[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
08:51 grondilu rn: my ($k, $m) = -3, 10; .say for $k % $m, %k mod %m;
08:51 p6eval niecza v24-23-g0520c7c: OUTPUT«[31m===[0mSORRY![31m===[0m��Variable %k is not predeclared at /tmp/F9BvbluWvh line 1:�------> [32mmy ($k, $m) = -3, 10; .say for $k % $m, [33m�[31m%k mod %m;[0m��Variable %m is not predeclared at /tmp/F9BvbluWvh line 1:�------> [32m $m) = -3, 10; …
08:51 p6eval ..rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '%k' is not declared. Did you mean '$k'?â�¤at /tmp/wXI0mkFIh9:1â�¤------> [32m ($k, $m) = -3, 10; .say for $k % $m, %k[33mâ��[31m mod %m;[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
08:51 grondilu rn: my ($k, $m) = -3, 10; .say for $k % $m, $k mod $m;
08:51 p6eval rakudo 8e6fa0: OUTPUT«7␤-3␤»
08:51 p6eval ..niecza v24-23-g0520c7c: OUTPUT«7␤7␤»
08:51 grondilu ^here
08:55 rindolf joined #perl6
09:07 grondilu rn: say -3 div 10;
09:07 p6eval niecza v24-23-g0520c7c: OUTPUT«-1␤»
09:07 p6eval ..rakudo 8e6fa0: OUTPUT«0␤»
09:08 moritz known rakudobug, iirc
09:08 rindolf joined #perl6
09:09 araujo joined #perl6
09:09 araujo joined #perl6
09:11 daxim joined #perl6
09:16 rindolf joined #perl6
09:32 quester left #perl6
09:36 kivutar joined #perl6
09:39 hypolin joined #perl6
09:46 dakkar joined #perl6
09:49 raiph__ joined #perl6
10:02 donaldh joined #perl6
10:03 spider-mario joined #perl6
10:05 woolfy joined #perl6
10:12 kivutar joined #perl6
10:22 kresike joined #perl6
10:22 kresike hello all you happy perl6 people
10:22 Ovid joined #perl6
10:24 Ovidius joined #perl6
10:32 erkan joined #perl6
10:32 erkan joined #perl6
11:03 am0c joined #perl6
11:35 fhelmberger joined #perl6
11:41 cognominal joined #perl6
11:52 cobra joined #perl6
12:13 SmokeMachine joined #perl6
12:20 cognominal joined #perl6
12:23 shinobicl joined #perl6
12:30 woolfy joined #perl6
12:38 cognominal joined #perl6
12:46 ObseLeTe joined #perl6
12:48 sqirrel joined #perl6
12:58 adu joined #perl6
13:08 cognominal joined #perl6
13:11 cognominal__ joined #perl6
13:25 cognominal joined #perl6
13:35 cibs joined #perl6
13:43 cognominal joined #perl6
13:44 census joined #perl6
13:46 ObseLeTe joined #perl6
13:48 cibs joined #perl6
14:16 bluescreen10 joined #perl6
14:16 cibs joined #perl6
14:21 PacoAir joined #perl6
14:23 cognominal joined #perl6
14:23 broquaint joined #perl6
14:24 cognominal joined #perl6
14:26 Psyche^ joined #perl6
14:28 kaare_ joined #perl6
14:31 uvtc joined #perl6
14:32 uvtc .u 𝑁
14:32 phenny U+1D441 MATHEMATICAL ITALIC CAPITAL N (𝑁)
14:40 uvtc TimToady: in the recently-written/mentioned Apollonius RC example, why use sigilless variables instead of (what seems to me, the more customary) sigilled ones? Ex., $v11, $v12...
14:41 timotimo because the $ isn't mathematical? or something?
14:45 FROGGS it looks more like a formular without the $, but I'm fond of it, a variable is a variable is a variable
14:45 bluescreen10 joined #perl6
14:49 benabik joined #perl6
14:54 tokuhiro_ joined #perl6
14:58 cibs joined #perl6
15:00 uvtc TimToady: also curious, why use the mathematical italic characters instead of ascii?
15:01 timotimo well, for one:
15:01 timotimo r: say v11.WHAT
15:01 Juerd Possibly, to change Perl from a write-only language to a read-only one?
15:01 p6eval rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared routine:â�¤    v11 used at line 1â�¤â�¤Â»
15:01 timotimo oh, huh?
15:02 Juerd r: my \v11 = 42; say v11.WHAT
15:02 p6eval rakudo 8e6fa0: OUTPUT«Int()␤»
15:02 timotimo TimToady mentioned version objects
15:02 moritz r: say v1.1.WHAT
15:02 p6eval rakudo 8e6fa0: OUTPUT«Version()␤»
15:03 timotimo oh, so it needs at least one .?
15:03 timotimo n: say v11.WHAT
15:03 p6eval niecza v24-23-g0520c7c: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Action method value:version not yet implemented at /tmp/Fezzp_yB39 line 1:â�¤------> [32msay v11[33mâ��[31m.WHAT[0mâ�¤â�¤Unhandled exception: invalid undef hereâ�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) …
15:03 timotimo n: my \v11 = 42; say v11.WHAT
15:03 p6eval niecza v24-23-g0520c7c: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Action method value:version not yet implemented at /tmp/zaInOKFJwT line 1:â�¤------> [32mmy \v11 = 42; say v11[33mâ��[31m.WHAT[0mâ�¤â�¤Unhandled exception: invalid undef hereâ�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1…
15:03 moritz timotimo: seems like
15:04 timotimo in that case, there's a bug in niecza :)
15:04 FROGGS uvtc: maybe to show that we can do awesome unicode stuff?
15:05 timotimo people will indeed look at it and say "oh, now it's read-only.", Juerd :)
15:09 uvtc FROGGS: Dunno. Maybe. TimToady: Whatever the reasons, I think the RC example would benefit from a short intro blurb explaining (A) why sigilless variables were used, and (B) why the mathematical unicode characters were used instead of just ascii. Just my ②¢. (I'd add the blurb myself, but don't know those answers.)
15:09 sjn Host * ServerAliveInterval 60
15:10 sjn Host * ServerAliveInterval 60
15:10 sjn Host * ServerAliveInterval 60
15:14 tokuhiro_ joined #perl6
15:17 timotimo arnsholt: what is "ZMQ_HAUSNUMERO" supposed to be? o_O
15:17 timotimo (also, it lacks one M it seems)
15:25 cognominal joined #perl6
15:28 timotimo so, perl6 will by default turn default values for arguments in parameter lists into closures if they look like code. is there a way to make it behave like python (evaluate the code once at "define-time", whatever that may mean) and then re-use that object forever?
15:28 timotimo r: sub foo($a = BEGIN { [] }) { $a.push(1) }; say foo; say foo; say foo;
15:28 p6eval rakudo 8e6fa0: OUTPUT«1␤1 1␤1 1 1␤»
15:28 arnsholt timotimo: It's just a really high number
15:29 timotimo arnsholt: is that actually in/from zmq?
15:29 arnsholt Do you have zmq-dev (or whatever your system calls it) installed?
15:29 timotimo oh, indeed i do
15:29 arnsholt Yeah. If you grep for the name in zmq.h it's explained
15:29 timotimo let me check the headers or something
15:29 arnsholt It's just a high number to make sure they don't conflict with already defined errnos
15:30 timotimo i see.
15:32 timotimo i suppose what i really want to "emulate" that python behavior is to just use a state variable, which python doesn't really have
15:36 uvtc left #perl6
15:40 arnsholt You can use a state variable, or just a global lexical
15:42 timotimo nah, global lexicals don't seem very nice for this, but i suppose it depends verily on the context.
15:44 FROGGS joined #perl6
15:47 timotimo arnsholt: i'm stumped by my not-knowing-about-zavolaj. i need getsockopt to work (in order to query RCVMORE) ... can you give me a few pointers?
15:49 am0c_ joined #perl6
15:49 timotimo should i create a big given with the possible values and look at the manual what they should return?
15:49 timotimo and create appropriate buffers?
15:49 ElDiabolo joined #perl6
15:58 cognominal joined #perl6
16:01 [particle] joined #perl6
16:13 donaldh joined #perl6
16:16 denisboyun joined #perl6
16:18 kresike bye folks
16:22 ObseLeTe joined #perl6
16:23 timotimo well, at least that's kind of what pyzmq does. it knows which options are int64 and such
16:24 arnsholt timotimo: I haven't really implemented getsockopt/setsockopt yet, actually
16:24 arnsholt They way they work/their signatures are set up are a bit fiddly
16:24 timotimo if you give me a bit of help, i can do it. i've got the python code in front of me right now
16:24 timotimo hold on, i'll give you a direct link
16:25 arnsholt But we could probably make it work
16:25 timotimo https://github.com/zeromq/pyzmq/blob/master/zmq/core/socket.pyx#L361
16:25 denisboyun joined #perl6
16:26 arnsholt It's mostly a question of doing it (which I haven't done) and possibly a bit of hackery
16:29 arnsholt I think the easiest solution is to make a couple of different getsockopt/setsockopt variants using is symbol(...) to handle the various kinds of arguments you can pass to the void *optval argument
16:30 arnsholt Does that make sense to you?
16:30 timotimo i do know know what "is symbol" does.
16:31 moritz it allows you install the Perl 6 sub under a different name than the C function
16:31 timotimo personally i would have tried a somewhat direct port of the cython code.
16:31 timotimo er, i would have implemented it as a method for the Socket class to be honest
16:34 arnsholt Yeah, it'll be in the Socket class. It's a workaround for the various pointer types that can be passed as option values (since if we just make it OpaquePointer the type checking will complain)
16:34 arnsholt And then only used from a method in Socket
16:34 skids joined #perl6
16:34 arnsholt It's just the internal plumbing that needs a bit of fiddling
16:36 arnsholt Can you wait an hour, hour and a half? It's just about time to make dinner here, and then I'll have some time to set this up with you after dinner
16:36 arnsholt (Today is work after dinner day anyways, so it works out quite well in that respect =)
16:37 timotimo sure, why not.
16:38 denisboyun_ joined #perl6
16:41 timotimo i'll prepare a list of options that take strings, 64 bit ints and such, so that you won't have to
16:43 SamuraiJack joined #perl6
16:46 arnsholt timotimo: Awesome! Thanks =)
16:46 arnsholt timotimo++
16:47 denisboyun___ joined #perl6
16:47 SmokeMachine joined #perl6
16:48 timotimo well, that was super simple. i could just copypaste and turn [ ... ] into set(...)
16:48 timotimo i guess i'll add more boilerplate
16:50 denisboyun_ joined #perl6
16:51 spider-mario joined #perl6
16:54 timotimo zavolaj has no int64 type?
16:56 jaldhar joined #perl6
16:56 timotimo i accidentally the whole thing. but i don't have a clue if it even works at all.
16:58 timotimo arnsholt: http://perpetuum-immobile.de/zmq_getsockopt.patch have a look if it makes sense to you
17:06 ElDiabolo joined #perl6
17:07 denisboyun___ joined #perl6
17:12 cognominal joined #perl6
17:19 denisboyun_ joined #perl6
17:20 [particle] joined #perl6
17:21 ElDiabolo joined #perl6
17:28 masak good evening, #perl6
17:29 phenny masak: 07:48Z <diakopter> ask masak known? r: macro marco { /hi/ }; marco
17:29 zby_home joined #perl6
17:29 TimToady also http://irclog.perlgeek.de/perl6/2013-02-20#i_6476740
17:29 masak diakopter: for the love of Gauss, don't call macros 'marco'. ;)
17:29 diakopter okay :)
17:29 Chillance joined #perl6
17:30 masak r: macro x { /hi/ }; x
17:30 p6eval rakudo 8e6fa0: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
17:30 diakopter r: macro mocra { /hi/ }; mocra
17:30 p6eval rakudo 8e6fa0: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
17:30 TimToady there was also some discussion of LTAness after that
17:30 masak :P
17:31 * masak back-clogs
17:32 japhb diakopter, How about calling your macros 'm'?  The abbreviation would be way easier to read.
17:33 timotimo hello masak
17:33 diakopter don't take it personally.. I'm trying to convince myself to care about readability in the face of cuteness..
17:33 TimToady .oO(You think that's readable today...)
17:35 diakopter (where trying implies failing)
17:38 cognominal joined #perl6
17:41 ObseLeTe joined #perl6
17:41 * PerlJam wonders about masak's wooden shoes that he wears on his back.
17:42 masak PerlJam: either that, or I was becoming retroactively congested.
17:43 masak now how's about I spend all this train time reviewing p6cc t1 solutions? how does that sound? :)
17:43 PerlJam masak++
17:43 masak I want to post the t1 thing before I leave for vacation on Saturday...
17:44 masak I'm about halfway through the reviewing.
17:44 diakopter masak+++
17:44 diakopter er
17:44 diakopter masak__
17:44 diakopter er
17:44 diakopter masak++
17:44 moritz ++masak
17:44 masak jnthn and I have had a fun $workday, by the way. we heckled each other on stage for 45 minutes :)
17:45 timotimo are there recordings? :)
17:45 diakopter "You're the best programmer in the world.." "no, you are.." "no, you are.."
17:45 masak :P
17:52 TimToady phenny: tell uvtc added the explanation to http://rosettacode.org/wiki/Problem_of_Apollonius#Perl_6 that you requested; thanks for requesting it :)
17:52 phenny TimToady: I'll pass that on when uvtc is around.
17:53 am0c joined #perl6
17:56 kaleem joined #perl6
17:57 tadzik hello #perl6
17:57 masak tadziku! \o/
17:57 moritz \o tadzik
18:01 tadzik \o/
18:05 cognominal joined #perl6
18:05 SamuraiJack_ joined #perl6
18:10 ElDiabolo masak, Hi. Still thinking about LINQ vs SQL.
18:10 ElDiabolo There are points for LINQ. It can do a non denormalizing join.
18:11 ElDiabolo But only if you join on equals.
18:15 moritz TimToady: should only /.../ cause a match in sink context, or any regex object?
18:15 denisboyun___ joined #perl6
18:16 gdey joined #perl6
18:16 moritz I vote for the former
18:18 denisboyun joined #perl6
18:19 masak ElDiabolo: I don't know enough about LINQ, to be honest. I'd need to study it more if I were to implement it.
18:22 arnsholt timotimo: Thanks for the patch!
18:23 arnsholt It's not quite what I had in mind, but it's well on its way
18:23 arnsholt timotimo++ # Doing the hard work for me =)
18:23 moritz .oO( every Perl 6 developer should have a minion who does the hard work for him)
18:23 tadzik certainly works for masak and his clones
18:24 moritz it's not really "masak and his clones"
18:25 moritz it's more like masak is the entirety of his clones
18:25 tadzik what if The Masak is the minion of one of the clones?
18:25 tadzik like a circular linked list
18:25 moritz not one major personality and then some inferior clones
18:26 cognominal joined #perl6
18:26 ElDiabolo masak, I found today that the other component that makes LINQ fun is already there. Its gather / take.
18:27 masak hm.
18:27 masak agree that you'd want laziness in there, yes.
18:27 ElDiabolo masak, Yes!
18:28 ElDiabolo masak, LINQ to db is necessarily lazy.
18:29 timotimo arnsholt: i'd be interested to know what you had in mind
18:31 arnsholt timotimo: Writing it up for getsockopt now
18:31 masak ElDiabolo: except when you're doing Rx, then it's necessarily observant ;)
18:33 ElDiabolo joined #perl6
18:41 denisboyun___ joined #perl6
18:42 cognominal joined #perl6
18:47 timotimo r: sub foo (Str(Any) $y) {...}
18:47 p6eval rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/V_1LAWIzZP:1â�¤------> [32msub foo (Str(Any) [33mâ��[31m$y) {...}[0mâ�¤    expecting any of:â�¤        statement listâ�¤        prefix or termâ�¤        prefix or meta-prefixâ�¤        new name to be definedâ�¤        formal…
18:47 timotimo didn't this work some time ago?
18:51 census_ joined #perl6
18:51 TimToady nope, NYI
18:51 timotimo that's probably a sizable chunk of work, too ...
18:52 timotimo std: sub foo (Str(Any) $a) { ... }
18:52 p6eval std 7551b8f: OUTPUT«Potential difficulties:â�¤  $a is declared but not used at /tmp/g834BzaX5c line 1:â�¤------> [32msub foo (Str(Any) [33mâ��[31m$a) { ... }[0mâ�¤ok 00:00 44mâ�¤Â»
18:52 timotimo maybe i could implement parsing that and throwing a NYI, though ...
18:53 FROGGS what exactly should Str(Any) $y do?
18:54 timotimo die with  "coercive type constraints not yet inmplemented"
18:54 PerlJam heh
18:55 FROGGS timotimo: I meant, what should it do when beeing implemented
18:55 FROGGS what is a coercive type constraint?
18:55 timotimo the function would now take any type of argument, but will coerce it to a string before assigning it to $a
18:55 skids rakudo used to have (or may still) some prestandard form of that.  Something like "Int $p as Str".
18:55 timotimo http://perlcabal.org/syn/S02.html#Coercive_type_declarations - this is the syn on it
18:55 PerlJam FROGGS: see S02:526
18:56 arnsholt jnthn: Does allowing NativeCall users to get the sizeof various types sound like a reasonable feature to you?
18:57 diakopter arnsholt: does to me :)
18:57 arnsholt I think it'd definitely be useful for things like int which could potentially vary in size
18:57 FROGGS arnsholt: yes, it does
18:57 FROGGS sizeof a cstruct is also useful I guess
18:58 FROGGS If you have to know its memsize for, say, SDL_RWops
18:58 PerlJam arnsholt: do we expect Perl 6 users to "size" things based on the available data type sizes of the underlying system?  (I think the answer is "yes", so we should export that to the user)
18:58 FROGGS timotimo, PerlJam: thanks
18:58 dalek perl6-roast-data: f0c310f | coke++ | / (4 files):
18:58 dalek perl6-roast-data: today (automated commit)
18:58 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/f0c310f745
18:58 dalek perl6-roast-data: 2672fa3 | coke++ | / (3 files):
18:58 dalek perl6-roast-data: today (automated commit)
18:58 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/2672fa3554
18:58 dalek perl6-roast-data: 0d5d865 | coke++ | / (4 files):
18:58 dalek perl6-roast-data: today (automated commit)
18:58 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/0d5d865167
18:59 arnsholt A C library could conceivably expect to get the size of something passed as an argument, certainly
18:59 diakopter arnsholt: definitely++
19:05 cognominal__ joined #perl6
19:06 am0c joined #perl6
19:08 TimToady the question strikes me more as "do we make C int available, regardless of size, in addition to int32 and int64?"
19:08 arnsholt I think we should
19:08 grondilu TimToady: why not?
19:08 diakopter I think so, b/c if we want to pass a buf to a C library that expects int*, we need to know how wide to space them
19:08 TimToady (the intent of int in Perl 6 is to reflect the size of the C int, whatever it is
19:08 TimToady )
19:09 arnsholt Some libraries have machine words as part of their API (sadly)
19:09 TimToady -1 :)
19:10 arnsholt So if we want to have some chance of talking to those libs with some kind of portability, I think we need it
19:10 [Coke] I cannot find the article/post where chromatic talked about rakudo not passing its own test suite. bother.
19:10 timotimo agreed. we won't make apis better by forbidding machine words in zavolaj
19:10 arnsholt Yeah, definitely -1, but fixing it is on the same order of magnitude of correcting all the people who are wrong on the internet =)
19:10 timotimo we will only make it harder for perl6 to interface with apis
19:11 TimToady sure, which is why it's already specced that way
19:11 arnsholt [Coke]: I'm pretty sure there are tests that are "not ok" in Perl 5 as well =)
19:11 arnsholt TimToady: Certainly, yeah
19:12 diakopter [Coke]: https://twitter.com/chromatic_x/status/299580714180018176
19:12 skids https://gist.github.com/skids/4998260  # Some thoughts I had a while back on native int ops that are annoyingly nonpresent in HLLs.
19:12 grondilu it's not just about portability.  Some people might want a machine int for speed or something, but don't want to bother wondering whether they should use 32 or 64 bits.
19:13 [Coke] diakopter: danke. that explains why I couldn't find it, it's got a url shortener. :P
19:15 TimToady moritz: the purpose of rx// is primarily to be a choose-your-ow-nquotes form of //, not to be the opposite of m//
19:15 TimToady *own
19:15 cognominal__ joined #perl6
19:16 TimToady so I think rx// and // should behave the same in sink context
19:18 masak so... why doesn't .uniq have a :by parameter?
19:19 TimToady and, in fact, it's specced that way at S05:2228
19:19 ElDiabolo joined #perl6
19:20 ElDiabolo joined #perl6
19:21 masak jnthn++ points out that in the method form (in analogy with .sort and .max), a &by argument should just be passed as a positional.
19:22 skids .oO(perlgeek irclog seems to strip leading colons from searches so you can't search perl6 adverbs)
19:24 timotimo hum, me has to build a newer nqp to build rakudo
19:24 skids .oO(yay github fixed "my gists")
19:24 arnsholt skids: Sure it doesn't just strip punctuation in general?
19:25 skids possibly
19:25 arnsholt That's pretty common for full-text search
19:25 timotimo everybody wants the colon!
19:25 skids the bitbucket gets the colon
19:26 [Coke] there, I can cross "replying to chromatic" off my mental todo list.
19:28 arnsholt [Coke]++
19:28 arnsholt Probably not productive to reply to chromatic, but nice paragraphs in the README
19:29 masak where? where?
19:30 arnsholt https://twitter.com/chromatic_x/status/299580714180018176
19:31 cognominal__ joined #perl6
19:33 masak [Coke]++
19:34 * timotimo spectests his grammar change
19:37 arnsholt Oh. Rakudo doesn't have an int64 type
19:37 * arnsholt goes to fix
19:39 rindolf Hi all.
19:40 arnsholt timotimo: Sorry for the delay. Took a bit longer than I expected =)
19:40 timotimo don't worry
19:40 timotimo i've found something else to hack on in the mean time
19:40 arnsholt Good, good =)
19:40 timotimo and whenever i get a little bored, i just look to my right where people are watching TPB:AFK on a beamer
19:40 TimToady rindolf: diakopter++ and I are having a mini-hackathon this morning
19:41 diakopter so far just thinkathon for me
19:41 arnsholt Oh, BTW. Is that pyx file you linked me to in a special format? It looks like Python, but has some bits of syntax I don't recognise
19:41 TimToady we're trying to figure out how one ought to integrate p5 and p6 threading in the least-insane way
19:41 timotimo it's cython
19:41 arnsholt cython?
19:42 * arnsholt googles
19:42 timotimo yes, it adds type information and such so that python code can be compiled
19:42 timotimo more or less
19:42 rindolf TimToady: ah.
19:42 timotimo makes it pretty easy to write bindings, too
19:42 arnsholt Oh, neat
19:42 rindolf TimToady: you may enjoy this bit from my homepage as well - http://www.shlomifish.org/humour/bits/Im-The-Real-Tim-Toady/
19:43 TimToady I guess it's more of a yackathon :)
19:43 timotimo shaveathon?
19:44 benabik joined #perl6
19:44 rindolf Nackathon.
19:44 [Coke] You could come over this way, we could have a Nyackathon.
19:45 TimToady too many dead-looking trees this time o' year...
19:45 timotimo > sub foo(Str() $foo) { ... } → coercive type declarations is not yet implemented. Sorry.      -  like?
19:45 * TimToady prefers a place where trees are always confused about what season it is...
19:45 timotimo oh, should remove the s from there, i think
19:45 TimToady or s/is/are/
19:46 timotimo well, i just do .NYI, so i'd have to either make a :plural named arg or add a .NYIs or something
19:47 TimToady then singular is fine
19:49 cognominal__ joined #perl6
19:50 timotimo nah, i'll add :plural. that's much prettier.
19:51 moritz TimToady: what about my $x = rx/a/; $x; 1;
19:51 moritz TimToady: should that cause a regex match?
19:51 moritz in other words, is regex match in void context syntactic?
19:51 timotimo oh my, i'll have to add a plural field to X::Comp::NYI
19:52 [Coke] TimToady: (\c) d'oh. I was just cutting and pasting his sample without thinking. Danke.
19:52 TimToady or you could just accidentally the "is"
19:52 PerlJam timotimo: don't shave the yak, just use the singular :)
19:53 timotimo well, i could also remove the "Sorry." from the end, because it will be thrown with a big ==Sorry!== at the top
19:53 timotimo TimToady: i could turn it into a verb, english supports that!
19:53 timotimo "declaring coercive types is not yet implemented", sound good?
19:54 TimToady "coercive types not yet implemented" is also fine
19:54 timotimo i can't accidentally the is, NYI .message is defined thusly: "$.feature is not yet implemented. sorry."
19:55 timotimo "coercive type declaring is not yet implemented" :)
19:55 TimToady that's not very Englishy
19:55 PerlJam timotimo: "Feature ``$.feature'' is not yet implemented"   ??  Then you can .NYI: "coercive type declaration"
19:55 colomon joined #perl6
19:56 timotimo that sounds quite stilted, i find :(
19:56 PerlJam yeah, I agree
19:56 TimToady I'd just s/is\s//
19:56 timotimo you mean for every invocation of NYI?
19:56 TimToady yeah
19:56 masak whoa, https://en.wikipedia.org/wiki/Operator-precedence_parser mentions PGE. that's gotta be old news at this point.
19:56 timotimo hm, why not
19:57 * arnsholt spectests
19:57 denisboyun_ joined #perl6
19:58 TimToady moritz: yes, it's syntactic
19:58 census joined #perl6
19:58 timotimo r: 1 + **
19:58 p6eval rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0m�HyperWhatever (**) is not yet implemented. Sorry. �at /tmp/tamBHOfCM_:1�------> [32m1 + **[33m�[31m<EOL>[0m�»
19:58 PerlJam timotimo: looking at the existing uses of NYI, I think TimToady's s/is\s// would work fine.
19:59 timotimo r: my Str Int $a;
19:59 p6eval rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Multiple prefix constraints is not yet implemented. Sorry. â�¤at /tmp/A_naCd7oCo:1â�¤------> [32mmy Str Int [33mâ��[31m$a;[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤Â»
19:59 timotimo yes, that's what i meant to say
19:59 moritz TimToady: ok, thanks
20:02 moritz $ ./perl6 -e '$_ = "foo"; /./; say $/'
20:02 moritz 「f」
20:05 timotimo my local implementation doesn't handle this correctly yet:
20:05 timotimo r: my Str(Any) $a = 1000;
20:05 p6eval rakudo 8e6fa0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/_iZC79AoNK:1â�¤------> [32mmy Str(Any) [33mâ��[31m$a = 1000;[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤        constraintâ�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        st…
20:06 cognominal__ joined #perl6
20:09 moritz the coercion syntax isn't implemented yet
20:09 PerlJam moritz: timotimo is adding the NYI for it.
20:09 moritz ah
20:09 TimToady or the nya, nya
20:09 TimToady Not Yet Awesome, I guess
20:10 PerlJam said twice for emphasis?
20:10 TimToady the lack of awesomeness is also not yet awesome
20:12 PerlJam timotimo: though, I don't understand ... are there two places in the grammar that parse type names?
20:13 PerlJam (I'm pretty sure I remember there being some contextual var that let you know if you were in a declaration or not)
20:16 timotimo PerlJam: yes, the one is type constraint, which can also have a constant value (as in multi MAIN("foo", $bar) { ... }) and when you have my, which won't allow type constraints
20:17 PerlJam Does   Str(Any) ::T $thing   make sense?  Wouldn't it just make ::T be Str?  or would ::T capture the type before coercion?
20:17 timotimo but i've made a mistake now and the core setting won't parse any more :(
20:17 PerlJam timotimo: you've won the "breaking core" achievement!  :)
20:18 dalek nqp/ops-fixes: 031801c | cotto++ | src/ops/nqp_dyncall.ops:
20:18 dalek nqp/ops-fixes: use a non-empty default case
20:18 dalek nqp/ops-fixes: review: https://github.com/perl6/nqp/commit/031801cf2d
20:18 timotimo oh i've broken the core setting a bunch of times before
20:18 dalek rakudo/nom: 6392d64 | (Arne Skjærholt)++ | src/core/natives.pm:
20:18 dalek rakudo/nom: Add int64 type.
20:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6392d64640
20:20 uvtc joined #perl6
20:21 timotimo i unbroke it, fortunately
20:21 cognominal__ joined #perl6
20:22 uvtc TimToady: thanks! ↓↓
20:22 phenny uvtc: 17:52Z <TimToady> tell uvtc added the explanation to http://rosettacode.org/wiki/Problem_of_Apollonius#Perl_6 that you requested; thanks for requesting it :)
20:22 timotimo okay, spectests and then pull request :D
20:23 uvtc But, what does "SSA style" mean? ("Finally, writing in an SSA style tends to help the optimizer.")
20:23 timotimo static single assignment
20:23 timotimo basically you turn a = 5; a = a + 10; a = a * 10;  into  a1 = 5; a2 = a1 + 10; a3 = a2 * 10;
20:23 timotimo so you'll have every name on the left side of an equals sign at most once
20:23 timotimo (plus some magic for loops and branches)
20:25 * arnsholt derps
20:26 masak "some magic"? you left out all the good parts! :P
20:26 arnsholt star: use NativeCall; my CArray[int] $foo .= new; $foo[0]; say "alive";
20:26 p6eval star 2012.12: OUTPUT«alive␤»
20:26 timotimo i don't really know the good parts, sorry :(
20:26 arnsholt star: use NativeCall; when 1 { my CArray[int] $foo .= new; $foo[0]; say "alive"; }
20:26 p6eval star 2012.12: OUTPUT«use of uninitialized variable $a of type Any in numeric context  in block  at /tmp/4KD8FMDH0k:1␤␤»
20:27 arnsholt I'm going to assume this is a NativeCall bug, but does anyone have any clue what might be going on?
20:27 arnsholt star: use NativeCall; when 1 { my CArray[int] $foo .= new; $foo[0] = 1; say "alive"; } # What I actually intended
20:27 p6eval star 2012.12: OUTPUT«use of uninitialized variable $a of type Any in numeric context  in block  at /tmp/Ma0tDchZWJ:1␤␤»
20:27 benabik joined #perl6
20:28 moritz star: use NativeCall; my CArray[int] $foo .= new; say $foo[0].perl
20:28 p6eval star 2012.12: OUTPUT«(signal SEGV)»
20:28 uvtc timotimo: Ah. Thanks. Added link in the RC page to the SSA wikipedia page.
20:28 arnsholt Oooh, fun. That's a bug as well
20:28 arnsholt moritz++
20:28 TimToady why is that written that way rather than my int @foo[$size] as S09 specs?
20:29 timotimo All tests successful.  -  yay
20:29 dvj r: my $a = "adsf"; $a ~~ s/ds/{ substr($1, 0, 1) }/;
20:29 p6eval rakudo 8e6fa0: OUTPUT«Nominal type check failed for parameter '$s'; expected Cool but got Any instead␤  in sub substr at src/gen/CORE.setting:2407␤  in block  at /tmp/yinhhItLMW:1␤␤»
20:29 arnsholt I don't really know. jnthn decided to =)
20:29 dvj what $s?
20:30 TimToady a leaky abstraction, apparently
20:30 labster joined #perl6
20:31 arnsholt Yeah, I think the error I get up there is a bug in the void context code
20:31 benabik sub substr(Cool $s, $pos, $chars?) { $s.substr($pos, $chars) }
20:32 arnsholt star: use NativeCall; my $stuff = 1; given $stuff { when 1 { my CArray[int] $foo .= new; $foo[0] = 1; say "alive"; } }
20:32 p6eval star 2012.12: OUTPUT«alive␤»
20:32 arnsholt Hmmm.
20:32 arnsholt Ooooh, never mind. Braino on my part
20:33 benabik dvj: The error happens because $1 never gets assigned in your code.
20:33 benabik dvj: So you end up calling substr(Any, 0, 1)
20:33 moritz dvj: that of method subst, which s/// desugars to
20:33 dvj ok
20:33 dvj I guess I'll use $/ instead :)
20:34 benabik moritz: No, in the substr that he calls in the RHS of s///
20:34 moritz oh
20:34 benabik dvj: Perhaps you meant $0 ?
20:34 donaldh_ joined #perl6
20:35 arnsholt dvj: There is no $1 since you don't have any capture parens
20:36 benabik r: my $a = "adsf"; $a ~~ s/(ds)/{ substr($0, 0, 1) }/; say $a
20:36 p6eval rakudo 8e6fa0: OUTPUT«adf␤»
20:36 dvj benabik: arnsholt: you're right. My example was bad. I'm porting some perl5 code where it's actually $1
20:36 dvj I just simplified to trigger the $s error
20:36 benabik dvj: s/(ds)/{ substr($0, 0, 1) }/ works
20:37 dvj 16   $string ~~ s:g/<<(year|day|hour|minute|second)s?>>/{ $1.substr(0,1) }/;
20:37 benabik Error seems somewhat LTA.  Perhaps it should say something like "in first argument to substr" instead.  :-/
20:37 dvj does the second match (because of :g) go into $1?
20:40 dvj nevermind, $0 is what I want :)
20:40 dvj thanks
20:41 timotimo https://github.com/rakudo/rakudo/pull/104 - i made a contribution \o/
20:41 moritz benabik: it says substr in the backtrace
20:42 benabik moritz: Right.  But how does $s connect to that?  Can't tell unless you open the setting.
20:43 benabik Or maybe if it printed the signature.
20:43 donaldh_ seen jnthn
20:44 benabik donaldh: ENOALOHA
20:45 donaldh_ benabik: thx, thought I'd syntax errored there
20:45 uvtc scene jnthn
20:46 arnsholt timotimo: Take a look at my latest commit. See what I'm doing?
20:46 timotimo in net::zmq?
20:46 benabik donaldh_: bacek had to shut down aloha and nobody's set up a replacement host yet.  :-/
20:46 benabik The code and database are all online though.
20:47 timotimo ah, i see what you're doing
20:47 timotimo do you think that already works?
20:50 grondilu About S14:  if I have a parametric type such as 'role Foo[Int $bar] {}', there is no implicit accessor to $bar, is there?  If I want one I need to write it myself 'method bar { $bar }'?
20:50 benabik role Foo[Int $.bar] ?
20:51 grondilu rn: role Foo[Int $.bar] {}; my $x = 13 but Foo[42]; say $x.bar;
20:51 p6eval niecza v24-23-g0520c7c: OUTPUT«Unhandled exception: No 'self' available for attributive?␤  at /tmp/3DUzicIomd line 0 (role-Foo @ 1) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting line 1388 (infix:<does> @ 23) ␤  at /home/p6eval/niecza/lib/CORE.settin…
20:51 p6eval ..rakudo 8e6fa0: OUTPUT«None of the parametric role variants for 'Foo' matched the arguments supplied.␤Unable to bind attributive parameter 'bar' - could not find self␤  in any specialize at src/gen/Metamodel.pm:2044␤  in any specialize at src/gen/Metamodel.pm:1701␤  in  at src/gen/Metamo…
20:52 benabik grondilu: I didn't think it actually existed.
20:53 grondilu rn: role Foo[Int $bar] {}; say my $x = 13 but Foo[42];
20:53 p6eval rakudo 8e6fa0: OUTPUT«13␤»
20:53 p6eval ..niecza v24-23-g0520c7c: OUTPUT«Potential difficulties:â�¤  $bar is declared but not used at /tmp/sYOMnufeux line 1:â�¤------> [32mrole Foo[Int [33mâ��[31m$bar] {}; say my $x = 13 but Foo[42];[0mâ�¤  $x is declared but not used at /tmp/sYOMnufeux line 1:â�¤------> [32mrole Foo[Int $bar] {}; s…
20:54 arnsholt timotimo: Yeah. Requires Rakudo HEAD (for the int64 type)
20:54 benabik r: role Foo[Int $bar] {}; my $x = 13 but Foo[42]; say $x.bar
20:54 p6eval rakudo 8e6fa0: OUTPUT«No such method 'bar' for invocant of type 'Int+{Foo}'␤  in block  at /tmp/oKWEu1i4Jx:1␤␤»
20:54 benabik rn: role Foo[Int $bar] { method bar { $bar } }; my $x = 13 but Foo[42]; say $x.bar
20:54 timotimo cool, thanks, alot! :)
20:54 p6eval rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«42␤»
20:54 arnsholt I'm not 100% sure it'll work as intended (untested, after all) but I think it's in the right direction
20:55 arnsholt Also, I'm not quite happy with the interface. If you have ideas for a better interface, feel free
20:56 timotimo er, does that return actually work?
20:56 donaldh_ benabik: is hosting aloha onerous?
20:57 arnsholt No it doesn't. This is why you always should test code =D
20:57 benabik donaldh_: I don't think so.  There was talk of putting it on feather, but nobody's taken the time yet.
20:57 timotimo :D
20:58 donaldh_ A task for someone with permissions _and_ tuits then
20:59 benabik donaldh_: I don't know that anyone would complain if someone hosted aloha elsewhere.  :-D
21:00 denisboyun joined #perl6
21:01 arnsholt timotimo++ # More cleverer than me
21:01 arnsholt timotimo: Let's try again with the new HEAD =)
21:02 timotimo hah, not actually cleverer. i think my lesser skill helped me out here :)
21:02 arnsholt Just a bit more distance from the code, I think
21:02 arnsholt I forgot the details =)
21:02 timotimo all right :)
21:06 arnsholt timotimo: Are there some tests in https://github.com/zeromq/pyzmq/ and I'm just not finding them, or are there none?
21:07 timotimo i don't know to be honest :(
21:08 arnsholt 'k
21:09 timotimo building rakudos as we speak
21:09 timotimo don't really have code to test it on, though, maybe i'll whip up a quick bit of test code
21:10 mtk joined #perl6
21:10 arnsholt Yeah, nothing to test on for me either =/
21:10 arnsholt Should probably get around to fixing that sometime soon =)
21:12 timotimo how hard would it be to copypaste-program setsockopt from the code we have now?
21:12 timotimo can i take the type from the hash and coerce a value to it or something?
21:13 arnsholt No need to coerce
21:14 arnsholt Should be pretty straightforward to copy-paste code setopt
21:14 timotimo i'll still have to keep the given/when?
21:14 arnsholt Yeah, to dispatch to the correct variant of zmq_setsockopt
21:15 arnsholt And create the appropriately typed CArray
21:15 timotimo well, there is only one variant of zmq_setsockopt :P
21:15 timotimo oh, what?
21:15 timotimo suddenly there's more
21:16 arnsholt You'll have to create the setsockopt variants, similar to what I did with getsockopt
21:16 arnsholt Should still only be one setsockopt
21:16 timotimo yes, i thought so
21:17 donaldh joined #perl6
21:23 * jnthn is home :)
21:24 kjs__ joined #perl6
21:24 bruges_ joined #perl6
21:24 timotimo what's the current way to express return nothing? just return; at the end?
21:29 timotimo arnsholt: would you have a problem with turning the different zmq_getsockopts and setsockopts into a multi? then we could remove the last line of each of the when cases after the given
21:31 timotimo well, maybe that'd be a bit less efficient
21:34 arnsholt I'm not sure if multis would work
21:35 arnsholt It'd be cool to try though!
21:35 arnsholt But perhaps keep what we have until we know it works (or it gets hacked into something that does work), and then try the multi idea then?
21:35 arnsholt I don't think anyone's tried to use multis with Zavolaj yet =)
21:37 arnsholt Bedtime for me now. But feel free to commit code for setsockopt and I'll look at it tomorrow
21:38 timotimo good night!
21:38 timotimo i won't stay up very much longer, though
21:44 skids r: use NativeCall; multi sub f (CArray[int] $b) { "[int]".say }; multi sub f (CArray[int8] $b) { "[int8]".say; }; my CArray[int8] $a .= new(); f($a)
21:44 p6eval rakudo 6392d6: OUTPUT«===SORRY!===␤Could not find NativeCall in any of: /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/site/lib, /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/vendor/lib, /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/lib, /h…
21:44 skids ah
21:44 skids star: use NativeCall; multi sub f (CArray[int] $b) { "[int]".say }; multi sub f (CArray[int8] $b) { "[int8]".say; }; my CArray[int8] $a .= new(); f($a)
21:44 p6eval star 2012.12: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'f' will never work with argument types (CArray+{IntTypedCArray}) (line 1)␤    Expected any of:␤    :(CArray+{IntTypedCArray} $b)␤    :(CArray+{IntTypedCArray} $b)␤»
21:45 timotimo :(
21:46 skids Though multis with P6 arguments in an "is repr" class do still work fine.
21:46 timotimo does the dispatcher have problems with thet mixed in roles?
21:47 jnthn Not entirely sure what's going on there
21:49 skids r: role A[$i] { };  multi sub f (A[0] $b) { "0".say }; multi sub f (A[1] $b) { "1".say; }; my A[1] $a; $a = A[1].new(); f($a) # this works
21:49 p6eval rakudo 6392d6: OUTPUT«1␤»
21:50 timotimo what if there's two composed roles?
21:51 skids Those are punned roles, I would assume.
21:51 skids so in effect classes.
21:52 skids r: role A[$i] { };  my A[1] $a .= new(); #interestingly...
21:52 p6eval rakudo 6392d6: OUTPUT«Cannot assign to a non-container␤  in method dispatch:<.=> at src/gen/CORE.setting:1014␤  in  at src/gen/Metamodel.pm:1338␤  in block  at /tmp/dkKR9JuZBb:1␤␤»
21:54 timotimo well, /me decommutes &
22:05 shinobicl left #perl6
22:06 dalek nqp: 7fc8127 | jnthn++ | src/ (2 files):
22:06 dalek nqp: Move mark hash to ParseShared.
22:06 dalek nqp:
22:06 dalek nqp: This should get rid of some bugs due to over-sharing of the hash, but
22:06 dalek nqp: also makes it easy to get rid of 2 more Q:PIR chunks.
22:06 dalek nqp: review: https://github.com/perl6/nqp/commit/7fc8127d32
22:10 grondilu rn:  role Mod[$modulus] does Real { method Bridge { self % $modulus } }; say (13 but Mod[10])
22:11 p6eval niecza v24-23-g0520c7c: OUTPUT«Unhandled exception: Method 'Bridge' must be resolved by class 'Int+Mod[curried]' because it exists in roles 'Mod[curried][...]' and 'Mod[curried][...]'␤  at /home/p6eval/niecza/lib/CORE.setting line 1388 (infix:<does> @ 23) ␤  at /home/p6eval/niecza/lib/C…
22:11 p6eval ..rakudo 6392d6: OUTPUT«Ambiguous call to 'gist'; these signatures all match:␤:(Numeric:D : Mu *%_)␤:(Numeric:D : Mu *%_)␤␤  in method gist at src/gen/CORE.setting:902␤  in sub say at src/gen/CORE.setting:7602␤  in block  at /tmp/W2a14FBppc:1␤␤»
22:11 grondilu :(
22:12 grondilu why couldn't it be that simple to define a modular integer?
22:24 donaldh jnthn: I sent you a pull request for nqp-jvm yesterday. findcclass and iscclass fixes
22:24 jnthn donaldh: Yes, saw that a few moments ago in my inbox :)
22:24 jnthn Thanks, will look soon :)
22:29 jnthn donaldh: oh, good catch on the PUNCT_TYPES
22:30 jnthn And...a few other things :)
22:30 dalek nqp-jvm-prep: f810b42 | (Donald Hunter)++ | / (3 files):
22:30 dalek nqp-jvm-prep: Added iscclass tests. Fixed iscclass to pass tests. Character.getType
22:30 dalek nqp-jvm-prep: does not return a bitfield. Chars 0-31 all return Character.CONTROL.
22:30 dalek nqp-jvm-prep: Added findcclass, findnotcclass and tests.
22:30 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/f810b42446
22:30 dalek nqp-jvm-prep: ad52981 | jonathan++ | / (3 files):
22:30 dalek nqp-jvm-prep: Merge pull request #17 from donaldh/findcclass
22:30 dalek nqp-jvm-prep:
22:30 dalek nqp-jvm-prep: Added findcclass, findnotcclass, tests. Added iscclass tests. Fixed iscclass to pass tests.
22:30 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/ad52981b24
22:32 jnthn donaldh++
22:35 uvtc Would be interesting if something like http://perl6.org/compilers/features could be autogenerated using tests is roast. That is, if each line in the feature matrix corresponded with a test (or set of tests).
22:36 jnthn uvtc: It really isn't that much to maintain the JSON file; it only needs updates now and then.
22:36 donaldh jnthn: I'm looking at bcel and invokedynamic
22:36 jnthn ooh, yaya
22:36 jnthn *yay
22:36 donaldh jnthn: bcel-5.2 does not support it. We'd need bcel-6.0-SNAPSHOT
22:37 donaldh jnthn: i.e. svn trunk
22:37 jnthn Well, we check in the JAR, so if you can throw in an updated one, that works for me
22:37 uvtc jnthn: Is there currently a way to graphically see how much of (and which parts of) Roast a given impl passes?
22:38 jnthn donaldh: I'll give you a commit bit so you can do it more easily
22:39 jnthn (done)
22:39 jnthn uvtc: Not as far as I know. I guess the numbers [Coke]++ produces each day are an easy data source
22:39 uvtc Seems like it would be quite cool to see a color-coded icon for each top-level directory in roast. Red ---> reddish-green --> greenish-red ---> green.
22:40 donaldh jnthn++
22:40 uvtc jnthn: Oh, coke/perl6-roast-data
22:40 uvtc jnthn: thanks.
22:47 cognominal joined #perl6
22:53 masak 'night, #perl6
22:53 labster 'night masak, 'morning #perl6
22:55 tadzik hello hello
22:55 * jnthn wonders where it's morning :)
22:56 uvtc I've heard that Perl 6 syntax is more regular than Perl 5. Made me think:
22:56 uvtc "It would take 5 bowls of Perl 5 to give you the same syntactic regularity as one bowl of Perl 6."
22:56 labster jnthn: japan probably
22:57 uvtc Oh man. I need to get a humor limiter for this keyboard.
22:58 labster uvtc: we'll put that on the perl 6 box when rakudo hits the shelves
22:59 labster I started playing around with lue's Lingua::EN::Number::Ordinal, and started thinking about a way to use a more language-independent algorithm... and ended up with this:
22:59 labster % perl6 number.p6 1284000126
22:59 labster 1284000126 ->
22:59 labster en: one billion two hundred eighty-four million one hundred twenty-six
22:59 labster es: uno mil doscientos ochenta y cuatro milliones ciento veintiséis
22:59 labster jp: 十二億八千四百万百二十六
23:00 uvtc left #perl6
23:00 lue labster++ # can you put the source somewhere, e.g. gist ? I'd like to see it.
23:01 labster which are all of the languages I know anything about.  And, for the first time ever, I'm going to say that Japanese is much easier to deal with.
23:02 lue I'd likely be able to scrounge up some French and German :) .
23:03 dalek nqp: bd369a5 | jnthn++ | src/HLL/Grammar.pm:
23:03 dalek nqp: Turn EXPR_reduce from PIR to NQP.
23:03 dalek nqp:
23:03 dalek nqp: Most of the work was done by kboga++. Added some native types and did
23:03 dalek nqp: some changes for the sake of performance.
23:03 dalek nqp: review: https://github.com/perl6/nqp/commit/bd369a53cf
23:03 lue .oO(Good, I did remember to mention short scale all those years ago)
23:04 labster lue: I'm sure it doesn't look all that great yet... but let me start a repo
23:05 lue OK. I'm sure my module doesn't look that great either :P
23:07 lue .oO(Well, I did put "zeroth" twice because it didn't work in the first spot. Sigh.)
23:11 labster https://github.com/labster/p6-Lingua-Number
23:12 tadzik labster: did you see http://wiki.perl6.org/Create%20and%20Distribute%20Modules ?
23:12 labster yes and it's not even close to that
23:13 labster everything is inline at this point.  I'm trying to decide if it makes more sense to have different languages modules inherit from it, or have language modules provide classes for lingua::number to use.
23:15 lue fwiw, looking at my Lingua::EN::Numbers::Ordinal module, I now would have preferred creating lightweight per-language text files for all the units, then allow one to choose the language through some mechanism.
23:16 lue (And then I'd be able to s:g/Lingua::EN::Numbers::Ordinal/Numbers::Ordinal/)
23:17 census joined #perl6
23:19 lue Does .WHICH give me something used in comparisons when it comes to "Name Equivalence of Types"?
23:28 woolfy left #perl6
23:50 cognominal joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo