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.
pugs_svn r22501 | putter++ | [elf_h] Fixed is() trait ordering. Tweaks. 01:06
pugs_svn r22502 | putter++ | [elfish/on_sbcl] Additional prelude. macro renaming. can(), .<> . CL elf did -e 'say 3'. 01:13
wayland76 Question: say I'm writing a function, and I have a variable called $test that is type Pair. How do I access the key and the value? 02:02
$test.value()?
[particle]2 yes 02:03
wayland76 yay :) 02:03
[particle] $test.kv(), .key(), .value() 02:06
wayland76 That's what I'm after :) I needed some way to represent an XPath-like axis while doing a tree search :) 02:07
literal what's a subset? 02:21
ah, never mind 02:22
rakudo_svn r31606 | particle++ | [rakudo] implement 'package' package declarator 02:23
pmurias what's the state of the test functions in the Prelude proposal? 09:50
wayland76 Anyone know which synopsis I need to read if I want to make my *own* iterator? 09:52
masak wayland76: sorry, no. have you tried grep'ing the synopses? 09:53
pmurias ack is better than grep 10:11
wayland76: gather maybe be what you are looking for 10:12
masak pmurias: aye. I just wish I could prevent it from spewing ANSI colour codes, so I could use it from within Emacs
pmurias use --nocolor or RTFM ;) 10:13
masak good idea :)
masak makes the appropriate alias 10:14
masak pugs: say map {[*] map { $_ * 10 }, [1..$_]}, [1..5] 10:23
p6eval pugs: OUTPUT[50␤]
masak that's gotta be wrong 10:24
pmurias pugs: map { $_ * 10 }, [1..$_] 10:37
p6eval pugs: RESULT[(0.0,)]
pmurias pugs: map { $_ * 10 }, [1..1]
p6eval pugs: RESULT[(10.0,)]
masak I don't know if I agree with the first one, but certainly the second 10:38
pmurias pugs: map { $_ * 10 }, [1..5] 10:40
p6eval pugs: RESULT[(50.0,)]
pmurias masak: pugs is correct in the example you give 10:41
masak please explain. 10:42
pmurias an array in numeric context turns into the number of elements 10:45
map {[*] map { $_ * 10 }, [1..$_]}, [1..5] turn into 10:46
[*] map { $_ * 10} [1..5]
which turns into [*]([1..5] * 10) which turns into [*] 50 which turns into 50 10:47
masak what forces numeric context?
pmurias [1..$foo] and $foo * 10
masak is there a version of my expression that does what I mean? 10:52
wayland76 >which ack 11:20
-bash: type: ack: not found
Yeah, I've been looking at gather/take 11:21
But I want to iteratively walk through a tree...
So I need the gather in one function, and the take in another
Can I do that?
masak wayland76: search.cpan.org/~petdance/ack-1.86/ack 11:22
wayland76: yes, you can
lambdabot Title: ack - grep-like text finder - search.cpan.org
masak wayland76: a gather is dynamic
this works in Rakudo already, since take works using exceptions
wayland76 Ok, great :) 11:23
wayland76 Yeah, I see ack (thanks). But I'm planning to upgrade my Fedora as soon as the new one comes out, so I won't install it now :). But I've bookmarked it. 11:26
ruoso wayland76, iterators are under-specced at the moment... 11:33
wayland76 ok 11:34
Are iterators a role I should implement?
Should I be overriding particular functions on that role?
ruoso it probably will be a role, yes... 11:35
the method is prefix:<=>
which 'fail' at the end of the iterator 11:36
if you're implementing a plain iterator that always return one item at a time, no matter in which context, that's fairly simple...
there are other iterators that support slice context, like the iterator returned by map
they are a bit more complex 11:37
wayland76 Ok, that gives me some idea of what to do. 11:40
Now I just wish for power loops :)
ruoso you might want to look at the smop map wiki
wiki page, I mena
*mean 11:41
wayland76 IKWYM
ruoso wayland76, "power loops"?
wayland76 (I know what you mean :) )
Yeah, it's a sort of iteration/recursion thing. I'll find a page. I read about it somewhere esoteric :)
www.nondot.org/sabre/Mirrored/AdvPr...nkel02.pdf 11:46
Near the end
I have the book of that PDF, btw :)
lambdabot Title: cache:www.nondot.org/sabre/Mirrored/AdvPr...nkel02.pdf - Goog ..., tinyurl.com/y39uw5
pmurias wayland76: any way gather/take is the thing you should propably use, you should mind about Iterator role if you want to something internalish 11:47
wayland76 pmurias: Agreed. Maybe I'll just code the thing now; it should be easy enough to include the iterator role later if I want :) 11:49
pmurias ruoso: hi
ruoso hi pmurias 11:50
wayland76 (oh... hi everyone :) ) 11:54
Which part in particular of the SMOP page, now that I've found it?
ruoso pmurias, I've been thinking at which point we should stop extending libsmop and start to think about effective runtime...
www.perlfoundation.org/perl6/index....p_operator
pmurias effective runtime being? 11:55
ruoso pmurias, ok, that didn't sound right...
pmurias, smop is a library so far... we need an actual interpreter
one that defines $*IN and $*OUT, for instance 11:56
that knows how to look for libraries, that kind of stuff
pmurias so what we need is some sort of executable which can read in m0ld and perl6 and run it? 11:58
ruoso yeah... exactly... 11:59
it might even be written in Perl 6
;)
and compiled down by mildew
wayland76 ruoso: Wow, thanks :) 12:00
ruoso wayland76, you might want to look at the map and grep tests in the smop repo 12:01
wayland76, smop is the first to support lazyness in map and grep
wayland76 Cool. I think I just want to use the Iterator role for now
I'm attempting operator overloading, so it's not like my code compiles now (at least in rakudo, which is what I'm using at the moment) 12:02
ruoso wayland76, but remember that is not part of the specs (at least not yet)
wayland76, and it's certainly not rakudo-oriented... 12:03
wayland76 Sure, I agree. But the logic of the situation presumably demands a similar solution 12:03
so if I write my code, I'll probably only have to change the function names and things :)
ruoso brb & 12:04
pmurias ruoso: is it decided yet how binding works? 12:07
pugs_svn r22503 | pmurias++ | [smop] added a test for the pure prototype HOW in p6 to be compiled by mildew 12:12
r22503 | pmurias++ | (dosn't run or compile yet)
r22504 | pmurias++ | [STD] added $foo.^!bar() 12:18
wayland76 Is there an easy way to do have it so that when I call a function on an object, it run somthing like { ancestor setup code } {descendant code } {ancestor cleanup code} ? 13:34
If $axes is an iterator, and $usetest is a Matcher function, and I've defined a prefix:<=> on my iterator, can I do this... 13:43
@nodes ==> map { =$axes ==> grep $usetest; };
lambdabot Unknown command, try @list
wayland76 ?
masak wayland76: lambdabot does that. it knows lambdabot commands look like '@' at start-of-line, but it doesn't know Perl 6 13:54
masak wayland76: your first question sounds like ordinary delegation to base class methods -- no problem, in other words 13:55
I'm very doubtful about your code example, even though I think I know what you're getting at. can't tell if what's within the braces is legal Perl 6 or not
rakudo_svn r31622 | pmichaud++ | [rakudo]: spectest-progress.csv update: 200 files, 4437 passing tests 15:56
pugs_svn r22505 | pmurias++ | [smop] stylistic fix - removed silly mold temporary variables 16:10
rakudo_svn r31625 | julianalbo++ | add a missing pop_eh in perl6 initialization 19:42
azawawi @seen pmichaud 20:15
lambdabot pmichaud is in #perl6. I last heard pmichaud speak 1d 6h 6m 4s ago.
azawawi @seen moritz_ 20:33
lambdabot moritz_ is in #perl6. I last heard moritz_ speak 1d 10h 42m 3s ago.
pugs_svn r22506 | lwall++ | [STD] unbreak $obj.^foo 21:08
pmurias TimToady: sorry for the bug, i should think twice before comitting 21:20
TimToady np, I still believe in forgiveness over permission 21:24
pmurias i should run make test before comitting? 21:25
TimToady well, that takes a while, and testt takes even longer, and I do it periodically anyway
and it was pretty obvious where to look for the bug. :) 21:26
so either way is fine
I'd much rather have progress, regardless of whether it's 1 step at a time or 3-steps-forward-2-steps-back at a time. :) 21:28
masak TimToady++ 21:29