Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-06-03

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

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

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

Perl 6 | Reference Documentation | Rakudo