»ö« 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. |
|||
00:06
araujo left
00:07
noganex joined
00:08
HarryS left
|
|||
sorear | um. | 00:10 | |
00:10
noganex_ left
|
|||
sorear | deleting all traces of a Parrot install: makes no difference | 00:10 | |
strace says that there was no reference outside the current directory! | 00:13 | ||
00:17
daniel-s joined
00:18
HarryS joined
00:23
HarryS left
00:28
silug joined
00:35
daniel-s left
|
|||
dalek | ecza: 1a9706b | sorear++ | / (3 files): Implement autothreading of only subs |
00:42 | |
sorear | rakudo: (2 ~~ 2 | 3).perl.say | 00:44 | |
p6eval | rakudo 048573: OUTPUT«Bool::True» | ||
00:46
silug left
|
|||
dalek | ecza: 5b69137 | sorear++ | / (3 files): Implement junctional ~~, special cases for !op and != |
00:50 | |
sorear | \o/ | ||
junctions in niecza are now basically complete | 00:51 | ||
TimToady | yäy | 00:57 | |
01:04
awwaiid left
|
|||
sorear | is current Rakudo expected to be buildable? | 01:06 | |
01:06
benabik_ joined,
benabik left,
benabik_ is now known as benabik
|
|||
sorear tries to build nom instead. | 01:08 | ||
TimToady | yes, I've built it successfully | 01:10 | |
Linux edo 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux | |||
01:14
thou left
01:29
bacek left
01:45
daniel-s joined
|
|||
daniel-s | Hi | 01:45 | |
sorear | hello, daniel-s. | 01:47 | |
daniel-s | So, when i find something i don't think is correct in the perl book or documentation, i've been messaging perlpilot | 01:48 | |
Should i be writing it in the bug track thingy on github? | 01:49 | ||
colomon | That would probably be a bit better, yes. | 01:54 | |
sorear | rakudo: say defined Mu | 01:56 | |
p6eval | rakudo 048573: OUTPUT«Bool::False» | ||
sorear | rakudo: say (defined (1|2)).perl | ||
p6eval | rakudo 048573: OUTPUT«Bool::True» | ||
01:57
whiteknight left
|
|||
sorear | o/ colomon | 01:58 | |
colomon | \o | ||
sorear | TimToady: is it OK for spectests to use so(5)? | 01:59 | |
TimToady: does that mean that I need a &so in the setting, in addition to &prefix:<so>? | 02:00 | ||
colomon | sorear: do I understand the backlog correctly to mean you are actually handling junction logic in parallel now? or is it just autothreading the way Rakudo has it now? | 02:16 | |
daniel-s | Perl6: my $a = 6.5; $a.say; | 02:19 | |
perl6: my $a = 6.5; $a.say; | 02:20 | ||
p6eval | pugs, rakudo 048573: OUTPUT«6.5» | ||
..niecza v6-43-g5b69137: OUTPUT«13/2» | |||
daniel-s | That's interesting, rakudo and rugs give decimal, the other is fraction | 02:21 | |
colomon | daniel-s: rakudo is also a fraction internally, but it prints it as a decimal | 02:22 | |
02:23
am0c joined
|
|||
colomon | rakudo: my $a = 6.5; $a.WHAT.say; $a.perl.say | 02:23 | |
p6eval | rakudo 048573: OUTPUT«Rat()13/2» | ||
colomon | rakudo: my $a = 6.5; say ($a + 1/17).perl.say | 02:26 | |
p6eval | rakudo 048573: OUTPUT«223/34Bool::True» | ||
02:30
araujo joined
|
|||
TimToady | yes, I think we should provide functional forms of prefixes where appropriate | 02:32 | |
TimToady wonders if there's a way to do that systematically | 02:34 | ||
(other than just forcing everyone to define them) | 02:35 | ||
bbl & | |||
02:40
ymasory joined
02:53
HarryS joined
03:03
starcoder left
03:04
Chillance left
03:05
starcoder joined
03:09
DarthGandalf left
03:10
sivoais left,
sivoais joined
03:11
Util left,
Util joined,
DarthGandalf joined,
jasonmay left
03:13
jtpalmer left
03:15
jtpalmer joined
03:16
hugme left
03:17
daniel-s_ joined,
jasonmay joined
03:20
daniel-s left
03:21
daniel-s joined
03:22
mberends joined
03:23
Su-Shee_ joined
03:26
Su-Shee left
03:37
daniel-s left
03:42
_jaldhar joined,
starcoder left,
starcoder joined
04:01
thou joined
04:03
thou left
04:09
silug joined
04:11
satyavvd joined
04:15
envi joined
04:44
ymasory left
|
|||
pmichaud | suggestion for new method on List: | 04:47 | |
method xxlast(Int $n = 1) { ... } # makes any finite List into an infinite list by repeating the last $n elements | 04:48 | ||
04:48
silug left
|
|||
pmichaud | thus @array.xxlast will have its last element repeated infinitely | 04:48 | |
04:48
silug joined
|
|||
pmichaud | @array.xxlist(3) will repeat the last three elements infinitely | 04:48 | |
*xxlast | 04:49 | ||
(feel free to suggest better method names) | |||
in general, xxlast($n) on a list acts like @list[*], (@list[*-$n .. *-1] xx *) | 04:50 | ||
(but can do so lazily) | |||
04:51
Alax joined
|
|||
Alax | 能用中文? | 04:52 | |
pmichaud | the infinitely extensible list in S03:4314 then becomes @array.xxlast | ||
05:02
silug left
|
|||
TimToady | Alax: 时大时小 | 05:06 | |
今小... | 05:07 | ||
JimmyZ 用中文 | 05:08 | ||
and masak | |||
我用日本語。 | 05:09 | ||
05:11
hudnix left
05:14
sftp left,
birdwindupbird joined
05:15
Khisanth left
|
|||
TimToady | pmichaud: .repfinal maybe | 05:17 | |
05:18
_jaldhar left
05:21
Eevee left
|
|||
sorear | daniel-s_: that's a bug in niecza. | 05:22 | |
05:25
daniel-s_ left,
daniel-s_ joined
05:26
tadam joined
|
|||
sorear | daniel-s_: that's a bug in niecza. | 05:26 | |
daniel-s_ | what is? | ||
sorear | rationals printing with a slash | ||
daniel-s_ | oh | ||
sorear | colomon: "autothreading" is the official name. A quite bad one, if you ask me. | 05:27 | |
daniel-s_ | sorear: want me to list it on here: | 05:28 | |
github.com/sorear/niecza/issues | |||
05:28
tadam left
|
|||
sorear | No | 05:28 | |
05:29
Khisanth joined
|
|||
sorear | there are already tests for it | 05:30 | |
I don't need a bug tracker to tell me things that comm -2 -3 <(find . | cut -c3- | sort) <(sort ~/rel/niecza/t/spectest.data) or git grep '#?niecza' can tell me | |||
05:43
molaf joined
|
|||
mberends | sorear: smartass ;) | 05:43 | |
05:47
tadam joined
05:48
tadam_ joined,
tadam left,
tadam_ is now known as tadam
|
|||
tylercurtis | niecza: say(3/2); | 05:49 | |
p6eval | niecza v6-43-g5b69137: OUTPUT«3/2» | ||
tylercurtis | rakudo: say(3/2) | 05:50 | |
p6eval | rakudo 048573: OUTPUT«1.5» | ||
tylercurtis | rakudo: say .perl given 3/2 | ||
p6eval | rakudo 048573: OUTPUT«3/2» | ||
sorear | \o/ nom builds for me | 05:53 | |
master however does NOT | |||
05:54
woosley joined
|
|||
sorear | (let me try this again...) | 05:54 | |
dalek | ast: af86cfd | sorear++ | S03-junctions/autothreading.t: Fudge and simplify S03-junctions/autothreading for Niecza |
05:55 | |
ast: b0f1ece | sorear++ | S03-junctions/boolean-context.t: Defossilize S03-junctions/boolean-context.t a bit. == does not accept Any arguments |
|||
05:58
tadam left
06:04
am0c left
06:09
nymacro joined
06:14
Mowah joined
06:15
koban` joined
|
|||
dalek | ast: 97213bc | sorear++ | S03-junctions/ (2 files): Fudge and defossilize S03-junctions/misc |
06:16 | |
ecza: 5168d25 | sorear++ | / (4 files): ~~Junction, non-autothready not, ne as !eq |
06:17 | ||
ecza: d22c6cb | sorear++ | lib/ (2 files): Tweaks to Test to handle junctions better, fake &WHAT and &HOW |
|||
ecza: b037fe8 | sorear++ | t/spectest.data: Add S03-junctions to spectest.data |
|||
06:26
yinyin joined
06:27
fhelmberger joined,
Alax left
06:30
jfried joined
06:32
amkrankruleuen left
06:37
amkrankruleuen joined
06:43
amkrankruleuen left
06:44
amkrankruleuen joined
06:53
starcoder2 left
06:55
starcoder2 joined
06:58
daniel-s_ left
07:00
amkrankruleuen left
07:04
amkrankruleuen joined
07:09
envi left
07:11
envi joined
07:12
mj41 joined
07:14
kaare__ joined,
Eevee joined
07:25
amkrankruleuen left
07:26
amkrankruleuen joined
07:34
hanekomu joined
07:41
amkrankruleuen left
07:42
flussence left,
amkrankruleuen joined
07:44
flussence joined
07:48
kaare__ left
07:49
amkrankruleuen left,
amkrankruleuen joined
|
|||
dalek | ecza: 8f41f1f | sorear++ | / (2 files): Micro-optimization to builtin type checking |
07:54 | |
ecza: b6269f8 | sorear++ | / (6 files): A new home for the random small scripts I used for this |
|||
ecza: 0e96ea2 | sorear++ | / (3 files): Fix Mu ~~ $smartmatch |
|||
07:59
silug joined
|
|||
moritz | sorear: return.t failed 6 tests | 08:02 | |
t/spec/S04-statements/return.t | |||
t/spec/S32-hash/pairs.t dies | 08:04 | ||
t/spec/S03-operators/repeat.t Failed test: 28 | 08:05 | ||
moritz does discontinuous integration | |||
sorear | ...TEST_JOBS? | ||
why out of order? | |||
08:05
Su-Shee_ is now known as Su-Sh,
Su-Sh is now known as Su-Shee
|
|||
moritz | TEST_JOBS=2 | 08:06 | |
no, I just missed repeat.t while it was scrolling by, but saw it in the summary | |||
sorear | return is doing something odd. | ||
moritz | niecza: say +"3a" | 08:07 | |
p6eval | niecza v6-46-gb037fe8: OUTPUT«Unhandled exception: System.FormatException: Unknown char: a at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0  at System.Double.Parse (System.String s, IFormatProvider provider) [0x00000] in | ||
..<filename unkno… | |||
moritz | I'm pretty sure that should return 3, warn | ||
sorear | I'm dreading having to write a number parser, but it seems inevitable | ||
moritz | we'll need one for rakudo too | ||
sorear | c.f. the recent debacle where parsing just the right string makes Java's number parser hang | 08:08 | |
moritz | just so that +$string returns the right type | ||
sorear | which went unnoticed for 18 years because number parsers are so hard to 1. visually scan for bugs 2. test for bugs | ||
I mean floating point base conversion | |||
integer base conversion isn't that bad at all | 08:09 | ||
Oh. | 08:10 | ||
I fixed eval to pass control exceptions | |||
eval_dies_ok 'return' causes a return from &eval | 08:11 | ||
if &eval was a bare block, it would still cause a return from &eval_dies_ok | |||
08:11
silug left
|
|||
sorear wonders whether to back out this change, or what | 08:12 | ||
or, hehehehehe, I could add a CONTROL { } to eval_dies_ok :) | 08:13 | ||
or, I could change the test such that it isn't checking eval behavior | |||
08:15
amkrankruleuen left
08:18
MayDaniel joined,
MayDaniel left
|
|||
felher | l/go laber | 08:19 | |
08:21
amkrankruleuen joined
08:24
aindilis left
08:40
frettled_ joined
08:43
frettled left
|
|||
dalek | ecza: 2742d7d | sorear++ | / (3 files): Block parameters default to Mu, method invocants to ::?CLASS |
08:44 | |
sorear | moritz: opinions on the best return.t action? | ||
08:45
awoodland left
|
|||
moritz | sorear: currently I think eval should imply CONTROL, just like it implies CATCH | 08:45 | |
sorear: though in the long run I'd prefer it if it implied none of the two | |||
sorear | right now niecza's eval implies neither | 08:46 | |
so I guess that's +1 for | |||
"eval_dies_ok does CONTROL" | |||
moritz | sounds sane-ish | 08:47 | |
08:54
frettled joined
|
|||
sorear | rakudo: my ($x) = (^*); say $x; | 08:56 | |
p6eval | rakudo 048573: OUTPUT«Cannot take numeric value for object of type Whatever in 'Any::Numeric' at line 1496:CORE.setting in 'prefix:<^>' at line 7674:CORE.setting in main program body at line 22:/tmp/dlq0LlewTF» | ||
09:01
frettled_ left
09:04
uniejo joined
|
|||
dalek | ecza: d124518 | sorear++ | t/spectest.data: Remove S32-hash/pairs; it relies on Pair cmp Pair, which was never really supported |
09:07 | |
ecza: e9691cc | sorear++ | lib/ (2 files): xx and Whatever/Array, fudging eval_*_ok to choke on control exceptions |
|||
ecza: 1131cc6 | sorear++ | / (2 files): Honor parameter types in inline blocks |
09:24 | ||
ast: 625cd92 | sorear++ | S03-junctions/ (2 files): Unfudge for block Mu parameters |
|||
09:31
woosley left
09:35
pernatiy joined
|
|||
dalek | ecza: 0da903b | sorear++ | lib/ (2 files): Implement junction arguments to subscripters |
09:37 | |
ast: 8315f60 | sorear++ | S03-junctions/ (2 files): Unfudge and fix tests for junction indexes |
|||
sorear | niecza> my %hash = :foo, :quux; ?(%hash{any <foo bar>}:exists) | 09:39 | |
Bool::True | |||
niecza> my %hash = :foo, :quux; ?(%hash{all <foo bar>}:exists) | |||
Bool::False | |||
\o/ | |||
sorear -> sleep (maybe?) | |||
moritz | sorear++ | 09:47 | |
09:53
daniel-s joined
10:01
MayDaniel joined,
math1 joined
|
|||
math1 | Bonjour | 10:01 | |
10:02
JimmyZ joined
10:04
daniel-s left
10:06
mtk left
10:11
_jaldhar joined
10:15
mtk joined
|
|||
math1 | Il y a t'il quelqu'un qui pourrait me renseigner sur un problème de compilation de module PERL via CPAN ? | 10:15 | |
PHP::Interpreter | |||
tadzik | I thought this is the line from the Call of Cthulu | 10:16 | |
flussence | rough translation: "this won't install, halp?" | 10:17 | |
math1 | Hi i have a problem to compile PHP::Interpreter with cpan. Does anyone can help me ? | 10:18 | |
flussence | math1: you might get better answers on a perl5 channel, but is there an error message? | 10:21 | |
10:42
MayDaniel left
10:47
daxim joined
|
|||
math1 | yep | 10:47 | |
pastebin.com/uey5i3dk | 10:49 | ||
flussence | the comments in that test seem to suggest they know it'll fail, so it should be safe to force-install it | 10:53 | |
10:54
f00li5h joined,
f00li5h left,
f00li5h joined
|
|||
math1 | I dit it. I "make installed" it | 10:54 | |
It works partly but not completly | 10:55 | ||
I mean I compiled it | |||
I instanciate a php class in my perl script | 10:56 | ||
It works… In fact It's about another problem… lol | 10:57 | ||
I have a segmentation fault when I use PHP::Interpreter in my perl script | |||
flussence | hm, that module hasn't been updated since 2008. Maybe it just doesn't work with newer PHP versions. | 10:59 | |
math1 | I pastebin.com/xv9PFa8k | 11:00 | |
I found many problem about this... | |||
www.perlmonks.org/?node_id=612502 | |||
I followed this topic too | 11:01 | ||
The solution is on the last post | |||
11:08
wamba joined
11:09
math1 left
11:10
pernatiy left
11:11
silug joined
11:12
wamba left
11:14
donri joined,
pernatiy joined
11:15
wamba joined
11:21
Chillance joined
11:22
silug left
11:24
koban` left
11:43
Vlavv` joined
11:44
Vlavv left
11:49
pernatiy left
11:50
molaf_ joined
11:53
molaf left
12:00
yinyin left
12:01
Vlavv` left
12:03
kaare__ joined
12:13
Vlavv` joined
12:15
_jaldhar left
12:18
satyavvd left
12:32
wknight8111 joined
12:33
bluescreen10 joined
12:37
bluescreen10 left
12:42
Chillance left
12:46
thou joined
12:53
bluescreen10 joined
12:54
Chillance joined
13:02
Holy_Cow joined
13:18
isBEKaml joined
13:22
koban` joined
13:23
ymasory joined
13:39
birdwindupbird left
14:01
wamba left
14:02
spq joined,
hudnix joined
14:11
pernatiy joined
14:21
hercynium joined,
silug joined
14:28
DarthGandalf left,
MayDaniel joined
14:32
MayDaniel left
14:34
daxim left
14:38
jfried left
14:39
jfried joined
14:40
silug left
14:43
wamba joined
14:46
kaare__ left
14:55
uniejo_ joined
14:57
uniejo_ left
14:58
koban` left
15:02
slavik joined
15:09
isBEKaml left
|
|||
sorear | good * #perl6 | 15:22 | |
15:22
bluescreen10 left
15:23
bluescreen10 joined
|
|||
TimToady | o/ | 15:28 | |
sjn | o7 | 15:33 | |
perplexa | o> | ||
15:35
woosley joined,
woosley left
15:37
Holy_Cow left
15:40
MayDaniel joined
15:48
MayDaniel left
15:50
bluescreen10 left
|
|||
sorear | bleh | 15:54 | |
after removing my old Parrot/Rakudo install, a clean build of Rakudo master also fails | |||
strace confirms that except for system libraries it's not picking up anything outside the Rakudo root | 15:55 | ||
what else could it be? | |||
15:56
nymacro left
|
|||
sorear | gdb ./perl6 / run -> got SIGSEGV in Parrot_Object_getprop from sort_candidates | 15:56 | |
jnthn | :/ | 15:58 | |
15:58
DarthGandalf joined
|
|||
jnthn | Hard to guess. | 15:58 | |
sorear: Low memory environment? | |||
Wonder if it triggers GC more than most people get it and tickles a missing write barrier or something. :s | 15:59 | ||
16:00
nymacro joined
|
|||
sorear | jnthn: yeah 98 mwords | 16:01 | |
96 | |||
jnthn: otoh, nom builds successfully | 16:02 | ||
the master segfault occurs in startup, before it even gets to the repl | |||
however, the stage1 starts successfully, as evidenced by being able to compile core.pm | |||
jnthn | sorear: Did nom build in a sane-ish amount of time? | 16:04 | |
sorear | stefan@stefans:~/dl/rakudo-ng$ parrot_install/bin/parrot -g ms2 ./perl6.pbc > say 2 + 2 | ||
4 | |||
jnthn: yes | |||
> | |||
looks like def. a GC issue | |||
shall I clean again and try with --gen-parrot --gen-parrot-option=(what do I put here to enable line numbers)? | 16:05 | ||
jnthn: even master built in a sane amount of time | |||
core.pm took 320 out of 384 mb and didn't hit swap | |||
took just under 10 mins iirc | 16:06 | ||
not like the 10 hour builds that drove me away from Rakudo in the first place... I'm impressed by everyone's work | |||
jnthn | sorear: nom should use a good bit less memory for Cusrsor/Match nodes. We need PAST switched to 6model to win a bunch more on build memory. | 16:07 | |
sorear: Sorry, not sure what flag you're looking for... | |||
Though Parrot's Configure.pl --help should tell you. | |||
sorear | the question was more "shall I" than "how do I" | 16:08 | |
jnthn | You could clean and try again, or I could hunt for a missing write barrier... | ||
sorear | I can look for how on my own, but won't bother if it won't help | ||
jnthn | If it's in sort_candidates that gives me a good guess. | ||
16:08
am0c joined
|
|||
sorear | eh, probably second-level damage | 16:09 | |
jnthn | Maybe, but it's also an easy area of the code base to believe would have a missing WB. | ||
sorear | "Invalid runcore gcdebug requested" | 16:10 | |
WTF #parrot WHY | |||
that was our only prayer | |||
jnthn | sorear: Does -G help? | 16:11 | |
(that disables GC) | |||
oh, wait...did you do that already... | |||
no, you did ms2 | |||
Ah, that makes it even more likely to be missing WB. | |||
sorear | -G also fixes it | ||
parrot ought to have an option to print the size in bytes of the nursery | 16:13 | ||
and another option to set it explicitly | |||
so you can reproduce this | |||
16:15
jedai left,
jedai joined
|
|||
sorear | help, I'm getting back my old cynicism and mistrust about #parrot | 16:15 | |
16:18
nymacro left
|
|||
sorear | rakudo: each(1,2,3).say | 16:20 | |
p6eval | rakudo 048573: OUTPUT«Could not find sub &each in main program body at line 22:/tmp/hvtZU5YRd0» | ||
sorear | jnthn: what do you think about each junctions? | ||
jnthn | I...didn't think too much about them. :) | 16:21 | |
sorear | I don't like em | ||
jnthn | They're newer than when I last did any work on Junctions in Rakudo. | ||
16:22
kaare__ joined
|
|||
sorear | each junctions are supposed to wrap a lazy list instead of an RPA | 16:22 | |
which means that most of niecza's junction logic is duplicated | |||
jnthn | They promise ordering also? | 16:23 | |
16:23
bluescreen10 joined
|
|||
sorear | yes | 16:23 | |
16:23
mj41 left
|
|||
jnthn | meh, I barely consider that a junction | 16:23 | |
grrr...whenre's it spec'd... | 16:24 | ||
Junctions section in S03 seems not to mention them. | |||
16:24
JimmyZ left
|
|||
jnthn | S02 mentions an Each type | 16:25 | |
sorear | S09:994 | ||
jnthn | (e.g. it's disctinct from Junction in a typeful way) | ||
sorear | S09:1066 | ||
16:25
DarthGandalf left
|
|||
sorear | oh yay, "conjectural" | 16:26 | |
that means I can kill it with fire if I don't want it | |||
jnthn | [This section is considered conjectural.] | ||
:) | |||
I can see the point of it. | |||
But yeah, it looks somewhat distinct from junctions. | |||
sorear | meh | 16:27 | |
there's little practical difference between if (kind == EACH) and if (type == Each), either way it involves massive code duplication in autothreading | |||
16:31
DarthGandalf joined
|
|||
jnthn | bbiab | 16:37 | |
16:43
flussence left
16:44
flussence joined
|
|||
dalek | p: 473c265 | tadzik++ | src/HLL/Compiler.pm: Quit REPL and print a newline on ^D This also works in Rakudo/nom, which makes RT #70297 fixed in nom. |
16:45 | |
16:46
silug joined
|
|||
sorear | rakudo: say (5 cmp "5") | 16:48 | |
p6eval | rakudo 048573: OUTPUT«0» | ||
sorear | rakudo: say (5 eqv "5") | ||
p6eval | rakudo 048573: OUTPUT«Bool::False» | ||
pmichaud | rakudo : say (5 cmp "5") | 16:49 | |
rakudo: say (5 cmp 5) | |||
p6eval | rakudo 048573: OUTPUT«0» | ||
pmichaud | hmmmm | ||
sorear | rakudo: say (5 cmp 5.0) | 16:50 | |
p6eval | rakudo 048573: OUTPUT«0» | ||
pmichaud | ah, we're not converting to bool | ||
sorear | rakudo: say (5 cmp 6.0) | ||
p6eval | rakudo 048573: OUTPUT«-1» | ||
sorear | rakudo: say (5 cmp 4.0) | ||
p6eval | rakudo 048573: OUTPUT«1» | ||
pmichaud | we're just returning the result of cmp_i_i_i directly | ||
easy fix | 16:51 | ||
sorear | I think this behavior is in violation of S03:3308 and S03:3296 | ||
discuss | |||
16:51
geekosaur left
|
|||
pmichaud | which behavior are you referring to? | 16:51 | |
16:52
allbery_b joined
|
|||
sorear | two values never compare as Order::Same / 0 unless they are exactly the same type | 16:52 | |
16:52
cdarroch joined,
cdarroch left,
cdarroch joined
|
|||
pmichaud | I've had longish discussions about problems with cmp in the past | 16:53 | |
what should they return if not same type? | 16:54 | ||
(i.e., this is an unresolved section of the spec) | |||
(or the spec is showing fossils) | 16:55 | ||
sorear | last I heard/dreamt, it was $a.WHAT.perl cmp $b.WHAT.perl | 16:57 | |
pmichaud | that doesn't seem plausible | ||
16:57
wanradt_ joined
|
|||
pmichaud | more specifically, what result are you expecting for 5 cmp "5" ? | 16:58 | |
(last I heard/dreamt, &infix:<cmp> "fell back" to string semantics or something like that.) | 16:59 | ||
(but I could've missed some later discussion on the topic) | |||
sorear | pmichaud: Less | 17:04 | |
pmichaud | sorear: you mean Order::Increase? (less than zero?) | 17:05 | |
sorear | uh | ||
rakudo: say (1 cmp 2).perl | |||
p6eval | rakudo 048573: OUTPUT«-1» | ||
sorear | rakudo: say ("a" leg "b").perl | ||
p6eval | rakudo 048573: OUTPUT«-1» | ||
jnthn | Doesn't cmp return 0 for same, -1 for less, 1 for greater? | ||
sorear | some .perl | ||
jnthn: no | 17:06 | ||
jnthn | Ah | ||
Well | |||
It seems it does in Rakudo ;) | |||
sorear | yes, Order::Increase, pmichaud | ||
jnthn | Oh...unless it's an enum that's numifying in an entertaining way :) | ||
pmichaud | why would 5 cmp "5" be Order::Increase, then ? | ||
17:06
awoodland joined
|
|||
sorear | because "Int" lt "Str" | 17:07 | |
pmichaud | huh? | ||
sorear | cmp isn't supposed to make sense, it's supposed to produce a total order. c.f. cmp(Complex,Complex) | ||
Complex isn't an ordered field and there's no sensible <=> for it | 17:08 | ||
pmichaud | you mean that my @a = (5, "4"); say sort @a should result in a list with 5 and "4" ? | ||
(in that order) | |||
sorear | yes. | ||
pmichaud | I'd love to see that discussion. :-) | ||
sorear | if the user has a list of mixed values and wants them all to be sorted as numbers, they should :by(&[<=>]) | ||
moritz | iirc cmp should fall back to infix:<leg> (string comparison) if the types don't match | 17:09 | |
but of the values, not of their types | |||
sorear | the main problem I have with my interpretation is that Ranges don't work | ||
pmichaud | what moritz++ said is what I remember | ||
sorear | 1 .. 2.5 # the smallest Num is larger than every Int. Oops! | 17:10 | |
ok. | |||
do either of you remember where you got this from? | |||
moritz | here | ||
sorear | also, what about 1 .. 40.5 ? | 17:11 | |
5 gt 40.5 | |||
pmichaud | ranges use the type of the lhs, iirc | ||
so since 1 is numeric, it uses a numeric comparison always | |||
moritz | 1 and 40.5 are both Numeric | 17:12 | |
pmichaud | I think these were discussed/decided/made tentative on #perl6, but the spec might not have been updated | ||
moritz: they're both numeric but not necessarily same type | |||
moritz | it's in the spectests, more or less | ||
pmichaud: yes, but cmp should know how to compare Real numbers, in the very least | |||
pmichaud | Real probably makes sense | ||
and indeed, Rakudo has &infix:<cmp>(Real, Real) defined. | 17:13 | ||
TimToady | it's actually an impossible problem to make consistently consistent | ||
sorear | \o/ TimToady | ||
TimToady | any given type may define an order that is inconsistent with Real v Real | ||
pmichaud | I think sorear++ is just looking for a spec update or fossil extraction | 17:14 | |
since the spec still talks about cmp in terms of eqv semantics | |||
TimToady | the sort on type first is the only consistent approach, but doesn't dwym at all | ||
17:14
fhelmberger left
|
|||
sorear | yeah, I want ===, eqv, and cmp done _right_ before v7 | 17:15 | |
TimToady | the whole thing starts to fuzz over into natural sorting as soon as you start to twim | ||
*d | |||
pmichaud | sorear: no problem, if you're willing to accept that "right" might change over time :-P | ||
sorear | so I want to understand the rules... | ||
so you say "eqv" and "cmp" are no longer related? | 17:16 | ||
moritz | things that are eqv should also be cmpable | ||
TimToady | please don't treat me as an oracle in this case :) | 17:17 | |
moritz | erm, if $a eqv $b then ($a cmp $b) == Order::Same | ||
pmichaud | I tend to think that eqv and cmp occupy different spaces | ||
$a eqv $b implies $a cmp $b == Order::Same, but if $a !eqv $b we can't say anything about $a cmp $b | 17:18 | ||
not based solely on eqv-ness, at any rate. | |||
moritz | right | 17:19 | |
pmichaud | TimToady: you're not the oracle here -- you're The Decider. :-P | ||
(in this case) | |||
TimToady | decoupling cmp makes sense from a usability perspective; you want all lists to be sortable, even if they aren't :) | ||
sorear | pmichaud: S03 says that for immutable types, === and eqv coincide. Agree? | 17:20 | |
TimToady | hence, we impose orderings on Complex and Pair | ||
even though they naturally don't work that way | |||
17:20
lumi joined
17:22
masak joined
|
|||
masak | oh hai | 17:22 | |
sorear | hello masak | ||
TimToady | so I think we say that cmp works like eqv only when the types are the same | ||
tadzik | hai masak | ||
pmichaud | sorear: I agree, unless it's wrong, in which case I disagree. :-) :-) | ||
moritz | sorear: sounds right | ||
sorear | masak: you just landed in the middle of an Exciting Spec Discussion. | ||
masak | ooh! | 17:23 | |
TimToady | .oO(re-exciting re-spec re-discussion) |
||
masak re-backlogs | |||
17:24
wamba left,
Mowah left
|
|||
sorear | so, to summarize what I've understood so far: | 17:24 | |
=== : Stateful indistinguishability | |||
17:24
wamba joined
|
|||
sorear | eqv : Snapshot indistinguishability | 17:24 | |
TimToady | and if we impose Numeric//Stringy generic semantics on cmp of different types, we strong suggest that Numeric and Stringy types respect the same ordering within their types | ||
masak | sorear: that is my understanding as well. | ||
sorear | cmp : Within each type, an order which generates eqv, but compares different types in a DWIM way | ||
TimToady | *strongly | ||
however, we can't do that for both Numeric and Stringy simultaneously and stay consistent | 17:26 | ||
"5" cmp "a" vs "5" cmp 4 etc. | 17:27 | ||
vs "5" cmp "40" | |||
so either we unify the Numeric/Stringy into natural sorting (which probably is inconsistent with the individual types eqv semantics) or we just suffer out-of-orderness with "5" cmp 5.0 | 17:28 | ||
that's the fork | 17:29 | ||
17:29
Mowah joined
|
|||
colomon thought it was always a given that "5" cmp 5.0 would not be a numeric comparison.... | 17:29 | ||
TimToady | we can pretty easily write the non-natural orderings, which tends to argue that cmp should default to natural | 17:30 | |
pmichaud | 05:22 <quietfanatic> What bothers me isn't the ambiguity in distinction, it's that there's two possible distinctions that aren't the same. | ||
05:23 <TimToady> if things like that bother you, either you should or shouldn't be a language designer. :) | |||
(sorry, had to repost that useful quote. ) | |||
TimToady | lol, really | 17:31 | |
pmichaud | colomon: it's not ever been that way in the spec. :-) | ||
colomon | "Some do, and some don't." (Reading too much Pooh this year.) | ||
TimToady | compounding the difficulty is that some sort algorithms blow up if you give circular orderings | 17:32 | |
sorear | heh, or worse... | 17:33 | |
I've seen qsort segfault before | |||
colomon | errr... seems like the spec definition of cmp is just plain broken? it doesn't seem to define an ordering at all. | ||
sorear | colomon: that's why I started this discussion | ||
colomon | sorear++ | ||
pmichaud | (re-started :-) | 17:34 | |
TimToady | the only solution consistent with letting types define their own cmp is to order based on types first | 17:35 | |
if we drive cmp in that direction, then we need to make it drop-dead easy to get at the natural ordering differently | 17:36 | ||
and maybe make sort default to the natural ordering | |||
colomon | TimToady: I know that's been said above and here again, but I didn't understand the logic either time. Can you try one more time for the very slow amongst us/ | ||
? | |||
TimToady | but individual types may not override the natural ordering | ||
PerlJam thinks that if there really were a "natural ordering" we wouldn't be having this conversation ;) | 17:37 | ||
pmichaud | colomon: I think TimToady is saying we need two forms of ordering, and that sort uses "natural ordering" (which isn't defined by &infix:<cmp>) | ||
note that quite a bit uses &infix:<cmp> besides, sort, also :-) | 17:38 | ||
TimToady | if you create fallbacks between types that allow mixing of values in the result, then you automatically get inconsistencies if the two types have different ideas on how to sort values that could be construed either way | ||
sorear | does natural ordering need to mix stuff such that 4 before "5" before 6 ? | 17:39 | |
TimToady | so suppose we have a Real generic fallback that works like you might expect, and we introduce a MyInt type that has cmp sorting in reverse order, to be perverse | 17:40 | |
two MyInt types will sort in the opposite order than two equivalent values that go through the Real order | |||
colomon | ooooo.... and that can create a situation where A is less than B, and B is less than C, and C is less than A? | 17:41 | |
sorear | if not, then I propose sub cmp($a,$b) { ($x ~~ Real ?? "Real" !! $x.WHAT) leg ($y ~~ Real ?? "Real" !! $y.WHAT) || ($x ~~ Real ?? $x <=> $y !! $x.cmp($y)) } | ||
TimToady | colomon: which is why I talked about circularities blowing up sort algos | ||
sorear | along with #`(Mu) method cmp($other) { ~self leg ~$other } | 17:42 | |
pmichaud | note that Parrot allows circularities already, with its broken 'cmp' semantics. | ||
TimToady | sorear: natural sorting will intermix numbers and strings that start with numbers | ||
I believe natural sorting can be defined consistently, but it's not trivial, and must enforce its own ideas on the individual types | 17:43 | ||
17:43
zby_home_ joined
|
|||
TimToady | s/consistently/consistently for all types that map to builtin types/ | 17:43 | |
pmichaud | "10", 2, "5" in Parrot end up with "10" cmp 2, 2 cmp "5", and "5" cmp "10" all being > 0 :-) | 17:44 | |
er, wait, that's not right | 17:45 | ||
anyway, it's possible to achieve in Parrot :-) | |||
jnthn | it's possible to fail to achieve in Parrot too :P | 17:46 | |
sorear | so it's like cmping over .Str.comb(/ <STD::number> || . /) ? | ||
pmichaud | parrot takes the type of the first operand as the type of comparison | ||
colomon | almost seems like what we're arguing is that there should be no cmp at all... | ||
pmichaud | so "3" cmp 20 and 20 cmp "3" are both >0 | 17:47 | |
colomon | just like you can no longer as for the length of a string, but have to ask for the number of chars or graphs or bytes or whatever | 17:49 | |
PerlJam | colomon: only if there's no object system to go with no cmp. | ||
flussence | .oO( maybe there should be a .COMPARES, like .ACCEPTS? ) |
||
colomon | no, my point is if you had to explicitly ask for what ordering to sort by, this problem goes away. | 17:50 | |
PerlJam | colomon: useful defaults (DWIM) is way better than requiring the poor, unwashed masses to make a decision. A little more pain for the language designer but much happiness for the language users. (<insert star trek quote here>) | 17:51 | |
17:52
wamba left
|
|||
colomon | PerlJam: useful defaults imply that there is a sensible default. Other than just making leg the default, like in Perl 5, I'm no longer sure there is such a thing. | 17:53 | |
PerlJam | colomon: or, put another way ... if we get rid of cmp, then we'll have to provide some standard comparators that are drop-dead easy to use (so that our users don't go crazy) and one of them will contain the comparison that we're talking about for cmp | 17:54 | |
pmichaud | comparison*s*, I think. | ||
PerlJam | yes. | ||
moritz | PerlJam: cmp is *very* convient, because it means you can sort arrays of numbers with the default op | ||
pmichaud | ...except when you can't. :-) | 17:55 | |
moritz | PerlJam: and at the same time you can sort arrays of strings with the default op | ||
pmichaud: usually you can. | |||
pmichaud: which why it's convenient | |||
pmichaud | but it is very nice to be able to do @list.sort(+*) to mean numeric sort | ||
without having to also specify a :by | |||
17:55
lumi left
|
|||
moritz | but still much more obscure than @list.osrt | 17:55 | |
*sort | 17:56 | ||
PerlJam | unless @list.sort does something unexpected :) | ||
17:56
lumi joined
|
|||
pmichaud | (my point being that +* for numeric sort requiers that sort know how to automagically sort numerically when needed) | 17:56 | |
*requires | |||
(as opposed to defaulting to always-leg semantics) | |||
colomon | I could maybe see making .sort actually examine the list to see if it is all numbers or number strings. | ||
TimToady | the two inconsistent things we expect from default sort: a) sort naturally, and b) sort fast | 17:57 | |
pmichaud | afk, lunch | 17:58 | |
PerlJam | The first is DWIM and should be huffmanly short, while the second thing falls under the rubric of "optimization" and so should be huffmanly long. Right? | 17:59 | |
17:59
thou left
|
|||
colomon | TimToady: okay, one more thing I'm not understanding in this discussion: why a distinction between cmp and "natural sort"? If you can come up with a consistent "natural sort", shouldn't that be how cmp is defined? | 17:59 | |
18:00
wanradt___ joined
|
|||
moritz | colomon: natural sort usually does much more than what we envision for cmp semanits | 18:00 | |
TimToady | yes, we can, but then we can't also let types define their own cmp inconsistent with that | ||
18:01
wanradt_ left
|
|||
moritz | ie compare the numbers in 'ab100' and 'ab99' by number | 18:01 | |
TimToady | it's easy to specify leg or <=> semantics with ~* or +*, so I don't think either of those should be sort's default | 18:02 | |
18:02
impious joined
|
|||
TimToady | natural sorting tends to be a standalone set of remapping semantics, whereas cmp is a system of cmp operators | 18:02 | |
colomon | except if cmp compares types first, then you cannot specify leg or <=> with ~* or +*, because there are Stringy and Numeric subtypes | 18:03 | |
TimToady | we're confusing two different meanings of "cmp" here | 18:04 | |
it's not inconsistent with the type's defining their own cmp, since Stringy and Numeric both coerce to some most-general type and use that type's cmp | 18:06 | ||
18:06
impious left
|
|||
TimToady | there's also the notion of a general cmp that is a collation order outside of types, and that's what we need to give a different name | 18:06 | |
18:06
am0c left
|
|||
TimToady | several different names, it seems | 18:07 | |
PerlJam | So, when two different types meet in a comparator they're both coerced to a more general type? | 18:09 | |
TimToady | pretty much have to be, or you end up with a combinatorial explosion | 18:10 | |
in the general case of collating sequences, they're remapped to a different string that you can sort stupidly | |||
sorear | sorry, distracted. | 18:11 | |
I'm back | |||
PerlJam | The "general cmp that is a collation order outside of types" could be called "col" :) | 18:12 | |
A col B (how does B collate with respect to A) | |||
or vice versa, I'm not sure about transitivity here. | |||
moritz | when I see "col" I think "column", not "collate" | 18:13 | |
PerlJam | moritz: that's just a matter of (re)education ;) | ||
yath | +1 | ||
18:13
aindilis joined
|
|||
masak | "col" could also mean "color". | 18:13 | |
I get that ambiguity ("color"/"column") a lot when programming board games. | |||
tadzik | or "collegaue", or however you write that | 18:14 | |
18:14
MayDaniel joined
|
|||
moritz | tadzik: cow-orker :-) | 18:14 | |
sorear | TimToady: why do you think types need to be able to override cmp? | ||
TimToady | isd "increase, same, decrease" | ||
are you asking why types should be allowed to define their own ordering? | 18:15 | ||
PerlJam | obscure enough that no one has any preconceived notions :) | ||
colomon | sorear: because you need to be able to provide a comparison operator for whatever weird type you have. | ||
well, "need" | |||
TimToady | sorear: but your question tangles the two different meanings of cmp that we're trying to detangle | ||
PerlJam | I want to sort Circles, Triangles, Squares, and any other manner of polygon. | 18:16 | |
hence, I probably need to define my own cmp | |||
TimToady | (if that's the cmp that we end up calling cmp) | ||
18:17
MayDaniel left
|
|||
TimToady | it's like trying to distinguish the Perl language's + operator that enforces numericity with a Python object's notion of what a + method does | 18:17 | |
PerlJam | isd might work, though I tend to want to put decrease on the left for some reason, so .... dsi :) | 18:18 | |
TimToady | here we can't just rely on the difference between single and multiple dispatch, as we can with + | ||
or maybe we should, and comparisons on a type should go through single dispatch | 18:19 | ||
to force the two arguments to be considered under the same type | |||
or we disallow/discourage creation of cmp multis with differing arg types | 18:20 | ||
or whatever we call the type's view of ordering, if not cmp | |||
PerlJam: except decrease first would be >=< instead of <=> | |||
the main problem with isd is that it's not as funny as "leg" :) | 18:21 | ||
moritz | isd sounds like some disorder :-) | ||
PerlJam | In my head dsi is a nice little graphic that looks like a cup, while yours looks like an upside down cup. | ||
moritz | the mixture between IRS and a disorder :-) | 18:22 | |
18:22
pyrimidine left
|
|||
TimToady | there's also bea, if we name the type's comparison based on before/eqv/after | 18:23 | |
and reserve cmp for the intertype ordering | |||
PerlJam | bea is my mother-in-law so ... -1 from me :) | ||
TimToady | you don't want to be ordered by your mother-in-law? :P | 18:24 | |
I think 'bea' for intra-type and 'cmp' for extra-type makes some sense to me | 18:25 | ||
where the default cmp is the default sort order | 18:26 | ||
which is probably not natural sorting | |||
but something simple like type-first, then type's bea (which for compound types collates each element in turn) | |||
and then we give a simple name to natural sorting | 18:27 | ||
that doesn't use cmp | |||
PerlJam | feels rightish to me. | ||
moritz thinks natural sorting belongs into a module, because there are so many ways to do it | |||
TimToady thinks languages that define one by default are at an advantage in the user's mind | 18:28 | ||
it would be trivial to override the built-in in p6; we designed it that way... | |||
use order MyNaturalSort; order @list; | 18:29 | ||
or just 'use MyNaturalSort' overrides order lexically | 18:30 | ||
18:30
jferrero joined,
Tedd1^ left
|
|||
TimToady | or just give it a different name and use it, to avoid confusion | 18:31 | |
order vs sort is probably good huffman, where order is doing a bit more work | |||
otoh, order seems more like it ties directly to Order:: | 18:33 | ||
so I wonder if cmp goes away entirely and we end up with $a ord $b for an ordering comparison | 18:35 | ||
which both constructively and destructively interferes with prefix:<ord> | |||
I don't like $a order $b because that's too heavy for the binary comparison, and visually confusing with an order listop | |||
oh, wait, now I'm confusing the two different things. order would use ord, and sort would presumably use cmp, which is the dumb one | 18:37 | ||
or maybe sort should use "$a srt $b" :) | |||
sorear | srt sounds like minmax to me | 18:38 | |
also like the Pentium FDIV algorithm | |||
masak | grmmmbl... minmax... :/ | ||
TimToady should go take a shower before he thinks too hard(er) | 18:39 | ||
sorear | this discussion is making me even more confused. I think. | 18:41 | |
TimToady | I think in this case it indicates progress. :) | 18:43 | |
masak | rakudo: say (1 minmax 2).perl | 18:44 | |
p6eval | rakudo 048573: OUTPUT«1..2» | ||
TimToady | because when I see how we get confused here, it's indicative that neurotypicals will get even more confused at just these points, and we need to be carefuller | ||
masak | rakudo: say ([minmax] 4, 2, 7, 1, 3).perl | 18:45 | |
p6eval | rakudo 048573: OUTPUT«1..7» | ||
pmichaud | back from lunch | ||
masak | rakudo: say (1 minmax (4 minmax 7)).perl | 18:46 | |
p6eval | rakudo 048573: OUTPUT«1..7» | ||
masak | rakudo: say (5 minmax (2 minmax 18)).perl | ||
p6eval | rakudo 048573: OUTPUT«2..18» | ||
masak | rakudo: say ((5 minmax 18) minmax (2 minmax 11)).perl | 18:48 | |
p6eval | rakudo 048573: OUTPUT«2..18» | ||
masak | remarkable. | ||
sjohnson | masak: ! | ||
masak | sjohnson! \o/ | 18:49 | |
18:49
allbery_b is now known as geekosaur
|
|||
masak | sjohnson: how's life with Perl? | 18:52 | |
sjohnson | pretty good | ||
been doing quite a bit of p5 stuff last few weeks at work | |||
one of them being a frontend for vim | |||
which is making my life much easier and less headache prone | 18:53 | ||
moritz thought vim already was a frontend | |||
masak | was just going to say that :) | ||
sjohnson | well, let me give you an example.. | ||
if you accidently pipe something to vim without doing the - thing | |||
it causes a headache | |||
also if you do: vim something.pl | grep something | |||
(don't ask why i'd ever do it, it's a bad habit of using the up arrow in bash improperly!) | 18:54 | ||
masak | this sounds eerily familiar. | ||
sjohnson | well i prevented both those things from happening. also hate the msg that comes up when a swap file is edited, i'd rather it tell me who's editing it and not ask me anything, and if i'm editing it myself on another screen window, have it switch the screen window for me | ||
jdhore1 | sjohnson, I can haz link? | ||
sjohnson | jdhore1: sure | 18:55 | |
oh yeah, also another thing it does | |||
is warn you with a question that you don't have write permission on a file | |||
jdhore1: preparing for a git push | 18:56 | ||
masak | sjohnson: ah. I might've been thinking about pipe.vim: www.vim.org/scripts/script.php?script_id=2769 | ||
sjohnson: have you seen it? | |||
sjohnson | nope | 18:57 | |
not really sure i understasnd what this does *scratches head* | |||
masak | it lets you pipe things into vim. | 18:58 | |
sjohnson | well.. i mean i do that already with using vim - | 19:01 | |
echo moose | vim - | |||
you're probalby thinking of something more advanced, though | |||
sjohnson doesn't use the advanced stuff | |||
19:08
benabik left,
benabik joined
|
|||
masak | no, I don't know offhand how pipe.vim is different from 'vim -'. | 19:10 | |
sorear | right. unix sucks. | 19:11 | |
sjohnson | jdhore1: just writing a bit of documentation, in case you actually decide to try this out | ||
sorear | the system is very low on DWIM-factor | 19:12 | |
jdhore1 | sjohnson, I can read the code as documentation :P | ||
sorear | hello sjohnson. | ||
sjohnson | sorear: howdy! | ||
sorear | bah. | 19:14 | |
'my $i = -10_000_000; 1 while $i++' | |||
this is basically a best case for the niecza optimizer... it's still 2.5x slower than 5.12 | |||
masak | sorear: any idea why? | 19:15 | |
sorear | this is an embarrasment... | ||
perl5 is classically regarded as one of the slowest currently used interpreters, and I'm losing to it with a JIT | |||
masak | :P | 19:16 | |
sorear | well, it's probably relevant that Perl 5 can run that loop without allocating | 19:17 | |
since the $x container is a Giant Union Of Doom that can hold unboxed ints | 19:18 | ||
19:18
icwiener joined
|
|||
sorear wonders if adding polymorphically unboxing containers to niecza would make any sense | 19:18 | ||
sadly, this being a managed environent, I can't overlap pointer and integer fields | |||
masak | management is killing performance! :P | 19:19 | |
19:20
birdwindupbird joined
19:30
math1 joined
19:37
envi left
19:38
sftp joined
|
|||
sorear | so maybe Variable could be a structure with an integer type_tag, 64 bits of nonpointer storage, and a pointer | 19:46 | |
and it could directly hold Int, Num, Str, Bool, Any, and use the pointer to a P6any otherwise | |||
sjohnson | jdhore1: github.com/smujohnson/web1-home/bl...bin/vim.pl | ||
sorear | would be a real pain to program for C# though | 19:47 | |
I'd rather use heavily macroed C for this :) | |||
sjohnson | masak: also remembered a few other things i didn't like: vi md5sum some.file # won't edit md5sum | ||
(another up-arrow mistake i commonly made) | |||
also, vi some .file # if you accidently put a space, it will not whine when you try to quit that there's "more files to edit" anymore | 19:48 | ||
dalek | ecza: b10ed5a | sorear++ | src/ (2 files): Cut an extraneous let out of postfix while. Little effect. |
||
sjohnson | (url script a few lines above if you want to peek at it) | ||
masak | sjohnson: we seem to have different command shell problems :) | 19:49 | |
19:51
lumi left
19:52
lumi joined
|
|||
sorear | probably even more relevant | 19:53 | |
19:53
kaare__ left
|
|||
sorear | 1 while $i++ # 5 indirect calls per iteration | 19:54 | |
sjohnson | masak: my colleagues use the frontend at work, and say it's a godsend :) | 19:56 | |
if even 1 person gets some use out of it, it was all worth it. well, it was worth it to prevent headaches for myself, so that's good too. | |||
20:02
NINA-2632 joined,
NINA-2632 left
|
|||
masak | sjohnson: of course. I'm glad to hear you're building solutions to problems for you and your colleagues. | 20:04 | |
jnthn | rakudo: my @a; for 1..5 -> $i { @a.push(sub { $i }) }; .() for @a | 20:13 | |
p6eval | rakudo 048573: ( no output ) | ||
jnthn | rakudo: my @a; for 1..5 -> $i { @a.push(sub { say $i }) }; .() for @a | ||
TimToady | sorear: Lisp implementations often bank on the pointer never using some of the low bits or some of the high bits. | ||
p6eval | rakudo 048573: OUTPUT«12345» | ||
jnthn | rakudo: my @a; for 1..5 -> $i { @a.push(sub foo { say $i }) }; .() for @a | ||
p6eval | rakudo 048573: OUTPUT«12345» | 20:14 | |
jnthn | rakudo: my @a; for 1..5 -> $i { @a.push(method foo { say $i }) }; .() for @a | ||
p6eval | rakudo 048573: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceSubfoo (subid "82_1307132053.89459") has no $!llsig and no $!lazysig in <anon> at line 7674:CORE.setting in main program body at line 1» | ||
jnthn | wow :) | ||
TimToady | rakudo: my @a; for 1..5 -> $i { @a.push(anon method foo { say $i }) }; .() for @a | 20:15 | |
p6eval | rakudo 048573: OUTPUT«Subfoo (subid "82_1307132137.63473") has no $!llsig and no $!lazysig in <anon> at line 7674:CORE.setting in main program body at line 1» | ||
TimToady | rakudo: my @a; for 1..5 -> $i { @a.push(anon method foo { say $i }) }; .($_) for @a | 20:16 | |
p6eval | rakudo 048573: OUTPUT«Subfoo (subid "82_1307132201.72778") has no $!llsig and no $!lazysig in <anon> at line 7674:CORE.setting in main program body at line 1» | ||
jnthn | Not going to bother investigating; just been re-working that chunk in nom and thought "huh, something looks adrift here..." :) | 20:17 | |
sorear | jnthn: any progress on the WB? | 20:19 | |
20:21
bluescreen10 left
|
|||
jnthn | sorear: Sorry, no - am trying to sort some nom stuff out ATM> | 20:22 | |
sorear has been toying with the idea of a c5niecza with OpTARG and CvPAD and SvGMAGICAL and all the other stuff that C# makes so hard | 20:24 | ||
20:25
mj41 joined
|
|||
masak | jnthn: hm, is it OK with you if I submit that one to RT? | 20:27 | |
20:29
wknight8111 left
|
|||
jnthn | masak: Why not? :) | 20:29 | |
masak submits rakudobug | 20:30 | ||
jnthn | masak: It'll make sure it gets a test that way :) | ||
And...on step closer to 2000 :P | |||
*one | |||
20:30
lumi left
|
|||
masak | ;) | 20:30 | |
20:31
lumi joined
20:32
jdv79 left
20:33
jdv79 joined
|
|||
jnthn | perl6: say 1; { $^a }; say 2; | 20:35 | |
p6eval | rakudo 048573: OUTPUT«1Not enough positional parameters passed; got 0 but expected 1 in main program body at line 2:/tmp/p5C2qefKMq» | ||
..niecza v6-55-gb10ed5a: OUTPUT«1Unhandled exception: No value in mainline available for parameter $a at /tmp/x9QQ3TLHjU line 1 (MAIN mainline @ 4)  at /home/p6eval/niecza/lib/CORE.setting line 1565 (CORE C715_ANON @ 2)  at /home/p6eval/niecza/lib/CORE.setting line 1566 (CORE module-CORE @ | |||
..53)  at /home/… | |||
..pugs: OUTPUT«1*** Blocks with implicit params cannot occur at statement level at /tmp/j79Hm4u9Pu line 1, column 1» | |||
TimToady | std: say 1; { $^a }; say 2; | ||
p6eval | std 4b1b100: OUTPUT«ok 00:01 114m» | ||
TimToady | hmm, supposed to complain about that | ||
jnthn | TimToady: It's illegal? | 20:36 | |
That is, compile-time illegal? | |||
TimToady | seems as though it ought to be | ||
jnthn | +1 | ||
TimToady | and STD has code that used to catch that... | ||
20:36
bluescreen10 joined
|
|||
jnthn | std: sub foo { { $^a } } | 20:37 | |
p6eval | std 4b1b100: OUTPUT«ok 00:01 113m» | ||
jnthn | How about that one? | ||
20:37
ymasory left
|
|||
TimToady | that too | 20:37 | |
can't return a bare block, it's taken as inline | 20:38 | ||
jnthn | OK, that makes my life easier. :) | ||
I'll let you fix the error handling in STD and then just nab that ;) | 20:40 | ||
sorear | what he said. | ||
jnthn: "2000"? | 20:41 | ||
jnthn: also, what bit of code are you reworking? | |||
20:42
jdv79 left
|
|||
jnthn | sorear: Just about everything to do with blocks | 20:42 | |
Decided I'd rather make sure closures are right early. :) | 20:43 | ||
Rakudo and closures have had some...history. | |||
sorear | How much memory does a nom sub use? | ||
I mean a Sub object, cloned | |||
tadzik | hello hello | 20:45 | |
sorear | hello tad zik | ||
jnthn | sorear: Dunno, but I'm pretty sure that the Parrot sub PMC itself dominates | 20:46 | |
sorear: Should be at least 1 PMC lighter than pre-nom ones | |||
Which means at least 2 memory allocations lighter. | |||
tadzik | what sense does a method make if it's not inside a class? | ||
sorear | so nom still uses Parrot Sub PMCs for closures? | ||
jnthn | sorear: Yes. Don't actually have a choice there, so far as I can see. | 20:47 | |
sorear | tadzik: lets you use 'self' to refer to the first argument | ||
tadzik | funky | ||
jnthn | sorear: Probably some chance of getting Parrot subs to take a weight loss program some day though... :) | ||
Anyway, sub = 1 P6opaque + 1 Parrot sub PMC | 20:48 | ||
tadzik | perl6: method foo($a, $b) { say $self, $a, $b }; foo('bar', 'asd') | ||
p6eval | niecza v6-55-gb10ed5a: OUTPUT«===SORRY!===Variable $self is not predeclared at /tmp/eumny8oRbn line 1:------> method foo($a, $b) { say ⏏$self, $a, $b }; foo('bar', 'asd')Undeclared routine: 'foo' used at line 1Potential difficulties: 'method' | ||
..declaration outside of… | |||
..rakudo 048573: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace===SORRY!===Symbol '$self' not predeclared in foo (/tmp/OC8vICwrFA:22)» | |||
..pugs: OUTPUT«***  Unexpected "," expecting "::" Variable "$self" requires predeclaration or explicit package name at /tmp/4yPZLgXZnK line 1, column 31» | |||
jnthn | self, not $self | 20:49 | |
tadzik | bam! bam! bam! | ||
oh, right | |||
perl6: method foo($a, $b) { say self, $a, $b }; foo('bar', 'asd') | |||
p6eval | pugs: OUTPUT«*** No compatible multi variant found: "&foo" at /tmp/hRuV1rzFEI line 1, column 42 - line 2, column 1» | ||
..niecza v6-55-gb10ed5a: OUTPUT«===SORRY!===Undeclared routine: 'foo' used at line 1Potential difficulties: 'method' declaration outside of class at /tmp/v_0uMKw5Mn line 1:------> method foo($a, $b) ⏏{ say self, $a, $b }; foo('bar', | |||
..'asd')Unhandled exception: Check f… | |||
..rakudo 048573: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceCould not find sub &foo in main program body at line 22:/tmp/N1pIP_Tc2L» | |||
20:49
jdv79 joined
|
|||
jnthn | tadzik: also need my :) | 20:49 | |
tadzik | jnthn: myself? :P | ||
moritz | perl6: my $m = method foo($a) { say self, $a }; $m(3, 5) | ||
tadzik | perl6: my method foo($a, $b) { say self, $a, $b }; foo('bar', 'asd') | ||
p6eval | niecza v6-55-gb10ed5a: OUTPUT«Potential difficulties: 'method' declaration outside of class at /tmp/awbr8GzSO3 line 1:------> my $m = method foo($a) ⏏{ say self, $a }; $m(3, 5)Unhandled exception: trying to dereference null at /home/p6eval/niecza/boot/lib/CORE.setting line | ||
..469 (CORE di… | |||
..pugs: OUTPUT«***  Unexpected "$m" expecting "=", "::", context, ":" or "(" Variable "$a" requires predeclaration or explicit package name at /tmp/lOPUlY5UZ_ line 1, column 4» | |||
..rakudo 048573: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceSubfoo (subid "78_1307134187.44165") has no $!llsig and no $!lazysig in main program body at line 7674:CORE.setting» | |||
rakudo 048573: OUTPUT«Not enough positional parameters passed; got 2 but expected 3 in 'foo' at line 2:/tmp/ikX7Hs5SYx in main program body at line 22:/tmp/ikX7Hs5SYx» | 20:50 | ||
..pugs: OUTPUT«*** No compatible multi variant found: "&foo" at /tmp/bBl_PL3Tkc line 1, column 45 - line 2, column 1» | |||
..niecza v6-55-gb10ed5a: OUTPUT«===SORRY!===Undeclared routine: 'foo' used at line 1Unhandled exception: Check failed at /home/p6eval/niecza/boot/lib/CORE.setting line 469 (CORE die @ 2)  at /home/p6eval/niecza/src/STD.pm6 line 1146 (STD P6.comp_unit @ 31)  at | |||
../home/p6eval/niecza/src… | |||
tadzik | what a mess did I make | ||
moritz | "Unhandled exception: trying to dereference null" | ||
looks like a niecza bug :-) | |||
ok, all of them are buggy | 20:51 | ||
tylercurtis | perl6: my method foo($a, $b) { say self, $a, $b }; foo('bar, 'baz', 'quux'); | 20:52 | |
20:52
lumi left
|
|||
p6eval | rakudo 048573: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22» | 20:52 | |
..pugs: OUTPUT«***  Unexpected "baz" expecting term postfix, operator, ":" or ")" at /tmp/YgWt6VxESy line 1, column 56» | |||
..niecza v6-55-gb10ed5a: OUTPUT«===SORRY!===Any()Unable to parse argument list at /tmp/mz6nJHblGH line 1:------> d foo($a, $b) { say self, $a, $b }; foo(⏏'bar, 'baz', 'quux');Couldn't find final ')'; gave up at /tmp/mz6nJHblGH line 1:------> a, $b) { | |||
..say self, $a, $b… | |||
tylercurtis | perl6: my method foo($a, $b) { say self, $a, $b }; foo('bar', 'baz', 'quux'); | ||
p6eval | pugs: OUTPUT«pugs: Missing invocant parameters in '&foo': 0 received, 1 missing» | ||
..rakudo 048573: OUTPUT«barbazquux» | |||
..niecza v6-55-gb10ed5a: OUTPUT«===SORRY!===Undeclared routine: 'foo' used at line 1Unhandled exception: Check failed at /home/p6eval/niecza/boot/lib/CORE.setting line 469 (CORE die @ 2)  at /home/p6eval/niecza/src/STD.pm6 line 1146 (STD P6.comp_unit @ 31)  at | |||
../home/p6eval/niecza/src… | |||
20:52
molaf_ left
20:53
lumi joined
20:54
tadam joined
|
|||
moritz | "my mthod" doesn't make any sense to me | 20:54 | |
*method even | |||
TimToady | it prevents it from being a "has method" | 20:55 | |
jnthn | moritz: my just means install it in the lexpad. | ||
TimToady | it's just a function that happens to treat its first arg as an invocant | ||
20:56
mj41 left
|
|||
moritz | rakudo: my $x = my method () { say self }; $x(3) | 20:56 | |
p6eval | rakudo 048573: OUTPUT«3» | ||
moritz | \o/ | 20:57 | |
sjohnson | masak: yep, perl has saved me from more headaches than advil or tylenhol | ||
TimToady | rakudo: my $x = my method () { say self }; 3.$x | ||
p6eval | rakudo 048573: OUTPUT«3» | ||
masak | rakudo: my $x = my method () { say self.WHAT }; $x($x) | 20:58 | |
p6eval | rakudo 048573: OUTPUT«Method()» | ||
21:01
birdwindupbird left
|
|||
math1 | Hi i have a problem to compile PHP::Interpreter with cpan. Does anyone can help me ? | 21:01 | |
tadzik | math1: this is a Perl 6 channel, you probably need help with Perl 5. Try #perl-help on irc.perl.org | 21:02 | |
21:02
cooper|ipad joined
|
|||
math1 | Alright. Ok man | 21:02 | |
sjohnson | math1: or #perl on freenode | 21:03 | |
math1 | cheers | ||
tadzik | have fun | 21:04 | |
21:06
mberends left
|
|||
TimToady | the problem with recognizing statement-level { $^a } as bogus is that { $^a }(1) is not bogus. | 21:06 | |
the old error message outlawed the latter, and was worked around by changing <block> to <pblock> | 21:07 | ||
so if we do recognize it at compile time, it'll have to be recognized at statement reduction time | |||
not in add_placeholder, where the old code is | 21:08 | ||
you can still trigger the old code though | 21:09 | ||
std: loop { $^a } | |||
p6eval | std 4b1b100: OUTPUT«===SORRY!===Placeholder variable $^a may not be used here because the surrounding block takes no signature at /tmp/qfnzs9DWOn line 1:------> loop { ⏏$^a }Check failedFAILED 00:01 112m» | ||
TimToady | rakudo: loop { $^a } | ||
p6eval | rakudo 048573: OUTPUT«(timeout)» | ||
TimToady | heh | ||
jnthn | :P | 21:11 | |
TimToady | so that's the mechanism I was thinking of, it just doesn't work out for bare blocks | ||
since we don't know they're bare yet | 21:12 | ||
unless we outlaw statements of the form {...}() | |||
masak | that'd be a shame. | 21:13 | |
TimToady | which seems like overkill, esp since rakudo picks up the error at run time | ||
>>todo | |||
jnthn | May be easier with semantic analysis. | 21:14 | |
TimToady | Might notice it when trying to inline bare blocks | 21:16 | |
21:21
lumi left
21:22
mikehh joined,
lumi joined
|
|||
mikehh | I am getting a build failure with latest rakudo master Dahut-12-g048573b on parrot RELEASE_3_4_0-153-gc2e3158 | 21:24 | |
mikemol | colomon: I only just now noticed that you implemented the Pi spigot as a sequence, but you didn't add it to justrakudoit.wordpress.com/2011/03...ces-of-pi/ | ||
Mind adding that? | 21:25 | ||
(Or mind if I do? Though it's easier to preserve attribution if you do) | |||
mikehh | see nopaste.snit.ch/49579 | ||
looks like a problem with Test.pm | 21:27 | ||
jnthn | TimToady: Is there a good criteria for when a bare block can be inlined, ooc? | 21:29 | |
e.g. in if $foo { bar() } else { baz() } | |||
21:29
math1 left
|
|||
jnthn | In that case do things like $! get in our way? | 21:29 | |
Or generally, any contextual where the outer block has a contextual of the same name? | 21:30 | ||
21:30
mj41 joined
21:37
ymasory joined
|
|||
TimToady | I'd imagine such in-lining would emulate the bits of entry/exit that are needed, and throw away the rest | 21:37 | |
if we find our semantics continually clobbering our performance, though, we can revisit our semantics | 21:38 | ||
jnthn | Probably do-able. | 21:41 | |
21:42
bluescreen10 left
21:45
tadam left
|
|||
jnthn | 1 files changed, 61 insertions(+), 119 deletions(-) | 21:46 | |
21:46
Psyche^ joined
|
|||
jnthn | Yeah, I like that kinda refactor... | 21:46 | |
masak | \o/ | ||
21:47
MayDaniel joined,
lumi left
21:48
lumi joined
|
|||
jnthn | yay, "my $x := -> Mu $a { say($a) }; $x(42)" works again. | 21:48 | |
21:48
wamba joined
|
|||
jnthn | Now to figure out where the missing decontainerization is... | 21:49 | |
oh, it's beer time! | |||
21:50
Patterner left,
Psyche^ is now known as Patterner
|
|||
masak | rakudo: class A { has @.x }; my $a = A.new(:x(1,2,3)); my @x := $a.x; @x[1] = 42; say $a.x.perl | 21:50 | |
p6eval | rakudo 048573: OUTPUT«[1, 42, 3]» | ||
masak | does anyone else consider this to be a problem, from an encapsulation point-of-view? | ||
jnthn | If you didn't want to share it, write @!x. | 21:51 | |
And your own accessor that clones or something. | 21:52 | ||
masak | right. | ||
TimToady | .oO(beer decontainerization!) |
||
jnthn | \o/ | ||
dalek | kudo/nom: 92f19d1 | jnthn++ | src/Perl6/Grammar.pm: Toss unused token. |
||
kudo/nom: ccc2fb3 | jnthn++ | src/Perl6/Actions.pm: Big refactor to try and get some closure handling stuff back in place and working. Also some basic pointy block support. |
|||
kudo/nom: 6e94078 | jnthn++ | src/CORE.setting/Code.pm: A cheaty Code.clone. |
|||
jnthn | phew, closures actually seem to work | ||
> sub foo(Any $i) { -> { say($i) } } | |||
> my $a := foo(1); my $b := foo(2); $a(); $b(); | |||
1 | |||
2 | |||
masak | I guess we can even provide attribute metaobjects that have the right default (that of cloning) from the start. so no real harm done. | ||
jnthn | masak: right | ||
masak | it's just a bit... unnecessary... that the default default is disencapsulation. | 21:53 | |
jnthn | my module EXPORTHOW { class MyMetaAttr { ... } } | ||
oh wait, not that | |||
my class MyMetaAttr { ... }; my module EXPORTHOW { $?PACKAGE.WHO<class-attr> := MyMetaAttr } # that... :) | 21:54 | ||
masak | TheDamian was concerned about attribute introspection breaking encapsulation. he should be concerned about the default accessors breaking encapsulation. | ||
jnthn | masak: It's nothing to do with the accessors really. | ||
masak | the accessors are handing out the array reference from inside the object. | 21:55 | |
jnthn | masak: They just return the array. Doing an index into the array is a method on the array, thorough the array's public interface. | ||
masak | by then it's too late. | ||
jnthn | What do you want the accessors to hand out? | ||
Do you want an array accessor to shallow-clone the entire array? | 21:56 | ||
masak | a different array. like you say, a clone. | ||
jnthn | I guess with laziness it's not *so* expensive. | ||
masak | yes, I guess I see the issues with cloning. | ||
TimToady | we really need "capabilities" | ||
where the default object returned is immutable, and you need a special view of the object to let you write it | 21:57 | ||
jnthn | TimToady: It's the making it immutable cheaply bit that'll take a little effort. | ||
TimToady | if I were doing this in the bad old days I'd use the 1-bit of the pointer to indicate rw-ness.... | ||
I'd make immutable the default | |||
jnthn | the 1-bit...eewwww! | 21:58 | |
:P | |||
TimToady | and add in the capability bit for the rw, at the expense of having to strip the bit | ||
21:58
bluescreen10 joined
|
|||
TimToady | or just trap the SEGV and test for rw in the signal handler ;) | 21:59 | |
masak | :P | ||
'night, #perl6 | |||
stay immutable. | |||
21:59
masak left
|
|||
TimToady | I'm hard to mute. | 22:00 | |
22:00
mj41 left
|
|||
colomon | mikemol: huh? | 22:00 | |
tylercurtis | rakudo: class ReadonlyPositional does Positional { has @!arr; method at_pos($i) { my $x = @!arr.at_pos($i); $x } }; class A { has @!foo; method foo { ReadonlyPositional.new(:array(@!foo)) } }; my A $a .= new(:foo(1,2,3); my @x := $a.foo; @x[1] = 42; say $a.foo.perl | 22:01 | |
mikemol | A while back, I indicated I thought Perl6 should implement rosettacode.org/wiki/Pi as a sequence | ||
p6eval | rakudo 048573: OUTPUT«===SORRY!===Confused at line 22, near "my A $a .="» | ||
tylercurtis | rakudo: class ReadonlyPositional does Positional { has @!arr; method at_pos($i) { my $x = @!arr.at_pos($i); $x } }; class A { has @!foo; method foo { ReadonlyPositional.new(:array(@!foo)) } }; my A $a .= new(:foo(1,2,3)); my @x := $a.foo; @x[1] = 42; say $a.foo.perl | ||
p6eval | rakudo 048573: OUTPUT«ReadonlyPositional.new(arr => [])» | ||
mikemol | From that, you wrote justrakudoit.wordpress.com/2011/03...ces-of-pi/ justrakudoit.wordpress.com/2011/04/26/more-pi/ and justrakudoit.wordpress.com/2011/04...eam-of-pi/ | 22:02 | |
tylercurtis | rakudo: class ReadonlyPositional does Positional { has @!arr; method at_pos($i) { my $x = @!arr.at_pos($i); $x } }; class A { has @!foo; method foo { ReadonlyPositional.new(:array(@!foo)) } }; my A $a .= new(:foo(1,2,3)); my @x := $a.foo; @x[1] = 42; say $a.foo.perl; say $a.perl | ||
p6eval | rakudo 048573: OUTPUT«ReadonlyPositional.new(arr => [])A.new(foo => [1, 2, 3])» | ||
tylercurtis | rakudo: class ReadonlyPositional does Positional { has @!arr handles <elements>; method at_pos($i) { my $x = @!arr.at_pos($i); $x } }; class A { has @!foo; method foo { ReadonlyPositional.new(:array(@!foo)) } }; my A $a .= new(:foo(1,2,3)); my @x := $a.foo; @x[1] = 42; say $a.foo.perl; say $a.perl | ||
p6eval | rakudo 048573: OUTPUT«ReadonlyPositional.new(arr => [])A.new(foo => [1, 2, 3])» | ||
tylercurtis | rakudo: class ReadonlyPositional does Positional { has @!arr handles <elements>; method at_pos($i) { my $x = @!arr.at_pos($i); $x } }; class A { has @!foo; method foo { ReadonlyPositional.new(:array(@!foo)) } }; my A $a .= new(:foo(1,2,3)); my @x := $a.foo; @x[1] = 42; say $a.foo[1] | 22:03 | |
p6eval | rakudo 048573: OUTPUT«Any()» | ||
tylercurtis | rakudo: class ReadonlyPositional does Positional { has @!array handles <elements>; method at_pos($i) { my $x = @!array.at_pos($i); $x } }; class A { has @!foo; method foo { ReadonlyPositional.new(:array(@!foo)) } }; my A $a .= new(:foo(1,2,3)); my @x := $a.foo; @x[1] = 42; say $a.foo[1] | ||
p6eval | rakudo 048573: OUTPUT«2» | ||
tylercurtis | (I think that just directly returning the result of @!array.at_pos should work, but ISTR some discussion of Rakudo not doing rwness/roness of subs in some ways.) | 22:05 | |
Although that approach is wrong for some use cases, in that between getting foo and accessing its elements, the underlying array could be changed. | 22:10 | ||
TimToady | readonly doesn't necessarily imply value semantics, that's what 'is copy' is for | 22:12 | |
the readonly default is intended only to protect the caller from side-effects in the callee, not vice versa | 22:15 | ||
22:15
hercynium left
22:20
bluescreen10 left
22:22
bluescreen10 joined
22:35
bluescreen10 left
22:39
bluescreen10 joined
22:41
lumi left,
lumi joined
22:43
bluescreen10 left
|
|||
dalek | p: 7ca852e | jonathan++ | src/ (2 files): More decontainerization twiddling. |
22:46 | |
22:49
lue left,
hanekomu left
|
|||
dalek | kudo/nom: 9df2d17 | jnthn++ | src/Perl6/Actions.pm: Get corrector semantics and save an op off every method call, thanks to putting decontainerization in a righter place. |
22:49 | |
22:51
whiteknight joined
22:56
wanradt___ left
|
|||
sorear | jnthn: what was that change about? | 22:59 | |
are you trying to implement non-rw subs? | |||
23:00
MayDaniel left
23:02
bluescreen10 joined
23:03
wamba left
|
|||
jnthn | sorear: It was about quite a few things. :) | 23:07 | |
sorear: Well, depends if you mean nqp one or Rakudo one. | |||
sorear: Rakudo one just means "don't decontainerize invocant here, it's done elsewhere now" | 23:08 | ||
And only needs doing in some places | |||
Otherwise you can't write a (grrrr...but still...) method foo($self is rw :) { $self = ... } | |||
23:11
_jaldhar joined
|
|||
sorear | jnthn: grr? | 23:12 | |
jnthn | sorear: It's possible but evil :) | ||
sorear: Anyway, in theory it works in nom now. | |||
sorear | meh | ||
jnthn | In practice I didn't do "is rw" yet...or did I... | ||
sorear | it's what makes hash autovivification work | ||
jnthn | oh, yes | 23:13 | |
sorear | so I put up with it | ||
jnthn | :) | ||
23:13
bluescreen10 left
|
|||
sorear ponders stealing jnthn's SIG_ELEM_* defines | 23:14 | ||
jnthn | Yes but mabye call them PARAM_ like I should have. ;) | ||
(I mostly killed the term "sig elem"... :)) | 23:15 | ||
sorear | How does SLURPY_BLOCK work? | ||
that (and, ok, attributives) is the only one I don't have an _exact equivalent_ to | |||
jnthn | I don't think I ever implemented slurpy blocks. | 23:16 | |
Nobody's ever missed them so far. :/ | |||
iirc, I couldn't think of an easy way to do them, so I figured "eh, I'll see if anybody moans about them being missing" :) | 23:17 | ||
Occasionally when you do that, the scary bit of spec in question goes away. : | 23:18 | ||
:P | |||
rakudo: say pir::eq__III(1,1) | |||
p6eval | rakudo 048573: OUTPUT«===SORRY!===error:imcc:The opcode 'eq_i_i_i' (eq<3>) was not found. Check the type and number of the arguments in file '(file unknown)' line 76407100» | ||
jnthn | ...line wut? | 23:19 | |
23:20
silug left
|
|||
jnthn | rakudo: say pir::iseq__III(1,1) | 23:21 | |
p6eval | rakudo 048573: OUTPUT«1» | ||
sorear | jnthn: well it's an imcc error, you know Rakudo generally makes super-bloated PIR | 23:23 | |
reading bind.h makes me feel so _behind_ | 23:24 | ||
jnthn | sorear: The one in nom? | ||
sorear | aye | ||
23:24
Mowah left
|
|||
jnthn | heh...niecza does rather more than rakudo/nom :) | 23:24 | |
I'm not even Turing complete yet. :) | 23:25 | ||
sorear | can't even emulate a tag system or a Minsky machine? | 23:26 | |
doesn't nom have recursion? | |||
and integers? | |||
jnthn | oh, yes, it does | ||
But...no relational ops :) | |||
sorear | so set up a bunch of mutually tail-recursive functions to emulate the states of a Minsky machine | ||
do you have Int.Bool? | |||
jnthn | Not yet | 23:27 | |
Working on those things at the moment. | |||
sorear rummages through his collection of hats, pulls out the one labeled Unlambda User | 23:28 | ||
jnthn | .oO( A curious implementation strategy. Meta-classes and multi-dispatch before booleans ) |
||
sorear | church encoding can give you your booleans | 23:29 | |
sub true($x,$y) { $x } | |||
jnthn | Hey, stop reminding me how many years it's been sicne my computation theory lectures :P | 23:30 | |
.oO( I wonder if you can build a turing machine out of different depths of inheritance hierarchy... ) |
23:31 | ||
sorear | .o( I had best hurry up, nom isn't holding still ) | 23:34 | |
23:41
_jaldhar left
23:44
awoodland left
23:50
_jaldhar joined
23:52
silug joined
|