pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by Tene on 29 July 2008.
rakudo_svn r31139 | tene++ | [rakudo] 01:16
r31139 | tene++ | Replace another instance of :inline with :pirop('newclosure').
meppuru good night 03:11
s1n @tell pmichaud i have something i need help testing, i have monday night free to finish this patch 04:24
lambdabot Consider it noted.
pmurias ruoso: is there anything you are blocking on that i should work on or is the direction i'm pushing smop in ok? 07:16
pmurias_ ruoso: i'm switching to method postcircumfix:<( )> (|$capture) {...} as method postcircumfix:<( )> ($capture) {...} leads to an awkward emitter/emitted code and is spec contradicting 08:05
pugs_svn r22250 | bpetering++ | Test commit bit: add self to AUTHORS 08:37
moritz_ missingthepoint++ # first commit
missingthepoint :) 08:39
moritz_: what's the state of IO in pugs and parrot? 08:41
i want a way to compare the C and perl6 versions of the code
moritz_ missingthepoint: both support reading of files and from STDIN, with various degrees for brokenness
missingthepoint was thinking of creating of file of rand() output
moritz_ in rakudo slurp($filename) works 08:42
missingthepoint should new tests be targeted to parrot? 08:43
err, s/parrot/rakudo/
pmurias_ there should be targeted at a Perl 6 implementation in general
moritz_ they should be implementation independant
but it doesn't hurt to make them as simple as possible, so that many implementations can run them 08:44
slurp($filename) works in both pugs and rakudo
pmurias_ and elf
missingthepoint ah, cool :)
i'll play around with that then 08:45
cheer, pmurias
*cheers
(can't type, need caffeine)
pmurias_ missingthepoint: cheers 08:46
missingthepoint moritz_: well, i have it compiling 08:52
i think i'll test against the C code before i commit...
but once it's committed, would you mind having a glance and pointing out any ways the perl6 could be written better? 08:53
moritz_ sure
will do 08:54
moritz_ monitors nearly all commits to t/ anyway
missingthepoint thanks heaps, moritz 08:55
you've made it a lot easier to get started
moritz_ plans to publish an article in "The Perl Review" about getting involved with the test suite 08:56
hope that it brings us some more volunteers
pugs_svn r22251 | pmurias++ | [smop/pugs] 08:59
r22251 | pmurias++ | switched to method postcircumfix:<( )> (|$capture) {...}
r22251 | pmurias++ | interpreter dies on an unknown method
r22251 | pmurias++ | pugs emits correct m0ld for $*OUT.print("1..1\nok 1\n")
pmurias_ moritz_: the test suit seems easiest for new people to get involved in 09:00
missingthepoint moritz_: soon, like the Fall 2008 issue? 09:00
moritz_ pmurias_: Aye, you don't need to know about compiler construction
missingthepoint: I hope so
missingthepoint moritz_: cool... if you have a draft i could give you feedback from a newbie's perspective :) 09:02
moritz_ missingthepoint: It will be based on www.perlmonks.org/?node_id=690945 and on t/HOWTO 09:03
lambdabot Title: Getting Involved with Perl 6 - an Update
pmurias_ moritz_: i don't think you need to know much about compiler construction for any other Perl 6 stuff
moritz_ missingthepoint: and I'll give you a draft as soon as it's in a readable state
pmurias_: probably not, but hacking on a *compiler* is a scary thought for many people
missingthepoint i second that, the test suite is a lot less intimidating from where i'm standing 09:04
moritz_ because a compiler is a huge, complex beast, and you have to be a computer scientist to understand it etc </FUD>
pugs_svn r22252 | pmurias++ | [smop] added missing file 09:05
missingthepoint i know :) 09:06
(that that's FUD) 09:07
but the test suite seemed like a logical place to start for me
moritz_ another point is that for most compiler hacking you need to know a few more languages, not just Perl 6 09:08
missingthepoint yep
pmurias_ moritz_: you can learn them as you go ;)
moritz_ pmurias_: sure you can, but it's easier if you don't have to ;) 09:09
missingthepoint moritz_: i'm happy to give feedback, if that would be helpful
moritz_: i actually ++'d that node today :)
moritz_ missingthepoint: it would. I just need a few hours to come up with the draft (and do other $stuff for real life) 09:10
Ontolog my $inFile = shift or die $usage; doesn't evaluate in perl 6? 09:11
what is the idiom now?
moritz_ @*ARGS.shift 09:12
lambdabot Unknown command, try @list
moritz_ shift doesn't default to @ARGV/@_ anymore
pmurias_ \/\/ die
// die
moritz_ aye
pmurias_ moritz_: although on the fly learning works better with haskell than C because you remain reasonable productive instead of cursing segfaults and memeory leaks 09:13
moritz_ pmurias_: instead you just curse failed type checks ;)
pmurias_ most of the failed type checks error messages don't make any sense at all they are just you have a bug indicators 09:15
Ontolog what doe shift default to now? 09:16
moritz_ yes, but they are still frustrating when you try to get something to run
Ontolog: there's now default
s/now/no/
a bare shift; never does something useful in Perl 6
Ontolog why? 09:17
did they take away default for everything or only shift?
moritz_ everything 09:18
most perl 5 builtins default to $_
which you can now obtain with a leading dot
so .say is the same as $_.say
Ontolog i see...
and .shift?
is @_.shift?
or @ARGS.shift?
moritz_ $_.shift
Ontolog and what is the * ?
moritz_ it means "global variable" 09:19
Ontolog i see
moritz_ perlgeek.de/blog-en/perl-5-to-6/15-twigils.html
lambdabot Title: blog | Perlgeek.de Blog :: Twigils
pmurias_ walk&
Ontolog ....twigils 09:25
sillyness!!
pugs_svn r22253 | moritz++ | [t/TASKS] we need to test the builtins from S29 with named arguments 09:31
Ontolog is there a list of primitive functions anywhere? 09:37
moritz_ S29 comes closest: perlcabal.org/syn/S29.htmh 09:38
erm, perlcabal.org/syn/S29.html
lambdabot Title: S29
Ontolog like, is there an "open" function anywhere? 09:40
I want to open a file and start reading from it 09:41
moritz_ Ontolog: yes, there's open($filename)
Ontolog: it should be documented in S16
Ontolog i see thanks
moritz_ (btw if you go at irc.pugscode.org all these S16 and stuff is turned into links) 09:42
Ontolog thanks 09:47
Why does while $in.readline { say $_; } not work?
I mean, why is $_ not set?
if I do $in.readline -> $line it works 09:48
but the default doesn't
moritz_ that's not the Perl 6 way of doing it 09:49
there's not implicit assignment to $_ anymore
Ontolog oh not at all??
jeez
moritz_ you'd use for =$in { .say }
Ontolog i see.. :P
moritz_ std: .say for =$in unless $foo; 10:06
p6eval std 22253: OUTPUT[cp: cannot create regular file `lex/STD/EXPR': Permission denied␤parse failure␤]
moritz_ ouch
std: .say for =$in unless $foo; 10:07
p6eval std 22253: OUTPUT[Unknown routines:␤ unless called at 1 ␤parsed␤] 10:08
moritz_ pugs: my %h=(a=>1, b=>2); my :($a,$b) := %h; say $a 10:57
p6eval pugs: OUTPUT[*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/m1oHE3oAp4 line 1, column 21-38␤]
moritz_ pugs: my %h=(a=>1, b=>2); my :($a,$b) := |%h; say $a
p6eval pugs: OUTPUT[*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/avbBs0o5aN line 1, column 21-39␤]
moritz_ pugs: my %h=(a=>1, b=>2); my (:$a,:$b) := %h; say $a
p6eval pugs: OUTPUT[*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/EqEMz1YA6h line 1, column 21-39␤]
moritz_ pugs: my %h=(a=>1, b=>2); my (:$a,:$b) := |%h; say $a 10:58
p6eval pugs: OUTPUT[*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/IihjUCbMHW line 1, column 21-40␤]
moritz_ pugs: my %h=(a=>1, b=>2); my :(:$a,:$b) := |%h; say $a
p6eval pugs: OUTPUT[*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/QJrK9K2RkJ line 1, column 21-41␤]
moritz_ pugs: my %h=(a=>1, b=>2); my :(:$a,:$b) := %h; say $a
p6eval pugs: OUTPUT[*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/LI8CH0XliY line 1, column 21-40␤]
Ontolog moritz_: so is $_ used at all in Perl 6? 11:45
can I start defining it myself? like for =$in -> $_ { mysub $_ }
moritz_ oh sorry, 'for' sets it by default 11:47
as does 'given'
but not 'while'
rakudo: .say for 1..3;
p6eval rakudo 31145: OUTPUT[1␤2␤3␤]
Ontolog i see, the . syntax, can I do that with my own subs? .mysub?
it doesn't seem to work 11:48
moritz_ let's try 11:50
rakudo: class A { sub foo { say "yes" }; }; given A.new { .foo };
p6eval rakudo 31145: OUTPUT[Method 'foo' not found for invocant of class 'A'␤current instr.: '_block35' pc 286 (EVAL_12:118)␤]
moritz_ rakudo: class A { method foo { say "yes" }; }; given A.new { .foo }; 11:51
p6eval rakudo 31145: OUTPUT[yes␤]
moritz_ Ontolog: it works, if you do it right
Ontolog: just remember that it's actually a method call, not a sub call
Ontolog so you can't do it with subs? 11:52
does perl even have normal subroutines?
*perl6
Myoma normal ?
moritz_ yes, it has 11:52
and no, you can't
Ontolog i see
moritz_ rakudo: sub foo { say "it's a sub" }; foo()
p6eval rakudo 31145: OUTPUT[it's a sub␤]
Ontolog is larry wall working on any of the implementations? 12:11
moritz_ Ontolog: he's working on STD.pm, the Perl 6 grammmar 12:12
Ontolog i see, where can I get this STD.pm and how do I use it? 12:14
i saw your mention of it on the mailing list there
if I have pugs or rakudo do I already have it? 12:15
moritz_ it's in the pugs repository in src/perl6/
Ontolog i see
moritz_ you need a perl 5.10.0 or later installed in /usr/local/bin/perl ;/
then you can type 'make'
to build it
and perl5.10.0 STD5_dump_match $file
Ontolog i see; already have perl 5.10 under /usr/local 12:16
i'll try to build it
what is the 5 for?
STD5??
shouldn't it be 6? ;)
moritz_ it refers to the Perl 5 translation of STD.pm
Ontolog i see so STD.pm is written in Perl 5? 12:17
hmm i see it's not 12:18
moritz_ no, it's written in Perl 6 12:20
and can automatically be translated to Perl 5
which is what gimmme5 does
Ontolog ahh cool
Ontolog hey man why didn't you major in cs instead of physics? 12:21
moritz_ funny, my girlfriend keeps asking the same ;)
Ontolog haha maybe you can do something with both of them (cs and physics) 12:22
moritz_ basically I didn't want to limit my scope to computers and the world of abstract thoughts
Ontolog i see
moritz_ Ontolog: indeed, in Germany we have to take a second subject, and I took CS
Ontolog would you say your first love is CS or Physics?
moritz_ Ontolog: and starting from mid October I'll be teaching a bit of theoretical physics for beginners 12:23
hard to say... my first love was Lego, then came electronics, then programming
Ontolog haha mine was legos too
moritz_ so probably physics
Ontolog so funny
when i was real young i loved legos 12:24
moritz_ build weird stuff with Lego, like combination locks and a machine that winds inductor coils 12:24
Ontolog that's cool, never did anything like that 12:25
moritz_ that was when I was not-so-young-anymore 12:26
perhaps 12 or 13
Ontolog i didn't know you could do that stuff with legos, were they special kits?
moritz_ the combination lock was pure lego 12:27
for the coil winder I used some non-lego stuff as well
pasteling "Ontolog" at 121.15.103.0 pasted "make bombs" (8 lines, 286B) at sial.org/pbot/32160 12:30
Ontolog 48 require "STD.pmc"; 12:31
moritz_ Ontolog: look at try5.out
Ontolog: it should contain some debugging information
Ontolog empty
moritz_ runs out of ideas 12:33
you could try to add a line '1;' at the end of STD.pmc
Ontolog haha i noticed STD.pmc is also empty 12:35
what the biff
moritz_ try ./gimme5 STD.pm > STD.pmc 12:36
that should fill STD.pmc
Ontolog that seems to get stuck in an infinite loop 12:42
pmurias_ re 13:41
rakudo_svn r31152 | moritz++ | [rakudo] Mapping.values shouldn't coerce to string, bacek++ 14:04
r31152 | moritz++ | Patch courtesy by Vasily Chekalkin, <bacek at bacek.com>
masak how do I refer to a method on an object in Perl 6? (without calling it) 14:10
moritz_ how would you in perl 5?
either as a string (the method name)...
or a closure
I guess that's what you'd use in Perl 6 as well 14:11
masak I was thinking along the lines of &($obj.method)
moritz_ I thought the same ;) 14:11
but I guess it wouldn't work
masak the string variant would be what, &"\$obj.method" ? 14:12
moritz_ my $x = uc; say "abc".$x() ?
pugs: my $x = uc; say "abc".$x()
p6eval pugs: OUTPUT[*** ␤ Unexpected "$x"␤ expecting "=", context, ":" or "("␤ at /tmp/mloepR1hRh line 1, column 4␤]
moritz_ uhm 14:13
of course you can say my $x = Classname::method; $x($obj:)
masak rakudo: class A { method x($n) { say $n; say self.WHAT } }; sub y($x) { $x() }; my $a = A.new; y( { $a.x(5) } ) 14:14
p6eval rakudo 31152: OUTPUT[5␤A␤]
masak this is enough for my purposes, I think
rakudo++
moritz_ erm &Classname::method I menat
*meant
masak rakudo: { nothing }() # :) 14:17
p6eval rakudo 31152: RESULT[Null PMC access in find_method()␤current instr.: '_block11' pc 25 (EVAL_13:12)␤]
moritz_ masak: I don't think that nothing() is specced anymore 14:18
masak oh. it Works on My Machine
my working copy must be old
moritz_: how does one write an empty block nowadays?
rakudo: if 5 {} else { say "Will this work?" } 14:19
p6eval rakudo 31152: RESULT[Null PMC access in find_method()␤current instr.: '_block11' pc 25 (EVAL_13:12)␤]
moritz_ masak: dunno, I just seem to recall that TimToady removed nothing
masak I remember him removing nothing too
but I think nothing remained in rakudo after that
moritz_ rakudo: unless 5 { say "Will this work?" }
p6eval rakudo 31152: RESULT[5]
masak moritz_: of course one can use unless instead 14:20
but I was thinking more like someone adding and removing lines of code from a block
and suddenly ending up with an empty one
(will a block only containing comments be interpreted as an empty hash, even when it's in the position of an if block?) 14:21
moritz_ masak: the grammer explicitly looks for a block after 'if', so it will not be interpreted as a hash
pmurias rakudo if 5 {;} 14:26
rakudo: if 5 {;}
p6eval rakudo 31153: RESULT[Null PMC access in find_method()␤current instr.: '_block11' pc 25 (EVAL_13:12)␤]
moritz_ rakudo: if 5 {;}; say "still there" 14:27
p6eval rakudo 31153: OUTPUT[still there␤]
moritz_ that's p6eval's oddity to try to squeeze out a value if nothing is printed to stdout
pmurias how should i emit ¢ from Pugs? 14:30
if i specifi it in a haskell literal it gets mangled 14:31
moritz_ $cent?
7~
oops
masak moritz_: it worries me that p6eval produces errors that aren't really there 14:34
moritz_ masak: hm, we could do some magic... 14:36
masak possibly.
moritz_ masak: right now if it doesn't produce any output, it is wrapped in ((...).perl).print or some such
masak not sure I think that's needed.
better to be consistent.
moritz_ masak: what we could do is it seperate STDOUT and STDERR for that program, and if there's no result on STDOUT then simply say "no output" 14:37
masak: but it's convenient
;)
masak sure, it's convenient.
I'm not going to oppose a feature that people like just because it produces errors I don't like :) 14:38
your idea with separating STDOUT and STDERR sounds intriguing.
if it works, I want it :)
moritz_ if you implement it, it works ;) 14:40
masak speaking of work...
masak is suddenly reminded of his real $work 14:41
moritz_ if not, you have to wait for the undefined future until someone (.oO( who could that be...?)) does it, perhaps
pugs_svn r22254 | pmurias++ | [smop][pugs] 15:02
r22254 | pmurias++ | pugs generates working m0ld
r22254 | pmurias++ | added a very simple test for that
r22254 | pmurias++ | m0ld also accepts ? as an ascii replacement for ¢
masak waits for the undefined future 15:03
pmurias moritz_: you want to evalbot to just die quietly if there are errors in the code
moritz_ pmurias: I don't think that's a good idea 15:13
pmurias moritz_: what was you idea for STDOUT and STDERR about? 15:14
moritz_ pmurias: if the code produces no output, wrap it in ((...).perl).print (as is now), but on that second run only check STDOUT (currently both are checked) 15:16
pmurias: some statements generate errors in some implementations if used as expressions 15:17
pmurias i understand, thanks 15:17
perl6: do {say 4}
p6eval elf 22254, pugs, rakudo 31155: OUTPUT[4␤]
pmurias perl6: do {1} 15:18
p6eval pugs, rakudo 31155: RESULT[1]
..elf 22254: RESULT[1␤]
pmurias moritz_: a "do {...}" might prevent some errors
moritz_ $program = '( ( do { ' . $program . "\n} ).perl ).print"; 15:20
that's what I use now
moritz_ shouldn't be hard to do, just need 10 minutes of straight thinking 15:22
meppl what does the perl()-method do?
moritz_ meppl: roughly the same as Data::Dumper in perl 5, ie it gives you a piece of perl code that constructs the object 15:23
meppl i see 15:24
moritz_ perl6: print [1, 2].perl
p6eval elf 22254: OUTPUT[[1,2]]
..pugs: OUTPUT[\(1, 2)]
..rakudo 31156: OUTPUT[[1, 2]]
pmurias pmichaud: what's the state of the "This Week in Perl 6" attempt? 15:39
pmichaud It didn't happen last night, so probably tonight. 15:39
lambdabot pmichaud: You have 1 new message. '/msg lambdabot @messages' to read it.
pmichaud @messages
lambdabot s1n said 11h 15m 11s ago: i have something i need help testing, i have monday night free to finish this patch
pmurias pmichaud: re raports/news how would you like to receive them? 15:43
pmichaud email is probably best, but I'll take them however 15:47
[email@hidden.address] 15:48
pugs_svn r22255 | moritz++ | [t/spec] unfudged a test that bacek++ made work in rakudo 15:49
moritz_ pmichaud: do you want/need any reports on test suite progress? 15:53
pmichaud moritz_: all reports are welcome :-) 16:27
pht quick question - how to declare a constant? i recall it was something like my $foo is constant, but that works not 16:28
moritz_ constant $foo = 3; # iirc 16:29
pugs: constant $x = 3; say $x;
p6eval pugs: OUTPUT[3␤]
moritz_ pugs: constant x = 3; say x;
p6eval pugs: OUTPUT[*** ␤ Unexpected "="␤ expecting ":" or "("␤ at /tmp/WYUW3ENQvo line 1, column 12␤]
moritz_ pugs: constant x := 3; say x;
p6eval pugs: OUTPUT[*** ␤ Unexpected "="␤ expecting "("␤ at /tmp/jGXL8YvBwf line 1, column 13␤]
moritz_ I think that it should also work, but not sure
pht > constant $str = 'foo'; 16:30
Null PMC access in type()
lambdabot mueval: Prelude.read: no parse
moritz_ pht: I didn't say that rakudo implemented it ;)
pht okay so basically it's not implemented
(in rakudo) 16:31
another q:
moritz_ rakudo: constant $x = 2; say $x;
p6eval rakudo 31156: OUTPUT[scope declarator 'constant' not implemented at line 1, near "= 2; say $"␤␤current instr.: 'parrot;Perl6;Grammar;Actions;scope_declarator' pc 121995 (src/gen_actions.pir:8516)␤]
moritz_ there you go, it even says nicely that it's not implemented ;)
pht > sub a ($x is rw) { say "$x"; }
lambdabot mueval: Prelude.read: no parse
pht > a('sth'); 16:32
lambdabot lexical error in string/character literal at character 't'
pht shouldnt this throw some error ?
moritz_ rakudo: sub a ($x is rw) { say "$x"; }; a('sth');
p6eval rakudo 31156: OUTPUT[sth␤]
moritz_ pht: why?
pht because i'm feeding a constant into what should be rw 16:32
moritz_ but that's only an error if you actually try to modify it
pht > sub a ($x is rw) { $x ~= 'bah'; say "$x"; } 16:33
lambdabot mueval: Prelude.read: no parse
pht works too
moritz_ rakudo: sub a ($x is rw) { $x ~= 'bah'; say "$x"; }; a('sth');
p6eval rakudo 31156: OUTPUT[sthbah␤]
moritz_ I guess that's an error 16:34
pht but maybe my first q explains it
(constants not implemented)
moritz_ no, I think that's a value/container distinction thing 16:34
pht shall i submit somewhere? 16:35
moritz_ rakudo: sub a ($x) { $x = 3; say $x}; a(4)
p6eval rakudo 31156: OUTPUT[Cannot assign to readonly variable␤current instr.: 'a' pc 166 (EVAL_15:71)␤]
moritz_ pht: please do, to [email@hidden.address]
pht can you try it with pugs: (or can I?)
moritz_ you can 16:36
pht pugs: sub a ($x is rw) { $x ~= 'bah'; say "$x"; }; a('sth'); 16:37
p6eval pugs: OUTPUT[*** Can't modify constant item: VStr "sth"␤ at /tmp/i7WG8BtOn0 line 1, column 20-31␤]
pht pugs: sub a ($x is rw) { say "$x"; }; a('sth');
p6eval pugs: OUTPUT[sth␤]
pht still, it seems weird, because 'is rw' should specifically ban constants. or not? 16:38
moritz_ I think it "claims the variable for writing", which doesn't have to fail
pht rakudo: sub a ($x is rw) { $x += 3; say $x}; a(4); 16:39
p6eval rakudo 31156: OUTPUT[7␤]
pmichaud rakudo doesn't yet treat constant values as read-only
moritz_ rakudo autovivifies a container here it seems
pmichaud well, $x is still a container, yes. 16:40
pht pugs: my $str is Str = 'foo';
p6eval pugs: RESULT[\"foo"]
pht rakudo: my $str is Str = 'foo';
p6eval rakudo 31156: RESULT["foo"]
pht seems i have older version ... 'PAST::Compiler can't compile node of type Perl6::Grammar' 16:41
pugs_svn r22256 | moritz++ | [t/spec] removed some obsolete usages of 'is $stuff, undef'
moritz_ pmichaud: mail sent 16:46
pmichaud thanks!
wknight-work I would like to get a pugs commit bit, to do some work on the Perl 6 book 17:32
TimToady msg me your email and preferred user name 17:35
wknight-work: and I can give you a commit bit
ruoso Hello! 17:36
wknight-work sent 17:37
ruoso TimToady, could you please clarify for me how "my @a = @b" at the same time copies the array and preserves lazyness? 17:39
TimToady it's possible that we'll define assignment to be eager by default 17:40
either that 17:41
ruoso so my @a = map { ... }, @b would be eager...
TimToady or we'll define some kind of crossover where it switches from eager to lazy
much like regexes switch from pure dfa-able to nfa-ish
if we go the eager assignment route, then we'd probably make push lazy :) 17:42
but maybe not 17:43
ruoso lazy push is something I doesn't really understand...
pugs_svn r22257 | Whiteknight++ | first edit, adding myself to AUTHORS
wknight-work done! 17:44
Thanks TimToady!
TimToady we have to have some way of adding lazy iterators to the "specs" of an array, if we want lazy arrays 17:45
even if some of the array is already evaluated 17:46
but at the moment I'm actually leaning toward defining some eager/lazy compromise, where we can guarantee that easy things get done eagerly and hard things get done lazily 17:47
for some definition or other
ruoso I was considering that lazy lists are always read only
TimToady p6 arrays have always been lazily extensible 17:48
and arrays are read-write
ruoso I can't think of a use case for lazy write on the array... 17:49
I could think of a composite array that has some fixed values and a lazy iterator as a backend for the other values 17:50
pmurias ruoso: hi
ruoso hi pmurias
TimToady well, what if you want to add another iterator to an existing array?
ruoso hmmm... I see... like if you could access the iterators of the list individually 17:51
something working on the line of slice context, for instance, that gives you another view on the array 17:52
but one could argue that adding another iterator is 17:53
my @c = (@a, @b)
I was thinking on implementing that in terms of iterators too
TimToady the basic question to me is how push should behave
ruoso it depends on the backend of each list 17:54
some simply doesn't support it
like 'feed's
other can store the value directly, like plain arrays 17:55
pmurias the list is already a wrapper around the iterator so i don't see why it can't support push (not sure if it should) 17:56
ruoso pmurias, it depends...
TimToady maybe if you could tell an iterator what its successor is...
ruoso sometimes it's the iterator that is a wrapper 17:57
sometimes it's the list
the relationship between the list and the iterator is up to them
ruoso for instance... 17:58
a plain array contains the actual values... an iterator to that array will be a simple wrappre
pmurias i understand
pmurias ruoso: i got pugs to compile $*OUT.print("...") to m0ld, but i need to handle scalar/value destinction to push it farther 18:02
pmichaud eagerly awaits assignment/interpolation clarifications :-) 18:04
pmurias i could either add a FETCH to *everything* now (not nice), or add context to the method call opcode (don't know how to push it into the SMOP_DISPATCH)
pmichaud: you are supposed to be planning a new way of doing context in rakudo? 18:05
pmichaud pmurias: I am? or perhaps I don't understand the question.
pmurias pmichaud: jonathan told me so 18:06
pmichaud I'd need to know the context of the comment, I guess. :-)
pmurias is searching the irc log
irclog.perlgeek.de/parrot/2008-09-13#i_566007 18:07
lambdabot Title: IRC log for #parrot, 2008-09-13
pmichaud oh, &want 18:08
I'm waiting to see how Parrot's calling conventions evolve before I worry too much about &want
ruoso pmurias, FETCH to *everything* is how I planned to do... forward context propagation should avoid unecessary calls
but as an optimization 18:09
pmichaud in Parrot a called subroutine can already do some (limited) introspection to figure out what the caller is expecting back, but that interface is undergoing some changes right now in a branch as part of the pdd27mmd branch that allison is working on 18:10
in particular, I think that Parrot's calling conventions are moving almost entirely to a Perl 6-like capture model
pmurias ruoso: what i don't like about FETCHing *everything* is that *everything* needs to be FETCHable
ruoso yes... that's the part of "every value is a scalar of itself"
and "every value is a list with one element that contains itself" 18:11
pmichaud and since the same conventions are used for returning values as for calling a sub, we may end up with significant support built-in to Parrot for key features of want
ruoso I'm trying to avoid "forward context propagation" at this moment, because it would make SMOP much more complex than it is at the moment... 18:12
"late context propagation" makes things much simpler...
every method call can simply return the value, and that's all.. 18:13
pmurias ruoso: why would it make SMOP that much more complex
ruoso because you would have a lot of "if context == foo, then ..., else ..." 18:13
pmurias ?
pmurias but now you would have loads of FETCH,postcircumfix:<[ ]>,push,shift.... in every class 18:14
s/class/RI
ruoso pmurias, only in the RIs that need to be used in item context...
or in list context... 18:15
and a value might return a read-only list in list context...
which means, no push, no shift...
ruoso the basic difference is that SMOP will probably fail with "Can't locate object method push" instead of "Can't push in read-only list" 18:16
pmurias and map and grep...
;) 18:17
ruoso map is no longer a method of list
;)
pmichaud map and grep are methods of Any
pmurias RI's don't do inheritence, maybe they could if they were generated
instead of hand (written|copy-and-pasted) 18:18
ruoso pmurias, now you gave me a very good reason for your RI DSL
pmurias ruoso: the if context == stuff would be only in a few context sensitive places
is there a way of putting context in SMOP_DISPATCH? 18:19
ruoso I was thinking about putting context in the capture 18:20
which would allow us to support multi-resolving-based-on-context on the future 18:21
pmurias visit from a friend&
ruoso but I really would like to stick with 'late context propagation' for now...
pmichaud TimToady: STD.pm currently defines all of the terminator:sym<whatever> tokens with <?before 'whatever' » > 18:25
but all of the calls to <terminator> as a subrule are (thus far) also embedded in <?before ...>
seems like we should be able to get rid of one or the other <?before ...> calls 18:26
(my preference would be to see token terminator:sym<foo> defined without the <?before ...> )
although I understand why it makes more sense to have <?before ...> there.
TimToady pmichaud: testing... 18:53
rakudo_svn r31158 | pmichaud++ | [rakudo]: spectest-progress.csv update: 162 files, 3361 passing tests 18:54
pmichaud I can argue it either way, so I definitely defer to your intuition/judgement on that one. it just looked a bit funny to me at first. 18:55
pugs_svn r22258 | lwall++ | [STD] remove redundant befores from terminators per pmichaud++ 18:58
cognominal perl6: say m/.../.WHAT 19:09
p6eval pugs: OUTPUT[Regex␤]
..elf 22258: OUTPUT[Regexp␤]
..rakudo 31158: OUTPUT[Block␤]
TimToady none of those are actually correct, since m/.../ is supposed to run immediately and return a Match object 19:26
pmichaud right -- we were discussing it on #parrot
rakudo doesn't do the immediate match semantics yet 19:27
however, it did bring up a question in my mind, that $x ~~ m/.../ can get a bit tricky on the implementation side
because we want to match against the pattern, and not against the immediate match result
TimToady okay, I'll think about that some 19:28
pmichaud but it also begs the question of how one would do $x ~~ s/foo/bar/; to do a substitution on something other than $_ 19:29
(they're effectively related.)
for now I'm sweeping it under the rug of "smart match sometimes has to be really smart (and ugly)"
TimToady well, we've always said that ~~ has some macro characteristics 19:30
pmichaud correct
TimToady maybe that's just part of it
pmichaud yes, that's the rug I'm using right now :-)
gotta pick up kids, back in 35
pugs_svn r22259 | lwall++ | [t/spec] two simple syntax errors found by STD 19:49
pmurias TimToady: does putting the context in the capture contractic the spec in any serious way? 19:58
TimToady pmurias: I don't believe so, but I could be wrong. :) 20:09
rakudo_svn r31160 | pmichaud++ | [rakudo]: Fix <?before <terminator>> to be <?terminator>. 20:43
pmichaud std: $ if 1; 20:52
p6eval std 22259: OUTPUT[parsed␤]
ruoso later & 20:58
rakudo_svn r31163 | pmichaud++ | [rakudo]: Fix statement modifier after listops (RT #57352, #57334, #57076) 21:11
pugs_svn r22260 | moritz++ | [t/spec] fixed pick.t, and fudged for rakudo 21:55
rakudo_svn r31165 | moritz++ | [rakudo] add newly fudged pick.t to spectest_regression 22:01