The topic for #perl6 is: pugscode.org/ planetsix.perl.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 TimToady on 25 November 2008.
00:05 iblechbot left 00:19 vixey left
cspencer pugs: .say for (1^..^10 :by(2)) 00:20
p6eval pugs: OUTPUT«*** ␤ Unexpected ":by"␤ expecting operator or ")"␤ at /tmp/Lv2bhPsOjt line 1, column 19␤»
cspencer pugs: .say for (1^..^10:by(2))
p6eval pugs: OUTPUT«*** ␤ Unexpected ":by"␤ expecting "_", fraction, exponent, term postfix, operator or ")"␤ at /tmp/7BYxTJBpCD line 1, column 18␤»
cspencer pugs: .say for (1..10 :by(2)) 00:21
p6eval pugs: OUTPUT«*** ␤ Unexpected ":by"␤ expecting operator or ")"␤ at /tmp/7tZQyyP09Z line 1, column 17␤»
cspencer pugs: say 1..10:by(2) 00:22
p6eval pugs: OUTPUT«*** Named argument found where no matched parameter expected: (by,Ann (Pos (MkPos "/tmp/7E9TTPfhlF" 1 14 1 15)) (Val (VInt 2)))␤ at /tmp/7E9TTPfhlF line 1, column 1 - line 2, column 1␤»
01:18 cspencer left 01:19 alc joined 01:26 alanhaggai joined 01:32 dukeleto joined 01:43 dukeleto_ joined, dukeleto left 01:48 nacho_ left 01:50 xinming left 02:00 dmpk2k joined 02:12 xinming joined 02:14 dukeleto joined 02:22 dukeleto_ left 02:45 alanhaggai_ joined 02:52 DemoFreak left 02:54 PZt joined
pugs_svn r24671 | tjp++ | Fixed typos/grammar in S02-S06. 02:54
02:57 alanhaggai left 02:59 alanhaggai_ is now known as alanhaggai 03:05 jhorwitz_ left 03:08 eternaleye_ left 03:12 eternaleye_ joined 03:13 zostay joined 03:28 cspencer joined 03:30 dukeleto left 03:31 dukeleto joined 03:33 meppuru joined 03:35 meppl left, cspencer left 03:40 meppuru is now known as meppl 03:42 dukeleto_ joined 03:53 dukeleto left 04:00 kisu joined 04:01 elmex_ joined 04:17 kisu_ left, elmex left, elmex_ is now known as elmex
meppl good night 04:21
04:23 meppl left 05:13 dukeleto joined 05:24 dukeleto_ left 05:25 alc left 05:33 alc joined 05:44 alanhaggai left 05:45 cspencer joined 05:46 alester joined 05:59 tuxdna joined 06:35 cspencer left 06:40 araujo left, brunoV left 06:45 justatheory joined
pugs_svn r24672 | pmichaud++ | [t/spec]: Remove some duplicate my declarations in hash.t . 06:56
07:15 maerzhase joined 07:23 maerzhase left 07:26 azawawi joined
azawawi hi 07:26
07:27 alester left
pugs_svn r24673 | azawawi++ | [Syntax::Highlight::Perl6] Added a test case for the re-use of STD bug 08:04
r24674 | azawawi++ | [Syntax::Highlight::Perl6] reverted to a working STD.pm release 08:07
r24674 | azawawi++ | [Syntax::Highlight::Perl6] Fixed the $DELIM warning bug caused by gimme5
r24674 | azawawi++ | [Syntax::Highlight::Perl6] reverted BUGS and SYNPOSIS and tests to use STD in main::
r24674 | azawawi++ | [Syntax::Highlight::Perl6] Updated Changes... Releasing to 0.0926 to CPAN
08:07 vixey joined 08:10 iblechbot joined
pugs_svn r24675 | azawawi++ | [Syntax::Highlight::Perl6] Added back the use STD in main:: 08:10
08:13 meppl joined 08:30 dukeleto_ joined 08:39 dukeleto left 08:45 Hell_Kaiser joined
pugs_svn r24676 | azawawi++ | [Syntax::Highlight::Perl6] Bumped version to 0.02961 09:24
r24676 | azawawi++ | [Syntax::Highlight::Perl6] Skipped t/02-hilitep6.t on win32 since it hanged
r24676 | azawawi++ | [Syntax::Highlight::Perl6] added bar.pl and Foo.pm to MANIFEST.SKIP
r24676 | azawawi++ | [Syntax::Highlight::Perl6] Updated changes and released to CPAN
09:36 tomyan joined 09:38 alc left 09:41 c9s_ is now known as c9s 09:54 DemoFreak joined 10:16 ejs joined 10:29 dukeleto_ left 10:32 masak joined 10:33 azawawi_ joined
moritz_ masak: pong 10:41
10:41 kisu left
masak moritz_: you mentioned the need for restructuring of S29. I'm about to do a lot of editing of S29 now. could you elaborate on what needs to be restructured? 10:41
10:41 ejs1 joined 10:42 kisu joined
moritz_ masak: I was mainly referring to the fact that most builtins work with an invocant of Any right now, even though S29 says they only work on Str, List or $other_type 10:43
masak moritz_: aye, that's true.
so it's mainly the signatures that need to be reviewed?
print and say are two good examples. it says in S16 that they work on Str. 10:44
moritz_ masak: yes, and we need a sentence explaining why its done....
masak but I have the impression that they work on most anything.
moritz_ masak: and for example for Any.reverse we need clarification if it's the list or the string reverse 10:45
10:45 azawawi left 10:46 azawawi joined
moritz_ well, say and print coerce to Str, they don't just work on Strs 10:46
masak moritz_: it feels a bit of a shame however. even though those parameter types are too strict, they do convey relevant information.
moritz_: yes, they coerce. and that goes for most other general functions.
moritz_ masak: then you can write things like sub say(*@args as Str) to be clear 10:47
masak moritz_: that's a good idea.
I'll need to do that all over S29, but at least it doesn't delete extant information. 10:48
moritz_ masak++ # spec grunt work 10:50
masak well, I consider S29 one of the most important resources to newcomers.
it's also one of the few places where I feel I can make a difference. 10:51
moritz_ aye
masak moritz_: btw, Druid detects winners now. and it's on its way to be able to handle arbritary board sizes. 10:52
moritz_ that's also the motivation for my spectest work - I feel I can make a much bigger difference there than if I tried to work my way into the parrot internals
masak moritz_: aye, same here.
10:52 ejs left
moritz_ re Druid, cool! 10:53
masak I'm pondering whether to make a blog post about how generality can destroy the beauty in simplicity. github.com/masak/druid/commit/18ebc...a2e31c2544
if nothing else, to get responses from the good Perl programmers on how to improve that code :)
wolverian the haskeller in me wants to ask why use strings where you could use your own type to model the domain better :) 10:54
masak (oops, that NB comment is a fossil. removing)
wolverian: see? immediately someone springs forward! :)
wolverian: please elaborate. 10:55
10:55 azawawi_ left 10:56 justatheory left
wolverian hm, nevermind. I thought you were doing strange string magic elsewhere in the app, but you're just using a 2D array there, which makes sense. 10:56
10:56 ruoso left
wolverian hm, would [~] be nicer than join ''? 10:58
masak wolverian: it would. changing. 10:59
wolverian++
wolverian though I wonder what the default array stringification is 11:00
masak rakudo: say [~] 1..5
moritz_ with spaces inbetween
p6eval rakudo 34563: OUTPUT«12345␤»
masak O RLY?
wolverian pugs and rakudo differ. 11:01
moritz_ rakudo: say ~<1 2 3>
p6eval rakudo 34563: OUTPUT«1 2 3␤»
wolverian er, no they don't.
1~2~3~4~5 != ~[1..5] :)
wolverian is slow
okay, time to sleep.
masak wolverian: g'night.
11:01 alech joined 11:20 alech left
avar rakudo: [~] 1 .. 5 11:45
p6eval rakudo 34566: RESULT«"12345"»
avar rakudo: [~] 1 .. 5 eq 1~2~3~4~5
p6eval rakudo 34566: RESULT«Bool::False»
avar rakudo: 1~2~3~4~5
p6eval rakudo 34566: RESULT«"12345"»
avar rakudo: ([~] 1 .. 5) eq (1~2~3~4~5) 11:46
p6eval rakudo 34566: RESULT«Bool::True»
11:50 ruoso joined, apeiron left
ruoso Hello! 11:52
Matt-W Hello 11:58
11:59 araujo joined 12:00 ihrd joined
ihrd hi there 12:03
12:04 pmurias joined
pmurias hi 12:04
ihrd rakudo: sub foo (%h?) { { a => 1, %h }.perl.say; }; foo( { b => 2 } )
p6eval rakudo 34566: OUTPUT«{"a" => 1, "b" => 2}␤»
ihrd rakudo: sub foo (%h?) { { a => 1, %h }.perl.say; }; foo({}); 12:05
p6eval rakudo 34566: OUTPUT«{"a" => 1}␤»
ruoso hi pmurias
ihrd rakudo: sub foo (%h?) { { a => 1, %h }.perl.say; }; foo();
p6eval rakudo 34566: OUTPUT«Odd number of elements found where hash expected␤current instr.: 'parrot;Perl6Hash;!STORE' pc 5676 (src/classes/Hash.pir:154)␤»
ihrd hi pmurias
so that look like bug for my, but mb it is not 12:06
ruoso ihrd, that looks like a parrot bug...
er...
a rakudobug 12:07
ihrd look like hash do not init right
ruoso post it to [email@hidden.address]
ihrd ok, I am submiting it
hm, I just thinking, mb it is not bug? 12:10
rakudo: say {a => 1, undef }.perl.say
p6eval rakudo 34566: OUTPUT«Odd number of elements found where hash expected␤current instr.: 'parrot;Perl6Hash;!STORE' pc 5676 (src/classes/Hash.pir:154)␤»
ihrd %h really is undef 12:11
ruoso the question is whether an undefined hash shouldn't behave as an empty hash
avar rakuo: sub foo (%h?) { return { %h } }; foo();
rakudo: sub foo (%h?) { return { %h } }; foo();
p6eval rakudo 34566: RESULT«{ ... }»
avar I think an empty has is the empty list in that context, not undef 12:12
anyway, anything else would be silly
ihrd avar: Rakudo do not understand you right
ruoso avar, I think it thought on { %h } as a code object
avar ah 12:13
ruoso rakudo: sub foo (%h?) { return %h.kv }; say foo().perl
ihrd rakudo: my %h; { %h }.WHAT.say;
p6eval rakudo 34566: OUTPUT«[0, undef]␤»
rakudo 34566: OUTPUT«Block␤»
avar rakudo: sub foo (%h?) { my $hashref = { %h }; $hashref }; foo();
pmurias ruoso: you know having mildew output a shared library wouldn't require changing m0ld at all
p6eval rakudo 34566: RESULT«{ ... }»
avar I screwed it up again:)
ruoso pmurias, you mean mildew compiling to a "plugin"?
pmurias yes 12:14
ruoso except changing the m0ld output ;)
avar how is the elf CL backend going? 12:15
ruoso avar, stalled AFAIK
pmurias ruoso: m0ld compiles a block of m0ld code to a C expression 12:16
ruoso ah.. it doesn't include the boilerplate...
the boilerplate is external.. right
avar how about elf itself (or other non-rakudo stuff) 12:17
pmurias it is kept in m0ld_boilerplate_{front,back}
ruoso avar, elf receives some attention by mncharity, ocasionally
avar, but mildew is progressing really fast
avar isn't there some page with test runs for all the implementations?
oh so yet another compiler now?:)
ruoso avar, and the first compiler which is a STD backend
(ok, maybe not the first) 12:18
avar ah, nice
pmurias pixie was first
avar is it written in p5?
pmurias mildew is written in p5
ruoso but the first targetting a p6 runtime
avar, it's written in p5, but targets SMOP
so it can have the proper semantics 12:19
avar, take a look at v6/mildew/t in the pugs repo
you'll see what it can do already
I've just implemented exception handling this weekend
avar ah, isn't that a fairly advanced thing to implement? 12:20
pmurias our feature set expands strangely
ruoso avar, we advance by concept, not by feature ;) 12:21
we have very few features
but support a lot of concepts ;)
12:22 rindolf joined
ruoso avar, for instance, mildew already implements "return" as spec 12:23
pmurias but we don't have say ;)
ruoso and, surprisingly, it is the first to do it
pmurias but you'll be able to use the say from Perl6::Say soon 12:24
ruoso heh
pmurias, I think I reached a complicated point with captures 12:25
hmm... maybe not
the problem is actually in the way we're implementing the signatuer
signatures 12:26
pmurias yes 12:27
go on ;)
ruoso better yet, the problem is that p6opaque is not enclosing the capture in a scalar before sending as parameter to dispatch
and we're probably not doing it on Code also 12:29
12:29 azawawi left, Hell_Kaiser left
pmurias constructing a Scalar of Capture on every postcircumfix:<( )> doesn't seem very nice 12:30
ruoso maybe the correct way would be to have a signature that doesn't enforce any context 12:32
12:32 azawawi joined
ruoso sub foo(\$capture) 12:32
std: sub foo(\$capture) 12:33
p6eval std 24676: OUTPUT«Unknown routines:␤ sub called at 0 ␤00:05 88m␤»
ruoso std: sub foo(\$capture) {...}
p6eval std 24676: OUTPUT«############# PARSE FAILED #############␤Syntax error at /tmp/NAD5nCVgXl line 1:␤------> sub foo(\$capture) {...}␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ standard stopper␤ statement modifier loop␤ terminator␤00:05 88m␤»
ruoso I think I'll post that to p6-language 12:35
12:57 azawawi_ joined
ruoso pmurias, actually... the problem is that the dotty operator presumes item context 13:01
at the moment...
and it's actually correct
the question is then "how do you call a method of a capture object"? 13:02
pmurias you put it in a scalar 13:06
and call a method on the scalar
ruoso right...
that's what the "\" operator does
13:06 azawawi left
pmurias object's which don't return themself in item context seem very tricky to handle properly 13:08
ruoso but then you need to dereference a capture when sending it in a call
pmurias, yes... but that's also what makes capture so powerfull
the problem is that the syntax foo(|$bar) means replacing the actual capture 13:09
13:09 masak left
ruoso VAR($bar).FETCH would do the trick 13:10
aha...
if foo( (a => 1) ); turns the pair into a positional argument 13:11
foo( (|$capture) ); turns the capture into a positional argument
sounds sane?
pmurias, what do you think? 13:12
I even think STD already parse this as a positional argument as well 13:14
at least at first look, it seems like
pmurias captures don't seem very sane to me atm, so it's hard for me to say 13:16
ruoso: you are aware that there are a lot of leaks in the mildew test suit? 13:18
ruoso yeah...
it's my new-years-promess 13:19
"fix all leaks in SMOP"
pmurias laughts
13:19 apeiron joined
ruoso I think this could be a work for a grant 13:20
pmurias, you could submit a grant proposal on that... 13:21
since you're the memory czar now ;)
ruoso just sent another lenghty mail to p6-language 13:22
pmurias shopping& 13:25
ruoso @tell TimToady if you have some time, could you please take a look at the two capture-related messages I sent to p6-language
lambdabot Consider it noted.
13:27 eternaleye joined 13:28 ihrd left 13:30 masak joined 13:31 justatheory joined
pugs_svn r24677 | ruoso++ | [smop] fix p6opaque calling of HOW.dispatch. 13:36
r24677 | ruoso++ | [smop] fix error message when OutOfItemsException is not caught
r24677 | ruoso++ | [mildew] uses the correct signature in dispatch
13:39 ejs1 left 13:41 eternaleye_ left
pugs_svn r24678 | pmurias++ | [smop] non-recursive method call on SMOP__Object* works (needs integration with PCL) 13:48
13:53 apeiron left
ruoso pmurias++ # cool 13:54
13:54 alester joined 13:55 apeiron joined
ruoso pmurias, the integration with p5 in the way you're working is not supposed to be done by using PCL 13:56
the PCL is a later stage to make XS stackless 13:57
13:57 alester left
ruoso the idea is to merge the SMOP interpreter with the p5 interpreter into a single runloop 13:57
pmurias ruoso: why shouldn't i use PCL? 14:00
ruoso pmurias, well.. you can
but it won't provide the semantics we expect 14:01
because if you have a stack made of: p5 -> mold -> p5 -> mold -> p5
you'll need to have several perl interpreters
pmurias thinks 14:02
14:03 apeiron left 14:04 apeiron joined
ruoso in order to support that kind of recursion... 14:04
we need to merge p5 runloop and SMOP runloop
14:04 lichtkind joined
pmurias so the problem is that if i'm in a p5 sub and it calls smop it can't call p5 again because the p5 interpreter is already executing that previous sub right? 14:08
ruoso yes.... 14:09
if we merge the runloops
we can save the "current continuation" in p5 using Coro
execute the smop code
enter a new Coro
and switch back to the outer Coro when you unwind the stack 14:10
pmurias so the next thing i'm doing is to steal the "save the current continuation" part from Coro? 14:12
ruoso Well...
I think you need to compatibilize p5 and SMOP 14:13
that means creating a modified p5 interpreter
where every p5 value is a SMOP__Object*
14:15 kisu_ joined
ruoso so you can use the Coro object in a $interpreter.goto($coro) call 14:15
pmurias why do i need to compatibilize p5 and SMOP? 14:17
ruoso because when you pass a SMOP__Object* as an argument to a p5 sub
pmurias isn't it mostly a performance thing 14:18
ruoso I'm not sure...
pmurias i'm currently wrapping the objects when doing interchange
ruoso then if you send a smop object to a p5 sub that re-sends that smop object to a smop code 14:19
you'll have a SMOP__Object* wrapping a SV* that wraps a SMOP__Object*
pmurias i have an if statement which avoids double wrapping 14:20
so it either wrapps or unwrapps an object when it needs conversion 14:21
ruoso hmm... ok...
doing the SMOP-P5 merge is the *real thing*...
pmurias it's part 3 on my C project plan 14:22
ruoso but I suppose you can start by simply doing this wrapping and supporting Coro
pmurias the problem with the SMOP-P5 merge is that will require a custom perl5 14:23
ruoso it's not really a problem
considering we're already embedding p5 in SMOP
14:24 azawawi joined
ruoso and also, a custom perl 5.10 feature might be integrated into the standard perl 5.12 ;) 14:24
pmurias i doubt it
as adding a RI would add a performace hit 14:25
ruoso not really, since p5 already checks for tie
checking if this is an SV or not is no performance hit 14:26
and #p5p people seemed surprisingly receptive to this idea
and everybody loves the phrase "perl 5.12 might support Perl 6" 14:27
14:30 azawawi left
ruoso pmurias, in fact, adding a RI might even make tie and overload simpler 14:31
14:31 azawawi_ left 14:32 kisu left 14:33 azawawi joined
pmurias i could try doing it 14:34
ruoso pmurias, have you seen the SMOPP5 wiki page?
pmurias yes, multiple times 14:35
ruoso :)
pmurias not having data* as a part of SMOP__Object would help
ruoso I'd like to get rid of it, actually 14:36
the sad part is that we would need to have special treatment for RIs in smop_lowlevel
(but maybe that's not that bad)
pmurias you mean in lowlevel.sm0p 14:39
ruoso yes
because the refcounting information is in *data
pmurias we would have a SMOP__Object_refcounted or a better named equivalent
ruoso pmurias, yes... probably declared in smop_lowlevel.h 14:40
but we would need to have
SMOP__Object_refcounted *and* SMOP__ResponderInterface_refcounted
pmurias and RI's and other object which use lowlevel would be subclasses of it
ruoso the problem is that moving data* out of SMOP__Object*
places the function callbacks of SMOP__ResponderInterface* in the address of the refcounting information of SMOP__Object_refcounted 14:41
thus SMOP__Object_refcounted is *not* binary compatible with SMOP__ResponderInterface_refcounted
pmurias yes
ruoso but SMOP__ResponderInterface is still binary compatible with SMOP__Object 14:42
so it's not a big deal
it's just a lot of work
to refactor
but it would be really nice
pmurias plus we might get rid of the data pointer altogether 14:43
ruoso yes yes
that's the cool part
the header of a SMOP__Object is simply one single pointer
it can't get any more opaque than that
pmurias what i meant that even SMOP__Object_refcounted wouldn't have it 14:44
ruoso it would have something else in its place
the SMOP_LOWLEVEL_INTERNAL struct 14:45
or a pointer to it
actually, it's cool that the members of the SMOP_LOWLEVEL_INTERNAL can be part of the "Default SMOP Object implementation"
and then we avoid an additional malloc
then we need to refactor almost everything 14:46
to replace SMOP__Object__BASE for SMOP__Object__RefCounted__BASE 14:47
on every object that is subject to lowlevel.sm0p refcounting
pmurias that's a simple s/// 14:48
;)
masak moritz_: yay! I won the Druid match against the inventor! 14:49
ruoso are you willing to take that refactor?
pmurias after i finish my p5 integration project 14:50
14:59 azawawi left 15:02 rindolf left
pmurias ruoso: did you update smopp5 to reflect the mainline, i don't really know how do it? 15:08
15:09 Grrrr left, Grrrr joined, araujo left, azawawi joined
ruoso pmurias, no, I didn't 15:10
mildew: $OUT.print("Hello from mildew!");
p6eval mildew: No output (you need to produce output to STDOUT)
15:15 araujo joined
pmurias don't know why it doesn't work 15:20
smop is properly compiled in the evalbot
ruoso: my git config looks like 15:21
[remote "blead"] url = git://perl5.git.perl.org/perl.git fetch = +refs/heads/*:refs/remotes/blead/*
ruoso what happens when you git pull blead? 15:22
15:24 Exodist joined
pmurias doing it now 15:25
it told me i didn't specifiy a branch 15:33
and it downloaded a lot of stuff
ruoso: if i git pull blead blead i get merge conflicts :( 15:39
now lots of stuff needs merging and i don't know how to undo the git pull blead blead 15:41
15:43 alester joined
pmurias git reset --hard HEAD worked 15:43
pmichaud what's the standard mechanism to get STD to produce a parse tree dump? 15:46
15:48 ejs joined 15:49 azawawi left
rakudo_svn r34579 | pmichaud++ | [rakudo]: spectest-progress.csv update: 264 files, 5802 passing, 141 failing 15:50
r34579 | pmichaud++ | Failure summary:
r34579 | pmichaud++ | S16-filehandles/io.rakudo aborted 57 test(s)
r34579 | pmichaud++ | S16-filehandles/io_in_for_loops.rakudo aborted 49 test(s)
r34579 | pmichaud++ | S16-filehandles/io_in_while_loops.t aborted 13 test(s)
r34579 | pmichaud++ | S16-io/basic-open.t aborted 9 test(s)
r34579 | pmichaud++ | S16-unfiled/slurp.rakudo aborted 9 test(s)
r34579 | pmichaud++ | integration/say-crash.t aborted 4 test(s)
15:51 hercynium joined 15:57 barney joined 16:11 stephens joined 16:12 eric256 joined
eric256 waves good morning 16:14
masak \o
eric256 man its hard trying to get back in gear 16:15
masak nod.
16:18 azawawi joined 16:20 vixey left 16:31 jhorwitz joined
pugs_svn r24679 | pmichaud++ | [t/spec]: Eliminate some "Redeclared variable" warnings in tests 16:32
TimToady pmichaud: to get a plain parse tree dump the output of STD->parsefile($file) 16:33
lambdabot TimToady: You have 2 new messages. '/msg lambdabot @messages' to read them.
TimToady to get something more ASTish, use viv, which autoloads action routines for reductions
decommuting from socal soon... 16:34
pmichaud TimToady: STD.pm shows two ways of parsing @( ... ) -- as a variable and as circumfix:sigil 16:38
ruoso points to two messages at p6-language ;)
pmichaud it seems to choose the circumfix:sigil form. When might it choose the variable one?
TimToady pmichaud: well, probably never... 16:39
16:39 vixey joined
TimToady ruoso: seems okay, though I guess I don't have enough caffiene to understand why we can't just make captures work that way by default 16:40
ruoso because they are in a $scalar 16:42
TimToady is think about *|$capture 16:45
ing
pmurias ruoso: doesn't a Scalar in item context return itself? 16:47
ruoso yes,
the problem is that when you have a signature binding, you force a context 16:48
pmurias ruoso: does it really?
ruoso yes,
foo(bar());
pmurias if i have a $capture $$capture returns the invocant
ruoso yes, that's the other isseue 16:52
moritz_ masak: congratulations! (re druid :-) 16:59
16:59 alanhaggai joined
pmurias moritz_: any idea's why the mildew evalbot doesn't work? 16:59
why can't the capture just return itself in item context?
lichtkind azawawi: hello had you took look at translation? 17:00
ruoso pmurias, because then "return" can't work as expected
moritz_ mildew: $*OUT.print("hi")
p6eval mildew: No output (you need to produce output to STDOUT)
17:01 azawawi_ joined
pmurias ruoso: example please 17:02
17:03 p6eval left
ruoso pmurias, the message i sent has an example 17:03
17:03 p6eval joined
moritz_ mildew: $*OUT.print("hi") 17:04
p6eval mildew: No output (you need to produce output to STDOUT)
moritz_ pmurias: I get a huge backtrace for each mildew command
pmurias: starting with Can't chdir to 'umas 002; ../../v6/mildew': No such file or directory 17:05
pmurias: moving the umask from line 55 to 56 should help, but I can't commit from the PC that I'm currently on 17:07
17:07 tuxdna left, p6eval left
moritz_ mildew: $*OUT.print("hi") 17:07
17:07 p6eval joined
moritz_ perl6: say 'sanity'; 17:08
p6eval elf 24679, pugs, rakudo 34583: OUTPUT«sanity␤»
masak sanity++
pmurias sanity is overrated ;)
masak karma sanity
@karma sanity
lambdabot sanity has a karma of 1
moritz_ ok, I changed that on the server, and now I don't get a bactrace anymore
perlbot, karma sanity
perlbot Karma for sanity: 6
masak pmurias: I wouldn't say so, no :)
pmurias moritz_: you mean from build-smop.sh?
moritz_ pmurias: no, from the evalbot 17:09
pmurias: on the terminal in which p6eval runs
afk &
pmurias build-smop.sh is outdated 17:10
@tell p6eval $OUT.print("hi") 17:12
lambdabot Consider it noted.
17:14 azawawi left
pmurias mildew: $OUT.print("hello world\n") 17:14
p6eval mildew: OUTPUT«hello world␤»
lambdabot p6eval: You have 1 new message. '/msg lambdabot @messages' to read it.
eric256 p6eval: $OUT.say("hi"); 17:15
pugs_svn r24680 | lwall++ | [S02] derivatives of * are Code, not Whatever 17:16
17:16 kisu_ is now known as kisu
eric256 perl6: $OUT.say("hi") 17:16
p6eval rakudo 34584: OUTPUT«Scope not found for PAST::Var '$OUT'␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
..elf 24679: OUTPUT«Global symbol "$OUT" requires explicit package name at (eval 115) line 3.␤ at ./elf_f line 3861␤»
..pugs: OUTPUT«hi␤»
pmurias eric256: $OUT.say is a hack a smop doesn't have multi methods yet so we don't have say 17:17
17:17 tomyan left
eric256 ohhh i was confused ;) lol i thought we might have $OUT and $IN ;) 17:17
17:18 tomyan joined 17:21 maerzhase joined
jnthn I think $*OUT.say should work, mind. :-) 17:23
17:23 cspencer joined
masak submits rakudobug 17:24
17:25 tomyan left 17:29 mberends joined
eric256 masak: re; github.com/masak/druid/commit/18ebc...a2e31c2544 i like your original implementation better ;) 17:33
cspencer good morning!
eric256 though i do wonder why you don't have a 2d array and a draw board function, then draw board would take the array and print it out 17:34
why do you "take my $line =" instead of just "take join ..." ?
masak eric256: you are aware that the "board" is 3-dimensional, right? :)
eric256: because I use the value twice.
17:35 azawawi joined
eric256 ohh i hmm... so how does storing it in a string solve the diminsion issue? i think i need to go read the whole source agian 17:35
lol
masak eric256: I like my original implementation better too :) but I'm looking to generalize to arbritary board sizes
eric256: I'm starting from an empty board, and "rendering" pieces on top of it
pmurias jnthn: having globals in mildew would also solve the issue, but globals are rather a low priority for me 17:36
eric256 masak: i'm gonna go reread your source ;) 17:37
ruoso jnthn, specially because I'm working to convince people we don't need globals ;)
we can use $+OUT instead ;)
17:40 azawawi_ left
ruoso I should implement $+OUT lookup soon 17:41
17:41 dukeleto joined
pmurias implementing module loading and some sort of a Prelude would be nice 17:42
ruoso we're close to that, actually 17:43
pmurias what do we need?
ruoso we need the module loader per se 17:44
pmurias i can do it 17:45
and?
ruoso Package.EXPORTALL 17:46
pmurias is Package.EXPORTALL hard? 17:50
ruoso: if there is a unused bit in sv_flags we could it to mark if there is a RI* pointer on the SV* 17:51
no that's a broken idea 17:52
ruoso pmurias, we don't need to.. the p5 interpreter can check if the SV is one of its own
the p5 interpreter can "know" a lot of internal RIs 17:53
17:54 rindolf joined
eric256 masak: on a side note i think merge can be greatly simplified ;) playing with something for that right now 17:55
masak eric256: cool.
eric256 is there a way to alias array elements in a for loop so they are editable? i.e for @A Z @B -> $a, $b { $a = $b }; ? 17:56
masak eric256: <-> 17:57
dunno if Rakudo has 'em yet
perl6: my @a = 1..3; for @a <-> $a { ++$a }; say @a.perl 18:00
p6eval pugs: OUTPUT«*** ␤ Unexpected ">"␤ at /tmp/yPaQBZr3GL line 1, column 24␤»
..rakudo 34586: OUTPUT«[2, 3, 4]␤»
..elf 24680: OUTPUT«Can't call method "flatten" without a package or object reference at (eval 123) line 4.␤ at ./elf_f line 3861␤»
eric256 oh wow
masak Rakudo++
eric256 even easier then
18:00 meteorjay left
masak eric256: are you planning to fork me on github? I'd very much like to be forked :) 18:02
eric256 rakudo: my @in = <ABCD>; my @new = "1#3 4"; for @in Z @new <-> $old, $new { given $new { when ' ' {$new = $old} } }; say @new; 18:03
p6eval rakudo 34586: OUTPUT«1#3 4␤»
masak eric256: nice. 18:04
eric256 rakudo: my @in = < A B C D E>; my @new = ( '1', ' ',3, '#', '5'); for @in Z @new <-> $old, $new { given $new { when ' ' {$new = $old} } }; say @new;
p6eval rakudo 34586: OUTPUT«Cannot assign to readonly variable.␤current instr.: 'die' pc 14740 (src/builtins/control.pir:204)␤»
eric256 hmmm its in there somewhere
but you can see how much simpler
i'll forkk and get it worked out
masak eric256++ 18:05
ruoso TimToady, what does *|$capture mean?
as I understand, |$capture means taking the entire capture that was sent to this invocation 18:06
what I proposed in the message to p6-l was \$capture in order to take that specific positional argument as a capture 18:07
so you can have several arguments, and one of them being a capture
as in 18:08
method dispatch($object, $identifier, \$capture)
or
method postcircumfix:<( )>(\$capture, :$cc)
unless I misunderstood |$capture 18:11
cspencer does the p6 metaobject provide a method of doing 'can' based on method signature? ie) $obj.^can("foo(Int, Str)") 18:12
eric256 given apparently makes it read only
or not. its something deeper 18:13
rakudo: my @a = <1 2 3 4 5 6>; my @b = (10..16); for @a Z @b <-> $a,$b { $a++ }; say @a;
p6eval rakudo 34586: OUTPUT«234567␤»
eric256 rakudo: my @a = <1 2 3 4 5 6>; my @b = (10..16); for @a Z @b <-> $a,$b { $a = $a +1 }; say @a;
p6eval rakudo 34586: OUTPUT«Cannot assign to readonly variable.␤current instr.: 'die' pc 14740 (src/builtins/control.pir:204)␤»
18:13 alanhaggai_ joined
eric256 rakudo: my @a = <1 2 3 4 5 6>; my @b = (10..16); for @a Z @b -> $a,$b { $a++ }; say @a; 18:13
p6eval rakudo 34586: OUTPUT«234567␤»
eric256 yea ++ is working regardless of anything else ;) how odd
masak submits rakudobug 18:14
ruoso cspencer, up to this point it is something like $obj.^can($identifier, $capture)
actually...
cspencer, up to this point it is something like $obj.^can($identifier, $capture?)
cspencer ruoso: is the capture object used to specifiy the signature?
ruoso no, it's a capture that you're trying to call the method with 18:15
cspencer is that detailed in the specs? 18:16
ruoso no...
there's no spec in the meta api yet
cspencer ah ok :)
ruoso except for some bits in S12
cspencer i'll fiddle around with it then, thank you :)
18:19 Ileg joined
Ileg hi 18:19
is there still support for cgi::irc? 18:20
literal try #perl, this channel is about the Perl 6 language
18:20 Ileg left
masak the fact that people often miss the '6' at the end of '#perl6' is promising for the eventual Perl 6 deployment. 18:21
18:26 Psyche^ joined 18:31 alanhaggai left
ruoso TimToady, taking an example from S06 18:35
sub foo(\$args) {...} 18:36
foo(1,2,3,:mice<blind>) {...}
would fail
because there are too many arguments
but otoh
sub foo(\$args, $other, $arg) {...} 18:37
foo(bar(),$other,$arg)
would delay the coercion on the return of bar()
or, if you want to pass a capture as-is 18:38
my $capture = \(1,2,3);
foo( (|$capture), $other, $arg);
or even 18:39
foo( (|(\(1,2,3)), $other, $arg);
but it's fairly pointless to use such a construct
using a plain list should work... 18:40
foo( (1,2,3), $other, $arg)
one very important side-effect 18:41
is that
foo( @x.grep{...}, 1,2,3) 18:42
can delay the context where [email@hidden.address] ... }' is used
and decide only later if it will be used as a list or as a slice
eric256 rakudo: ("abcdefg").split
p6eval rakudo 34587: OUTPUT«No applicable methods.␤␤current instr.: '_block14' pc 58 (EVAL_13:38)␤»
eric256 rakudo: ("abcdefg").split() 18:43
p6eval rakudo 34587: OUTPUT«No applicable methods.␤␤current instr.: '_block14' pc 58 (EVAL_13:38)␤»
eric256 rakudo: ("abcdefg").split('')
p6eval rakudo 34587: RESULT«["a", "b", "c", "d", "e", "f", "g"]»
18:43 Patterner left, Psyche^ is now known as Patterner
masak jnthn: why does ("abcdefgh").split say no applicable methods? is it looking for a method, and if so, which one? 18:44
ruoso masak, it's looking for a candidate in multi split
but there's no candidate with 0 args
masak ruoso: ah, ok. 18:45
ruoso TimToady, the reasoning behind this is that if you send a capture to be bound to a signature like :($capture), it already implies item context... so the '\' operator works by enclosing the capture into a scalar, while the '|' operator removes the enclosing scalar 18:50
18:54 dwhipp joined
cspencer rakudo: say "A"-- 19:07
p6eval rakudo 34587: OUTPUT«Unable to set lvalue on PAST::Val node␤current instr.: 'parrot;PAST;Val;lvalue' pc 556 (src/PAST/Node.pir:161)␤»
cspencer rakudo: my $x = 'A'; $x--; say $x
p6eval rakudo 34587: OUTPUT«A␤»
masak cspencer: greetings. 19:08
cspencer masak: hey, how's it going? 19:09
19:09 dwhipp left
masak cspencer: very well, thank you. how's the :by() work going? 19:09
cspencer masak: probably done-ish today or tomorrow, i think?
masak nice. have you run it against my tests yet? 19:10
cspencer nope, the :by($n) syntax (as in 1..10:by(2)) hasn't been added in yet 19:11
masak oh, right.
cspencer i've just been creating the ranges as Range.new(:by(2), ...)
masak maybe I should make a crack at adding the syntax.
cspencer that would be great
i've not fiddled much with the parser and the grammar, and wouldn't quite know where to start
masak I'm a wee bit busy, but might be able to squeeze some in grammar hacking somewhere. we'll see. 19:12
cspencer great, let me know how it turns out if you find time :)
masak cspencer: I should put together a small tutorial on how to add syntax to Rakudo :) might be good for others as well. 19:13
cspencer i would definitely appreciate that :)
masak anyway, looking forward to the Range.new(:by(2)) patch. 19:14
19:14 smtms joined
cspencer thanks, i'll keep you posted :) 19:14
masak excellent. 19:15
19:15 ejs left 19:24 cspencer left
pmurias ruoso: how would adding an RI* pointer to SV* help with integrating the runloops? 19:24
ruoso because to SMOP, everything will just be a SMOP__Object*
and that's all 19:25
19:28 alanhaggai__ joined 19:36 Jedai joined 19:37 cspencer joined 19:39 sri_kraih joined, pmurias left 19:43 alanhaggai_ left, barney left 19:53 sri_kraih left 19:57 tomyan joined
eric256 masak i sent you a pull request for druid ;) 19:57
first of many hopefully
later i plan on working on some of those scripting games problems and getting them in perl6-examples 19:58
19:58 tomyan left
masak eric256: reviewing. 19:59
wow! new merge sub looks much sexier.
azawawi eric256: what kind of game problems r u going to work on? ;-) 20:00
20:01 Ehtyar left
masak eric256: applied, thanks! 20:05
20:06 aindilis` left
Matt-W idly pokes through the bug tracker looking for something suitable to try and fix 20:07
20:15 mtkatwork joined
masak Matt-W: #58524, p'haps. 20:15
20:16 justatheory left
masak #60234 might be fun too. 20:16
possibly #60636, though that might be jnthn's turf. 20:17
#61070. 20:19
20:26 alanhaggai__ left
ruoso later & 20:28
20:28 ruoso left
rakudo_svn r34591 | chromatic++ | [Rakudo] Fixed IO open modes; all spectests pass again. 20:30
cspencer so if i've got a range like: 'Z'..'A':by(-1) and i'm iterating over it down towards 'A' 20:34
eventually i'll end up with the range 'A'..'A':by(-1)
masak sounds reasonable. 20:35
cspencer but since 'A'-- is also 'A', that range will never terminate
masak I disagree.
cspencer ok
masak since the start and end points are the same, it's trivially one element.
cspencer that's true
masak so we're saved. 20:36
however, in the case ('AA'..'Z'):by(1), we're screwed
oops, :by(-1)
cspencer because things aren't supposed to wrap to a string of a different length? 20:37
masak cspencer: because 'Z'++ eq 'AA', but 'AA'-- eq 'AA' 20:38
cspencer right.
so what to do in that case, i wonder?
masak wonders if it'd possible to write a compiler heuristic that emitted a warning for ranges which do not look infinite, but are.
cspencer: well, Perl 6 _does_ support infinite ranges... 20:39
cspencer it's true, it does :)
masak cspencer: so I suggest you just keep iterating forever.
cspencer that sounds easy enough to this guy
back in a bit, lunch time 20:40
20:56 rindolf left
cspencer back 21:00
ok, so if i've got a range like: 1..1:by(-1) 21:02
masak rakudo: say (1..1).elems
p6eval rakudo 34591: OUTPUT«1␤»
cspencer the first iteration will return 1, and the range will be updated to 0..1:by(-1)
masak rakudo: for 1..1 { say "OH HAI" }
p6eval rakudo 34591: OUTPUT«sh: ./parrot: Permission denied␤»
cspencer and the iteration will stop, on account of no further elements
masak cspencer: right.
cspencer so on a similar note, after you've done an iteration on 'A'..'A':by(-1), what would the range look like afterwards? 21:03
pmichaud ...iteration does not modify the range.
rakudo; my $r = 1..1; for $r { say $_ }; say $r.perl; 21:04
rakudo: my $r = 1..5; for $r { say $_ }; say $r.perl;
p6eval rakudo 34591: OUTPUT«1␤2␤3␤4␤5␤1..5␤»
pmichaud (arguably this is wrong -- perhaps it should be for =$r { ... } ) 21:05
still, the point remains that iterating a range doesn't modify it.
cspencer so the from and to aren't modified then 21:06
masak pmichaud: I disagree. `for =$r` would iterate over one element. 21:07
cspencer a 1..5 range is always a 1..5 range?
masak cspencer: well, unless you shift or pop it :)
pmichaud masak: I think that `for $r` should iterate over one element.
Matt-W masak: thanks for the suggestions. I'm not sure which would be easiest, but I'll have a poke around and see if I can come up with some idea how to tackle them
masak pmichaud: well, maybe that too.
pmichaud same as: my $r = (1,2,3); for $r { ... } would iterate over one element
masak Matt-W: best of luck.
cspencer ah, ok, i was actually shifting in my case, so yes :)
masak pmichaud: aye. 21:08
Matt-W masak: it is my ambition to actually *need* a commit bit :)
masak Matt-W: :)
Matt-W: people often prove their worth by sending useful patches. just a tip. :)
cspencer i've got my terminology all mixed up here 21:09
Matt-W masak: Well give me a while and I might manage to write one :)
cspencer what about: $r = 'A'..'A'; $r.shift; $r.perl.say
masak perl6: $r = 'A'..'A'; $r.shift; $r.perl.say
p6eval rakudo 34591: OUTPUT«Scope not found for PAST::Var '$r'␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
..pugs: OUTPUT«*** ␤ Unexpected " ="␤ expecting "::"␤ Variable "$r" requires predeclaration or explicit package name␤ at /tmp/MLvO8GG0fu line 1, column 3␤»
..elf 24680: OUTPUT«Global symbol "$r" requires explicit package name at (eval 117) line 3.␤Global symbol "$r" requires explicit package name at (eval 117) line 4.␤Global symbol "$r" requires explicit package name at (eval 117) line 5.␤ at ./elf_f line 3861␤»
masak perl6: my $r = 'A'..'A'; $r.shift; $r.perl.say 21:10
p6eval pugs: OUTPUT«\\()␤»
..rakudo 34591: OUTPUT«"B".."A"␤»
..elf 24680: OUTPUT«Can't call method "shift" without a package or object reference at (eval 117) line 4.␤ at ./elf_f line 3861␤»
masak I'd guess that behavior might be unspecced.
cspencer what's elf, out of curiosity?
masak cspencer: an implementation of Perl 6 in Perl 6. 21:11
cspencer ah, ok
Matt-W That must be fun
masak perl.net.au/wiki/Elf
it seems to be a lot of fun, actually.
you should check out the source code.
I'm positively amazed that a Perl 6 compiler of that magnitude already exists, without receiving more attention, even within the Perl 6 community. 21:12
Matt-W I should, I've been trying to write something that uses rules so I suspect it might have interesting things for me to look at
21:12 lisppaste3 joined
masak Matt-W: svn.pugscode.org/pugs/misc/elf/ 21:13
21:13 lichtkind left
cspencer for the behavior of .shift on the 'A'..'A' range, is that something worth posting to p6-lang? 21:22
masak thinks so
pmichaud I think the existing spec is quite clear on that point, though. 21:25
cspencer ok
pmichaud .shift on 'A'..'A' causes the range to become 'B'..'A'
cspencer and for a shift on 'A'..'A':by(-1) ?
masak 'A'..'B', presumably 21:26
cspencer which would be a null range
pmichaud that would be correct. 21:27
cspencer ok, that makes sense
pmichaud (null range)
because 'A'..'A' has one element in it, and after shifting it should be null.
cspencer right, ok, that makes perfect sense
thanks for letting me talk out loud here :)
or maybe that's think out loud 21:28
masak both :)
pmichaud was thinking "write out loud", but that's a Sharpie(TM) service mark :-) 21:32
21:33 icwiener joined
masak time to pretend to sleep. 21:34
g'night, people.
21:34 masak left
cspencer masak: good night! 21:35
Matt-W I'm very confused now
infix:~~ calls a method called 'ACCEPTS' on one of its arguments, giving the other as a parameter. Bool's 'ACCEPTS' seems to just return self, which is doing my head in. 21:37
pmichaud $x ~~ True is always true 21:39
$x ~~ False is always false
from S03:
$_ X Type of Match Implied Match if (given $_) 21:40
====== ===== ===================== ===================
Any Bool simple truth X
to smart match on $x being true or false, one would use .true, I think. 21:41
pugs_svn r24681 | schwarzer++ | [docs/Perl6/Spec] typo: use lower case letters 21:42
21:42 Matt-W_ joined
pugs_svn r24682 | schwarzer++ | [docs/Perl6/Spec] typos and minor style changes 21:43
21:47 Matt-W_ left, smtms left, p6eval left, vixey left, jhorwitz left, Exodist left, simcop2387 left, dmpk2k left, Matt-W left, cspencer left 21:48 iblechbot left, elmex left, charsbar_ left, eric256 left, araujo left, Grrrr left, DemoFreak left, xuser_ left, lambdabot left, apeiron left, eternaleye left, meppl left, rhr_ left, lisppaste3 left, dukeleto left, stephens left, xinming left, hercynium left, bsdperl left, kisu left, szbalint left, jnthn left, nnunley left, hcchien left, broquaint left, SamB left, dalek left 21:49 Tene joined, Matt-W joined, lisppaste3 joined, cspencer joined, smtms joined, dukeleto joined, p6eval joined, vixey joined, jhorwitz joined, eric256 joined, stephens joined, hercynium joined, Exodist joined, araujo joined, Grrrr joined, apeiron joined, eternaleye joined, DemoFreak joined, meppl joined, iblechbot joined, elmex joined, xinming joined, dmpk2k joined, charsbar_ joined, xuser_ joined, bsdperl joined, simcop2387 joined, rhr_ joined, lambdabot joined, drbean_ joined, yahooooo joined, Khisanth joined, zev joined, r0bby joined, pasteling joined, literal joined, c1sung joined, edenc joined, nothingmuch joined, Eevee joined, StephenPollei joined, ilbot2 joined, Trey joined, allbery_b joined, mj41 joined, go|dfish joined, awwaiid joined, irc.freenode.net sets mode: +o Tene, japhb joined, kidd joined, kcwu joined, cls_bsd joined, wolverian joined, Lunchy joined, buubot joined, Guest16015 joined, baest joined, silug joined, IRSeekBot joined, ingy joined, spinclad joined, jjore joined, szabgab joined, sunnavy joined, mtve joined, integral joined 21:50 jnthn joined, kisu joined, dalek joined, SamB joined, broquaint joined, hcchien joined, nnunley joined, szbalint joined, irc.freenode.net sets mode: +o jnthn 21:51 mtkatwork left, AzureStone joined 22:03 Whiteknight joined 22:06 knewt_ joined, azawawi left 22:10 knewt_ is now known as knewt 22:12 azawawi joined
Matt-W [matthew@asymptote perl6]$ pwd 22:14
/home/matthew/Compiling/parrot/languages/perl6
[matthew@asymptote perl6]$ ./perl6 -e "open 'perl6.pir'"
Invalid mode for file open
^ not good
pmichaud Matt-W: try svn up -- a fix was just added a short while ago. 22:25
Matt-W shall do 22:26
pmichaud: excellent ,seems to be working now 22:30
22:35 vixey left 22:38 revdiablo joined
revdiablo Is there any documentation about 'yield' and 'produce' besides the draft S17? 22:40
22:47 alexi5 joined
alexi5 hello 22:47
22:54 knewt left
eric256 if (A..A).shift = (B..A) then would (A..A).pop = (A..B)?? 22:55
rakudo: my $r = ('A'..'A'); $r.perl.say; $r.pop; $r.perl.say;
p6eval rakudo 34594: OUTPUT«"A".."A"␤"A".."A"␤»
eric256 rakudo: my $r = ('A'..'A'); $r.perl.say; $r.shift; $r.perl.say;
p6eval rakudo 34594: OUTPUT«"A".."A"␤"B".."A"␤»
eric256 definitly not intuitive if thats the speced behaviour 22:56
rakudo: my $r = ('A'..'A'); $r.perl.say; $r.shift; $r.perl.say; $r.pop; $r.perl.say
p6eval rakudo 34594: OUTPUT«"A".."A"␤"B".."A"␤"B".."A"␤»
22:58 hercynium left 23:17 icwiener left
revdiablo From my reading of S17, C<produce> sounds like it does the same thing as C<yield>, but I have a feeling I'm just misunderstanding the description... anybody further details I can read about? 23:18
23:21 mberends left 23:22 ruoso joined
ruoso Hello! 23:23
23:29 Limbic_Region joined, lambdabot left
revdiablo Limbic_Region: Hey, long time no see 23:30
Limbic_Region salutations
23:32 lambdabot joined 23:33 iblechbot left
revdiablo Limbic_Region: You wouldn't happen to know about yield and produce, would ya? =) 23:33
Limbic_Region yield from coroutines? 23:34
or from a gather/take?
revdiablo From coroutines. I know what yield normally does, but S17 makes it sound like produce does the same thing, hence my confusion.
Limbic_Region I haven't been keeping up with the synopses - let me go read 23:35
23:35 cognominal joined
Limbic_Region revdiablo: um, S17 is not on dev.perl.org/perl6 23:35
revdiablo It's still a draft, so really rough. It's probably a tragic combination of rough docs and my comic misunderstanding. 23:36
feather.perl6.nl/syn/
Limbic_Region yeah, should ping TimToady about the draft Ss in the pugs repository since I am pretty sure that is now their current "official" home 23:37
23:39 cognominal left, cognominal joined
revdiablo A friend of mine asked how Perl 6 will do coroutines, and I tried to quote relevant docs. Instead I got confused and scared 23:39
Limbic_Region revdiablo: every time I have brought up coroutines to TimToady - he has said that gather/take is more powerful and the way to go 23:40
revdiablo: that synopsis really needs some clearing up if it is to be "approved" 23:41
revdiablo The gather/take docs left me a little confused, too 23:42
I feel like I haven't been paying enough attention for the past 2 years
Limbic_Region at least that long for me too 23:43
revdiablo I should pick an arbtirary time and start using rakudo instead of perl. 23:45
Limbic_Region revdiablo: I am asking pmichaud over on #parrot about the synopses
pmichaud here. 23:48
Limbic_Region oh
pmichaud many of the documents in the repo are still draft and not really "official"
S17 is one of those.
revdiablo I wonder how much trouble it would be to change my nick after all these years
pmichaud but yes, gather/take is really the Perl 6 answer at the moment 23:49
Limbic_Region pmichaud: well, if you scroll up - you can see why re-organizing the Synopses like the test suite could be a good idea for curious onlookers
revdiablo tried to explain something and got all confused
revdiablo Sadly, that happens more and more these days ;) 23:50
pmichaud L-R: that's a very interesting idea
Limbic_Region and it would be nice if one of the gather/take examples were a translation of typical coroutine for those trying to figure out how it is an improvement
pmichaud perhaps an easier approach is to take a typical coroutine and express it with gather/take 23:51
revdiablo I remember how gather/take works, but it seems a little clunky as a replacement for the simple uses of yield
Limbic_Region pmichaud - that's what I meant
pmichaud revdiablo: actually, I find it a bit more elegant.
revdiablo: if you can point me to a (relatively simple) yield example, I think I can come up with the gather/take equivalent. 23:52
Limbic_Region can do that 23:53
revdiablo I can translate/simplify an example from some python code I wrote the other day
Limbic_Region www.sidhe.org/~dan/blog/archives/000178.html
pmichaud python code would be fine, too. 23:54
revdiablo Here's one in perl5ish syntax: sub files { my $self = shift; for my $row ($self->{sth}->fetchall_arrayref) { yield $row->[0]; } } 23:55
pmichaud okay, I'll get a little close, then.
Limbic_Region right - in p5 speak you would create an iterator using a closure
yield makes that easier 23:56
revdiablo Yeah, it's really convenient for the simple case
pmichaud my $a = gather { for =$sth -> $row { take $row[0]; } };
where =$sth is whatever you're wanting to iterate over 23:57
revdiablo pmichaud: Then the consumer can iterate on $a?
pmichaud revdiablo: yes.
revdiablo Ok, that works. =) 23:58
pmichaud of course, it can also be
my $a = gather { for =$sth -> $row { sub_that_invokes_take($row); } };
i.e., 'take' doesn't have to be lexically in the gather block 23:59
it can be in some other sub that is dynamically called from gather