»ö« 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! Set by sorear on 4 February 2011. |
|||
grondilu just fixed his Digest library which could not be compiled. | 00:01 | ||
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
00:10
donaldh left
00:14
alec__ joined
00:22
census_ left
00:32
gdey left
00:34
gdey joined,
gdey left
|
|||
rprajapa | quit | 00:34 | |
00:34
rprajapa left
00:35
shinobicl joined
00:38
gdey joined
00:53
gdey left,
gdey joined,
gdey left
00:55
shinobicl left
00:59
anuby joined
01:08
cognominal left
01:09
hypolin joined
01:13
cognominal joined
01:19
mberends joined
|
|||
diakopter | mberends: howdy! | 01:26 | |
01:31
lustlife joined
01:42
benabik joined
01:43
cognominal__ joined
01:44
cognominal left
02:04
Vlavv_ joined,
telex joined
02:15
shinobicl joined
02:17
grondilu joined
02:21
raiph__ joined,
raiph_ joined,
raiph joined
02:23
grondilu left
02:28
cognominal__ left
02:35
cognominal__ joined
02:43
shinobicl left
02:46
erkan left
02:48
FROGGS_ joined
02:51
Yappo__ joined
02:52
FROGGS left
03:12
cognominal joined,
cognominal__ left
03:28
orafu joined
03:55
japhb_ left
04:05
anuby left
04:06
anuby joined
04:07
anuby left
04:08
anuby joined
04:20
cognominal left
04:26
xinming left
04:28
Chillance left,
xinming joined
04:45
preflex_ joined
04:47
preflex_ is now known as preflex
05:44
kaleem joined
05:56
FROGGS_ left
|
|||
TimToady | rosettacode.org/wiki/Problem_of_Apo...ius#Perl_6 | 06:06 | |
06:07
hypolin left
|
|||
timotimo | oh, $.foo won't interpolate in strings? | 06:07 | |
(i suppose because it really is a method call) | 06:08 | ||
06:08
hypolin joined
|
|||
sorear | it will. | 06:10 | |
TimToady | hmm, maybe it should | ||
sorear | also, method calls interpolate in strings | ||
n: my $foo = "hello"; say "$foo.flip() world" | 06:11 | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«olleh world» | ||
TimToady | yeah, works fine without the brackets | ||
fixed, timotimo++ | 06:13 | ||
06:18
Tedd1 left
|
|||
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:19 | |
06:21
Tedd1 joined,
sqirrel joined
|
|||
moritz | \o | 06:22 | |
TimToady | o/ | 06:23 | |
sorear | o/ | 06:24 | |
lue | Quick question: why were sigilless variables introduced? (I know it was possible before for constants, why extend to variables?) | 06:27 | |
moritz | lue: to allow storing non-constant stuff without forcing a context on it | 06:28 | |
TimToady | it only incidentally also made it really easy to introduce new terms to the grammar | 06:29 | |
(that won't be parsed as functions requiring arguments) | |||
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? | ||
TimToady | it's the rawest form of binding we have | 06:33 | |
what used to be called "is ref", then "is parcel" | |||
lue | [ also, the Perl 6 solution for Apollonius looks the prettiest :) ] | 06:34 | |
TimToady | well, that's mostly because of the the postfix:<²> | ||
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 | ||
it was originally translated from the python, which is full of x*x and such | 06:36 | ||
06:36
FROGGS joined
|
|||
FROGGS | morning | 06:36 | |
TimToady | o/ | 06:37 | |
the next goal is to pass Mathematica; 20 more will do it... | |||
well, assuming a non-moving target... :) | 06:38 | ||
japhb | All you need is greater velocity, equal acceleration, and enough time ... | 06:39 | |
TimToady | we've always gone for greater acceleration regardless of the current velocity, which will always win eventually | 06:40 | |
06:41
benabik left
|
|||
sorear | o/ FROGGS | 06:43 | |
.oO( greater jerk is still better ) |
06:44 | ||
06:44
benabik joined
|
|||
diakopter | :) | 06:44 | |
FROGGS | morning TimToady, japhb, sorear, diakopter | 06:45 | |
diakopter | g'day | ||
sorear | o/ diakopter | 06:47 | |
FROGGS | TimToady: have you seen the discussion about $/ and Str.subst? irclog.perlgeek.de/perl6/2013-02-19#i_6474949 | 06:48 | |
06:48
quester joined
|
|||
TimToady | yes, been thinking about it | 06:50 | |
FROGGS | k, thanks | ||
TimToady | wondering whether there should be an optional argument to the method forms with an "out" parameter that defaults to $/ | ||
so /foo/ is equivalent to .match(/foo/, :set($/)) or some such | 06:51 | ||
or :set would set $/ by default | |||
name negotiable, of course | 06:52 | ||
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 | ||
FROGGS | nr: "abc".match(/a/); say $/ | ||
p6eval | rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«「a」» | ||
FROGGS | nr: "abc".match("a"); say $/ | ||
p6eval | rakudo 8e6fa0: OUTPUT«「a」» | ||
..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) … | |||
sorear | what is the ~~ s/// problem? | ||
TimToady | sorear: currently, but we might simplify that | ||
the argument of using the methods as hypers is rather strong | 06:54 | ||
moritz | nr: my $x = "abc"; say $x ~~ s/a/A/; | ||
TimToady | you really don't want 100 methods trying to set $/ in parallel | ||
p6eval | rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«True» | ||
moritz | nr: my $x = "abc"; say $x ~~ s/x/A/; | ||
TimToady | so setting $/ is probably a bad default | ||
p6eval | rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«False» | ||
moritz | huh, it even kinda works | ||
sorear | TimToady: might be relevant: niecza's .subst supports an undocumented flag :inplace | 06:55 | |
FROGGS | moritz: I did that in january or so | ||
sorear | n: my $x = "abc"; $x.subst(/a/,'A',:inplace); say $x | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«Abc» | ||
TimToady | um, why wouldn't that just be a .= instead? | ||
moritz | because we want to return a different value than we assign to $x | 06:56 | |
TimToady | not that it matters in sink context, but I getcha | 06:57 | |
06:57
clkao joined
|
|||
sorear | I suppose I could have spelled it :$p = True | 06:58 | |
TimToady | it almost feels to me like :inplace should just be a different method name | 07:01 | |
07:01
rindolf joined
|
|||
TimToady | it's an argument that does violence to the API | 07:01 | |
usually that's a smell that an option is doing too much work | 07:02 | ||
07:02
Jimmy joined
|
|||
rindolf | Hi all. | 07:03 | |
TimToady: hi. | |||
FROGGS | are there other pieces in the spec that allow one to say that a method has side effects or not? | ||
hi rindolf | |||
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 | ||
sorear | 1. subst doesn't ordinarily return a boolean "did this match?" flag | ||
2. it would capture the $/ set | |||
rindolf | FROGGS: hi. | 07:05 | |
TimToady | 1 is what I'm complaining about, doing violence to the contract | 07:06 | |
2 can be worked around, methinks | |||
FROGGS | nr: my $x = "abc"; $x.subst(/(a)/,'A'); say $0 | 07:08 | |
p6eval | rakudo 8e6fa0: OUTPUT«「a」» | ||
..niecza v24-23-g0520c7c: OUTPUT«Any()» | |||
FROGGS | hmmm, if $/ should not be set, then $0 isnt allowed too | 07:09 | |
07:09
b1rkh0ff left
|
|||
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 | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«Trueaabc» | ||
FROGGS | interesting | 07:10 | |
TimToady | but that is going to break down with ».subst as someone pointed out | ||
07:11
Jimmy left
|
|||
TimToady | it may be cleaner to go back to the -> $/ {} mileau | 07:11 | |
or something macro-y for the replacement | 07:12 | ||
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
07:22
alec__ left
07:26
alec__ joined
07:29
labster joined
07:31
lustlife left
07:33
lustlife joined
07:39
rindolf left,
rindolf joined
07:48
rindolf left
|
|||
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
07:50
domidumont joined,
nebuchadnezzar joined
07:52
nebuchadnezzar left
|
|||
arnsholt | Has masak presented a talk called Macro Polo yet? | 07:56 | |
07:58
nebuchadnezzar joined,
rindolf left,
rindolf joined
08:04
SamuraiJack joined
08:06
rindolf left
08:07
rindolf joined
08:15
rindolf left,
rindolf joined
08:17
domidumont left
08:21
domidumont joined
|
|||
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» | ||
dvj | r: shift <a b c> | ||
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» | ||
dvj | how do I shift/pop from a list? | 08:22 | |
FROGGS | r: say <a b c>.flat.shift | ||
p6eval | rakudo 8e6fa0: OUTPUT«a» | ||
sorear | r: my @list = <a b c>; say @list.shift | ||
p6eval | rakudo 8e6fa0: OUTPUT«a» | ||
sorear | r: my @list = <a b c>; say shift @list | ||
p6eval | rakudo 8e6fa0: OUTPUT«a» | ||
sorear | <a b c> is an immutable list literal (of type Parcel) | 08:23 | |
08:23
rindolf left
|
|||
dvj | r: say <a b c>.flat.perl | 08:23 | |
p6eval | rakudo 8e6fa0: OUTPUT«("a", "b", "c").list» | ||
08:23
rindolf joined
|
|||
dvj | r: say <a b c>.perl | 08:23 | |
p6eval | rakudo 8e6fa0: OUTPUT«("a", "b", "c")» | ||
dvj | ok | 08:24 | |
TimToady | <a b c>.shift is kind of like 42-- | 08:25 | |
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» | ||
..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:28
SamuraiJack left
|
|||
FROGGS | rakudo's message could be better | 08:29 | |
TimToady | agreed | 08:30 | |
Attempt to modify a readonly value | 08:31 | ||
or so | |||
and niecza should avoid the word "scalar" | 08:32 | ||
08:32
mtk left
08:33
SamuraiJack joined,
rindolf left,
rindolf joined
|
|||
TimToady | especially if <a b c>.shift ever throws that error, since it's a value, but not a scalar | 08:34 | |
well, except in the sense that everything is a scalar when viewed as an object... | |||
moritz | why does a Parcel even have a .shift method? | 08:35 | |
nr: say so Any.^can('shift') | |||
p6eval | rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«False» | ||
moritz | nr: say so Parcel.^can('shift') | ||
p6eval | rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«False» | ||
moritz | rn: <a b c>.shift | ||
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… | ||
..rakudo 8e6fa0: OUTPUT«No such method 'shift' for invocant of type 'Parcel' in block at /tmp/sHfeBW41yH:1» | |||
08:36
mtk joined
|
|||
moritz | ok, I think I mis-backlogged something | 08:36 | |
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 | ||
(I can give you a commit bit if you don't have one) | |||
if you want review, then yes, a pull request | |||
cotto | I'm half-asleep. I'll push to a branch. | 08:38 | |
dalek | p/ops-fixes: f802b49 | cotto++ | src/ops/nqp (3 files): clean up some ops definitions |
||
moritz | the missing semicolon are no-brainers | 08:40 | |
cotto | so am I right now | ||
;) | |||
knight | 08:41 | ||
08:42
rindolf left
08:43
rindolf joined
|
|||
moritz | good knight, cotto | 08:44 | |
08:50
grondilu joined
|
|||
grondilu | rn: my ($k, $m) = -3, 10; .say for $a % $m, %a mod %m; | 08:51 | |
p6eval | niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Variable $a is not predeclared at /tmp/m5ZizPlvom line 1:------> my ($k, $m) = -3, 10; .say for ⏏$a % $m, %a mod %m;Variable %a is not predeclared at /tmp/m5ZizPlvom line 1:------> my ($k, $m) = -… | ||
..rakudo 8e6fa0: OUTPUT«===SORRY!===Variable '$a' is not declaredat /tmp/l1di5QpUzz:1------> my ($k, $m) = -3, 10; .say for $a⏏ % $m, %a mod %m; expecting any of: postfix» | |||
grondilu | rn: my ($k, $m) = -3, 10; .say for $k % $m, %k mod %m; | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Variable %k is not predeclared at /tmp/F9BvbluWvh line 1:------> my ($k, $m) = -3, 10; .say for $k % $m, ⏏%k mod %m;Variable %m is not predeclared at /tmp/F9BvbluWvh line 1:------> $m) = -3, 10; … | ||
..rakudo 8e6fa0: OUTPUT«===SORRY!===Variable '%k' is not declared. Did you mean '$k'?at /tmp/wXI0mkFIh9:1------> ($k, $m) = -3, 10; .say for $k % $m, %k⏏ mod %m; expecting any of: postfix» | |||
grondilu | rn: my ($k, $m) = -3, 10; .say for $k % $m, $k mod $m; | ||
p6eval | rakudo 8e6fa0: OUTPUT«7-3» | ||
..niecza v24-23-g0520c7c: OUTPUT«77» | |||
grondilu | ^here | ||
08:55
rindolf left,
rindolf joined
|
|||
grondilu | rn: say -3 div 10; | 09:07 | |
p6eval | niecza v24-23-g0520c7c: OUTPUT«-1» | ||
..rakudo 8e6fa0: OUTPUT«0» | |||
moritz | known rakudobug, iirc | 09:08 | |
09:08
rindolf left,
rindolf joined
09:09
araujo joined,
araujo left,
araujo joined
09:11
daxim joined
09:16
rindolf left,
rindolf joined
09:26
hypolin left
09:28
sqirrel left
09:32
quester left
09:36
kivutar joined
09:39
hypolin joined
09:46
dakkar joined
09:47
raiph__ left
09:49
raiph__ joined
09:59
labster left
10:02
donaldh joined
10:03
spider-mario joined
10:05
hypolin left,
anuby left,
woolfy joined
10:11
kivutar left
10:12
kivutar joined
10:22
kresike joined
|
|||
kresike | hello all you happy perl6 people | 10:22 | |
10:22
Ovid joined,
Ovid is now known as Guest37321
10:23
Guest37321 is now known as Ovidius,
Ovidius is now known as curtispoe,
curtispoe left
10:24
Ovidius joined
10:32
erkan joined,
erkan left,
erkan joined
11:03
am0c joined
11:35
fhelmberger joined
11:39
am0c left
11:41
cognominal joined
11:52
cobra joined
12:13
SmokeMachine joined
12:19
cognominal left
12:20
cognominal joined
12:23
shinobicl joined
12:30
woolfy left,
woolfy joined
12:32
cognominal left
12:38
cognominal joined
12:46
ObseLeTe joined
12:48
sqirrel joined
12:52
cognominal left
12:58
adu joined
13:08
cognominal joined
13:11
cognominal__ joined
13:13
cognominal left
13:15
SamuraiJack left
13:16
cognominal__ left
13:19
adu left
13:23
skids left
13:25
cognominal joined
13:35
cibs joined
13:39
cognominal left
13:42
ObseLeTe left
13:43
cognominal joined
13:44
census joined,
kaleem left
13:46
ObseLeTe joined
13:48
cibs left,
cibs joined
14:07
bbkr left
14:08
ObseLeTe left
14:14
cibs left
14:16
bluescreen10 joined,
cibs joined
14:21
PacoAir joined
14:23
cognominal left,
Patterner left,
cognominal joined,
broquaint joined
14:24
cognominal left,
cognominal joined
14:26
Psyche^ joined,
Psyche^ is now known as Patterner
14:28
kaare_ joined
14:31
uvtc joined
|
|||
uvtc | .u 𝑁 | 14:32 | |
phenny | U+1D441 MATHEMATICAL ITALIC CAPITAL N (𝑁) | ||
14:34
donaldh left
14:39
benabik left
|
|||
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:40 | |
timotimo | because the $ isn't mathematical? or something? | 14:41 | |
14:44
bluescreen10 left
|
|||
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 | |
14:45
bluescreen10 joined
14:49
benabik joined
14:50
cibs left
14:54
tokuhiro_ joined
14:56
spider-mario left
14:58
cibs joined
|
|||
uvtc | TimToady: also curious, why use the mathematical italic characters instead of ascii? | 15:00 | |
timotimo | well, for one: | 15:01 | |
r: say v11.WHAT | |||
Juerd | Possibly, to change Perl from a write-only language to a read-only one? | ||
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===Undeclared routine: v11 used at line 1» | ||
timotimo | oh, huh? | ||
Juerd | r: my \v11 = 42; say v11.WHAT | 15:02 | |
p6eval | rakudo 8e6fa0: OUTPUT«Int()» | ||
timotimo | TimToady mentioned version objects | ||
moritz | r: say v1.1.WHAT | ||
p6eval | rakudo 8e6fa0: OUTPUT«Version()» | ||
timotimo | oh, so it needs at least one .? | 15:03 | |
n: say v11.WHAT | |||
p6eval | niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Action method value:version not yet implemented at /tmp/Fezzp_yB39 line 1:------> say v11⏏.WHATUnhandled exception: invalid undef here at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) … | ||
timotimo | n: my \v11 = 42; say v11.WHAT | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Action method value:version not yet implemented at /tmp/zaInOKFJwT line 1:------> my \v11 = 42; say v11⏏.WHATUnhandled exception: invalid undef here at /home/p6eval/niecza/boot/lib/CORE.setting line 1… | ||
moritz | timotimo: seems like | ||
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:04
FROGGS left
|
|||
timotimo | people will indeed look at it and say "oh, now it's read-only.", Juerd :) | 15:05 | |
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 | ||
Host * ServerAliveInterval 60 | 15:10 | ||
15:14
tokuhiro_ left,
jaldhar left,
tokuhiro_ joined
|
|||
timotimo | arnsholt: what is "ZMQ_HAUSNUMERO" supposed to be? o_O | 15:17 | |
(also, it lacks one M it seems) | |||
15:20
tokuhiro_ left
15:23
cognominal left
15:25
cognominal joined
|
|||
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 | |
r: sub foo($a = BEGIN { [] }) { $a.push(1) }; say foo; say foo; say foo; | |||
p6eval | rakudo 8e6fa0: OUTPUT«11 11 1 1» | ||
arnsholt | timotimo: It's just a really high number | ||
timotimo | arnsholt: is that actually in/from zmq? | 15:29 | |
arnsholt | Do you have zmq-dev (or whatever your system calls it) installed? | ||
timotimo | oh, indeed i do | ||
arnsholt | Yeah. If you grep for the name in zmq.h it's explained | ||
timotimo | let me check the headers or something | ||
arnsholt | It's just a high number to make sure they don't conflict with already defined errnos | ||
timotimo | i see. | 15:30 | |
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:32 | ||
15:36
uvtc left
|
|||
arnsholt | You can use a state variable, or just a global lexical | 15:40 | |
timotimo | nah, global lexicals don't seem very nice for this, but i suppose it depends verily on the context. | 15:42 | |
15:42
cobra left
15:44
FROGGS joined
|
|||
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:47 | |
15:49
am0c_ joined,
am0c_ is now known as am0c
|
|||
timotimo | should i create a big given with the possible values and look at the manual what they should return? | 15:49 | |
and create appropriate buffers? | |||
15:49
ElDiabolo joined
15:53
cognominal left
15:58
cognominal joined
16:01
[particle] joined
16:13
donaldh joined
16:16
denisboyun joined
|
|||
kresike | bye folks | 16:18 | |
16:18
kresike left
16:19
cognominal left
16:21
denisboyun left
16:22
ObseLeTe joined
|
|||
timotimo | well, at least that's kind of what pyzmq does. it knows which options are int64 and such | 16:23 | |
16:23
kivutar left
|
|||
arnsholt | timotimo: I haven't really implemented getsockopt/setsockopt yet, actually | 16:24 | |
They way they work/their signatures are set up are a bit fiddly | |||
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 | ||
hold on, i'll give you a direct link | |||
arnsholt | But we could probably make it work | 16:25 | |
timotimo | github.com/zeromq/pyzmq/blob/maste...t.pyx#L361 | ||
16:25
denisboyun joined
|
|||
arnsholt | It's mostly a question of doing it (which I haven't done) and possibly a bit of hackery | 16:26 | |
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:29 | ||
Does that make sense to you? | 16:30 | ||
timotimo | i do know know what "is symbol" does. | ||
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. | ||
er, i would have implemented it as a method for the Socket class to be honest | |||
16:34
ObseLeTe left
|
|||
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 | |
And then only used from a method in Socket | |||
16:34
skids joined
|
|||
arnsholt | It's just the internal plumbing that needs a bit of fiddling | 16:34 | |
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 | ||
(Today is work after dinner day anyways, so it works out quite well in that respect =) | |||
timotimo | sure, why not. | 16:37 | |
16:38
denisboyun_ joined
16:39
denisboyun left
|
|||
timotimo | i'll prepare a list of options that take strings, 64 bit ints and such, so that you won't have to | 16:41 | |
16:43
SamuraiJack joined
|
|||
arnsholt | timotimo: Awesome! Thanks =) | 16:46 | |
timotimo++ | |||
16:46
SmokeMachine left
16:47
denisboyun___ joined,
SmokeMachine joined
|
|||
timotimo | well, that was super simple. i could just copypaste and turn [ ... ] into set(...) | 16:48 | |
i guess i'll add more boilerplate | |||
16:49
denisboyun_ left,
denisboyun___ left
16:50
denisboyun_ joined
16:51
spider-mario joined
16:53
ElDiabolo left
|
|||
timotimo | zavolaj has no int64 type? | 16:54 | |
16:54
colomon left
16:56
jaldhar joined
|
|||
timotimo | i accidentally the whole thing. but i don't have a clue if it even works at all. | 16:56 | |
arnsholt: perpetuum-immobile.de/zmq_getsockopt.patch have a look if it makes sense to you | 16:58 | ||
17:06
ElDiabolo joined,
daxim left
17:07
denisboyun___ joined
17:09
denisboyun_ left
17:10
[particle] left
17:12
cognominal joined
17:18
am0c left,
denisboyun___ left
17:19
ElDiabolo left,
denisboyun_ joined,
jaldhar left
17:20
[particle] joined
17:21
ElDiabolo joined
|
|||
masak | good evening, #perl6 | 17:28 | |
phenny | masak: 07:48Z <diakopter> ask masak known? r: macro marco { /hi/ }; marco | 17:29 | |
17:29
zby_home joined
|
|||
TimToady | also irclog.perlgeek.de/perl6/2013-02-20#i_6476740 | 17:29 | |
masak | diakopter: for the love of Gauss, don't call macros 'marco'. ;) | ||
diakopter | okay :) | ||
17:29
Chillance joined
|
|||
masak | r: macro x { /hi/ }; x | 17:30 | |
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===too few positional arguments: 2 passed, 3 (or more) expected» | ||
diakopter | r: macro mocra { /hi/ }; mocra | ||
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===too few positional arguments: 2 passed, 3 (or more) expected» | ||
TimToady | there was also some discussion of LTAness after that | ||
masak | :P | ||
17:31
cognominal left
|
|||
masak back-clogs | 17:31 | ||
japhb | diakopter, How about calling your macros 'm'? The abbreviation would be way easier to read. | 17:32 | |
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.. | ||
TimToady | .oO(You think that's readable today...) |
||
diakopter | (where trying implies failing) | 17:35 | |
17:38
cognominal joined
17:41
ObseLeTe joined
|
|||
PerlJam wonders about masak's wooden shoes that he wears on his back. | 17:41 | ||
masak | PerlJam: either that, or I was becoming retroactively congested. | 17:42 | |
now how's about I spend all this train time reviewing p6cc t1 solutions? how does that sound? :) | 17:43 | ||
PerlJam | masak++ | ||
masak | I want to post the t1 thing before I leave for vacation on Saturday... | ||
I'm about halfway through the reviewing. | 17:44 | ||
diakopter | masak+++ | ||
er | |||
masak__ | |||
er | |||
masak++ | |||
moritz | ++masak | ||
masak | jnthn and I have had a fun $workday, by the way. we heckled each other on stage for 45 minutes :) | ||
timotimo | are there recordings? :) | 17:45 | |
diakopter | "You're the best programmer in the world.." "no, you are.." "no, you are.." | ||
masak | :P | ||
17:47
cognominal left
|
|||
TimToady | phenny: tell uvtc added the explanation to rosettacode.org/wiki/Problem_of_Apo...ius#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
17:56
kaleem joined
|
|||
tadzik | hello #perl6 | 17:57 | |
17:57
kaleem left
|
|||
masak | tadziku! \o/ | 17:57 | |
moritz | \o tadzik | ||
tadzik | \o/ | 18:01 | |
18:05
cognominal joined,
SamuraiJack_ joined,
SamuraiJack left
18:06
dakkar left
|
|||
ElDiabolo | masak, Hi. Still thinking about LINQ vs SQL. | 18:10 | |
There are points for LINQ. It can do a non denormalizing join. | |||
But only if you join on equals. | 18:11 | ||
moritz | TimToady: should only /.../ cause a match in sink context, or any regex object? | 18:15 | |
18:15
denisboyun___ joined
18:16
gdey joined
|
|||
moritz | I vote for the former | 18:16 | |
18:17
denisboyun___ left,
denisboyun_ left
18:18
denisboyun joined
|
|||
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:19 | |
18:20
cognominal left
|
|||
arnsholt | timotimo: Thanks for the patch! | 18:22 | |
It's not quite what I had in mind, but it's well on its way | 18:23 | ||
timotimo++ # Doing the hard work for me =) | |||
moritz | .oO( every Perl 6 developer should have a minion who does the hard work for him) |
||
tadzik | certainly works for masak and his clones | ||
moritz | it's not really "masak and his clones" | 18:24 | |
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? | ||
like a circular linked list | |||
moritz | not one major personality and then some inferior clones | ||
18:26
cognominal joined
|
|||
ElDiabolo | masak, I found today that the other component that makes LINQ fun is already there. Its gather / take. | 18:26 | |
masak | hm. | 18:27 | |
agree that you'd want laziness in there, yes. | |||
ElDiabolo | masak, Yes! | ||
masak, LINQ to db is necessarily lazy. | 18:28 | ||
timotimo | arnsholt: i'd be interested to know what you had in mind | 18:29 | |
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 left,
ElDiabolo joined
18:37
cognominal left
18:41
sqirrel left,
denisboyun___ joined
18:42
denisboyun left,
cognominal joined
18:47
fhelmberger left,
SamuraiJack_ left
|
|||
timotimo | r: sub foo (Str(Any) $y) {...} | 18:47 | |
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===Missing blockat /tmp/V_1LAWIzZP:1------> sub foo (Str(Any) ⏏$y) {...} expecting any of: statement list prefix or term prefix or meta-prefix new name to be defined formal… | ||
timotimo | didn't this work some time ago? | ||
18:49
ElDiabolo left
18:51
census_ joined
|
|||
TimToady | nope, NYI | 18:51 | |
timotimo | that's probably a sizable chunk of work, too ... | ||
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:------> sub foo (Str(Any) ⏏$a) { ... }ok 00:00 44m» | ||
timotimo | maybe i could implement parsing that and throwing a NYI, though ... | ||
18:52
census left
|
|||
FROGGS | what exactly should Str(Any) $y do? | 18:53 | |
timotimo | die with "coercive type constraints not yet in^Hmplemented" | 18:54 | |
PerlJam | heh | ||
FROGGS | timotimo: I meant, what should it do when beeing implemented | 18:55 | |
what is a coercive type constraint? | |||
timotimo | the function would now take any type of argument, but will coerce it to a string before assigning it to $a | ||
skids | rakudo used to have (or may still) some prestandard form of that. Something like "Int $p as Str". | ||
timotimo | perlcabal.org/syn/S02.html#Coercive...clarations - this is the syn on it | ||
PerlJam | FROGGS: see S02:526 | ||
arnsholt | jnthn: Does allowing NativeCall users to get the sizeof various types sound like a reasonable feature to you? | 18:56 | |
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 | ||
FROGGS | arnsholt: yes, it does | ||
sizeof a cstruct is also useful I guess | |||
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) | ||
FROGGS | timotimo, PerlJam: thanks | ||
dalek | rl6-roast-data: f0c310f | coke++ | / (4 files): today (automated commit) |
||
rl6-roast-data: 2672fa3 | coke++ | / (3 files): today (automated commit) |
|||
rl6-roast-data: 0d5d865 | coke++ | / (4 files): today (automated commit) |
|||
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 left,
cognominal__ joined
19:06
am0c left,
am0c joined
|
|||
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 | ||
grondilu | TimToady: why not? | ||
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 | ||
TimToady | (the intent of int in Perl 6 is to reflect the size of the C int, whatever it is | ||
) | |||
arnsholt | Some libraries have machine words as part of their API (sadly) | 19:09 | |
TimToady | -1 :) | ||
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. | ||
timotimo | agreed. we won't make apis better by forbidding machine words in zavolaj | ||
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 =) | ||
timotimo | we will only make it harder for perl6 to interface with apis | ||
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 =) | ||
TimToady: Certainly, yeah | |||
diakopter | [Coke]: twitter.com/chromatic_x/status/299...4180018176 | 19:12 | |
skids | gist.github.com/skids/4998260 # Some thoughts I had a while back on native int ops that are annoyingly nonpresent in HLLs. | ||
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. | ||
[Coke] | diakopter: danke. that explains why I couldn't find it, it's got a url shortener. :P | 19:13 | |
19:13
benabik left
19:15
cognominal__ left
|
|||
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 | |
*own | |||
19:15
cognominal__ joined
|
|||
TimToady | so I think rx// and // should behave the same in sink context | 19:16 | |
masak | so... why doesn't .uniq have a :by parameter? | 19:18 | |
TimToady | and, in fact, it's specced that way at S05:2228 | 19:19 | |
19:19
ElDiabolo joined,
ElDiabolo left
19:20
ElDiabolo joined
|
|||
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:21 | |
skids | .oO(perlgeek irclog seems to strip leading colons from searches so you can't search perl6 adverbs) |
19:22 | |
timotimo | hum, me has to build a newer nqp to build rakudo | 19:24 | |
skids | .oO(yay github fixed "my gists") |
||
arnsholt | skids: Sure it doesn't just strip punctuation in general? | ||
skids | possibly | 19:25 | |
arnsholt | That's pretty common for full-text search | ||
timotimo | everybody wants the colon! | ||
skids | the bitbucket gets the colon | ||
19:25
cognominal__ left
|
|||
[Coke] | there, I can cross "replying to chromatic" off my mental todo list. | 19:26 | |
arnsholt | [Coke]++ | 19:28 | |
Probably not productive to reply to chromatic, but nice paragraphs in the README | |||
masak | where? where? | 19:29 | |
arnsholt | twitter.com/chromatic_x/status/299...4180018176 | 19:30 | |
19:31
cognominal__ joined
|
|||
masak | [Coke]++ | 19:33 | |
timotimo spectests his grammar change | 19:34 | ||
arnsholt | Oh. Rakudo doesn't have an int64 type | 19:37 | |
arnsholt goes to fix | |||
rindolf | Hi all. | 19:39 | |
arnsholt | timotimo: Sorry for the delay. Took a bit longer than I expected =) | 19:40 | |
timotimo | don't worry | ||
i've found something else to hack on in the mean time | |||
arnsholt | Good, good =) | ||
timotimo | and whenever i get a little bored, i just look to my right where people are watching TPB:AFK on a beamer | ||
TimToady | rindolf: diakopter++ and I are having a mini-hackathon this morning | ||
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 | ||
TimToady | we're trying to figure out how one ought to integrate p5 and p6 threading in the least-insane way | ||
timotimo | it's cython | ||
arnsholt | cython? | ||
arnsholt googles | 19:42 | ||
timotimo | yes, it adds type information and such so that python code can be compiled | ||
more or less | |||
rindolf | TimToady: ah. | ||
timotimo | makes it pretty easy to write bindings, too | ||
arnsholt | Oh, neat | ||
rindolf | TimToady: you may enjoy this bit from my homepage as well - www.shlomifish.org/humour/bits/Im-T...Tim-Toady/ | ||
TimToady | I guess it's more of a yackathon :) | 19:43 | |
timotimo | shaveathon? | ||
19:44
benabik joined
|
|||
rindolf | Nackathon. | 19:44 | |
19:44
cognominal__ left
|
|||
[Coke] | You could come over this way, we could have a Nyackathon. | 19:44 | |
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? | ||
TimToady prefers a place where trees are always confused about what season it is... | |||
timotimo | oh, should remove the s from there, i think | ||
TimToady | or s/is/are/ | ||
timotimo | well, i just do .NYI, so i'd have to either make a :plural named arg or add a .NYIs or something | 19:46 | |
TimToady | then singular is fine | 19:47 | |
19:49
denisboyun___ left,
cognominal__ joined
|
|||
timotimo | nah, i'll add :plural. that's much prettier. | 19:50 | |
moritz | TimToady: what about my $x = rx/a/; $x; 1; | 19:51 | |
TimToady: should that cause a regex match? | |||
in other words, is regex match in void context syntactic? | |||
timotimo | oh my, i'll have to add a plural field to X::Comp::NYI | ||
[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" | ||
PerlJam | timotimo: don't shave the yak, just use the singular :) | ||
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 | |
TimToady: i could turn it into a verb, english supports that! | |||
"declaring coercive types is not yet implemented", sound good? | |||
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." | ||
"coercive type declaring is not yet implemented" :) | 19:55 | ||
TimToady | that's not very Englishy | ||
PerlJam | timotimo: "Feature ``$.feature'' is not yet implemented" ?? Then you can .NYI: "coercive type declaration" | 19:56 | |
19:56
colomon joined
|
|||
timotimo | that sounds quite stilted, i find :( | 19:56 | |
PerlJam | yeah, I agree | ||
TimToady | I'd just s/is\s// | ||
timotimo | you mean for every invocation of NYI? | ||
TimToady | yeah | ||
masak | whoa, en.wikipedia.org/wiki/Operator-pre...nce_parser mentions PGE. that's gotta be old news at this point. | ||
timotimo | hm, why not | ||
19:56
ElDiabolo left
|
|||
arnsholt spectests | 19:57 | ||
19:57
cognominal__ left,
denisboyun_ joined
|
|||
TimToady | moritz: yes, it's syntactic | 19:58 | |
19:58
census joined
|
|||
timotimo | r: 1 + ** | 19:58 | |
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===HyperWhatever (**) is not yet implemented. Sorry. at /tmp/tamBHOfCM_:1------> 1 + **⏏<EOL>» | ||
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; | ||
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===Multiple prefix constraints is not yet implemented. Sorry. at /tmp/A_naCd7oCo:1------> my Str Int ⏏$a; expecting any of: scoped declarator» | ||
timotimo | yes, that's what i meant to say | ||
moritz | TimToady: ok, thanks | ||
$ ./perl6 -e '$_ = "foo"; /./; say $/' | 20:02 | ||
「f」 | |||
timotimo | my local implementation doesn't handle this correctly yet: | 20:05 | |
r: my Str(Any) $a = 1000; | |||
p6eval | rakudo 8e6fa0: OUTPUT«===SORRY!===Two terms in a rowat /tmp/_iZC79AoNK:1------> my Str(Any) ⏏$a = 1000; expecting any of: scoped declarator constraint postfix infix or meta-infix infix stopper st… | ||
20:06
cognominal__ joined
|
|||
moritz | the coercion syntax isn't implemented yet | 20:09 | |
PerlJam | moritz: timotimo is adding the NYI for it. | ||
moritz | ah | ||
TimToady | or the nya, nya | ||
Not Yet Awesome, I guess | |||
PerlJam | said twice for emphasis? | 20:10 | |
TimToady | the lack of awesomeness is also not yet awesome | ||
PerlJam | timotimo: though, I don't understand ... are there two places in the grammar that parse type names? | 20:12 | |
(I'm pretty sure I remember there being some contextual var that let you know if you were in a declaration or not) | 20:13 | ||
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:16 | |
20:17
cognominal__ left
|
|||
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
benabik left
|
|||
PerlJam | timotimo: you've won the "breaking core" achievement! :) | 20:17 | |
dalek | p/ops-fixes: 031801c | cotto++ | src/ops/nqp_dyncall.ops: use a non-empty default case |
20:18 | |
timotimo | oh i've broken the core setting a bunch of times before | ||
dalek | kudo/nom: 6392d64 | (Arne Skjærholt)++ | src/core/natives.pm: Add int64 type. |
||
20:20
uvtc joined
|
|||
timotimo | i unbroke it, fortunately | 20:21 | |
20:21
cognominal__ joined
|
|||
uvtc | TimToady: thanks! ↓↓ | 20:22 | |
phenny | uvtc: 17:52Z <TimToady> tell uvtc added the explanation to rosettacode.org/wiki/Problem_of_Apo...ius#Perl_6 that you requested; thanks for requesting it :) | ||
timotimo | okay, spectests and then pull request :D | ||
uvtc | But, what does "SSA style" mean? ("Finally, writing in an SSA style tends to help the optimizer.") | 20:23 | |
timotimo | static single assignment | ||
basically you turn a = 5; a = a + 10; a = a * 10; into a1 = 5; a2 = a1 + 10; a3 = a2 * 10; | |||
so you'll have every name on the left side of an equals sign at most once | |||
(plus some magic for loops and branches) | |||
arnsholt derps | 20:25 | ||
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"; | ||
p6eval | star 2012.12: OUTPUT«alive» | ||
timotimo | i don't really know the good parts, sorry :( | ||
arnsholt | star: use NativeCall; when 1 { my CArray[int] $foo .= new; $foo[0]; say "alive"; } | ||
p6eval | star 2012.12: OUTPUT«use of uninitialized variable $a of type Any in numeric context in block at /tmp/4KD8FMDH0k:1» | ||
arnsholt | I'm going to assume this is a NativeCall bug, but does anyone have any clue what might be going on? | 20:27 | |
star: use NativeCall; when 1 { my CArray[int] $foo .= new; $foo[0] = 1; say "alive"; } # What I actually intended | |||
p6eval | star 2012.12: OUTPUT«use of uninitialized variable $a of type Any in numeric context in block at /tmp/Ma0tDchZWJ:1» | ||
20:27
mtk left,
benabik joined
|
|||
moritz | star: use NativeCall; my CArray[int] $foo .= new; say $foo[0].perl | 20:28 | |
p6eval | star 2012.12: OUTPUT«(signal SEGV)» | ||
uvtc | timotimo: Ah. Thanks. Added link in the RC page to the SSA wikipedia page. | ||
arnsholt | Oooh, fun. That's a bug as well | ||
moritz++ | |||
TimToady | why is that written that way rather than my int @foo[$size] as S09 specs? | ||
timotimo | All tests successful. - yay | 20:29 | |
dvj | r: my $a = "adsf"; $a ~~ s/ds/{ substr($1, 0, 1) }/; | ||
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» | ||
arnsholt | I don't really know. jnthn decided to =) | ||
dvj | what $s? | ||
TimToady | a leaky abstraction, apparently | 20:30 | |
20:30
labster joined
|
|||
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) } | ||
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» | ||
arnsholt | Hmmm. | ||
Ooooh, never mind. Braino on my part | |||
benabik | dvj: The error happens because $1 never gets assigned in your code. | 20:33 | |
dvj: So you end up calling substr(Any, 0, 1) | |||
moritz | dvj: that of method subst, which s/// desugars to | ||
dvj | ok | ||
I guess I'll use $/ instead :) | |||
benabik | moritz: No, in the substr that he calls in the RHS of s/// | 20:34 | |
moritz | oh | ||
benabik | dvj: Perhaps you meant $0 ? | ||
20:34
donaldh_ joined
20:35
census_ left
|
|||
arnsholt | dvj: There is no $1 since you don't have any capture parens | 20:35 | |
benabik | r: my $a = "adsf"; $a ~~ s/(ds)/{ substr($0, 0, 1) }/; say $a | 20:36 | |
p6eval | rakudo 8e6fa0: OUTPUT«adf» | ||
dvj | benabik: arnsholt: you're right. My example was bad. I'm porting some perl5 code where it's actually $1 | ||
I just simplified to trigger the $s error | |||
benabik | dvj: s/(ds)/{ substr($0, 0, 1) }/ works | ||
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. :-/ | ||
dvj | does the second match (because of :g) go into $1? | ||
nevermind, $0 is what I want :) | 20:40 | ||
thanks | |||
timotimo | github.com/rakudo/rakudo/pull/104 - i made a contribution \o/ | 20:41 | |
moritz | benabik: it says substr in the backtrace | ||
benabik | moritz: Right. But how does $s connect to that? Can't tell unless you open the setting. | 20:42 | |
Or maybe if it printed the signature. | 20:43 | ||
donaldh_ | seen jnthn | ||
benabik | donaldh: ENOALOHA | 20:44 | |
donaldh_ | benabik: thx, thought I'd syntax errored there | 20:45 | |
uvtc | scene jnthn | ||
arnsholt | timotimo: Take a look at my latest commit. See what I'm doing? | 20:46 | |
timotimo | in net::zmq? | ||
benabik | donaldh_: bacek had to shut down aloha and nobody's set up a replacement host yet. :-/ | ||
20:46
zby_home left
|
|||
benabik | The code and database are all online though. | 20:46 | |
timotimo | ah, i see what you're doing | 20:47 | |
do you think that already works? | |||
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] ? | ||
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… | ||
..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… | |||
benabik | grondilu: I didn't think it actually existed. | 20:52 | |
grondilu | rn: role Foo[Int $bar] {}; say my $x = 13 but Foo[42]; | 20:53 | |
p6eval | rakudo 8e6fa0: OUTPUT«13» | ||
..niecza v24-23-g0520c7c: OUTPUT«Potential difficulties: $bar is declared but not used at /tmp/sYOMnufeux line 1:------> role Foo[Int ⏏$bar] {}; say my $x = 13 but Foo[42]; $x is declared but not used at /tmp/sYOMnufeux line 1:------> role Foo[Int $bar] {}; s… | |||
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 | ||
p6eval | rakudo 8e6fa0: OUTPUT«No such method 'bar' for invocant of type 'Int+{Foo}' in block at /tmp/oKWEu1i4Jx:1» | ||
benabik | rn: role Foo[Int $bar] { method bar { $bar } }; my $x = 13 but Foo[42]; say $x.bar | ||
timotimo | cool, thanks, alot! :) | ||
p6eval | rakudo 8e6fa0, niecza v24-23-g0520c7c: OUTPUT«42» | ||
arnsholt | I'm not 100% sure it'll work as intended (untested, after all) but I think it's in the right direction | ||
Also, I'm not quite happy with the interface. If you have ideas for a better interface, feel free | 20:55 | ||
timotimo | er, does that return actually work? | 20:56 | |
donaldh_ | benabik: is hosting aloha onerous? | ||
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. | ||
timotimo | :D | ||
donaldh_ | A task for someone with permissions _and_ tuits then | 20:58 | |
benabik | donaldh_: I don't know that anyone would complain if someone hosted aloha elsewhere. :-D | 20:59 | |
20:59
denisboyun_ left
21:00
denisboyun joined
|
|||
arnsholt | timotimo++ # More cleverer than me | 21:01 | |
timotimo: Let's try again with the new HEAD =) | |||
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 | ||
I forgot the details =) | |||
timotimo | all right :) | ||
21:03
donaldh_ left
|
|||
arnsholt | timotimo: Are there some tests in github.com/zeromq/pyzmq/ and I'm just not finding them, or are there none? | 21:06 | |
timotimo | i don't know to be honest :( | 21:07 | |
21:07
donaldh left
|
|||
arnsholt | 'k | 21:08 | |
timotimo | building rakudos as we speak | 21:09 | |
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
|
|||
arnsholt | Yeah, nothing to test on for me either =/ | 21:10 | |
Should probably get around to fixing that sometime soon =) | |||
timotimo | how hard would it be to copypaste-program setsockopt from the code we have now? | 21:12 | |
can i take the type from the hash and coerce a value to it or something? | |||
arnsholt | No need to coerce | 21:13 | |
Should be pretty straightforward to copy-paste code setopt | 21:14 | ||
timotimo | i'll still have to keep the given/when? | ||
arnsholt | Yeah, to dispatch to the correct variant of zmq_setsockopt | ||
And create the appropriately typed CArray | 21:15 | ||
timotimo | well, there is only one variant of zmq_setsockopt :P | ||
oh, what? | |||
suddenly there's more | |||
arnsholt | You'll have to create the setsockopt variants, similar to what I did with getsockopt | 21:16 | |
Should still only be one setsockopt | |||
timotimo | yes, i thought so | ||
21:17
donaldh joined
21:22
FROGGS left
|
|||
jnthn is home :) | 21:23 | ||
21:24
kjs__ joined,
domidumont left,
bruges_ joined
|
|||
timotimo | what's the current way to express return nothing? just return; at the end? | 21:24 | |
21:25
SmokeMachine left
|
|||
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:29 | |
21:30
b1rkh0ff left
|
|||
timotimo | well, maybe that'd be a bit less efficient | 21:31 | |
arnsholt | I'm not sure if multis would work | 21:34 | |
It'd be cool to try though! | 21:35 | ||
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? | |||
I don't think anyone's tried to use multis with Zavolaj yet =) | |||
Bedtime for me now. But feel free to commit code for setsockopt and I'll look at it tomorrow | 21:37 | ||
timotimo | good night! | 21:38 | |
i won't stay up very much longer, though | |||
21:41
benabik left
21:42
denisboyun left
|
|||
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… | ||
skids | ah | ||
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) | |||
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)» | ||
timotimo | :( | 21:45 | |
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? | ||
jnthn | Not entirely sure what's going on there | 21:47 | |
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» | ||
timotimo | what if there's two composed roles? | 21:50 | |
skids | Those are punned roles, I would assume. | 21:51 | |
so in effect classes. | |||
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» | ||
timotimo | well, /me decommutes & | 21:54 | |
21:54
kjs__ left
22:04
skids left,
lustlife left
22:05
shinobicl left
|
|||
dalek | p: 7fc8127 | jnthn++ | src/ (2 files): Move mark hash to ParseShared. This should get rid of some bugs due to over-sharing of the hash, but also makes it easy to get rid of 2 more Q:PIR chunks. |
22:06 | |
grondilu | rn: role Mod[$modulus] does Real { method Bridge { self % $modulus } }; say (13 but Mod[10]) | 22:10 | |
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 | |
..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» | |||
grondilu | :( | ||
why couldn't it be that simple to define a modular integer? | 22:12 | ||
22:17
kaare_ left
22:22
PacoAir left
|
|||
donaldh | jnthn: I sent you a pull request for nqp-jvm yesterday. findcclass and iscclass fixes | 22:24 | |
22:24
colomon left
|
|||
jnthn | donaldh: Yes, saw that a few moments ago in my inbox :) | 22:24 | |
Thanks, will look soon :) | 22:25 | ||
donaldh: oh, good catch on the PUNCT_TYPES | 22:29 | ||
And...a few other things :) | 22:30 | ||
dalek | p-jvm-prep: f810b42 | (Donald Hunter)++ | / (3 files): Added iscclass tests. Fixed iscclass to pass tests. Character.getType Added findcclass, findnotcclass and tests. |
||
p-jvm-prep: ad52981 | jonathan++ | / (3 files): Merge pull request #17 from donaldh/findcclass Added findcclass, findnotcclass, tests. Added iscclass tests. Fixed iscclass to pass tests. |
|||
jnthn | donaldh++ | 22:32 | |
uvtc | Would be interesting if something like 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:35 | |
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 | ||
jnthn | ooh, yaya | ||
*yay | |||
donaldh | jnthn: bcel-5.2 does not support it. We'd need bcel-6.0-SNAPSHOT | ||
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 | ||
uvtc | jnthn: Is there currently a way to graphically see how much of (and which parts of) Roast a given impl passes? | ||
jnthn | donaldh: I'll give you a commit bit so you can do it more easily | 22:38 | |
(done) | 22:39 | ||
uvtc: Not as far as I know. I guess the numbers [Coke]++ produces each day are an easy data source | |||
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. | ||
donaldh | jnthn++ | 22:40 | |
uvtc | jnthn: Oh, coke/perl6-roast-data | ||
jnthn: thanks. | |||
22:47
cognominal joined
22:48
cognominal__ left
|
|||
masak | 'night, #perl6 | 22:53 | |
labster | 'night masak, 'morning #perl6 | ||
tadzik | hello hello | 22:55 | |
jnthn wonders where it's morning :) | |||
uvtc | I've heard that Perl 6 syntax is more regular than Perl 5. Made me think: | 22:56 | |
"It would take 5 bowls of Perl 5 to give you the same syntactic regularity as one bowl of Perl 6." | |||
labster | jnthn: japan probably | ||
uvtc | Oh man. I need to get a humor limiter for this keyboard. | 22:57 | |
labster | uvtc: we'll put that on the perl 6 box when rakudo hits the shelves | 22:58 | |
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 | ||
% perl6 number.p6 1284000126 | |||
1284000126 -> | |||
en: one billion two hundred eighty-four million one hundred twenty-six | |||
es: uno mil doscientos ochenta y cuatro milliones ciento veintiséis | |||
jp: 十二億八千四百万百二十六 | |||
23:00
uvtc left
|
|||
lue | labster++ # can you put the source somewhere, e.g. gist ? I'd like to see it. | 23:00 | |
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:01 | |
lue | I'd likely be able to scrounge up some French and German :) . | 23:02 | |
dalek | p: bd369a5 | jnthn++ | src/HLL/Grammar.pm: Turn EXPR_reduce from PIR to NQP. Most of the work was done by kboga++. Added some native types and did some changes for the sake of performance. |
23:03 | |
lue | .oO(Good, I did remember to mention short scale all those years ago) |
||
23:04
census left
|
|||
labster | lue: I'm sure it doesn't look all that great yet... but let me start a repo | 23:04 | |
lue | OK. I'm sure my module doesn't look that great either :P | 23:05 | |
.oO(Well, I did put "zeroth" twice because it didn't work in the first spot. Sigh.) |
23:07 | ||
labster | github.com/labster/p6-Lingua-Number | 23:11 | |
tadzik | labster: did you see wiki.perl6.org/Create%20and%20Distr...%20Modules ? | 23:12 | |
labster | yes and it's not even close to that | ||
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:13 | ||
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:15 | |
(And then I'd be able to s:g/Lingua::EN::Numbers::Ordinal/Numbers::Ordinal/) | 23:16 | ||
23:17
census joined
|
|||
lue | Does .WHICH give me something used in comparisons when it comes to "Name Equivalence of Types"? | 23:19 | |
23:20
bluescreen10 left
23:28
woolfy left
23:42
cognominal left
23:44
am0c left
23:50
spider-mario left,
cognominal joined
23:56
rindolf left
|