»ö« | perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ | UTF-8 is your friend! Set by Tene on 14 May 2009. |
|||
00:06
ruoso_ joined
00:08
ruoso_ left
00:12
nsh left
00:15
icwiener left,
ruoso left
00:17
nsh joined
|
|||
ab5tract | stjohnson, I like ruby but am also excited about perl 6 | 00:20 | |
00:23
lichtkind_ left,
nsh left
00:25
pmurias left
00:31
nsh joined
00:43
kst left,
kst joined
|
|||
sjohnson | ab5tract: i think Perl 6 will be my favourite | 00:43 | |
and i am excited as well | |||
00:45
mizioumt left,
frew|work left
|
|||
ab5tract | sjohnson, why don't you like ruby | 00:46 | |
sjohnson | if there wasn't perl 6 it would be my favourite, but not a fan of most blocks (like if, etc) being done with english words | ||
as i like to hit the % key in Vim, and have it match the { and }'s | |||
that's one reason off the top of my head | 00:47 | ||
ab5tract | cool | ||
sjohnson | another thing.. in perl, you can do if(@ARGV) | ||
whereas in ruby, you will have to do if ARGV.empty? | |||
or something like that | |||
ab5tract | unless ARGV.empty? , yeah | ||
sjohnson | yeah thats the one | 00:48 | |
unless | |||
i prefer using if's and perl knowing what i am trying to do | |||
ab5tract | yeah, they are two quite different branches on the family tree | ||
sjohnson | i can usually write in Perl quite fast becuase the if statement can always figure out what i am trying to accomplish | ||
ab5tract | Tene, are you there? | 00:49 | |
sjohnson, yes, that is a consequence of Ruby's everything-as-object model | 00:51 | ||
sjohnson | i think the fact that things that are empty / 0 are true in ruby is the real issue | 00:52 | |
ab5tract | sjohnson, which is a consequence of the said model | ||
sjohnson | but doesnt perl 6 do it too? | 00:53 | |
ab5tract | what? treat everything as an object? | ||
sjohnson | yeah | ||
rakudo: say 0.WHAT | |||
p6eval | rakudo 23718a: OUTPUT«Int()» | ||
sjohnson | rakudo: if 0 { } else { print "false"; } | 00:54 | |
ab5tract | i don't think so, or at least minus the limitations that Ruby's implementation constrains | ||
p6eval | rakudo 23718a: OUTPUT«false» | ||
ab5tract | rakudo: my $x; if $x { } else { print "false"; } | 00:55 | |
p6eval | rakudo 23718a: OUTPUT«false» | ||
00:56
wknight8111 left
|
|||
sjohnson | rakudo: my $x; say $x.WHAT; | 00:57 | |
p6eval | rakudo 23718a: OUTPUT«Failure()» | ||
sjohnson | in any case, i am super excited for Perl 6 to come out | 00:58 | |
it fixes many minor annoyances in perl 5, plus a whole lot more | 00:59 | ||
ab5tract | a whole whole lot more | 01:00 | |
sjohnson | rakudo: my $x = do if 1 { 5 } else { 10}; say $x; | ||
p6eval | rakudo 23718a: OUTPUT«5» | ||
sjohnson | rakudo: my $x = do(if 1 { 5 } else { 10}); say $x; | ||
p6eval | rakudo 23718a: OUTPUT«5» | ||
sjohnson | pugs: my $x = do(if 1 { 5 } else { 10}); say $x; | ||
p6eval | pugs: OUTPUT«***  Unexpected "$x" expecting "=", expression, ")", context, ":" or "(" postfix op at /tmp/HbthV3fOE8 line 1, column 4» | ||
sjohnson | pugs: my $x = do if 1 { 5 } else { 10}; say $x; | 01:01 | |
p6eval | pugs: OUTPUT«5» | ||
sjohnson | interesting | ||
Tene | ab5tract: I am here. | ||
ab5tract | i had a suggestion for the cardinal-rakudo bridging | ||
Tene | ab5tract: go ahead. | ||
ab5tract | idiomatic ruby would have a foreign_require "example" | ||
01:02
nbrown_ joined
|
|||
Tene | ab5tract: I don't know what you mean. | 01:02 | |
ab5tract | but would normally never also have an option for loading a module within that | ||
sorry | |||
right now foreign_require takes two arguments, right? | |||
the library to load and the module to load | 01:03 | ||
01:03
nbrown left
|
|||
ab5tract | (the module within the library) | 01:03 | |
in idiomatic ruby you load the library | |||
TimToady | std: my $x = do(if 1 { 5 } else { 10}); say $x; | ||
p6eval | std 26923: OUTPUT«##### PARSE FAILED #####Unable to parse argument list; couldn't find final ')' at /tmp/Rqv5mgwJCg line 1:------> my $x = do(if 1 { 5 } else { 10}); say $x; expecting nofunFAILED 00:02 36m» | ||
ab5tract | and then explicitly include any modules you wish to use, when you wish to use them | 01:04 | |
so the example from the blog would be | |||
Tene | ab5tract: no, it requires the language to load a library from, and the library. | ||
ab5tract | oh okay yes i see that | 01:05 | |
Tene | ab5tract: it's not rakudo/cardinal specifically, it's any language that supports the same API. | 01:06 | |
No other languages do yet. | |||
ab5tract | can you send me the link to your blog i've misplaced it | ||
Tene | And foreign_require is just the first way to load a library that i could think of. | 01:07 | |
blogs.gurulabs.com/stephen/ | |||
ab5tract | okay so the distinction im trying to make is | 01:08 | |
if Foo.pm was in fact a ruby library | |||
when you do a require "foo" | |||
you would still have to do an 'include Foo' | |||
in order for greet to be visible | 01:09 | ||
if sub greet were defined outside of module Foo, then they would be visible upon the load | |||
Tene | OK, yes, that should probably be fixed. | ||
I don't actually know ruby. | |||
ab5tract | yeah i know so I just wanted to give you a heads up :) | 01:10 | |
Tene | I will accept and commit any patches to cardinal to work that way. I'd love to see some work on that. | ||
ab5tract | yeah I keep meaning to write test cases and all sorts of crap for cardinal | ||
but i'm spread pretty thin | |||
ill fork cardinal though | |||
Tene | Even test cases would be great. | 01:11 | |
ab5tract | yeah like I said I've been meaning to do them I'm just working on like a million projects at once right now | 01:12 | |
anyway, you mentioned on your blog for suggestions on how to make it more ruby-like | |||
ask and you shall receive ;) | |||
Tene | Thank you. | 01:14 | |
If you could post tha tin a comment there, I'd be more likely to remember it. btw. :) | |||
ab5tract | Tene, does cardinal assume I have parrot in my path? | ||
sure thing | |||
Tene | You can use an argument to Config.pl, I think... | 01:15 | |
If not, that's probably a bug | |||
ah | 01:16 | ||
--parrot-config=~/src/parrot/parrot_config | |||
01:17
DemoFreak left
|
|||
ab5tract | cool thx | 01:20 | |
01:21
M_o_C left
01:24
ruoso joined
|
|||
ab5tract | new comment in mod queue :) | 01:24 | |
Tene | ab5tract: the part about automatically importing subs not defined in a namespace is unlikely to be supported without some significant changes in Parrot, that won't happen for quite a while. | 01:26 | |
In Parrot, there isn't actually a way to say "What are the objects in this bytecode file?". All you can do is load the bytecode, and then look for symbols in a specific namespace. | 01:27 | ||
ab5tract | okay that is fune | 01:28 | |
*fine | |||
it was more there as an example | 01:29 | ||
indeed it is rarely done that way | |||
awesome that cardinal has an interpreter shell! | 01:30 | ||
01:32
shinobi-cl joined
01:34
bacek joined
|
|||
Tene | :) | 01:45 | |
01:45
IRSeekBot joined,
Chillance left
02:01
ab5tract_ joined
02:11
alester joined
02:20
shinobi-cl left,
nsh left
02:24
bacek_ joined
02:25
alester left
02:36
ruoso left
02:38
bacek left
02:46
VX64Z left
02:52
ruoso joined
|
|||
literal | rakudo: say <a #channel> | 02:59 | |
p6eval | rakudo 23718a: OUTPUT«a#channel» | ||
literal | rakudo: say «a #channel» | 03:00 | |
p6eval | rakudo 23718a: OUTPUT«a#channel» | ||
bacek_ | rakudo: say 1.i | 03:06 | |
p6eval | rakudo 23718a: OUTPUT«Method 'i' not found for invocant of class 'Int'» | ||
bacek_ | rakudo: say eval("1.i") | 03:07 | |
p6eval | rakudo 23718a: OUTPUT«» | ||
bacek_ | perl6: say 1.i | ||
p6eval | rakudo 23718a: OUTPUT«Method 'i' not found for invocant of class 'Int'» | ||
..pugs: OUTPUT«*** No such method in class Int: "&i" at /tmp/SKXgysFtjS line 1, column 5 - line 2, column 1» | |||
..elf 26923: OUTPUT«Can't call method "i" without a package or object reference at (eval 123) line 3. at ./elf_h line 5881» | |||
bacek_ | seen moritz_ | 03:08 | |
!seen moritz_ | |||
say moritz_ Looks like is_approx(eval("sqrt($i.i)"), 1i, 'got the square root of -1.i') in S32/sqrt.t is incorrect | 03:09 | ||
msg moritz_ Looks like is_approx(eval("sqrt($i.i)"), 1i, 'got the square root of -1.i') in S32/sqrt.t is incorrect | |||
EWRONGDIALECT | 03:10 | ||
!say moritz_ Looks like is_approx(eval("sqrt($i.i)"), 1i, 'got the square root of -1.i') in S32/sqrt.t is incorrect | |||
perl6: say log10(-1i) | 03:13 | ||
p6eval | elf 26923: OUTPUT«Undefined subroutine &GLOBAL::log10 called at (eval 124) line 3. at ./elf_h line 5881» | ||
..pugs: OUTPUT«0 + -0.6821881769209206i» | |||
..rakudo 23718a: OUTPUT«0» | |||
bacek_ | perl6: say log10(-1i).WHAT | ||
p6eval | rakudo 23718a: OUTPUT«Num()» | ||
..elf 26923: OUTPUT«Undefined subroutine &GLOBAL::log10 called at (eval 125) line 3. at ./elf_h line 5881» | |||
..pugs: OUTPUT«Complex» | |||
03:15
bacek_ is now known as bacek
|
|||
pugs_svn | r26924 | bacek++ | [t/spec] Mark all complex log10 as todo for rakudo. Including wrongly passing tests. | 03:15 | |
03:24
cspencer joined
03:39
meppuru joined
03:48
cspencer left
03:54
meppl left
|
|||
ab5tract_ | which editors have syntax highlighting for parrot and or perl 6 and where can I find them? | 03:55 | |
eternaleye | bacek: If you're looking for the messagebot, labdabot-- has @tell as his syntax, but is deprecated, and phenny++ has 'phenny: tell ..." as her syntax | ||
*lambdabot | 03:56 | ||
bacek | eternaleye: thanks | ||
eternaleye | np | ||
ab5tract_ | by 'them' I mean the syntax highlighting configs | ||
bacek | ab5tract_: both editors highlighting | 03:57 | |
has highlighting | |||
eternaleye | ab5tract_: At very least Emacs and VIM have syntax hilighting, running a find command to locate the respective scripts (ISTR them being in the pugs repo) | 03:59 | |
04:00
VX64Z joined
|
|||
eternaleye | util/perl6.vim , misc/Syntax-Highlight-Perl6/lib/rsc/perl6.vim , and util/cperl-mode.el | 04:00 | |
meppuru | good night | 04:05 | |
04:06
meppuru left
|
|||
ab5tract_ | eternaleye, why thank you very much | 04:07 | |
strange, rakudo comes with no such thing | 04:12 | ||
eternaleye | ab5tract_: svn.pugscode.org/pugs | 04:15 | |
(also the svn co url) | |||
ab5tract_ | just saying, thats a bit strange that it doesnt come with rakudo | 04:16 | |
eternaleye | Oh, I thought you were looking in the rakudo tree and couldn't find what I listed | 04:17 | |
:/ | |||
ab5tract_ is stupid but not quite that :) | 04:18 | ||
04:21
xinming_ joined
|
|||
eternaleye is | 04:24 | ||
eternaleye did that | 04:25 | ||
pugs_svn | r26925 | jdlugosz++ | add C<> tags, fix typos, fix out-of-date \$args to |$args, use Callable (not Code or others) for the role, change .wrap to return a cookie object to unwrap, remove the only use of := that wasn't in a declaration (hoping for single-assign semantics) and show regular assignment | 04:26 | |
..for Routine to replace its "do" property without changing the Routine object's identity. | |||
04:38
xinming left
|
|||
pugs_svn | r26926 | jdlugosz++ | Refer to actual concrete class C<Routine> where applicable, replace Code with actual class or role names. Add mention of non-instantiatable roles were classes were listed instead of "etc." | 04:48 | |
04:51
VX64Z left
|
|||
TimToady | bacek: it's 1\i now, and .i is a normal method. This applies to any postfix operators that start alphabetic | 04:53 | |
it's not necessary on 1i, of course, but on $x\i it is. | |||
rakudo: say 1\i | 04:54 | ||
p6eval | rakudo 23718a: OUTPUT«Statement not terminated properly at line 1, near "\\i"in Main (src/gen_setting.pm:0)» | ||
TimToady | looks like rakudo doesn't do that yet | ||
std: say 1\i | |||
p6eval | std 26926: OUTPUT«ok 00:02 35m» | ||
04:55
kst left,
kst joined
04:57
bacek_ joined
|
|||
TimToady | bacek_: see ^^ | 04:58 | |
bacek_ | TimToady: I missed previous line. And ilbot is absent... | 05:00 | |
TimToady | it's 1\i now, and .i is a normal method. This applies to any postfix operators that start alphabetic | 05:01 | |
it's not necessary on 1i, of course, but on $x\i it is. | |||
rakudo doesn't know it yet though | |||
but | |||
std: say 1\i | 05:02 | ||
p6eval | std 26926: OUTPUT«ok 00:02 35m» | ||
bacek_ | rakudo: say 1\i | ||
p6eval | rakudo 23718a: OUTPUT«Statement not terminated properly at line 1, near "\\i"in Main (src/gen_setting.pm:0)» | ||
bacek_ | ok. Test is definitely wrong. | ||
05:05
skids left
|
|||
pugs_svn | r26927 | bacek++ | [t/spec] Remove wrong sqrt(-1.i) test. TimToady++ for clarification. | 05:05 | |
05:11
FurnaceBoy left
05:13
bacek left
05:18
hcchien_ joined,
clkao left,
hcchien left
05:21
clkao joined
05:41
ejs joined
05:51
ab5tract_ left
05:56
ejs left
05:58
sbp left
06:01
finanalyst joined
|
|||
finanalyst | rakudo: say foo(1,2,3);sub foo($a,$b is copy,$c?){$b=4;return $a+$b+$c} | 06:03 | |
p6eval | rakudo 23718a: OUTPUT«8» | ||
finanalyst | rakudo: say foo(1,2,3);sub foo($a,$b is copy, $c=3){$b=4;return $a+$b+$c} | ||
p6eval | rakudo 23718a: OUTPUT«8» | ||
finanalyst | rakudo: say foo(1,2,3);sub foo($a,$b,$c=3 is copy){$c=4;return $a+$b+$c} | 06:04 | |
p6eval | rakudo 23718a: OUTPUT«Unable to parse multisig; couldn't find final ')' at line 1, near "is copy){$"in Main (src/gen_setting.pm:0)» | ||
finanalyst | rakudo: say foo(1,2,3);sub foo($a,$b,$c=3 is copy ){$c=4;return $a+$b+$c} | 06:05 | |
p6eval | rakudo 23718a: OUTPUT«Unable to parse multisig; couldn't find final ')' at line 1, near "is copy ){"in Main (src/gen_setting.pm:0)» | ||
TimToady | default has to follow traits | ||
finanalyst | rakudo: say foo(1,2,3);sub foo($a,$b,$c is copy =3){$c=4;return $a+$b+$c} | 06:06 | |
p6eval | rakudo 23718a: OUTPUT«7» | ||
finanalyst | ah | ||
06:08
sbp joined
|
|||
sjohnson | rakudo: say dazzle(); | 06:08 | |
p6eval | rakudo 23718a: OUTPUT«Could not find non-existent sub dazzle» | ||
06:09
ejs joined
|
|||
finanalyst | i just checked S06 again and did not find traits before defaults to be specified | 06:09 | |
TimToady: may I suggest a clarification to S06 specifying traits before defaults? | 06:13 | ||
TimToady | it's clarified in STD :) | 06:16 | |
06:19
ejs left
|
|||
finanalyst | TimToady: is STD part of the description of perl6? | 06:20 | |
TimToady | effectively | ||
finanalyst | how do i read it? | ||
i mean, where is the latest version? | 06:21 | ||
TimToady | src/perl6/STD.pm | ||
06:21
ejs joined
|
|||
finanalyst | will STD be one of the defining documents for perl6, or is it a temporary condition - that the working copy is a part of the spec? | 06:22 | |
TimToady | the problem with putting traits after the default is it looks like the trait applies to the default value | ||
it is defining | 06:23 | ||
finanalyst | is this a departure from the idea that perl6 should be defined independently from the implementation? | 06:25 | |
sjohnson | rakudo: print do 1 + 3; | 06:26 | |
p6eval | rakudo 23718a: OUTPUT«4» | ||
TimToady | sure, but it's a departure that's several years old | ||
finanalyst | my perception was that as you found inconsistencies/better ways of doing things, you updated the specs | 06:27 | |
TimToady | STD is one of the specs | 06:28 | |
sjohnson | rakudo: my $x = 100; my $y = 0; my $ret; do { $y++; $x++; $ret .= "$x, "; } while ($y < 3); print $ret; | ||
p6eval | rakudo 23718a: OUTPUT«.= must have a call on the right hand side at line 1, near " .= \"$x, \""in Main (src/gen_setting.pm:2553)» | ||
finanalyst | TimToady: STD is not yet cited on any of the sites as being a part of the specs, or official documentation | 06:29 | |
TimToady | tough nuggies :) | ||
std: my $x = 100; my $y = 0; my $ret; do { $y++; $x++; $ret .= "$x, "; } while ($y < 3); print $ret; | |||
p6eval | std 26927: OUTPUT«Potential difficulties: Possible obsolete use of .= as append operator; in Perl 6 please use ~= instead at /tmp/cfEqJLbxwC line 1:------> $ret; do { $y++; $x++; $ret .= "$x, "; } while ($y < 3); print $ret;ok 00:04 37m» | ||
sjohnson | did i find a bug? | 06:31 | |
is is there a proper way to append strings other than .= | 06:32 | ||
in p6 | |||
TimToady | use ~=, since ~ is concat | ||
also, there's no do {} while | 06:33 | ||
std: my $x = 100; my $y = 0; my $ret; do { $y++; $x++; $ret ~= "$x, "; } while ($y < 3); print $ret; | |||
p6eval | std 26927: OUTPUT«ok 00:04 37m» | ||
TimToady | std: my $x = 100; my $y = 0; my $ret; repeat { $y++; $x++; $ret ~= "$x, "; } while ($y < 3); print $ret; | ||
p6eval | std 26927: OUTPUT«ok 00:04 37m» | ||
TimToady | rakudo: my $x = 100; my $y = 0; my $ret; do { $y++; $x++; $ret ~= "$x, "; } while ($y < 3); print $ret; | 06:34 | |
p6eval | rakudo 23718a: OUTPUT«101, 102, 103, » | ||
sjohnson | std: my $x = 100; my $y = 0; my $ret; repeat { $y++; $x++; $ret ~= "$x, "; } while ($y < 3); print "$ret\n"; | ||
p6eval | std 26927: OUTPUT«ok 00:04 37m» | ||
sjohnson | wow | ||
oops | |||
i broketed it | |||
TimToady | the do form is supposed to be prohibited | 06:35 | |
sjohnson | std: my $x = 100; my $y = 0; my $ret; do { $y++; $x++; $ret ~= "$x, "; } while ($y < 3); print "$ret\n"; | 06:38 | |
p6eval | std 26927: OUTPUT«ok 00:04 37m» | ||
sjohnson | neither one seem to work with std | 06:39 | |
TimToady | std doesn't do anything except parse | ||
biab & | |||
sjohnson | doing this line exactly in perl 5 buggers up my prompt | ||
my $x = 100; my $y = 0; my $ret; do { $y++; $x++; $ret .= "$x, "; } while ($y < 3); print "$ret" | 06:40 | ||
if i dont put the "\n" after $ret, it buggers up my prompt | |||
i wonder why | |||
sjohnson is going to try on another shell | |||
ahh works there | |||
probably something to do with my fancy-shamncy bash color prompt | 06:41 | ||
perl! | 06:48 | ||
06:55
sri_kraih joined
07:00
hcchien_ left,
clkao left
07:04
cognominal left
07:21
nbrown_ left
07:26
stepnem left
07:28
iblechbot joined
07:30
nemstep joined,
stepnem joined
07:32
stepnem left
07:36
nemstep left
07:38
stepnem joined
07:56
mikehh left
08:07
mikehh joined
08:16
sbp left
08:17
sbp joined,
bacek_ left
|
|||
sbp | #talis | 08:17 | |
er, sorry | |||
"/join " in one tab, focus stolen, channel name in another... :-) | |||
08:19
ssm joined
08:28
abra joined
08:34
ejs left
|
|||
sjohnson | worry not, friend | 08:36 | |
08:42
bacek joined
08:46
cognominal joined
09:03
abra left
09:12
nacho_ left
09:14
DemoFreak joined
09:35
clkao joined
09:40
bacek left
09:43
bacek joined
09:48
pmurias joined
09:49
nacho_ joined
09:53
nacho__ joined
09:54
nacho__ left,
nacho_ left
10:12
ZuLuuuuuu joined
|
|||
pmurias | ruoso: hi | 10:14 | |
finanalyst | i am running a rakudo program with an iterative loop. it generates a 'segmentation fault' at the same point in the loop for a variety of adjustments to the algorithm. anything i can do to isolate the problem? | 10:23 | |
Tene | finanalyst: try to reduce the program to as simple a program as possible that still segfaults. | 10:25 | |
Gothmog_ | or run it with valgrind :) | 10:26 | |
finanalyst | what is valgrind? | 10:27 | |
ok just googled valgrind. anything special to apply to rakudo? | 10:28 | ||
10:28
M_o_C joined
|
|||
Gothmog_ | i dunno. should be compiled with debug symbols, though. :) | 10:29 | |
finanalyst | are debug symbols included by default with bleeding edge rakudo? | 10:36 | |
10:43
skids joined
10:50
Chillance joined
10:54
abra joined
10:55
bacek_ joined
|
|||
skids | When not eagerized, 1..3 is a Range and 1..3.Iterator is a RangeIterator (if the spec is current). Anyone want to hazard a guess as to what the corresponding roles for <a b c> xx 10 are? | 11:02 | |
Or offer suggestions about how to prevent an explosion of such classes, e.g. a generic generator role with opaque state and assignable .get method? | 11:05 | ||
So that everything that gens a list is List does Generator but nothing more specific? | 11:07 | ||
11:09
bacek left
11:11
bacek_ left
11:13
wknight8111 joined
11:14
iblechbot left
11:15
meppl joined,
ejs joined
11:22
REPLeffect left
11:23
jferrero left,
finanalyst left
11:24
kst left,
kst joined
11:32
pmurias left
11:43
lichtkind joined
12:21
payload left
12:23
kane_ left
12:29
M_o_C left
12:39
icwiener joined
12:43
kane_ joined
12:44
_Chillance_ joined
12:53
Chillance left
13:03
M_o_C joined
13:19
pmurias joined
13:22
fridim_ joined
13:25
ElectricHeavyLan joined
13:29
Kisu joined
13:32
araujo left
13:46
Chillance joined
13:50
kst left
13:51
kst joined
13:52
araujo joined
13:54
_Chillance_ left,
M_o_C left
13:58
ElectricHeavyLan left
14:25
M_o_C joined
14:37
nsh joined
14:47
ilogger2_ joined
14:51
payload joined
14:55
LylePerl joined
15:10
Psyche^ joined
15:15
FurnaceBoy joined
15:20
Psyche^ joined
15:23
hcchien joined
15:25
Psyche^_ joined
15:37
jferrero joined,
iblechbot joined
15:38
araujo joined
15:46
DJ-DONGDOT joined
15:53
kst joined
16:22
mikehh_ joined
16:43
nbrown joined
16:46
Psyche^ joined
17:03
kst joined
17:05
cspencer joined
|
|||
cspencer | I've just built the latest build of rakudo, and the spectest is failing for me though it's not giving me a list of failed tests | 17:05 | |
does anyone know why that might be? | 17:06 | ||
it looks something like this: pastie.org/488224 | 17:07 | ||
jnthn | cspencer: Heh, looks at first glance like it counts a passing todo test as a fail?! | 17:18 | |
cspencer | jnthn: i'm not sure...it was doing this on an earlier build last week and i don't recall the TODO being there at that time | 17:19 | |
jnthn | Wstat: 0 Tests: 29 Failed: 0 | 17:20 | |
cspencer | hmmm | ||
jnthn | oh, wait, that's just for the one file, not overall | ||
Hm. Odd. | |||
cspencer | this is on os x, i'll do a check out on linux and see if i get the same result | 17:21 | |
17:26
mberends joined
|
|||
jnthn | Can't believe we fail at failing... | 17:27 | |
jnthn -> dinner | 17:30 | ||
mberends | literal: ping | 17:35 | |
17:48
amoc joined
18:01
Lorn joined
18:07
ilbot2 joined
18:20
masak joined
|
|||
literal | pong | 18:20 | |
masak | saluton, #perl6. | ||
sjohnson: oh, you're still here? in that case, welcome. :) | 18:23 | ||
18:27
nihiliad joined
18:29
jferrero joined
|
|||
mberends | literal: fwiw, just letting you know that I've decided to do a port of Pod::Parser to perl5 and v6.pm. I have no idea how it will come out, but scalability of parrot/rakudo has been bothering me and makes development and testing awkward. The port is actually research work for my talk in Lisbon. | 18:30 | |
masak: salutons 2 u 2. | 18:31 | ||
masak | mberends: \o/ | ||
mberends: a port? cool! | |||
mberends | this v6.pm has been around a while and it needed to be tried out | 18:32 | |
masak googles 'cpan v6' | |||
mberends | the docs are very scant so it seems best to dive in and try it | 18:33 | |
masak | Pugs, eh? | ||
mberends | it has contributions from Pugs but appears to run completely in Perl 5 | ||
masak | o_O | 18:34 | |
mberends: that sounds too good to be true... | 18:35 | ||
mberends | it's just a subset of P6, too good to be true indeed | ||
masak | sure, sure. but which subset? :) | 18:36 | |
literal | mberends: ok | 18:40 | |
I've been using Damian's Perl6::Perldoc so far | |||
mberends | literal: how has that worked for you? | 18:41 | |
masak | literal: g'day. tried to finish my pre-23rd work with u4x before leaving for the weekend, but I didn't get that far. I hope to look at it tomorrow. in the meantime, I'd be very happy to talk about the design of the grok tool. | 18:42 | |
literal | it's fast and understands everything except formatting codes with «» (though I think that's a bug) | ||
18:42
JDlugosz joined
|
|||
literal | masak: ok | 18:42 | |
masak | literal: by the way, did you read moritz_++'s idea about meeting weekly in #perl6-gsoc? | ||
JDlugosz | howdy folks | ||
literal | masak: no, I must have missed that | 18:43 | |
masak | JDlugosz: saluton! | ||
literal: was a while ago. | |||
mberends | JDlugosz, hi | ||
literal | on FreeNode? | ||
masak | literal: they did that last year. sounds like a good idea to me. | ||
literal | yeah | ||
masak | literal: yes, but that channel might not exist any more. | ||
literal | it does now... | 18:44 | |
masak | ah irclog.perlgeek.de/ says #perl6-soc. | ||
literal | ah, ok | ||
JDlugosz | Hey masak, did you see my post to the mailing list? | 18:45 | |
masak | JDlugosz: I saw the link, but I was away and didn't have time to read it. | ||
masak reads it now | |||
18:46
nsh joined
|
|||
JDlugosz | The one that begins "my brain made a wrong turn some time on Tuesday." | 18:47 | |
masak | yes, I read that one. | ||
nice post. | |||
(I thought you meant the "Parameter Passing Examples" article linked from the first post in that thread.) | 18:48 | ||
JDlugosz | So, can you offer any discussion to the questions I called out with arrows? | ||
The Parameter Passing is wrong, it seems. But I'm glad to hear it will be good once it's straightened out! | 18:49 | ||
masak | hm, I'm not one of the philosophers over here, I'm the guy who tries to beat Rakudo into submission... :) | ||
JDlugosz | It's fuel to keep plugging away. | ||
The code-pounders often have real answers when the pholosophers (other than myself) don't see the issues. | 18:50 | ||
18:50
moritz joined
|
|||
JDlugosz | To wit, "how does that happen"? | 18:50 | |
masak reads the first question in the email carefully | 18:51 | ||
to be perfectly frank, the two levels of containers in Perl 6 always confused me a little. | 18:52 | ||
JDlugosz | Or the second, which is short. | ||
It certainly has been confusing in the specs, so no doubt. | 18:53 | ||
I'm wondering if there is some level of DWIM implemented (not in the spec), or whether I'm missing something conceptually. | 18:55 | ||
masak | JDlugosz: right now I'm backtracking from your first question, seeing how much of the previous part of the email I have to read to get the context. | ||
maybe I'll start by rambling about what I think happens with 'my $x = 1, 2, 3;'... | |||
JDlugosz | Don't worry about what I said before on that thread. I set up "from the top" in that post. | ||
rambling: OK. | 18:56 | ||
masak | that's a scalar on the left and a list of stuff on the right. | ||
JDlugosz | I'm all ears. | ||
masak | the list gets turned into an array and stored into the scalar variable. | ||
I'm guessing you have no problem with that part. | 18:57 | ||
JDlugosz | A little out of date... the list is now a Capture, and it doesn't get turned into anything else. That is, in item context it returns itself. | ||
masak | in that case, you know more than I do. | 18:58 | |
rakudo: my $x = 1, 2, 3; say $x.WHAT | |||
p6eval | rakudo 23718a: OUTPUT«Array()» | ||
masak | that's my reality at present. :) | ||
I don't know about those fancy "Capture" thingies. | |||
JDlugosz | Ah, in this case, say $x.WHAT, the method-on-scalar forwarding kicks in, and the WHAT applies to the contained object. So it will indeed say it is a list (Array, List, Capture, depending on vintage of implementation). | 18:59 | |
So we agree there: $x is bound to a scalar, which holds the list object, which contains 3 Ints. | 19:00 | ||
masak | JDlugosz: Array and List doesn't have to do with the age of the impl. they're just two different classes implementing Positional. | ||
rakudo: say Array ~~ List, List ~~ Array | 19:01 | ||
p6eval | rakudo 23718a: OUTPUT«10» | ||
masak | Arrays are a kind of List, but they're also mutable, which Lists aren't. | 19:02 | |
JDlugosz | vintage: which type does the parenthetical comma-separated list create? | ||
masak | the List. :) | ||
but I hear you, it's the Capture nowadays. | |||
JDlugosz | but racudo shows Array. | ||
masak | yes, because... hm, you really force me to think about the deep issues, don't you? :) | 19:03 | |
JDlugosz | Yes, the immutable "literal" sequence is now Captures throughout the synopses. | ||
jnthn | je to masak! :-) | ||
masak: How was your weekend? | |||
masak | jnthn: wonderful, thank you. | ||
JDlugosz | Whatever. It doesn't matter to the question at hand. $x is bound to scalar, which contains something suitable for @. | 19:04 | |
jnthn | :-) | ||
masak | jnthn: my brain is now running on pure Esperanto for a few days. | ||
JDlugosz | When you say my @y := $x; that should be an error because $x is not BOUND to something that does Positional. | ||
But should sub foo (&y) {...} foo($x); be expected to work via DWIM? | 19:05 | ||
19:05
ejs joined
|
|||
masak | JDlugosz: as long as $x does Callable, sure. | 19:05 | |
JDlugosz | Sure, says I, when $x isn't bindable to &y, it goes with what $x contains, automatically. | ||
Callable? | |||
jnthn | JDlugosz: I expect binding will dwim too, just needs a runtime check. | ||
JDlugosz | foo does Callable. | ||
masak | JDlugosz: Callable is the & role. | ||
just as Positional is the @ role. | 19:06 | ||
jnthn | Callable is the role done by things that you can invoke. | ||
JDlugosz | Sorry, I meant @y. | ||
jnthn | Remember than a $foo can contain anything. | ||
JDlugosz | Same difference. | ||
masak | JDlugosz: ah. | ||
JDlugosz: is your question whether the Positional role has to sit on the variable or on its contents? | |||
JDlugosz | "contains" == value or implementation type? | ||
masak: Yes. Seems that it must do both, to fit the intent. | 19:07 | ||
masak | JDlugosz: yes, I think so. | ||
but my brain is foggy. | |||
JDlugosz | Because you can certainly pass a real Array as the argument! | ||
masak | sure. | ||
JDlugosz | So, the argument bound to @y may be something that does Positional, or a scalar that contains such a thing. | 19:08 | |
masak | er. | ||
I don't think about it that way... :/ | |||
JDlugosz | my $x := @A; foo($x); # OK, bind directly to argument. | 19:09 | |
masak | when you do foo(@array), it passes the array in @array. when you do foo($array), and $array contains something that does Positional, it passes that. | ||
JDlugosz | my $x; $x=1,2,3; foo($x); # scalar doesn't do Positional. | ||
masak | JDlugosz: why doesn't it do Positional? | 19:10 | |
jnthn | rakudo: my $x; $x=1,2,3; sub foo(@a) { }; foo($x); | ||
p6eval | rakudo 23718a: ( no output ) | ||
jnthn | Good. | ||
JDlugosz: It does. | |||
masak thought so | |||
jnthn | JDlugosz: When you talk about $x you're really tending the mean "the value" | ||
If you want to talk about the container unambiguously, you would say $x.VAR | 19:11 | ||
JDlugosz | Ah, might be old ideas? Now, passing is done with a Capture, which doesn't know it needs to pull out the value. It keeps everyting intact, for later use. Think \( $x ). | ||
jnthn: yes, I take that as a general design principle. | |||
jnthn | JDlugosz: OK, so the upshot is that in the example above, it cares about whether the thing stored in the scalar does Positional. | 19:12 | |
masak | jnthn: btw, what's the latest word on the 'sub foo(Int @a) { ... }; my @a = 1..*; foo(@a)' issue? :) | 19:13 | |
JDlugosz | Yes. In that particular call with that particular binding of $x. | ||
jnthn | masak: Latest is you need to write my Int @a | ||
masak | jnthn: ah. sounds familiar. | 19:14 | |
jnthn: probably quite sane. if typing is done in one place, it could be done in both places. | |||
jnthn | masak: This was discussed at NPW, because I kinda wanted to know too since I was trying to get parametric roles wrapped up at the time. And that was the outcome. | ||
masak: The other thing that came out though was that you can do | |||
masak | jnthn: ok. I think I'm happy with that. | ||
JDlugosz | if $x is bound directly to an Array, then foo($x); still works, but differently. | ||
jnthn | sub foo(Num @x) { }; my Int @y; foo(@y) | ||
masak: Which it wasn't clear if you should be able to do before, but now it's clarified and in S14. :-) | 19:15 | ||
masak: I think it's a good enough balance of dwim vs implementation complexity. | |||
masak | aye. | 19:16 | |
JDlugosz | Guys, what about my next question? How does method calls on a scalar work? | ||
jnthn | JDlugosz: Again, the container is just transparent. | ||
If you want to call a method on the container, do $foo.VAR.meth | |||
JDlugosz | So the Scalar forwards all methods to its contents. | ||
jnthn | Yes. | 19:17 | |
19:17
icwiener_ joined
|
|||
JDlugosz | Look what I said about nesting them.... right? | 19:17 | |
jnthn | Pretty much. | ||
JDlugosz | So how does VAR actually work? | ||
jnthn | Well, it's a macro. | 19:18 | |
So the implementation can do whatever it feels like. | |||
JDlugosz | Like what, specifically? | ||
It can't just wrap the scalar in something else, because forwading is a property of the scalar at run-time. | 19:19 | ||
I'm supposing that it returns a proxy. | |||
jnthn | We do something along those lines in Rakudo, but the exact upshot is all a bit hazy at the moment. | ||
Yes, it's a kind of proxy. | |||
In Rakudo. | |||
There's probably more than one way to actually implement it. | |||
I'm not completely sure how it's all going to play out just yet. We're really cheating quite a lot of scalars in Rakudo. | 19:20 | ||
JDlugosz | In general terms, to allow implementation freedom... I suppose $x.VAR.foo could be a macro that takes care of foo as well, doing a idfferent kind of dispatch. | ||
jnthn | erm, *on scalars | ||
JDlugosz | Or, it known to be a proxy, then $y= VAR$x; should work. | 19:21 | |
jnthn | .VAR is a macro. | ||
It hands back something you can call a method on. | |||
It may just be soemthing that has a different HOw | |||
*HOW | |||
Thing is that some implementations may go down the road of really having a container and having that point to a value. | |||
JDlugosz | OK. That sounds good. But it doesn't have to be a macro to do that... it could be a method that's not forwarded. | 19:22 | |
jnthn | In Rakudo we're kinda lazy about scalar containers, in an effort to have less garbage collectable objects around. | ||
JDlugosz | How much of the expression does the macro suck up to rewrite? Just the VAR as if it were a function, or the trailing dot and stuff as well? | ||
jnthn | "I'll act like I've got a container when you ask me for it." | ||
Just the .VAR | 19:23 | ||
$foo.VAR.rw is I guess like ($foo.VAR).rw | |||
JDlugosz | So if it works that way, is there any reason why it needs to be a macro, rather than just a member that's not forwarded? | ||
jnthn | Because special cases in the dispatcher are a bad idea. | 19:24 | |
19:24
kst joined
|
|||
jnthn | Have you any reasons for it not to be a macro? | 19:24 | |
JDlugosz | I'm just thinking of more general cases, the universe of possible implementations that code might run on and expect to get the same behavior. | 19:25 | |
masak | JDlugosz: in case you're curious, I have no particular relation to the thing you refer to as 'method forwarding' above. | ||
JDlugosz | So what is defined behavior needs to be considered carefully. | ||
jnthn | Oh, also, you can use .VAR on non-scalars too and it works like the identity function, IIRS12C | ||
JDlugosz | masak: I don't understand. relation? | ||
masak | JDlugosz: I think of everything as working on the value inside the variable. | ||
jnthn | And that means every single dispatcher that gets written would have to know about .VAR. So, certainly a macro. :-) | 19:26 | |
masak | JDlugosz: since I consider everything as being forwarded (I guess), this term isn't something I tend to use when thinking about these things. | ||
JDlugosz: to prevent forwarding, I'd have to use VAR($x) or some such. | |||
jnthn | masak: That's probably because you're not meant to have to think about it most of the time. :-) | ||
JDlugosz | Look at the call to $x.foo(). If $x is bound to something other than a scalar, it operates directly on it. | ||
masak | jnthn: aye. that says something about the design of the language, that the seams aren't visible. :) | 19:27 | |
JDlugosz | Because $x can be bound to other containers, or anything really, such as a Dog. | ||
masak | JDlugosz: I'm trying to formulate a question that makes you explain to me why I need to think in terms of forwarding. hang on. :) | 19:28 | |
JDlugosz | So if the compiler doesn't know to expect the item container, it sends foo to whatever is in $x, as it's "just an object". | ||
masak | JDlugosz: and when isn't it "just an object"? | 19:29 | |
JDlugosz | The particular thing $x refers to then implements the Scalar behavior of reflecting that to the contained value instead. | ||
masak: I think I just did that. | |||
masak | ok. I'm not sure I follow, then. | ||
I always call methods on the things the variables contain. | |||
JDlugosz | masak: think about this case: sub bar ($x) { $x.foo() } | 19:30 | |
Now you can call it with bar(@A); | |||
and now in the body of bar, $x is not bound to a scalar, but directly to an Array. | 19:31 | ||
masak | the only difference to me between @a and $a (if $a is an Array), is that @a auto-flattens in some cases. | ||
JDlugosz: yes, dure. | |||
JDlugosz | The code inside the body can't assume the presence of a Scalar bound to $x. | ||
masak | JDlugosz: what's strange about that? | ||
feels completely non-odd to me. | 19:32 | ||
by the way, I don't know what to think about Scalar either. :) | |||
JDlugosz | The call to $x.foo can't assume the presence of a Scalar bound to $x. | ||
masak | 'Scalar' is not something I use in my daily coding. | ||
JDlugosz | The item container. | ||
masak | um. | 19:33 | |
I'm sorry I can't be more helpful in this instance. | |||
JDlugosz | re S02: my $spot is Scalar; # this is the default | ||
masak | yes, I recall you writing that. | ||
I have no idea what it means for Scalar to be the default, or for $x not being bound to a Scalar. | 19:34 | ||
JDlugosz | And we went over the case of my $x = 1,2,3; $x is bound to an item, which contains a list. | ||
masak | in Perl 5, Scalar meant num or str, but I have the feeling it doesn't here. | ||
JDlugosz | right. Scalar is shown as the default concrete class for an item container. | ||
jnthn | masak: Basically it boils down to, when you have an array you clearly have a container (the array) that holds values. In theory, for $foo, there is a container capable of holding one item. | ||
erm, one value | 19:35 | ||
masak | JDlugosz: I see we don't share the same model of things here. I'm sure your model is closer to the spec, so I will try to absorb it as much as I can. | ||
jnthn | masak: Thing is, we try and hide the existence of that container away msot of the time. | ||
masak | jnthn: yes. and with me, you succeeded very well. :P | ||
JDlugosz | I think I had your model -- item container always present, code knows to indirect off of it -- until last week when it was explained to me to be mistaken. | ||
jnthn | masak: Down to the pointer that Rakudo is currently optimized for not really bothering with the container in a lot of cases. | ||
masak | jnthn: I still haven't seen the seam where it all breaks apart. | 19:36 | |
jnthn | erm, the point | ||
masak: When you start applying traits to a scalar or you use .VAR. | |||
masak | JDlugosz: that's good to know. I'll brace for a paradigm shift, then. | ||
JDlugosz | Yes, I would expect the implementation to optimize away the item container when it can, inline the redirection elsewhere, etc. | ||
jnthn | JDlugosz: We do tend to wrap parameters that are passed to a routine in a container when we need to. | 19:37 | |
masak | jnthn: nope, still don't see it. I know about using .VAR, and I don't find that strange. but I also don't see how that applies to $x containing an Array. | ||
JDlugosz | masak: if that's not a shift, how does racudo handle $x being bound directly to an Array? | ||
masak | "rakudo". | ||
JDlugosz | containing != bound to. | ||
masak | JDlugosz: I don't see the problem. dollar variables can be bound to anything. | ||
JDlugosz | Yes, they can. So they are not always bound to item containers. | 19:38 | |
masak | no, why should they? :) | ||
dollar doesn't mean scalar any more. it means anything. | |||
JDlugosz | So how does $x.foo work? | ||
masak | only @, % and & shrink the types. | ||
jnthn | .oO( $ is the interface uncontract ) |
||
19:39
Chillance joined
|
|||
masak | JDlugosz: the method foo is called on the value of $x. | 19:39 | |
JDlugosz | You said that in rakudo the method call assumes the existance of the item container, using the value instead. | ||
The "value" == the item inside the item container. | |||
What if it doesn't have an item container? | |||
masak | 'assumes the existance of the item container'? | ||
jnthn | JDlugosz: The method call just calls the method. It doesn't care what's underneath. | ||
masak | JDlugosz: what's an item container? | 19:40 | |
JDlugosz: sorry, model fail again. :/ | |||
jnthn | JDlugosz: If there's some kind of scalar container thing there, that'll just "forward on the dispatch". | ||
JDlugosz | I thought we were on the same page re item containers. | ||
jnthn | JDlugosz: If you can read C-ish code, check out src/pmc/objectref.pmc and src/pmc/perl6scalar.pmc | ||
JDlugosz | or Scalar, by default. | ||
masak | JDlugosz: I have no idea what an item container would be. I don't use the term Scalar. I don't need 'method forwarding' to explain things in my model. | 19:41 | |
so far, you haven't shown why I'd need to. | |||
(or at least, I haven't noticed why.) | |||
that seam seems really well-hidden! :) | 19:42 | ||
JDlugosz | What does the thing returned from VAR operate on? E.g. the STORE and FETCH? | ||
jnthn | JDlugosz: Maybe cleanest is to say: if there is any kind of item container, it'll forward. Method invocation is always on the thingy you current have - which you maybe just obtained from the lexpad or namespace or whatever. | ||
19:42
brunov joined
|
|||
JDlugosz | What is the shared "lvalue" when you say my $x := $y; ? | 19:42 | |
masak | JDlugosz: ok, now we're getting somewhere. | 19:43 | |
I can relate to lvalues. | |||
jnthn | JDlugosz: I think that would pretty much boil down to taking whatever a lookup of $y gives and making future lookups of $x give back the same thingy. | ||
That is, from this point onwards a lookup of $x and a lookup of $y would give the same thing. | 19:44 | ||
Whatever that thing happens to be. | |||
Where the "what sort of thing is it" to me is very much a "we worry about it when we need to know" or maybe "if the optimizer can figure it out it can do so and maybe do something smart". | 19:45 | ||
JDlugosz | I think I see your point about rakudo though: the existance of the default item container is absorbed by the implementation. It might fail on some subtle case according to the spec, but for the most part you expect them to be optimized out. | ||
masak | if I do 'my ($a, $b, $c, $d) = 1, 2, 3, 4; $b := $a; $c := $b; $b := $d', will $c then be 1 or 4? | 19:46 | |
jnthn | JDlugosz: Oh, I know full well we'll have to patch up some of the rough edges in Rakudo on this. | ||
pugs_svn | r26928 | schwarzer++ | [Perl6/Spec] typos | ||
masak | JDlugosz: I've been learning Perl 6 mostly through Rakudo, so I've kinda fallen for the illusion that 'the default item container is absorbed', whatever that means. :) | 19:47 | |
brunov | masak++ # blogpost of that backlog | ||
jnthn is reading it and wishing he'd thought more :-) | 19:48 | ||
Don't think I said anything too stupid though. Phew. :-) | 19:49 | ||
masak++ # well spotted | 19:50 | ||
masak | :) | 19:51 | |
JDlugosz | Let me wrk it out in multiple lines... | ||
my ($a, $b, $c, $d) = 1, 2, 3, 4; | |||
For scalars holding Ints. | |||
$b := $a; | |||
I argue that binding ought to be single-assignment semantics... no examples of := in the synposes that aren't on the declaration. But if allowed, $b now binds to the same item container as $a. | |||
$c := $b; | |||
$c bound to same container as $a and $b. Let's call that S1, for a Scalar object with an "===" id of 1. | |||
$b := $d | |||
$b changed again, bound to same object as $d, which is still S4. | |||
So $c refers to S1, which contains a value of 1. | |||
masak | aye. | ||
that makes sense. | 19:52 | ||
JDlugosz++ # explanation | |||
JDlugosz | re patch up the rough edges: It sounds like taking on the Captures will be rough, since that will show the item containers more. At least in the less-than-obvious uses cases that you optimize over already. | ||
brunov: what blog? | 19:53 | ||
19:53
moritz_ joined
|
|||
brunov | JDlugosz, use.perl.org/~masak/journal/39025?from=rss | 19:53 | |
jnthn | JDlugosz: Rakudo has generally proved itself to be pretty bendable. :-) | ||
JDlugosz: I'm only onto the third re-write of method dispatch now. ;-) | 19:54 | ||
JDlugosz | blog or no, let me mention <www.nntp.perl.org/group/perl.perl6....5.html> for the record, for the benifit of backlogers. | ||
masak | jnthn: and it just keeps getting better. :) jnthn++ | ||
JDlugosz | jnthn: That is good. | ||
jnthn | JDlugosz: In what you wrote above, for === I think you maybe watned =:= for container equality? | ||
Oh, wait, no. | 19:55 | ||
:-) | |||
oh, hang on... | |||
JDlugosz | No, I was thinking of "object identity" of the containers. | ||
jnthn | :-) | ||
JDlugosz | Containers thought of as objects. | ||
You got it. <g> | |||
masak | jnthn: does 'container equality' mean 'the things have the same memory address'? | ||
JDlugosz | =:= is a shortcut for VAR's and ===. | 19:56 | |
masak | oh, ok. | ||
jnthn | Pretty much. | ||
masak | both explanations make sense to me. | ||
jnthn | masak: Yes and no. =:= should only be usable on container-ish things. | ||
1 =:= 1 currently is allowed in Rakudo but shouldn't be afaik. | |||
masak | jnthn: ah. well, yes. | 19:57 | |
JDlugosz | What happens if you try? | ||
jnthn | If it is allowed the results are going to be very unpredictable anyway. :-) | ||
masak | rakudo: say 1 =:= 1 | ||
p6eval | rakudo 23718a: OUTPUT«0» | ||
masak | :) | ||
JDlugosz | Good point re specification though. | ||
jnthn | I suspect that should be an error. | ||
JDlugosz | At least use them on variables, not literals. $x =:= $y means "bound to the same thiing?" even if they are Dogs, not containers. | 19:58 | |
jnthn | Aye. | ||
JDlugosz | Does VAR work on non-variables? | ||
jnthn | Just the identity function on non-scalars I think. | ||
JDlugosz | While === will "fall though" to the value in an item container. | ||
jnthn | *nod* | 19:59 | |
Yeah, I guess that means .WHICH is container-transparent for scalars. | |||
JDlugosz | So why not define $x =:= $b as being exactly the same meaning as VAR($x)===VAR($y) . | ||
As far as I can tell, =all= methods fall through to the value. | 20:00 | ||
jnthn | I highlighted it because IIRC .WHICH is meant to be a macro. | ||
JDlugosz | That is why, it was mentioned a fewminutes ago, that VAR is a macro, not a special method that doesn't fall though. | ||
jnthn | HOW and WHAT are anyways... | ||
JDlugosz | HOW is a macro? I thought HOW was a method on Object. | 20:01 | |
moritz_ | no, HOW and WHAT don't participate in normal method dispatch | ||
not even in single dispatch | |||
JDlugosz | S12 calls them metamethods. | ||
jnthn | No | ||
JDlugosz | Ah, "all actually macros" | ||
jnthn | These are all actually macros, not true operators or methods. | ||
*nod* | |||
JDlugosz | Just to get around any possible bootstrapping dispatch issues, I suppose. | 20:02 | |
jnthn | Yes. | ||
JDlugosz | Not that Moose has any. | ||
jnthn | Also so they're predictable | ||
And your own .WHAT method doesn't suddenly make things insane. :-) | |||
JDlugosz | But that gives me another reason to appreciate why some things are defined as being macros. Lets them be excluded when you say "all methods". I suppose it makes it immune from changing the dispatcher logic. | 20:03 | |
jnthn | Aye. I see that as a good thing. | ||
JDlugosz | Ah, and so $obj.$s won't call it, but will call any real method by that name. | ||
jnthn | you probably mean $obj."$s" | 20:04 | |
JDlugosz | sayith S12: And if you don't know the method name in advance, you'd be using the variable form anyway: | ||
$obj.$somemeth | |||
jnthn | Right, in that case $somemeth is meant to be a Callable. | 20:05 | |
Or an array of callable in which case you've got a candidate list that you can defer over. | |||
JDlugosz | Or a string. | ||
jnthn | no | ||
JDlugosz | $obj."foo"; $s="foo"; $obj.$s; | ||
jnthn | rakudo: my $x = "abs"; say 42."$x"; say 42.$x; | ||
p6eval | rakudo 23718a: OUTPUT«42get_pmc_keyed() not implemented in class 'Perl6Str'in Main (/tmp/AF0TiLIDi7:1)» | ||
jnthn | No, you need quotes around the variable if you are using it as a name. | 20:06 | |
$obj.$s expects $s to contain a method. | |||
JDlugosz | Sayith S12: $obj."$methodname"(1,2,3) # use contents of $methodname as method name | ||
jnthn | Right. | 20:07 | |
JDlugosz | OK, so you still put it in quotes. It interpolates. | ||
jnthn | Yes | ||
but $obj."$meth" means something very different from $obj.$meth | |||
brb, getting zmrzlina :-) | |||
JDlugosz | The quote tells it to use the string. Different syntax to prevent errors, not because feature is unavailable. | 20:08 | |
If the Callable stringifies to the method name, it would mean the same :) | |||
Save that for the "goofy tricks to mess with newbe's" column. | 20:09 | ||
masak | we've also been promised that closures .perlify to their source code whenever possible. :) | ||
JDlugosz | Hmm. can't reload the source without the proper closure context to pick up the variables closed over. So that is more for debugging then for marshalling. | 20:10 | |
Great for "what is that?" when figuring out why it doesn't work. | |||
jnthn | back...and mn'am! :-) | 20:11 | |
JDlugosz | Seeing for yourself { $field1=$_ } will help you understand why the button isn't exiting the form. | ||
jnthn | .oO( great, now I'm going to blow all my earnings on travel, beer AND this ice cream... ) |
||
JDlugosz: Callables won't always stringify to the method name though. :-) | 20:12 | ||
JDlugosz | No, I expect more qualified names at the very least. Just thinking that you could make one that did. | 20:13 | |
jnthn | You could. | ||
But, well, different syntax for different things. :-) | |||
20:13
kst joined
|
|||
jnthn | And the difference is even more stark in $obj."@foo" and $obj.@foo ;-) | 20:13 | |
masak | jnthn: ah, zmrzlina. I get it now. :) | 20:14 | |
it's мороженое in Russian. seems related. | 20:15 | ||
jnthn | masak: Yes, that's one of our consonant-deprived words. Best thing is that it's written all over the place, in tourist areas, maintaining the language's terrifying image. ;-) | ||
masak | jnthn: does 'zmrzlina' mean 'frozen'? | ||
jnthn: I'm not afraid of consonants. they tried to scare me in Slovenia, but it takes more than a čmrlj to freighten me. :) | 20:16 | ||
jnthn | ;-) | ||
JDlugosz | jnthn: where are you located? | ||
masak | s/ei/i/ | ||
jnthn | masak: It's very similar to the word for frozen | ||
masak | jnthn: ha! :) | ||
jnthn | mrazeny is IIRC the (masc nom) forzen | 20:17 | |
icwiener_ | There is a sentence in S16 that seems to contains some error but I do not know how to fix it: "The NameServices role has a bunch of functions that between them will return the whole·Name Services database between them, as lists of objects. The lists are specifically·intended to be lazy." | ||
jnthn | (adjective) | ||
JDlugosz: I'm currently living in Bratislava, Slovakia. | |||
patmat | one question, what can i use in perl 5.10 for "prompt" in perl6 :/ | 20:18 | |
masak | jnthn: maybe there is a verb zmraz too, which only differs from mraz in aspect? | ||
patmat | otherwise id ask in #perl i know there is <STDIN> | ||
jnthn | masak: Well, all Slovak verbs end in soft t | ||
mrznut is to freeze | |||
I forget the aspect though :-( | |||
masak | oh, ok. | 20:19 | |
jnthn looks it up | |||
moritz_ | there's IO::Prompt (but Unix only, or so I have been told) | ||
patmat | moirtz_ great hanks! | ||
jnthn | masak: oh, there's zmrznut too, which is almost certainly the other one | ||
patmat | so there is a prompt :) | ||
erm thanks hehe | |||
jnthn | masak: I'd expect from instinct that zmrznut must be the "once" | ||
masak | jnthn: looks that way, from what you just told me. :) | ||
jnthn | Which would fit with with zmrzlina. | 20:20 | |
masak | uh huh. | ||
periodically frozen ice cream is such a drag. | |||
patmat | moritz_ erm how do i use IO::Prompt correctly? | ||
20:20
LadyLunacy joined
|
|||
moritz_ | patmat: first you install it, then you follow the docs. | 20:21 | |
masak | patmat: './proto install io-prompt' | ||
moritz_ | masak: wrong major version ;-) | ||
erm, not wrong, but the other one | 20:22 | ||
patmat | i can install it via cpan? | ||
masak | no. wrong. :P | ||
patmat | ahh i'm such a newbie!! | ||
moritz_ | patmat: yes | ||
or if you happen to run Debian, you can do 'aptitude install libio-prompt-perl' | 20:23 | ||
icwiener_ | patmat: If you use Linux, then your distro might have packages. | ||
patmat | Ubuntu here :) | ||
icwiener_ | Likely the same an Debian then. :) | 20:24 | |
patmat | hehe ye | ||
moritz_ | well, the ubuntu packages might have a brown colour instead ;-) | ||
icwiener_ | hehe | ||
20:25
lambdabot joined
|
|||
masak | rakudo: say Nil ~~ List | 20:25 | |
p6eval | rakudo 23718a: OUTPUT«0» | 20:26 | |
masak | rakudo: say Nil ~~ Positional | ||
p6eval | rakudo 23718a: OUTPUT«1» | ||
20:30
tulcod joined
20:31
lucs joined
20:33
jferrero joined
|
|||
jnthn afk for a bit | 20:34 | ||
patmat | hrmm how do i use the IO::Prompt ? | 20:35 | |
module | |||
masak | as described on its CPAN page? | ||
patmat | ahh sorry here it is | 20:36 | |
masak | there's usually a SYNOPSIS part that gives a useage example. | ||
followed by more exact descriptions about different subs and methods. | 20:37 | ||
patmat: is there something Perl6-related I can help you with today? :) | |||
patmat | masak hehe no thanks didnt have much time to do someething :(( | 20:38 | |
masak | no wonder, if you keep getting distracted by Perl 5... :P | 20:39 | |
patmat | hehe | ||
Cannot write to terminal: No such device or address at /home/patmat/code/mauslaus002.pl line 9 | 20:40 | ||
hrm no | 20:41 | ||
20:43
ZuLuuuuuu joined
20:46
icwiener joined
|
|||
masak | rakudo: sub infix:<.>($a, $b) { say "OH HAI" }; say "OH" . "NOES" | 20:50 | |
p6eval | rakudo 23718a: OUTPUT«OH HAI1» | ||
masak | rakudo: sub infix:<.>($a, $b) { "OH HAI" }; say "OH"."NOES" | 20:51 | |
p6eval | rakudo 23718a: OUTPUT«Method 'NOES' not found for invocant of class 'Str'» | ||
masak | how magical is the method-call dot? does it count as an ordinary infix op? I know it has some unspace requirements going on, so it would seem it isn't... | 20:52 | |
jnthn | (away really, drive by comment) I really don't see it as being an ordinary infix op. | 20:53 | |
masak | no, you're probably right. | 20:54 | |
that means that the above is in order. | |||
JDlugosz | Anybody know about enum types? | ||
jnthn | We don't parse it like any old infix, it's got a syntactic category of its own (dotty) | ||
20:54
payload joined
|
|||
masak | JDlugosz: don't ask to ask. :) | 20:55 | |
jnthn | JDlugosz: I did Rakudo's implemention, but I forgot about it as quickly as possible again afterwards... ;-) | ||
masak | JDlugosz: also known as "I might not know, but I'm curious enough to listen to your question" :) | 20:56 | |
jnthn | I find that bit of S12 pretty hazy and found it hard to hold together all the demands. But at least the current implemention checks more boxes than the first one. | ||
masak | (checking boxes)++ | ||
JDlugosz | S09 shows lower-case enum to define them, but S03 uses Enum as a type name. | ||
20:57
kate21de joined
|
|||
jnthn | I'd mostly just gone on S12. | 20:57 | |
masak | rakudo: enum A <a b c>; say A.WHAT | ||
p6eval | rakudo 23718a: OUTPUT«A()» | ||
masak | rakudo: enum A <a b c>; say A ~~ Enum | ||
jnthn | std: my Enum $x; | ||
p6eval | rakudo 23718a: OUTPUT«Could not find non-existent sub Enum» | ||
std 26928: OUTPUT«##### PARSE FAILED #####Malformed my at /tmp/RfXn15xCyM line 1:------> my Enum $x;FAILED 00:02 35m» | |||
jnthn | JDlugosz: Think S03's Enum type name is legacy. | ||
masak | nod. | 20:58 | |
jnthn | (It doesn't fit with my model of enums from S12.) | ||
JDlugosz | I think S03, on smart match, is referring to "some type name that is the name of an enumeration", just like matching class and role. | ||
jnthn | Ah, OK. | ||
In that case it may be OK. | |||
masak | JDlugosz: but it's listed in the column "Actual type"... | 20:59 | |
JDlugosz: and all the others are actual types. | |||
JDlugosz | Yes. | ||
masak | which seems strange. | ||
JDlugosz | That whole line is strange. Class Enum Role are not the actual types, but categories of actual types. | ||
masak | at the very least, it should be clearly marked that the name is metasyntactic. | 21:00 | |
JDlugosz | Just a meta-thing in the text. | ||
masak | JDlugosz: aye, you're right. | ||
jnthn | std: my Role $x; | ||
p6eval | std 26928: OUTPUT«ok 00:02 36m» | ||
jnthn | Role is a real type name. | ||
Class is maybe not but maybe is and if it is it probably means "something that is a meta-class" but we may end up s/Class/MetaClass/ or something. | 21:01 | ||
I'm not sure exactly where that'll end up | |||
We just need SomeLabel that we can multi-dispatch on with a metaclass for setting class traits. | |||
masak | JDlugosz: S02 also mentions the 'Class' class, but makes it clear that it refers to an Abstraction-like thing, i.e. part of the namespace class hierarchy. | ||
jnthn afk again | 21:02 | ||
masak | hm, that wasn't a very clear explanation on my part. | ||
I interpret 'Class' as per S02 as something akin to 'Module' and 'Package'. | |||
JDlugosz | "any type declared using class, enum, or role" | ||
masak | rakudo: role A {}; say A ~~ Role | 21:03 | |
p6eval | rakudo 23718a: OUTPUT«0» | ||
JDlugosz | Or perhaps it should now refer to "type objects". | ||
masak submits rakudobug | |||
JDlugosz | But a type object has the type of that type, not any kind of metaclass type. | ||
Since that is only used in the table for the "type membership" .does(X) test, it's clear that it is meant to be any prototype object, or a named value that is a type. | 21:05 | ||
The Class Enum Role probably means "named values declared as classes, etc." | 21:06 | ||
masak | it might, but it shouldn't say it like that. | ||
JDlugosz | I plan on editing S03 soon anyway. | 21:07 | |
Since it's already in $_, it can't be a literal named value. So any prototype object, now called "type object", is what it should say. | 21:08 | ||
Sorry, that's the X column. It is a literal, not in $_. | |||
So any named value that is a type. | |||
21:09
rewt joined
|
|||
masak | aye. | 21:09 | |
JDlugosz | A voice crys from the other room, "John.... are we going out?" | 21:10 | |
masak | of course we are. :) | ||
it's Sunday evening. we always go out on Sundays. | 21:11 | ||
JDlugosz | She means to fix the fence, not to have fun. | ||
masak | oh. | ||
um, you go right ahead. I'll... come out a bit later. | |||
21:13
kst joined
|
|||
Matt-W | hey | 21:18 | |
masak: great blog entry | |||
21:18
SamuraiJack joined
|
|||
Matt-W | I managed to come stay at my parents' house and not bring my laptop charger, so I've been on no rakudo time whereas I would have done some stuff :( | 21:19 | |
TimToady | rakudo: sub foo ($x) { say [1,2,$x].elems }; foo(<a b c d>) | 21:29 | |
p6eval | rakudo 23718a: OUTPUT«3» | ||
TimToady | that is correct | ||
rakudo: my @a = <a b c d>; my $a := @a; say [1,2,$a].elems | |||
p6eval | rakudo 23718a: OUTPUT«6» | ||
TimToady | that is incorrect | 21:30 | |
it is an invariant that $x never interpolates in list context | |||
Matt-W | rakudo seems to be paying more attention to that @a it's bound to | ||
TimToady | yes, but inconsistently with the sig binding earlier | 21:31 | |
Matt-W | indeed | ||
not good | |||
no wonder I get confused about list interpolation | |||
masak | Matt-W: thank you. :) | 21:32 | |
TimToady | incidentally, people keep writing "my $x = 1,2,3;" | 21:35 | |
this is also incorrect | |||
Matt-W | should be [1, 2, 3]? | ||
TimToady | (1,2,3) at least | ||
assignment to a scalar limits RHS to tighter than , | 21:36 | ||
21:36
wknight8111 joined
|
|||
masak | oh! | 21:36 | |
Matt-W | what should my $x = 1, 2, 3 do? | ||
error or $x == 3 or? | |||
TimToady | rakudo: loop (my $a = 1, my $b = 2; $a < 5; $a++, $b++) { say "$a $b" } | ||
masak | I actually half-thought that thought earlier on today. | ||
p6eval | rakudo 23718a: OUTPUT«Unable to set lvalue on PAST::Val nodein Main (src/gen_setting.pm:3166)» | ||
TimToady | that oughta work | ||
masak reports rakudobug | 21:37 | ||
Matt-W | masak: are you taking down bug reports? | ||
TimToady | it's not because rakudo is parsing it as a list assignment | ||
masak | Matt-W: so it seems. :) | ||
TimToady | (a known bug, iirc) | ||
masak searches | |||
we have too many known bugs! :P | 21:38 | ||
Matt-W | perhaps I should take some time to learn how to fix some of them | ||
TimToady | that's partly your fault | ||
Matt-W | hah | ||
masak | :) | ||
Matt-W | TimToady: But if he didn't report them, they'd still be there, and known bugs are better than unknown bugs | ||
masak has a tendency to produce lots of known bugs | 21:39 | ||
Matt-W | In a similar way to how a known missing manhole cover on a dark road is better than falling down it | ||
TimToady | we'd really like to accumulate a few more known unbugs | ||
masak | nope, a cursort glance at a search for 'loop' & queue=perl6 does not yield anything substantial. reporting just in case. | 21:40 | |
rakudo: loop (my $a = 1, my $b = 2;0;) { say "$a $b" } | 21:42 | ||
p6eval | rakudo 23718a: OUTPUT«Unable to set lvalue on PAST::Val nodein Main (src/gen_setting.pm:3166)» | ||
masak | 'night, all. | 21:49 | |
22:04
justatheory joined
22:06
kst joined
22:13
pmurias joined
|
|||
pmurias | hi | 22:13 | |
22:14
SamuraiJack joined
|
|||
sjohnson | hi | 22:26 | |
ruoso | hi pmurias | 22:33 | |
pmurias | ruoso: hi | 22:46 | |
ruoso: i'm thinking about writing a trace gc we could use once in a while to free cycles | 22:48 | ||
ruoso: as i don't know how to solve some cycles with weakrefs (like $?BLOCK) | 22:49 | ||
wayland76 | ruoso / pmurias: Someone was asking me whether SMOP is ready to install | 23:07 | |
23:07
nsh joined
23:15
Chillance joined
23:17
kst joined
|
|||
pmurias | wayland76: installing smop isn't supported yet | 23:19 | |
wayland76 | pmurias: Ok, thanks | 23:25 | |
23:32
kate21de1 joined
|
|||
sjohnson | rakudo: my $x = 1,2,3; print $x | 23:43 | |
p6eval | rakudo 23718a: OUTPUT«1 2 3» | ||
sjohnson | rakudo: my $x = 1,2,3; print $x.WHAT | ||
p6eval | rakudo 23718a: OUTPUT«Array()» |