Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-02-04

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:05 arlinius joined #perl6
00:15 tadzik lue: the former is deprecated
00:24 Woodi joined #perl6
00:25 jerome joined #perl6
00:27 dayangkun joined #perl6
01:12 anuby joined #perl6
01:15 hypolin joined #perl6
01:15 kst` joined #perl6
01:23 shinobicl joined #perl6
01:41 sevin joined #perl6
01:48 shinobicl left #perl6
01:51 sampo joined #perl6
01:56 sampo joined #perl6
02:14 _jaldhar joined #perl6
02:16 MikeFair_ joined #perl6
02:23 MikeFair__ joined #perl6
02:33 MikeFair joined #perl6
02:47 raiph_ joined #perl6
02:53 lue r: my %h; my %g; :(%g, %h) := \(1=>2,3=>4); say %h.perl; say %g.perl
02:53 p6eval rakudo 935c90: OUTPUT«This type cannot unbox to a native string␤  in method Capture at src/gen/CORE.setting:5104␤  in block  at /tmp/tj28pwJCK5:1␤␤»
02:55 MikeFair joined #perl6
03:01 MikeFair__ joined #perl6
03:11 swarley- joined #perl6
03:25 swarley| joined #perl6
03:33 skids left #perl6
03:34 skids joined #perl6
03:42 dayangkun joined #perl6
03:45 arlinius joined #perl6
04:06 preflex_ joined #perl6
04:59 shinobicl joined #perl6
05:00 hulu joined #perl6
05:00 hulu helo
05:01 hulu r: my $step = 3; say map({ '192.168.1.' ~ "$_\n"; }, (0, { $^a + $step } ... (256 - (256 % $step)));
05:01 p6eval rakudo 935c90: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in argument list; couldn't find final ')'â�¤at /tmp/b2vUWu9iT9:1â�¤------> [32m^a + $step } ... (256 - (256 % $step)));[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤    â€¦
05:02 hulu why this can't run
05:02 hulu r: my $step = 3; say map({ '192.168.1.' ~ "$_\n"; }, (0, { $^a + $step } ... ((256 - (256 % $step)) / $step) * $step));
05:02 p6eval rakudo 935c90: OUTPUT«192.168.1.0␤ 192.168.1.3␤ 192.168.1.6␤ 192.168.1.9␤ 192.168.1.12␤ 192.168.1.15␤ 192.168.1.18␤ 192.168.1.21␤ 192.168.1.24␤ 192.168.1.27␤ 192.168.1.30␤ 192.168.1.33␤ 192.168.1.36␤ 192.168.1.39␤ 192.168.1.42␤ 192.168.1.45␤ 192.168.1.48␤ 192.168.1.51␤ 192.168.1.54␤ 192…
05:02 hulu why this run
05:03 geekosaur first one loses for exactly the reason it says.  specifically you lost the closing ) for the map
05:03 geekosaur try counting parens
05:04 hulu r: my $step = 3; say map({ '192.168.1.' ~ "$_\n"; }, (0, { $^a + $step } ... (256 - (256 % $step))));
05:04 p6eval rakudo 935c90: OUTPUT«192.168.1.0␤ 192.168.1.3␤ 192.168.1.6␤ 192.168.1.9␤ 192.168.1.12␤ 192.168.1.15␤ 192.168.1.18␤ 192.168.1.21␤ 192.168.1.24␤ 192.168.1.27␤ 192.168.1.30␤ 192.168.1.33␤ 192.168.1.36␤ 192.168.1.39␤ 192.168.1.42␤ 192.168.1.45␤ 192.168.1.48␤ 192.168.1.51␤ 192.168.1.54␤ 192…
05:04 hulu geekosaur: thx
05:06 juiko joined #perl6
05:06 Tabrenus joined #perl6
05:08 shinobicl left #perl6
05:09 sevin joined #perl6
05:10 hulu r: my $step = 3; say map({ '192.168.1.' ~ "$_\n"; }, (0, { $^a + $step } ... (256 - (256 % $step))));
05:10 p6eval rakudo 935c90: OUTPUT«192.168.1.0␤ 192.168.1.3␤ 192.168.1.6␤ 192.168.1.9␤ 192.168.1.12␤ 192.168.1.15␤ 192.168.1.18␤ 192.168.1.21␤ 192.168.1.24␤ 192.168.1.27␤ 192.168.1.30␤ 192.168.1.33␤ 192.168.1.36␤ 192.168.1.39␤ 192.168.1.42␤ 192.168.1.45␤ 192.168.1.48␤ 192.168.1.51␤ 192.168.1.54␤ 192…
05:11 hulu geekosaur: what's means of $^a
05:12 geekosaur $^ indicates an implicit parameter; rather than declaring them (which would be ``-> $a { ... }'') you just use it, and the first $^something gets the first parameter and the next different $^something will get the second, etc.
05:12 geekosaur it doesn't care what you call them, only the order of use matters
05:13 hulu 0, { $^a + $step } ... 255 where the parameter
05:14 geekosaur the thing there that is doing parameters is map
05:14 geekosaur wait
05:14 geekosaur actually that's a good question, hm
05:15 geekosaur oh, I see
05:16 geekosaur it'sa range expression with a WhateverCode; $^a is the previously generated value
05:16 xinming_ joined #perl6
05:16 geekosaur I think you could also say (0, * + $step ... (256 - (256 % $step)))
05:17 benabik It's a range expression with a code block.  A WhateverCode is a auto-generated block from a Whatever (*)
05:17 benabik ... Like that.
05:18 am0c joined #perl6
05:23 hulu r: say (0, * + 3 ... (256 - (256 % 3)))
05:23 p6eval rakudo 935c90: OUTPUT«0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225…
05:25 Psyche^ joined #perl6
05:25 hulu geekosaur: what a WhateverCode
05:26 geekosaur I may be using the wrong term for this one...
05:26 geekosaur actually I think the *+3 is a whatevercode, yours is just a block
05:27 benabik You can also give a code block for the last entry.  So (0, *+3 ...^ * >= 256)
05:27 benabik Er.  s/>=/>
05:28 geekosaur so, you have a list defined as (start, next ... end)
05:28 geekosaur next and end could be literal numbers, or whatevercode (thing using "*" as the previous value to specify the next or final value as apporpriate) or a {block} which can use a parameter the same way
05:29 geekosaur if you use a block, you either need to use a pointy block (-> $a { ... }) or use an implicit parameter like $^a
05:29 geekosaur if you use whatevercode, it's just * (as, for example, * + 3)
05:30 hulu what (start, next ... end)
05:30 geekosaur (0, * + $step ... (256 - (256 % $step)))
05:30 geekosaur it's a range
05:30 hulu the start is must have
05:30 geekosaur start at 0, next item is * + $step ... end is 256 - (256 % $step)
05:31 benabik S03:1779
05:31 kaleem joined #perl6
05:31 benabik It's a sequence.  There is also a range operator, which is somewhat simpler.
05:31 * geekosaur is heading back to bed now...
05:34 hulu benabik: what the parameter of  {$^a + $step}
05:34 benabik hulu: The previous value of the sequence.
05:35 hulu benabik: what the parameter of  {$^a +  $^b + $step}
05:37 benabik hulu: When given a closure that takes N arguments, the sequence calls it with the previous N values of the sequence.
05:44 hulu r: say 0, 1, 2, { $^a + 1 } ... 255
05:44 p6eval rakudo 935c90: OUTPUT«0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91…
05:44 hulu benabik: why this not 0 1 2 0 1 2
05:45 benabik hulu: Each value is produced by giving the block the last value.  So {$^a + 1} gets 2 the first time, returning 3.  Next time it gets 3 and gives 4.  And so on.
05:49 hulu r: say 0, 1, 2, { $^a + $^b + 1 } ... 255
05:49 p6eval rakudo 935c90: OUTPUT«(timeout)»
05:49 hulu r: say 0, 1, 2, { $^a + $^b + 1 } ... 3
05:49 p6eval rakudo 935c90: OUTPUT«(timeout)»
05:49 benabik r: say 0,1,2,*+*+1 ... * > 100
05:49 p6eval rakudo 935c90: OUTPUT«0 1 2 4 7 12 20 33 54 88 143␤»
05:50 benabik Sequences only stop on exact matches.
05:51 hulu r: say 0, 1, 2, { $^a + $^b + 1 } ... > 100
05:51 p6eval rakudo 935c90: OUTPUT«[31m===[0mSORRY![31m===[0m�Preceding context expects a term, but found infix > instead�at /tmp/MsxQc1lKrU:1�------> [32msay 0, 1, 2, { $^a + $^b + 1 } ... >[33m�[31m 100[0m�»
05:51 hulu r: say 0, 1, 2, { $^a + $^b + 1 } ... * > 100
05:51 p6eval rakudo 935c90: OUTPUT«0 1 2 4 7 12 20 33 54 88 143␤»
05:52 hulu $^a is 2 $^b is 1
05:52 hulu benabik: ok?
05:52 benabik I think it's the other way around.
05:53 benabik r: say 0,1,2,{say $^a; say $^b; $^b+1}...5
05:53 p6eval rakudo 935c90: OUTPUT«1␤2␤2␤3␤3␤4␤0 1 2 3 4 5␤»
05:53 * benabik goes AFK
05:54 hulu r: say 0,1,2,{say $^a; say $^b;}...5
05:54 p6eval rakudo 935c90: OUTPUT«(timeout)1␤2␤2␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤True␤…
05:56 hulu benabik:  what's means 1␤2␤2␤3␤3␤4␤0 1 2 3 4 5
06:07 hulu r: say 0,1,2,{say $^a; say $^b;say $^c; $^b+1}...5
06:07 p6eval rakudo 935c90: OUTPUT«0␤1␤2␤1␤2␤2␤2␤2␤3␤2␤3␤3␤3␤3␤4␤3␤4␤4␤0 1 2 2 3 3 4 4 5␤»
06:08 hulu r: say 0,1,2,{say $^a; say $^b;say $^c; $^b+1}...5
06:08 p6eval rakudo 935c90: OUTPUT«0␤1␤2␤1␤2␤2␤2␤2␤3␤2␤3␤3␤3␤3␤4␤3␤4␤4␤0 1 2 2 3 3 4 4 5␤»
06:08 hulu r: say 0,1,2,{say $^a; say $^b;say $^c; $^c+1}...5
06:08 p6eval rakudo 935c90: OUTPUT«0␤1␤2␤1␤2␤3␤2␤3␤4␤0 1 2 3 4 5␤»
06:11 hulu n: say 0,1,2,{say $^a; say $^b;say $^c; $^c+1}...5
06:11 p6eval niecza v24-18-gaf64300: OUTPUT«012{ ... }␤»
06:12 dayangkun joined #perl6
06:27 viewer joined #perl6
06:32 drbean joined #perl6
06:34 FROGGS joined #perl6
06:56 PacoAir joined #perl6
07:09 FROGGS morning
07:14 diakopter o/
07:16 arnsholt 'lo
07:42 domidumont joined #perl6
08:03 domidumont joined #perl6
08:12 nwc10 come back fijal. I want to ask you why "(libffi - not recommended)"
08:13 FROGGS nwc10: maybe you write him/her via github: https://github.com/fijal
08:17 GlitchMr https://github.com/perl6/std/pull/4
08:17 GlitchMr Sounds interesting
08:19 moritz nwc10: or simply message him/her
08:21 GlitchMr Because the code wasn't written by Perl 6 developers? But seriously, I think that libffi is interesting choice.
08:21 GlitchMr Already used in other programming languages.
08:22 arnsholt It may just be because it's not very nice to work with, or something like that
08:23 GlitchMr https://github.com/atgreen/libffi/blob/master/doc/libffi.info
08:23 GlitchMr Is it so hard?
08:23 arnsholt Looking at it now
08:27 arnsholt Dyncall looks more convenient, to be honest
08:27 arnsholt But not sure what fijal meant about libffi
08:40 nebuchadnezzar joined #perl6
08:55 hoelzro happy Monday, #perl6!
08:56 tadzik happy happy hoelzro
08:58 mathw not a happy Monday
08:58 mathw maybe next week's will be happier
08:59 kresike joined #perl6
08:59 kresike hello all you happy perl6 people
09:05 tadzik am I the only one around here who is suffering because they had to get up from the bed? ;)
09:06 mathw possibly
09:06 mathw I've got to have an unpleasant conversation with my boss
09:09 oliver_ joined #perl6
09:10 oliver_ left #perl6
09:10 GlitchMr- joined #perl6
09:12 dayangkun joined #perl6
09:12 arnsholt tadzik: Nope =)
09:12 arnsholt My gf started work at 8 this morning, and I usually leave with her
09:12 arnsholt So I had to get up a bit earlier than I'm used to =)
09:13 tadzik oh, the horror
09:14 tadzik I wasn't able to wake up at my usual 7.30, and had to postpone it to 8.30
09:14 tadzik yes, that's late, but I'm barely conscious anyway :|
09:14 arnsholt Hehe
09:15 FROGGS I was pretty awake when I got up at 6 (have the coffee machine + timer in bedroom now ...), but now I cant move my head (sleeping at $kids-bedroom.floor() isnt that comfortable as it seems)
09:19 sqirrel joined #perl6
09:30 wtw joined #perl6
09:37 swarley| joined #perl6
09:43 Psyche^ joined #perl6
09:47 dakkar joined #perl6
10:01 grondilu ;;ticker
10:03 * FROGGS 7deb9d7: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'ticker' used at line 1␤Check failed␤FAILED 00:00 41m␤»
10:12 moritz :-)
10:12 bbkr__ joined #perl6
10:16 fhelmberger joined #perl6
10:18 imarcusthis- joined #perl6
10:19 bbkr_ joined #perl6
10:23 bbkr__ joined #perl6
10:25 bbkr_ joined #perl6
10:28 grondilu_ joined #perl6
10:29 bbkr__ joined #perl6
10:59 hulu r: say ~<abstract Concrete>.sort;
10:59 p6eval rakudo 935c90: OUTPUT«Concrete abstract␤»
11:00 hulu what's means ~<>
11:01 hoelzro r: say ~0.WHAT
11:01 p6eval rakudo 935c90: OUTPUT«use of uninitialized value of type Int in string context  in block  at /tmp/D_hnEYr1mh:1␤␤␤»
11:02 hulu r: say ~0;
11:02 p6eval rakudo 935c90: OUTPUT«0␤»
11:02 hulu r: say 0~0;
11:02 p6eval rakudo 935c90: OUTPUT«00␤»
11:02 hoelzro =(
11:02 hoelzro hulu: I *think* it's "stringify"
11:03 hulu hoelzro: what's stringify
11:03 hoelzro hulu: converting the argument to a String
11:03 hoelzro r: say 0.WHAT
11:03 p6eval rakudo 935c90: OUTPUT«Int()␤»
11:03 hoelzro r: say (~0).WHAT
11:03 p6eval rakudo 935c90: OUTPUT«Str()␤»
11:04 hulu r: say (~<abstract Concrete>).WHAT;
11:04 p6eval rakudo 935c90: OUTPUT«Str()␤»
11:05 hulu r: say <abstract Concrete>.WHAT;
11:05 p6eval rakudo 935c90: OUTPUT«Parcel()␤»
11:05 hoelzro hmm
11:05 hoelzro r: say ~Int
11:05 p6eval rakudo 935c90: OUTPUT«use of uninitialized value of type Int in string context  in block  at /tmp/gz52w_NsxM:1␤␤␤»
11:05 hoelzro interesting, but not unexpected
11:05 moritz infix ~ concatenates, prefix ~ stringifies
11:06 Su-Shee_ joined #perl6
11:06 hulu r: say <abstract Concrete>.sort;
11:06 p6eval rakudo 935c90: OUTPUT«Concrete abstract␤»
11:06 hulu r: say <abstract Concrete>.sort.WHAT;
11:06 p6eval rakudo 935c90: OUTPUT«Parcel()␤»
11:11 hulu moritz: what means of stringifies
11:11 moritz hulu: to turn into a string
11:11 moritz hulu: by the way, the correct way to ask the question is: "What does stringifies means?"
11:11 arnsholt s/means/mean/ # =)
11:11 hulu moritz: thx my english is poor
11:15 SmokeMachine joined #perl6
11:21 SmokeMac_ joined #perl6
11:27 SmokeMachine joined #perl6
11:50 erkan joined #perl6
11:50 erkan joined #perl6
11:51 hulu_ joined #perl6
11:51 hulu_ left #perl6
11:52 hulu joined #perl6
11:55 hulu r: my @doors = False xx 101;($_ = !$_ for @doors[0, * + $_ ...^ * > 100]) for 1..100;say "Door $_ is ", <closed open>[ @doors[$_] ] for 1..100;
11:55 p6eval rakudo 935c90: OUTPUT«Door 1 is open␤Door 2 is closed␤Door 3 is closed␤Door 4 is open␤Door 5 is closed␤Door 6 is closed␤Door 7 is closed␤Door 8 is closed␤Door 9 is open␤Door 10 is closed␤Door 11 is closed␤Door 12 is closed␤Door 13 is closed␤Door 14 is closed␤Door 15 is closed␤Door 16 is…
11:56 Liz_ joined #perl6
11:57 hulu what does '@doors[0, * + $_ ...^ * > 100]' mean?
11:58 SmokeMachine joined #perl6
12:00 hulu helo
12:00 cognominal joined #perl6
12:01 SmokeMac_ joined #perl6
12:01 breinbaas joined #perl6
12:06 brrt joined #perl6
12:08 hulu moritz: what does '@doors[0, * + $_ ...^ * > 100]' mean?
12:15 hulu who can help me
12:18 brrt hulo, whats your question?
12:18 brrt hulu, sorry :-)
12:18 brrt let me see…..
12:19 hulu brrt: what does '@doors[0, * + $_ ...^ * > 100]' mean?
12:20 swarley- joined #perl6
12:20 brrt honestly
12:20 brrt i do not know :-)
12:20 brrt it seems like constructing a slice
12:20 brrt obviously
12:20 brrt but i'm not sure why the 0 is neccessary
12:21 hoelzro you need it to give the sequence a place to start, I think
12:21 hoelzro ...^ is "up until", I think
12:21 cognominal nr: $_=5; 0, * + $_ ...^ * > 100
12:21 p6eval rakudo 935c90, niecza v24-18-gaf64300:  ( no output )
12:21 hoelzro * > 100 is the ending condition
12:21 cognominal nr: $_=5; say 0, * + $_ ...^ * > 100
12:21 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100␤»
12:21 brrt clearly
12:21 brrt ah
12:22 brrt it is a sequence from up to where * is higher than 100
12:22 hulu thx
12:22 brrt * is replaced by a magic variable or something
12:22 hulu what does 'up until' mean?
12:22 FROGGS nr: say 0 ...^ 10
12:22 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
12:22 brrt nr: say ^10
12:23 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0..^10␤»
12:23 hoelzro hulu: it means up to, but not including
12:23 brrt nr: say ( ^10 );
12:23 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0..^10␤»
12:23 FROGGS nr: say ( @( ^10 ) );
12:23 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
12:24 hulu r: say ( ^10 );
12:24 p6eval rakudo 935c90: OUTPUT«0..^10␤»
12:25 hulu r: say ( ( ^10 ));
12:25 p6eval rakudo 935c90: OUTPUT«0..^10␤»
12:25 hulu say ( @( ^10 ) ); what does '@' mean?
12:25 hulu FROGGS: say ( @( ^10 ) ); what does '@' mean?
12:25 Gruber joined #perl6
12:26 FROGGS it is a list contextualizer, it populates the (lazy) list into its elements
12:26 bruges joined #perl6
12:26 FROGGS should be the same as:
12:26 FROGGS nr: say ^10.list
12:26 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0..^1␤»
12:26 FROGGS hmmm
12:26 FROGGS nr: say( ^10.list )
12:26 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0..^1␤»
12:27 cognominal rn: say  $_=5; 0, * + $_ ...^ { $_ > 100 }
12:27 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«5␤»
12:27 cognominal rn:  $_=5; say 0, * + $_ ...^ { $_ > 100 }
12:27 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100␤»
12:29 imarcusthis joined #perl6
12:29 cognominal because that a simple list, perl 6 could figure it out itself
12:29 breinbaas joined #perl6
12:29 cognominal rn: say   0, 5, 10 ...^ { $_ > 100 }
12:29 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100␤»
12:30 pjcj joined #perl6
12:30 FROGGS nr: say (^10).list
12:30 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
12:31 FROGGS there you go
12:31 brrt nr: say 0.list
12:31 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«0␤»
12:34 cognominal nr: say 0.list.perl
12:35 p6eval rakudo 935c90: OUTPUT«(0,).list␤»
12:35 p6eval ..niecza v24-18-gaf64300: OUTPUT«(0, ).list␤»
12:35 bbkr_ joined #perl6
12:35 cognominal which is redundant
12:36 cognominal nr: say (0,).perl
12:36 p6eval rakudo 935c90: OUTPUT«(0,)␤»
12:36 p6eval ..niecza v24-18-gaf64300: OUTPUT«(0, )␤»
12:36 cognominal or not :)
12:36 cognominal nr: say (0,).WHAT.perl
12:36 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«Parcel␤»
12:36 cognominal I keep forgetting about parcels
12:50 sqirrel joined #perl6
13:03 SmokeMachine joined #perl6
13:35 onlooker989781 joined #perl6
13:47 * [Coke] grumbles at himself for not finding any time to hack on nqp-jvm this weekend. bad Coke.
13:47 [Coke] jnthn++ # blog post.
13:53 GGG joined #perl6
14:01 dalek perl6-roast-data: f73924b | coke++ | / (4 files):
14:01 dalek perl6-roast-data: today (automated commit)
14:01 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/f73924b37e
14:01 dalek perl6-roast-data: c1edff8 | coke++ | / (4 files):
14:01 dalek perl6-roast-data: today (automated commit)
14:01 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/c1edff886e
14:01 dalek perl6-roast-data: 6949883 | coke++ | / (4 files):
14:01 dalek perl6-roast-data: today (automated commit)
14:01 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/69498832db
14:07 atrodo joined #perl6
14:07 bluescreen10 joined #perl6
14:12 [Coke] looks like a few more rakudo failures crept in.
14:13 PacoAir joined #perl6
14:19 b1rkh0ff joined #perl6
14:19 moritz huh
14:19 moritz my last spectests were all clean
14:19 bluescreen10 joined #perl6
14:20 cognominal joined #perl6
14:26 kaare_ joined #perl6
14:28 FROGGS mine too
15:00 PacoAir joined #perl6
15:00 stopbit joined #perl6
15:02 isBEKaml joined #perl6
15:02 [Coke] 865c95f roast, rakudo has 25 failures. doesn't say which version of rakudo, but it's...
15:03 [Coke] 6d5dc67
15:03 SamuraiJack joined #perl6
15:03 [Coke] this is with whatever config we have available on rakudo. Could be something due to ICU, due to the fact that's running via cron and not a login shell...
15:04 [Coke] Note that the command line "dash-e" failures have been occurring for a while as well.
15:04 [Coke] if I need more env vars in https://github.com/coke/perl6-roast-data/blob/master/bin/rakudo.sh, that can be arranged
15:05 [Coke] also, I'm running via t/spec/test_summary, not "make spectest"
15:08 timotimo [Coke]: it would be super weird if ICU were missing due to not having a login shell :|
15:10 isBEKaml hello, #perl6!
15:36 [Coke] timotimo: those are 2 different issues.
15:37 [Coke] yes, it would be super weird if they were related.
15:45 timotimo oh, haha d)
15:45 timotimo :) okay
15:45 FROGGS joined #perl6
15:57 timotimo is "moreinput" the mechanism in STD that detects when a line isn't complete yet?
15:57 moritz s/line/statement/ I think
15:57 SamuraiJack_ joined #perl6
15:58 timotimo er, yeah
15:58 timotimo you would register a function that does, for instance, a prompt and readline to that moreinput thing?
15:58 moritz yes
15:59 timotimo hm, that seems pretty simple to port over to rakudo. i must be missing something obvious
16:01 moritz I hope you are right
16:04 timotimo you hope i'm missing something obvious? :P
16:05 moritz no, I hope you are righ that it is easy to port
16:05 SmokeMac_ joined #perl6
16:06 timotimo if i see correctly, it only touches the whitespace rule and the unspace rule
16:10 TimToady joined #perl6
16:11 kaleem joined #perl6
16:21 * masak is back home o/
16:25 ingy /o\
16:26 timotimo \o\
16:26 masak /o/
16:27 PerlJam _o_
16:27 masak ^o^
16:27 isBEKaml |o|
16:27 masak ~o~
16:27 ingy |+ö+|
16:27 isBEKaml *o*
16:27 masak [o]
16:27 PerlJam o
16:28 isBEKaml /o/\
16:28 SunilJoshi joined #perl6
16:28 TimToady »o̤«
16:28 ingy örz
16:29 masak »ő«
16:29 * ingy pines for TimTöady
16:30 * TimToady hums The Pines of Röme
16:31 isBEKaml (˚இ˚)
16:31 kaleem_ joined #perl6
16:32 masak isBEKaml: vute!
16:32 masak cute*
16:33 TimToady is that an elephant with its nose tied in a knot?
16:33 cognominal joined #perl6
16:33 timotimo ˇ[ˇ
16:33 isBEKaml TimToady: kind of. :D
16:34 isBEKaml it's a Tamil letter, pronounced "e" (like how you pronounce the letter "e")
16:34 fgomez joined #perl6
16:34 TimToady that's part of why I suggested it was an elephant
16:35 isBEKaml or a swirling vortex.
16:35 isBEKaml Ah, I see what you did there. ;)
16:39 TimToady I looked up the actual Unicode (and its sound, which suggests an elephant trumpeting) before suggesting the elephant :)
16:40 TimToady though I would not go as far as to claim that it's how an elephant trumpeting would actually be represented in the Tamil language
16:43 isBEKaml Then that audio must have been quite loud! :)
16:43 masak maybe it's a capital இ ? :)
16:44 isBEKaml :D
16:46 masak TimToady: any reactions to my suggestion to add defaults to subtypes?
16:46 masak TimToady: should I patch STD.pm6 while I patch the spec? ;)
16:47 alec joined #perl6
16:48 [hds] joined #perl6
16:49 [hds] left #perl6
16:50 jnthn evening, #perl6
16:50 brrt hi jnthn
16:51 jnthn masak: Add...what? :)
16:51 masak jnthn: http://irclog.perlgeek.de/perl6/2013-02-03#i_6406843
16:52 brrt jnthn, is there a repo / branch for the nqp-jvm port?
16:52 isBEKaml hello, jnthn
16:52 masak brrt: http://irclog.perlgeek.de/perl6/2013-02-03#i_6406843
16:52 masak ugh.
16:53 masak brrt: https://github.com/jnthn/nqp-jvm-prep
16:53 brrt masak++ thanks :-)
16:53 masak brrt: when in doubt, check someone's github account ;)
16:53 brrt right
16:53 brrt i had looked at the perl6 account only :-)
16:53 SamuraiJack_ joined #perl6
16:54 jnthn masak: OK, can you demonstrate the use case for them?
16:54 jnthn masak: Their semantics, where they'd apply, etc.
16:55 masak jnthn: the default is used for uninitialized variables and unbound parameters. the default is *checked* against the subtype constraint at BEGIN time.
16:55 masak I'm undecided about whether the default should be thunked, like the lhs of infix:<xx>.
16:56 masak but mostly because I haven't thought about a use case for either choice yet.
16:56 * jnthn would be more convinced if he saw a prototype implementation also ;)
16:57 FROGGS ahh, hi all!
16:57 masak aaaaaahhhh hi FROGGS! \o/
16:58 jnthn bbi10
16:58 masak jnthn: I'll... see what I can do.
16:58 isBEKaml masak: are we trying to take over programmer errors too? :)
16:58 masak isBEKaml: please be more specific.
16:58 jnthn masak: Failing that though, concrete use cases would be nice :)
16:59 masak jnthn: I hate it that the default value of Odd (as defined in the spec) is divisible by 2
16:59 FROGGS (°o°)
16:59 FROGGS TimToady: have you seen my pull request?
16:59 masak jnthn: I think this should be addressed. I think defaults is the right fix. Ada has'em.
16:59 isBEKaml masak: uninitialized variables form a subset of programmer errors. That said, I don't see where we can use defaults for subtype constraints.
16:59 masak jnthn: it's like giving the subtype a new "zero".
17:00 masak isBEKaml: you *don't* see why we *can* use? did you forget a negation? :P
17:00 tadzik hi!
17:00 isBEKaml masak: I don't don't see. :P
17:00 masak oh, *where* we can...
17:00 masak tadzik! \o/
17:01 tadzik \o/
17:01 isBEKaml tadzik!
17:01 timotimo are those defaults relevant to autovivification at all?
17:01 masak depends if you can type container types with subtypes.
17:01 masak I guess you can.
17:02 isBEKaml like my Parent $foo = Child.new(blah) ?
17:03 masak those are not the subtypes I'm talking about.
17:03 isBEKaml linky on irclog, please? (I have no context) :(
17:03 tadzik nothing like a good starwars reference :)
17:03 timotimo "you don't need to see this subtype's ident card. move along" *waves hand*
17:03 masak r: subset Odd of Int where { $_ % 2 }; my Odd $n; say $n
17:03 p6eval rakudo 935c90: OUTPUT«Odd()␤»
17:03 masak r: subset Odd of Int where { $_ % 2 }; my Odd $n; say $n % 2
17:03 p6eval rakudo 935c90: OUTPUT«Parameter '' requires an instance, but a type object was passed␤  in method Bridge at src/gen/CORE.setting:3117␤  in sub infix:<%> at src/gen/CORE.setting:3034␤  in block  at /tmp/ppcw3JC6AV:1␤␤»
17:03 masak r: subset Odd of Int where { $_ % 2 }; my Odd $n; say +$n % 2
17:03 p6eval rakudo 935c90: OUTPUT«use of uninitialized variable $n of type Odd in numeric context  in block  at /tmp/eNFecDoxuf:1␤␤0␤»
17:04 masak r: subset Odd of Int where { $_ % 2 }; my Odd $n; say so +$n % 2
17:04 p6eval rakudo 935c90: OUTPUT«use of uninitialized variable $n of type Odd in numeric context  in block  at /tmp/sOt4exUmiD:1␤␤False␤»
17:04 masak see?
17:04 masak Odd can be *even*.
17:04 masak (because we don't have a defaults mechanism)
17:04 masak the current proposal is 'subset Odd of Int where { $_ % 2 } default 1;' -- but I'm not married to the syntax.
17:06 isBEKaml Okay, I see you're talking of constrained types. ( I was confused by the wording of subtypes)
17:06 masak sorry for confusing you.
17:06 masak they're called subtypes in the spec.
17:07 FROGGS masak: what are you proposing to change? an implicit default value?
17:07 timotimo an explicit default value
17:08 masak right.
17:08 FROGGS who? :P
17:08 isBEKaml be explicit!
17:08 masak for when the default (type object) of the wrapped type doesn't cut it.
17:08 masak like with 'Odd'.
17:08 isBEKaml r: my Int $foo; say $foo;
17:08 p6eval rakudo 935c90: OUTPUT«Int()␤»
17:08 isBEKaml :/
17:08 isBEKaml r: my Int $foo; say +$foo;
17:09 p6eval rakudo 935c90: OUTPUT«use of uninitialized variable $foo of type Int in numeric context  in block  at /tmp/7F5njj5t9Q:1␤␤0␤»
17:09 masak FROGGS, isBEKaml: the default value is *implicit* if you don't supply it, and *explicit* if you do.
17:09 jnthn masak: I think S09 may have something about the default value of an array slot.
17:09 masak I'm not proposing it has to be supplied, always.
17:09 jnthn masak: It may be nice if we can unify these things.
17:09 masak jnthn: ooh
17:09 isBEKaml masak: Taking yoru example of subset Odd of Int, why not used Int's defaults? (is that how it is, currently?  - I'd guess so)
17:10 * FROGGS .oO( unicorns++ )
17:10 masak I may or may not be proposing that if you *don't* supply a default and the implicit default doesn't pass the subtype's test, that's a compile-time error.
17:10 masak isBEKaml: yes, that's how it is now. and the Int() type object, when modulo'd by 2, produces a warning and results in 0, falsy. so Int() is *not* Odd.
17:10 masak isBEKaml: and that bothers me.
17:11 masak isBEKaml: if you were to use the subtype in a parameter list, for example, it's technically possible (just by not passing anything) to get a value in the variable that doesn't pass the subtype test. which makes it rather a weak precondition. :/
17:14 isBEKaml masak: Right - so you want to allow the programmer to specify defaults explicitly and at the same time ban weak predicates? (The latter is not what you said, but hey, it's a nice topping. ;)
17:14 masak jnthn: didn't find anything in S09 about array slot defaults :/
17:15 masak isBEKaml: something like that. I want subtypes to always hold, and currently, type objects (and the inability to supply defaults) can make them not hold.
17:16 japhb I agree with that argument, FWIW.
17:16 masak \o/
17:16 isBEKaml masak: I agree, it would be nice to have.
17:16 japhb Especially the bit about parameter constraints not actually constraining the arguments.
17:16 japhb That's ... a real problem.
17:17 masak it's been bothering me for years.
17:17 jnthn Is it me, or did the "view raw" link disappear on https://github.com/perl6/specs/blob/master/S02-bits.pod
17:17 masak now please discuss (1) whether the default (explicit or implicit) not passing the subtype test should be a compile-time error, and (2) syntax. I'll be away for ~45 minutes ;)
17:17 isBEKaml jnthn: "Sorry, blob took too long to generate" :)
17:18 jnthn isBEKaml: Yes, there used to be a "view it as raw text" link.
17:18 FROGGS https://raw.github.com/perl6/specs/master/S02-bits.pod
17:18 FROGGS dont see the link either
17:19 palakas joined #perl6
17:19 cognominal me neither
17:19 jnthn masak: Oh, I was thinking of the "is default" trait in S02...
17:20 japhb An explicit default that doesn't pass the subtype test is clearly insane.  Compile time error, no question in my mind.
17:21 FROGGS japhb: an implicit default that doesnt pass is insane too
17:21 japhb I would argue having an implicit default that doesn't pass is not a good thing, but it's also not clearly insane, because you as the programmer might know that the default never gets used.
17:21 masak jnthn: an "is default" trait might be cleaner, yes.
17:21 japhb (I'm not saying it's clear that it *shouldn't* whine, but I am saying that it's *not* clear it *should*.)
17:22 FROGGS I vote for an 'is insane' trait ;o)
17:22 isBEKaml what about the case where we specify constrained types on custom types? What if there were an implicit default? (I'm not sure if this is even possible, constrained types on custom types)
17:23 TimToady .oO(subset roles...)
17:24 masak japhb: agreed.
17:24 TimToady the idea of defaults has been in the air for several years now; it shows up in the discussion KeyHash for instance, and we've talked about it several times on IRC
17:25 TimToady it kinda makes sense to put defaults on a subtype, and it kinda doesn't
17:26 TimToady it feels like a too-concrete thing for a subtype to be claiming
17:26 japhb TimToady, it almost feels like the base types not having explicitly declared defaults is "a magic list of constants to remember"
17:26 japhb So I don't think subtypes are special in this sense.
17:26 TimToady otoh, it might be the most convenient peg to hang it, if we don't have a better peg
17:27 TimToady base types are designed to allow at least one out-of-band value (Maybe types in H-land)
17:27 TimToady and subtypes are more like Just types
17:28 TimToady I suspect there are conflicting use cases for defaults interacting here...
17:30 TimToady unmarked value vs identity value vs out-of-band value vs [your ad here]
17:31 TimToady most likely value
17:31 TimToady (and hence, can usually be omitted)
17:31 TimToady most likely starting value
17:31 japhb Don't identity values come from operators, not operands?
17:31 TimToady there are just a lot of different reasons you might want a default
17:32 TimToady japhb: sure, but my confidence was shaken recently
17:32 japhb oh?
17:32 TimToady in thinking about longest-zip, I was thinking the missing value could be determined by the operator
17:33 TimToady but then a recent RC entry wanted 0 default for *
17:36 japhb I'm not entirely sure what to make of that.
17:36 benabik joined #perl6
17:36 japhb My immediate reaction is to blame the RC entry, because of years of government training ... er, I mean public schooling.
17:36 arlinius joined #perl6
17:37 japhb OTOH, I have myself seen cases where I wanted a 0 to fall out of multiplying an empty list.
17:37 TimToady well, only relates to the current topic tangentially
17:38 japhb Must go afk, will backlog
17:40 TimToady it's in http://rosettacode.org/wiki/Numeric_error_propagation#Perl_6 in the calculation of covariance
17:40 TimToady if there was a longest zip that could default Z* to 0, I wouldn't have to jump through hoops with the @INDEP array
17:41 TimToady which is just a backdoor to lengthen all the independent error vectors to the same length, so that Z works
17:46 moritz r: say roundrobin((1, 2, 3); (10, 20)).map({ [+] @$_ }).perl
17:46 p6eval rakudo 935c90: OUTPUT«(1, 10, 2, 20, 3).list␤»
17:46 moritz r: say roundrobin((1, 2, 3); (10, 20)).tree.map({ [+] @$_ }).perl
17:46 p6eval rakudo 935c90: OUTPUT«(11, 22, 3).list␤»
17:46 moritz looks like a longest zip with default 0 to me
17:47 jnthn dinner &
17:51 TimToady r: say roundrobin((1, 2, 3); (10, 20)).tree.map({ [*] @$_ }).perl
17:51 p6eval rakudo 935c90: OUTPUT«(10, 40, 3).list␤»
17:51 TimToady moritz: doesn't default to 0 for *
17:52 moritz oh right
17:52 Chillance joined #perl6
17:56 TimToady mind, I'm just cargo-culting the formulas from the p5 code without thinking about what they mean :)
17:57 masak TimToady: maybe a :default adverb on reduction metaops would help in your use case?
18:03 TimToady it feels like it very nearly defeats all the notational convenience of Z, but perhaps it's still clearer than the alternatives
18:14 SamuraiJack joined #perl6
18:14 moritz is there any other metaop than Z that might benefit from a default?
18:15 PacoAir joined #perl6
18:16 masak oh, I meant [op], not Zop
18:23 benabik_ joined #perl6
18:26 spider-mario joined #perl6
18:31 moritz when would a default for [op] kick in? for undefined values?
18:32 * [Coke] wonders what calling out to native java classes from nqp-jvm would look like.
18:36 zby_home joined #perl6
18:38 domidumont joined #perl6
18:41 cognominal moritz, indent with a negative indent as used per heredoc messes up with tabs after the indent zone in a line. That's makes heredoc poor suited to generate Makefiles
18:42 cognominal * poorly
18:43 japhb r: my @a; my @b = (5); say [*] @a; say [*] @b; say +@a && [*] @a; say +@b && [*] @b;
18:43 p6eval rakudo 935c90: OUTPUT«1␤5␤0␤5␤»
18:43 masak cognominal: oh, interesting use case.
18:43 japhb ^ FWIW, a solution to at least *my* problem with the default of [*];
18:43 masak cognominal: might be indent is not the solution for Makefiles, though.
18:43 masak oh, heredocs. hm.
18:44 zby_home_ joined #perl6
18:44 japhb It works, but it's a tad too "clever".
18:44 cognominal rn: say "  \t".indent(-2).perl
18:44 p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«"      "␤»
18:44 masak cognominal: yeah.
18:44 masak by design.
18:45 cognominal I would prefer by default and have an option to preserve tabs :)
18:46 * masak mulls over this
18:48 cognominal for what should be the default, I am not sure; but I advocate the possibility to override it
18:49 cognominal We generate Makefiles in rakudo btw, but with Perl 5, I think.  :)
18:51 raiph__ joined #perl6
18:51 felher Am I missing something or doesn't Buf have a elems method as per specification?
18:52 felher Oh, maube in Stringy...
18:53 cognominal nr: say Buf.^find_method('elems').WHAT
18:53 p6eval rakudo 935c90: OUTPUT«Method()␤»
18:53 p6eval ..niecza v24-18-gaf64300: OUTPUT«Unhandled exception: Unable to resolve method find_method in type ClassHOW␤  at /tmp/AByE40xTEL line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4219 (module-CORE @ 580) ␤…
18:54 cognominal Not sure to know the way to find where a method is defined
18:55 spider-mario_ joined #perl6
18:56 felher r: say Buf.^mro
18:56 p6eval rakudo 935c90: OUTPUT«Cannot look up attributes in a type object␤  in method list at src/gen/CORE.setting:7362␤  in method gist at src/gen/CORE.setting:7372␤  in method gist at src/gen/CORE.setting:5128␤  in sub say at src/gen/CORE.setting:7595␤  in block  at /tmp/mHccnIBN92:1␤␤»…
18:56 felher hm...
18:58 cognominal it's defined here  https://github.com/rakudo/rakudo/blob/nom/src/core/Buf.pm#L41
19:00 felher cognominal: thanks :) I'm more interested if it is specced, though.
19:02 felher Ah, I guess S02-bits.pod:928 is what I wanted :0
19:02 felher * :)
19:05 spider-mario joined #perl6
19:08 swarley I'm getting a core dump trying to compile the latest nqp
19:08 swarley swarley@OctaviasViolin ~/Programming/rakudo/nqp (git)-[master] % ./nqp
19:08 swarley src/call/context.c:708: failed assertion 'Parrot_pcc_get_regs_used(interp, ctx, REGNO_STR) > idx'
19:09 timotimo you do your programming on a violin? mad props.
19:09 swarley I also do programming on a viola, mandolin, and cello
19:11 swarley building a fresh version to test
19:11 [Coke] swarley: how did you configure your nqp?
19:12 swarley perl Configure.pl
19:12 [Coke] (using a local parrot or a pre-installed one - I'm assuming local - did you clean it out first?
19:12 [Coke] ok. what does `which parrot` say, and what about parrot --version?
19:12 swarley It appears to be using /usr/bin/local/parrot
19:13 swarley err
19:13 swarley /usr/local/bin/parrot
19:13 fgomez joined #perl6
19:13 swarley I can tell you more about it in a second, I'm building from a fresh repo, and if it fails again I'll rebuild parrot
19:14 swarley Are there plans to develop a more featureful repl for nqp/perl6?
19:15 [Coke] not for nqp.
19:15 jnthn swarley: What features do you want?
19:16 [Coke] rakudo, I think someone is trying to improve partial command detection.
19:16 * jnthn improved the error reporting a week or so back.
19:16 swarley jnthn; just prettifying. I'm not sure if you do any sort of work with ruby but I work closely with the pry team, and I helped with fancy-lang's repl as well.. I'm a fan of pretty repls :)
19:18 swarley Also auto indent, auto multiline, syntax hilighting, etc. Things you don't need but are neat
19:21 japhb_ joined #perl6
19:28 araujo joined #perl6
19:28 FROGGS joined #perl6
19:35 Targen joined #perl6
19:38 dalek perl6-roast-data: c508ac1 | coke++ | / (4 files):
19:38 dalek perl6-roast-data: today (automated commit)
19:38 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/c508ac1db4
19:39 * [Coke] notes that the rakudo failures are gone today.
19:39 [Coke] (except for the long standing issues with dash-e
19:42 grondilu joined #perl6
20:01 fhelmberger joined #perl6
20:01 bruges joined #perl6
20:03 fgomez joined #perl6
20:08 swarley recompiling parrot seems to have worked
20:10 swarley yup all tests successful
20:15 grondilu about REPL:  relaxed mode in REPL by default would be nice
20:18 [Coke] relaxed?
20:18 [Coke] you mean "no strict;" ?
20:18 [Coke] (that doesn't work anywhere yet)
20:22 grondilu [Coke]: yes that's what I meant.  I mean, once it works, I'd like it to be the default for REPL.
20:22 grondilu this and a persistent history
20:23 benabik joined #perl6
20:24 SmokeMachine joined #perl6
20:28 swarley how do I add a directory to the use path?
20:29 grondilu push @INC, $dir
20:29 grondilu or @*INC maybe
20:29 grondilu r: say @*INC
20:29 p6eval rakudo 935c90: OUTPUT«/home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/site/lib /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/vendor/lib /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/lib /home/p6eval/.perl6/2013.01-97-g6d5dc67/lib␤»
20:29 grondilu yep,  push @*INC
20:36 [Coke] you can also use the env var PERL6LIB
20:37 eiro hello everyone
20:37 eiro masak, http://www.africafornorway.no/
20:43 cognominal joined #perl6
20:46 swarley how do I compile my nqp file to pbc?
20:47 masak eiro: yes, I found it the same night. funny and thought-provoking.
20:49 swarley whenever i try to use a file it says it cant find the pbc
20:51 swarley nevermind, I figured it out
20:52 dalek nqp-jvm-prep: 64838dd | jonathan++ | src/org/perl6/nqp/runtime/Ops.java:
20:52 dalek nqp-jvm-prep: Fix nqp::substr; patch from nwc10++.
20:52 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/64838dd46c
20:53 [Coke] swarley++
20:54 swarley How do I declare a sub to be global?
20:55 tadzik hey eiro
20:55 swarley I declared a sub at the bottom of this file, but it says it can't find the sub
20:56 swarley But it can find the classes
20:56 huf how are you calling it?
20:56 jnthn swarley: mark the sub with "is export"
20:56 huf oh shit this is one channel over :D
20:56 huf disregard me, bash.org quote
20:56 swarley sub my_sub() is export ?
20:56 jnthn *nod*
20:57 swarley still can't find it
20:57 jnthn Did you recompile to the PBC after the change?
20:57 swarley yes
20:57 jnthn Hm.
20:58 jnthn Not sure. there's a bunch of working examples in e.g. nqp-jvm-prep
20:58 jnthn See helper.nqp or so.
20:58 swarley yesCan only use get_who on a SixModelObject
20:58 swarley I get that when I 'use' it
20:58 swarley And then the parrot error from earlier when I exit
20:59 jnthn You're doing the use from the REPL?
20:59 swarley yes
20:59 jnthn I know it works in the Perl 6 one. I've no idea about NQP.
21:00 jnthn I don't see why it wouldn't, mind.
21:00 jnthn If it works from a file, feel free to file an nqp bug about it not working in the repl.
21:00 swarley I'm going to try to run it outside of the repl
21:04 cognominal joined #perl6
21:07 fgomez joined #perl6
21:07 swarley What method is called for ~($foo) ?
21:09 sorear .Str or .Stringy, I forget the current spec
21:09 [Coke] r: class A { method Str { return "eek" }}; my $foo = A.new; ~($foo).say;
21:09 p6eval rakudo 935c90: OUTPUT«A.new()␤»
21:09 [Coke] r: class A { method Stringy { return "eek" }}; my $foo = A.new; ~($foo).say;
21:09 p6eval rakudo 935c90: OUTPUT«A.new()␤»
21:10 swarley Yeah neither is working in nqp either
21:11 jnthn r: class A { method Str { return "eek" }}; my $foo = A.new; (~$foo).say
21:11 p6eval rakudo 935c90: OUTPUT«eek␤»
21:11 jnthn Precedence :)
21:12 swarley oh, so you need (~$foo)
21:12 [Coke] mmm. I'm wondering what ~($foo) is doing.
21:12 [Coke] stringify the listify of $foo?
21:12 [Coke] er, no, since ($foo) isn't what it once was.
21:12 eiro hey tadzik :)
21:13 eiro masak, sure but it can be prophetic in some way: we can't see clearly how global warning will affect the weather :)
21:14 masak eiro: in fact, Norway is fairly cold already.
21:14 eiro right :)
21:14 jnthn [Coke]: the .say method was called and then it stringified the result of say in void context, I tink.
21:14 cxreg joined #perl6
21:14 masak I'm pretty sure humans didn't evolve at this latitude... :)
21:15 eiro they can't evolve anymore: you're all so perfect!
21:15 swarley nqp: class A { method Str() { return "eek" }}; my $foo := A.new; (~$foo).say()
21:15 p6eval nqp: OUTPUT«Method 'say' not found for invocant of class 'String'␤current instr.: '' pc 92 ((file unknown):52) (/tmp/i9o1JZQlmt:1)␤»
21:15 swarley nqp: class A { method Str() { return "eek" }}; my $foo := A.new; say((~$foo))
21:15 p6eval nqp: OUTPUT«A<2452302>␤»
21:15 swarley :/
21:16 jnthn I don't think NQP supports that, off hand.
21:16 jnthn Or there's some is parrot_vtable hack
21:16 jnthn Though probably that's going away in favor of making the thing you just wrote work...
21:16 eiro btw: i finally try to explore the rakudo code to figure out where my encoding problem can have a long term solution
21:16 eiro but i guess it will not be a cross-vm solution
21:17 simcop2387 joined #perl6
21:20 swarley swarley@OctaviasViolin ~/Programming/nqp-yarv (git)-[master] % nqp lib/RAST/Nodes.nqp
21:20 swarley Method 'Str' not found for invocant of class 'Integer'
21:20 swarley seriously?
21:21 jnthn swarley: Seriously.
21:22 jnthn swarley: NQP is quirky.
21:22 jnthn swarley: In some places, too much so.
21:22 swarley I just want to unify how I dump data
21:23 swarley so that natives and complex data dont need to be separated
21:24 tadzik jnthn: what do we really expect of nqp::existpos?
21:25 tadzik it's not really test-covered in our nqp. I would assume that it says "does such index exist in the array", but looking at Parrot I see that it checks for definedness
21:25 jnthn swarley: ah, we wrap stuff in QAST/JAST in QAST::IVal etc...
21:25 jnthn tadzik: eek
21:25 jnthn tadzik: I...wonder where it's used
21:25 tadzik jnthn: nowhere
21:26 swarley Can someone please just tell me how to stringify everything the same way? :(
21:26 tadzik jnthn: the only place I found is t/nqp/52-vtable.t
21:26 tadzik plus the bindings in nqp
21:26 * tadzik checks rakudo
21:26 jnthn tadzik: Maybe in Rakudo?
21:26 tadzik ok, rakudo uses it
21:26 tadzik yeah
21:26 tadzik I'll just figure out what does it expect :)
21:27 jnthn tadzik: I think it uses it to know if there's any such an index in the array
21:27 swarley or at least tell me how to tell what an object's class is :(
21:28 tadzik jnthn: so it's practically nothing more than "is this index lower than the number of elements?"
21:28 swarley Can anyone point me to overloading of operators in nqp/perl6?
21:29 jnthn swarley: You can't overload operators in NQP.
21:29 jnthn In Perl 6 it's declaring a multi
21:29 swarley blargh
21:29 jnthn tadzik: Something like that.
21:30 swarley Well, how do I get the class of an object in nqp?
21:30 swarley oh
21:30 swarley .WHAT
21:30 swarley does nqp have case?
21:32 swarley nqp: class Test {}; class Foo is Test { }; my $bar := Foo.new(); say($bar.WHAT == Test);
21:32 p6eval nqp: OUTPUT«1␤»
21:33 swarley how would I tell if it inherits a class?
21:34 * swarley sighs
21:34 swarley I suppose it just won't be that easy
21:35 [Coke] swarley: OOC, what are you doing that needs NQP and not rakudo?
21:36 jnthn nqp::istype($obj, TheClass)
21:44 swarley swarley@OctaviasViolin ~/Programming/nqp-yarv (git)-[master] % nqp lib/RAST/Nodes.nqp
21:44 swarley ['YARVInstructionSequence/SimpleDataFormat', 1, 2, 1, { arg_size:   0,  local_size: 0,  stack_max:  0}, '<compiled>', '<compiled>', nil, 1, :top, 0, 0, 0, 3]
21:44 swarley Starting to come out
21:45 swarley I need to dump those arrays at the end correctly though
21:47 eiro the goal of making rakudo portable is removing the pir::* in the code, right ?
21:48 PerlJam eiro: the way you said it sounds backwards to me, but the gist seems right  :)
21:50 eiro sorry i'm french. bad accent, bad presidents. (but pretty good wine and cheese)
21:50 eiro thanks PerlJam
21:50 masak eiro: at least you replaced that sarcasm president.
21:50 masak ;)
21:51 eiro sure: the other doesn't need sarcasm to make us laught
21:53 tadzik what's nqp for 'Mu'?
21:53 diakopter NQPMu
21:53 eiro 'night everyone
21:53 tadzik diakopter: thanks
21:55 diakopter yw XD
21:58 tadzik jnthn: sent you a pull request with my shot at existspos
21:58 tadzik I guess I should add those tests to nqp as well
21:59 jnthn tadzik: yes, please
21:59 tadzik sure
21:59 PacoAir joined #perl6
21:59 dalek nqp-jvm-prep: 543db9d | tadzik++ | / (6 files):
21:59 dalek nqp-jvm-prep: Implement and test existspos
21:59 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/543db9d920
21:59 dalek nqp-jvm-prep: c50cd3c | jonathan++ | / (6 files):
21:59 dalek nqp-jvm-prep: Merge pull request #13 from tadzik/existspos
21:59 dalek nqp-jvm-prep:
21:59 dalek nqp-jvm-prep: Implement and test existspos
21:59 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/c50cd3c298
22:00 jnthn tadzik++
22:00 tadzik I contributed \o/
22:00 tadzik now deletepos :)
22:01 dalek nqp: edf9493 | tadzik++ | t/nqp/59-nqpop.t:
22:01 dalek nqp: Add tests for nqp::existspos
22:01 dalek nqp: review: https://github.com/perl6/nqp/commit/edf949306a
22:03 dalek nqp-jvm-prep: 5cd217a | (Gerhard R)++ | Makefile:
22:03 dalek nqp-jvm-prep: New Makefile with mostly atomic rules suitable for parallel make
22:03 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/5cd217a667
22:03 dalek nqp-jvm-prep: cd0e5d1 | jonathan++ | Makefile:
22:03 dalek nqp-jvm-prep: Merge pull request #12 from gerdr/newmakefile
22:03 dalek nqp-jvm-prep:
22:03 dalek nqp-jvm-prep: New Makefile with mostly atomic rules suitable for parallel make
22:03 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp-jvm-prep/commit/cd0e5d129d
22:12 jnthn 'night, #perl6
22:13 tadzik good knight jnthn
22:16 swarley Sweet, it works
22:17 colomon \o/
22:17 [Coke] yay, make rules updated for nqp-jvm
22:17 colomon seeing lots of jvm commits brings a smile to my face every time.
22:18 [Coke] sweeeet.
22:24 bbkr__ joined #perl6
22:27 swarley That terrible moment when the VM you're working with is only documented in japanese
22:28 * swarley prays to god that the method signature says that the last argument is
22:31 dalek nqp: 44054e8 | tadzik++ | t/nqp/59-nqpop.t:
22:31 dalek nqp: Add tests for nqp::deletepos
22:31 dalek nqp: review: https://github.com/perl6/nqp/commit/44054e8263
22:39 * swarley doesn't quite know where to go from here.
22:40 swarley I suppose I need to add more nodes
22:44 swarley nqp: class Foo { has $!bar; }; class Baz is Foo { method BUILD() { $!bar := 1; }; method test() { say($!bar); } }; Baz.new().test()
22:44 p6eval nqp: OUTPUT«Attribute '$!bar' not declared at line 2, near " := 1; }; "␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
22:44 swarley :s
22:45 tadzik private attributes are private :)
22:45 swarley oh, duh
22:45 swarley nqp: class Foo { has $bar; }; class Baz is Foo { method BUILD() { $bar := 1; }; method test() { say($bar); } }; Baz.new().test()
22:45 p6eval nqp: OUTPUT«Use of undeclared variable '$bar' at line 2, near " := 1; }; "␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
22:45 swarley err
22:46 tadzik nqp: class Foo { has $.bar; }; class Baz is Foo { method BUILD() { $b!ar := 1; }; method test() { say($!bar); } }; Baz.new().test()
22:46 p6eval nqp: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "has $.bar;"␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
22:46 tadzik oh, duh
22:46 swarley nqp doesn't have $.
22:46 tadzik right
22:47 tadzik I also put ! in the wrong place :)
22:47 tadzik so you'd have to write your own accessors I guess
22:50 swarley also
22:50 swarley How do i write a BUILD method with just one argument that isn't named?
22:52 tadzik phenny: tell jnthn deletepos pullrequested as well :)
22:52 phenny tadzik: I'll pass that on when jnthn is around.
22:53 tadzik swarley: it seems that BUILD in nqp is completely manual
22:53 tadzik unlike Perl 6
22:53 tadzik so you can write it any way you want, as it'd be you who'd be calling it
22:54 swarley Well, I don't quite know why when I only put one argument in the signature and call it with one, it says i'm calling it with too many
22:55 swarley nqp: class Foo { method BUILD($foo!) { say($foo); } }; Foo.new("bar");
22:55 p6eval nqp: OUTPUT«too many positional arguments: 2 passed, 1 expected␤current instr.: 'new' pc 4377 (src/stage2/gen/NQPCORE.setting.pir:2047) (src/stage2/NQPCORE.setting:228)␤»
22:55 swarley What am I doing incorrectly?
22:55 tadzik I suppose that the auto-generated new() receives 0 arguments, you're calling it with 1
22:56 swarley But it says I'm passing 2
22:56 swarley r: class Foo { method BUILD($foo!) { say($foo); } }; Foo.new("bar");
22:56 p6eval rakudo 935c90: OUTPUT«Default constructor for 'Foo' only takes named arguments␤  in method new at src/gen/CORE.setting:730␤  in block  at /tmp/Fc9j4KCe4z:1␤␤»
22:57 swarley o-o
22:57 tadzik swarley: one is the invocant
22:57 tadzik yeah, BUILD in Perl 6 is quite extraordinary
22:57 swarley i thought that :$foo! would make it named?
22:57 tadzik I plegded to not say any opinions about it though :)
22:57 tadzik r: class Foo { method BUILD(:$foo!) { say($foo); } }; Foo.new("bar");
22:57 p6eval rakudo 935c90: OUTPUT«Default constructor for 'Foo' only takes named arguments␤  in method new at src/gen/CORE.setting:730␤  in block  at /tmp/LbhrfKDKKv:1␤␤»
22:57 tadzik ah
22:58 tadzik r: class Foo { has $!foo; method BUILD(:$foo!) { say($foo); } }; Foo.new(foo => "bar");
22:58 p6eval rakudo 935c90: OUTPUT«bar␤»
22:58 tadzik there you go
22:58 tadzik 1) you need to declare it
22:58 tadzik 2) default new does indeed only take named arguments
22:58 tadzik the common practice is:
22:58 swarley oh
22:58 tadzik r: class A { has $.b; method new($b) { self.bless(*, b => $b) } }; A.new(5).b.say
22:58 p6eval rakudo 935c90: OUTPUT«5␤»
22:59 swarley nqp: /hello/.Str()
22:59 p6eval nqp:  ( no output )
22:59 swarley nqp: say(/hello/.Str())
22:59 p6eval nqp: OUTPUT«␤»
22:59 swarley o-o
23:00 tadzik what did you expect? :)
23:00 swarley More of a string?
23:00 masak I think that is a string.
23:00 swarley Well, considering I got no string at all for Num and Int
23:00 tadzik I guess a regex stringifies to ""
23:01 masak rn: say ~/hello/
23:01 p6eval niecza v24-18-gaf64300: OUTPUT«Regex()<instance>␤»
23:01 p6eval ..rakudo 935c90: OUTPUT«␤»
23:01 tadzik nqp: say(5.Str())
23:01 p6eval nqp: OUTPUT«Method 'Str' not found for invocant of class 'Integer'␤current instr.: '' pc 49 ((file unknown):39) (/tmp/WB9srYCwql:1)␤»
23:01 masak 'night, #perl6
23:01 swarley nini
23:01 tadzik good knight masak
23:02 swarley [3] pry(main)> /hello/.to_s
23:02 swarley => "(?-mix:hello)"
23:02 swarley That was what I was hoping for.. that being from ruby
23:02 tadzik I don't think we spec how the regex should stringify
23:04 [Coke] swarley: plus also nqp ain't perl6.
23:04 tadzik yeah, not quite
23:18 swarley well I think I've done enough on it for today.. I've got a working example, and a few primitives that can convert into data i can use in the bytecode
23:20 tadzik awesome
23:23 lorn joined #perl6
23:31 marloshouse_ joined #perl6
23:36 benabik joined #perl6
23:38 cognominal joined #perl6

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

Perl 6 | Reference Documentation | Rakudo