Camelia, the Perl 6 bug

IRC log for #perl6, 2010-04-27

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

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

All times shown according to UTC.

Time Nick Message
00:03 ruoso joined #perl6
00:06 dalek left #perl6
00:06 dalek joined #perl6
00:07 diakopter hrm
00:09 sorear Caught up.
00:09 diakopter dalek: die
00:09 sorear jnthn: the getprop/setprop is my least favorite bit too.
00:11 jnthn sorear: The namespace that $lsm.get_namespace($mod); returns is actually a clone, IIRC?
00:11 jnthn O rnot?
00:11 jnthn If so, why not just create EXPORT::DEFAULT namespace within it?
00:11 jnthn Same for any other tags.
00:12 jnthn And then get_imports can just work "as normal".
00:12 sorear It's not a clone; I'm not quite sure it can be
00:12 jnthn Maybe we can still get away with sticking an EXPORT::DEFAULT namespace in there anyway.
00:12 diakopter jnthn: would you do a test commit to rakudo plz?  I may have broken dalek
00:12 jnthn diakopter: I'm spectesting something right now, it's nearly done. :-)
00:12 sorear if we did that, then it would be harder to set variables in other HLLs
00:12 sorear maybe
00:13 jnthn BTW, the other thing is that I added :lang back for eval
00:13 jnthn So now we can use Blizkost to eval p5 code too. :-)
00:13 sorear TimToady: I see $! at the same semantic level as $self->meta->get_meta_instance->set_slot($self, 'foo') or however you spell that these days
00:14 sorear TimToady: which makes me suspect that $! should never be used outside of the the implementations of accessor generators
00:14 sorear TimToady: i.e. within attribute traits
00:14 jnthn sorear: Anyway, we don't really need a solution Right Now, but I think the setprop/getprop has to go away.
00:15 sorear jnthn: We're in agreement there.
00:15 TimToady submethods need $! access
00:15 jnthn sorear: OK, great. :-)
00:16 Spreadsheet_ left #perl6
00:20 diakopter jnthn: did you commit?
00:20 jnthn 3000 more spectests to go... :-)
00:21 jnthn (well, I committed...but not pushed yet ;-))
00:21 diakopter you and your newfangled abstraction layers
00:21 jnthn Sorry for being such a git.
00:22 * sorear reads the "tweaked" patch
00:23 diakopter "git 'er done" "git on over here".  sorry.  no puns appear.
00:25 jnthn dalek had better git the push I just did onto the channel!
00:25 diakopter hm.
00:27 diakopter sigh.
00:28 jnthn Я хочу мою карму!
00:28 jnthn :-(
00:28 jnthn sorear: eval patch pushed too
00:28 jnthn sorear++ # Blizkost
00:28 dalek rakudo: a27dfef | jonathan++ | src/cheats/eval.pm:
00:28 dalek rakudo: Re-enable :lang attribute for eval. Now we can eval Perl 5 code using Blizkost.
00:28 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/a​27dfef72d206279d00511d2fc441d51ed7287c8
00:29 diakopter O_O
00:29 dalek left #perl6
00:29 dalek joined #perl6
00:29 diakopter ok
00:30 jnthn yay!
00:33 gruotr joined #perl6
00:33 diakopter hm.
00:33 diakopter I guess it checks every 5 min or something
00:35 jnthn It did lose one patch.
00:35 jnthn (one before that one)
00:35 diakopter hm.
00:35 diakopter <-- fail
00:36 sorear diakopter: How does dalek decide what to announce where?
00:36 diakopter I'm relearning that.
00:36 diakopter I used to know, since I created it originally, then Infinoid redid it 10x over, 10x better
00:37 * sorear is mostly wondering why blizkost shows up over in #parrot instead of here
00:37 colomon TimToady: It seemed inconsistent to me that for min and max, we had operator versions, and methods on Range and "list", but for minmax we had only the operator versions and the method on Range.  And since I went looking for it for the code I was writing, and it was easily implemented and potentially more efficient than calling min and max individually, I just went ahead and added it.
00:37 sorear rakudobuild memory usage seems to have regressed a bit
00:38 sorear was 261MB peak immediately after chromatic++'s COW leakhunt
00:38 envi^home joined #perl6
00:38 sorear now peaking around 340MB
00:40 diakopter dalek: eat worms
00:42 jnthn Will be interesting to see how the immutable strings stuff helps.
00:42 TimToady colomon: I think minmax should always *return* a Range
00:43 TimToady the list form of return is a fossil from before Ranges behaved like intervals
00:44 colomon TimToady: oh, I see
00:44 colomon all the different versions of minmax?
00:44 TimToady the specs haven't caught up with this view though
00:44 TimToady yes, probably
00:44 TimToady and Range.minmax is meaningless in that view
00:45 TimToady or a no-op
00:45 TimToady should probably be renamed to Range.endpoints or some such, if it's to return a list
00:46 TimToady or just skip it, and make people write Range.min, Range.max if they mean that
00:46 * jnthn -> sleep, o/
00:46 TimToady ciao
00:47 colomon TimToady: here's the code I actually used it in:
00:47 colomon our method bounds() {
00:47 colomon my ($u-min, $u-max) = @.points.map({$_[0]}).minmax(&[<=>]);
00:47 colomon my ($v-min, $v-max) = @.points.map({$_[1]}).minmax(&[<=>]);
00:47 colomon ($u-min .. $u-max, $v-min .. $v-max);
00:47 colomon }
00:47 araujo any pug developer around here?
00:47 diakopter sorear: I finally found the stdout logs for dalek
00:47 colomon So obviously returning a Range fits vert well with that usage.
00:47 araujo pugs*
00:48 dalek left #perl6
00:48 dalek joined #perl6
00:48 TimToady .bounds would be better than .endpoints
00:48 colomon :)
00:49 colomon so minmax operator and "list".minmax return Ranges, Range.minmax renamed to Range.bounds.
00:49 colomon That sounds pretty reasonable to me.
00:51 TimToady and [minmax] returns a range of the minnest min and maxest max of all the ranges in its list, assuming singletons are $n..$n
00:51 dalek left #perl6
00:51 dalek joined #perl6
00:51 diakopter finally.
00:51 colomon TimToady: that's a different variation on [minmax] than I was thinking.
00:51 TimToady there's another interpretation of minmax that returns a minimum range plus a maximum range
00:52 colomon maybe unify: minmax Range, other returns Range expanded to contain other.  minmax Range, Range returns the smallest Range that contains both Ranges.
00:53 colomon (those are meant to be infix operators.)
00:53 TimToady yes, I think of minmax as just finding a single range that encompasses everything
00:53 colomon and (infix proper this time) Any minmax Any returns the Range from the min of the two to the max of the two.
00:53 TimToady not finding the range of mins pluse the range of maxes
00:54 colomon I love that, that would fit very well with the code I was writing.
00:54 colomon Shall I tackle the code / tests and see how that works in practice?
00:54 TimToady mostly I think of minmax as just replacing a bunch of parallel min= and max= ops
00:54 TimToady sure
00:55 TimToady finding the max minimum and the min maximum sound more like some kind of "outer" thing
00:57 TimToady I don't know whether the term 'minmax' will mean that to some large subset of people though
00:57 colomon I do wonder if there might be a better name.
00:57 colomon rakudo: say 4 minmax 10
00:57 p6eval rakudo a27dfe: OUTPUT«Confused at line 11, near "say 4 minm"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
00:57 colomon looks like we never actually implemented the minmax operator.
00:58 TimToady well, it's been wandering in and out of spec periodically
00:58 sorear araujo: there are no pugs developers
00:58 sorear afaik
00:59 colomon I think auderyt++ still pokes away at it now and then.
00:59 colomon but I haven't seen her around here in a while.
00:59 sorear auderyt--
00:59 diakopter she keeps it updated for the latest ghc & latest hackage
00:59 sorear audreyt++
01:00 colomon sorear++
01:00 spinclad though not in the pugs repository now
01:00 diakopter right, on github
01:00 diakopter now that mildew no longer has a pugs dependency, I'm sorely tempted to clean up pugscode...
01:00 sorear How so?
01:00 dalek csmeta: r197 | diakopter++ | trunk/Sprixel/Main.cs:
01:00 dalek csmeta: [perlesque] still another test commit. :)
01:00 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=197
01:01 diakopter oh goody
01:01 TimToady someone should write a Haskell emitter for viv :)
01:01 spinclad :)
01:01 * diakopter jabs TimToady with a functor
01:01 sorear I'm looking forward to when we can rewrite viv in perl6
01:01 spinclad compile grammars into Parsec
01:02 colomon TimToady: Hmmm.... should normal min and max also get the enhanced functionality to handle Range arguments?  That is, 4 min 2..20 would return 2
01:02 TimToady yes, I suspect you're right
01:02 colomon right now it would just be a fatal error, I think.
01:04 TimToady [minmax] @list should behave like ([min] @list)..([max] @list), and vice versa, probably
01:04 colomon oh, except how that works wrt Ordering is kind of funky.
01:05 TimToady yes, well, we still haven't really defined ordering across differing types...
01:05 sorear rakudo: use Cwd :from<perl5>; say getcwd;
01:05 p6eval rakudo a27dfe: OUTPUT«Unable to find module 'Cwd'.␤current instr.: 'perl6;Perl6;Module;Loader;need' pc 35780 (src/gen/role_pm.pir:932)␤»
01:06 sorear rakudo: use Cwd:from<perl5>; say getcwd;
01:06 p6eval rakudo a27dfe: OUTPUT«"load_language" couldn't find a compiler module for the language 'perl5'␤current instr.: 'perl6;Perl6;Module;Loader;need_foreign' pc 36574 (src/gen/locator_pm.pir:213)␤»
01:08 TimToady one could argue that (0..5) <= (3..7) and (0..3) < (5..7); one could also argue that overlapping intervals are not comparable
01:09 TimToady dunno how the mathematicians think of it
01:09 TimToady there's a lot of any vs all semantics going on there
01:10 colomon I think I've implemented a straightforward version of minmax which will do the right thing on "normal" orderings.  I'm going to give that a try.
01:11 Infinoid left #perl6
01:11 dalek csmeta: r198 | diakopter++ | trunk/Sprixel/ (2 files):
01:11 dalek csmeta: [perlesque] another fix for "else".  sigh.
01:11 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=198
01:11 diakopter http://wonder-tonic.com/geocitiesizer/content.​php?theme=2&amp;music=8&amp;url=www.perl6.org
01:12 ash_ joined #perl6
01:13 lisppaste3 joined #perl6
01:16 diakopter TimToady: if a goto LABEL occurs in a block that assigns a new dynamic var where LABEL occurs outside that block, does the value of that dynamic var get "reverted"?
01:19 colomon rakudo: given 10 { when Num { say "Num!"; }; when Int { say "Int!"; }; };
01:19 p6eval rakudo a27dfe: OUTPUT«Num!␤»
01:20 colomon rakudo: given 10 { when Numb { say "Num!"; }; when Int { say "Int!"; }; };
01:20 p6eval rakudo a27dfe: OUTPUT«Missing block at line 11, near "; when Int"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
01:20 colomon I see.
01:21 dalek csmeta: r199 | diakopter++ | trunk/Sprixel/src/Perlesque/ControlFlow.cs:
01:21 dalek csmeta: fix "unless" also.
01:21 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=199
01:22 * colomon just unpacked his copy of Perl 6 Essentials, from 2003.  Perhaps they were getting a little ahead of themselves there.  :)
01:22 diakopter if anyone wants an explanation of any of the files in src/Perlesque, I would be glad to explain the structure & the API "DSL" I created for it.
01:39 xinming joined #perl6
01:48 am0c joined #perl6
01:58 Psyche^ joined #perl6
01:59 takadonet1 joined #perl6
01:59 takadonet1 hey everyone
01:59 sorear Hello!
02:00 takadonet1 sorear: how are you sir?
02:01 sorear Quite happy
02:01 takadonet1 good to hear!
02:07 snarkyboojum joined #perl6
02:08 snarkyboojum g'day #perl6 hackers
02:09 snarkyboojum how many perl6-ish gsoc projects were given the green light?
02:10 colomon 2
02:10 colomon plus 5 or 6 parrot projects
02:10 agentzh joined #perl6
02:10 snarkyboojum colomon: ah - how many perl 6 applications were there roughly?
02:10 colomon I don't know.
02:11 colomon I only heard about those two ahead of time.
02:11 agentzh snarkyboojum: we're going to run perl 6 in production *grin*
02:11 snarkyboojum agentzh: w00t
02:12 agentzh snarkyboojum: once we've got ngx_lua for nginx and a perlito with a lua emitter ;)
02:12 snarkyboojum the mind boggles! :)
02:12 * agentzh is currently working hard on ngx_lua with his teammates.
02:13 sorear snarkyboojum: use :from<perl5> works now.
02:13 snarkyboojum sorear: I saw something in the backlog! sorear++!
02:14 snarkyboojum sorear: I'm going to have to give it a go today (and work out how to get it going)
02:15 JimmyZ joined #perl6
02:16 araujo sorear, ooh i see .. mm
02:31 orafu joined #perl6
02:35 JimmyZ rakudo: use Cwd:from<perl5>; say getcwd;
02:36 p6eval rakudo a27dfe: OUTPUT«"load_language" couldn't find a compiler module for the language 'perl5'␤current instr.: 'perl6;Perl6;Module;Loader;need_foreign' pc 36574 (src/gen/locator_pm.pir:213)␤»
02:36 diakopter I think blizkost is not installed on p6eval
02:36 JimmyZ Yeah
02:45 patspam joined #perl6
02:53 colomon rakudo: my @a = 3..10; say min(@a)
02:53 p6eval rakudo a27dfe: OUTPUT«Inf␤»
02:55 diakopter pugs: my @a = 3..10; say min(@a)
02:55 p6eval pugs: OUTPUT«3␤»
02:56 colomon neither one of those is supposed to work, so far as I know.
02:58 ash_ why not?
02:59 colomon min takes an ordering function as its first argument
03:00 colomon If you don't need the ordering function you can just call [min] @a
03:00 ash_ rakudo: my @a = 3..6; say [min] @a;
03:00 p6eval rakudo a27dfe: OUTPUT«3␤»
03:01 colomon rakudo: my @a = 3..6; say @a.min
03:01 p6eval rakudo a27dfe: OUTPUT«3␤»
03:01 colomon many options.
03:02 TimToady diakopter: yes, it gets reverted, as if an exception had been thrown to the outer block, and the goto happened there.
03:03 diakopter k I figured
03:03 TimToady dynamic vars merely pick the current lexpad and its OUTERs
03:03 diakopter easy enough to compile-time know how many to pop
03:03 diakopter for perlesque, at least
03:03 diakopter since perlesque dynamics will never fall back to..
03:04 diakopter something or other in the spec; I forget
03:07 sorear TimToady: How does the rule that imports clone the namespace interact with cases where the foreign language modifies its own namespace?
03:07 sorear Most importantly, Perl5 AUTOLOAD
03:15 ash_ joined #perl6
03:22 snarkyboojum do I need a separately installed parrot to build blizkost?
03:23 sorear snarkyboojum: probably not, but that configuration is untested
03:23 snarkyboojum I pointed it at a parrot_config that came bundled with --gen-parrot when building rakudo, and it created a makefile ok, but make died
03:25 bbkr joined #perl6
03:27 snarkyboojum when building with perl 5.12, I get further with perl 5.10 - but different error
03:27 sorear How did make die?
03:28 snarkyboojum with 5.10 or 5.12?
03:29 sorear Both, ideally
03:29 snarkyboojum sorear: this is for 5.10 http://gist.github.com/380285
03:31 bradb joined #perl6
03:32 snarkyboojum sorear: this is for 5.12 http://gist.github.com/380288
03:32 sorear snarkyboojum: count yourself lucky
03:32 sorear you appear to have compiled Perl 5.10 and Parrot with different C compilers
03:32 snarkyboojum yay
03:32 snarkyboojum for 5.10 quite possible
03:32 snarkyboojum how about 5.12?
03:32 sorear Blizkost uses the union of the compile options in order to keep both perl.h and parrot.h happy
03:33 sorear using two different compilers is usually a recipe for segfaults anyway
03:33 snarkyboojum my 5.10 is a mac os x special
03:33 sorear that it failed at compile time is a blessing
03:33 snarkyboojum 5.12 was compiled by me
03:33 sorear I should add a configure-time check for Perl's $Config{cc} being the same as Parrot's
03:34 snarkyboojum sorear: how about the 5.12 error? :)
03:34 sorear Looking now
03:35 sorear You need to configure Perl with -Dusemultiplicity for blizkost to work properly
03:35 snarkyboojum oic
03:35 sorear that allows multiple Perl interpreters in one process
03:36 sorear eventually, there's going to be some kind of logic to make P5Interpreter sometimes a singleton
03:36 sorear -Dusethreads implies -Dusemultiplicity, so most generic system perls (which don't disable any feature, let alone one as ooh-ahh as multithreading) will have it
03:37 snarkyboojum I tend not to compile with -Dusethreads
03:37 snarkyboojum (or is that on by default :))
03:38 sorear It's off by default.
03:38 snarkyboojum right
03:38 sorear In 5.12, -Duseshrplib is also off by default
03:38 snarkyboojum will have bash at rebuilding with usemultiplicity
03:38 sorear This could be a problem :p
03:39 sorear well
03:39 sorear it may work
03:39 snarkyboojum so run with useshrplib as well?
03:39 sorear depending on your OS
03:39 sorear yes
03:39 snarkyboojum okydoke
03:39 sorear useshrplib enables the generation of libperl.so
03:39 molaf joined #perl6
03:39 sorear /dyld/dll
03:39 sorear by default 5.12 perls are statically linked
03:40 sorear Blizkost must be built as a dynamic library
03:40 sorear using static libraries to build dynamic libraries is problematic, since on many systems code going into dynamic libraries needs special compile flags
03:41 snarkyboojum goodie - will see how it goes
03:41 sorear on linux/i386 trying to use non-dynamic-library objects in a dynamic library will cost you a significant amount of load time and runtime memory usage
03:41 sorear there's probably at least one platform where it won't work at all
03:41 charsbar joined #perl6
03:56 lue joined #perl6
03:56 lue hello!
03:58 ash_ hi
03:58 snarkyboojum lue o/
04:01 sorear snarkyboojum: Have you installed the new 5.12 yet?
04:01 snarkyboojum sorear: having several goes
04:01 sorear what do you mean by that?
04:02 snarkyboojum well I've built it several times, but not convinced I've managed to get it configured correctly :)
04:02 sorear could you hold off for a moment on the install, I mean
04:04 snarkyboojum already installed it, but no cigar
04:04 sorear ah
04:04 sorear well
04:05 sorear that's as well
04:10 meppl joined #perl6
04:24 snarkyboojum joined #perl6
04:25 JimmyZ Could somebody install Bliskost on p6eval?
04:29 sorear snarkyboojum: Could you test the latest blizkost patch?
04:30 sorear I've added some fail-earlier code to the config system
04:30 snarkyboojum sorear: cool - will give it a run
04:30 sorear to catch the two errors you found, and one that bit me earlier
04:33 snarkyboojum sorear: catches that fact that my perl isn't configured to allow the runtime creation of new intepreters..
04:33 snarkyboojum s/that fact/the fact/
04:38 cognominal rakudo:  sub a { say "hi" } if 0; a()
04:38 p6eval rakudo a27dfe: OUTPUT«hi␤»
04:38 sorear std: sub a {say "hi" } if 0
04:38 p6eval std 30480: OUTPUT«ok 00:01 109m␤»
04:39 sorear phenny: tell TimToady : Should sub foo { } accept statement modifiers?  std accepts it
04:39 phenny sorear: I'll pass that on when TimToady is around.
04:39 eternaleye std: my $foo if 0
04:39 p6eval std 30480: OUTPUT«ok 00:01 107m␤»
04:39 eternaleye ... I thought that was ruled illegal
04:44 sorear my $foo if 0 has a clearly defined parse and semantics
04:44 sorear it does nothing at runtime and is equivalent in every way to my $foo
04:45 sorear old versions of perl5 got this wrong and produced what is now 'state' behavior as a bug
04:51 eternaleye sorear: There was a discussion about it being banned in p6, I'll see if I can dig it up
04:51 eternaleye A good long while ago
04:57 dalek csmeta: r200 | diakopter++ | trunk/Sprixel/ (50 files):
04:57 dalek csmeta: compilation of stage1 to disk! :)  the emitted perlesque.exe is the new way to
04:57 dalek csmeta: run perlesque after Sprixel.exe is run.  Yes, had to make nearly everything in
04:57 dalek csmeta: RunSharp public. :)
04:57 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=200
04:58 sorear .exe or @exe@?
04:59 yakeworld joined #perl6
05:00 chhxu joined #perl6
05:01 diakopter .exe
05:01 ReiniUrban joined #perl6
05:01 diakopter sigh.
05:01 diakopter it's lightning fast to load/run in .NET
05:01 sorear .exe is a universal in the CLR?
05:01 diakopter (windows)
05:02 diakopter yeah, but the extension actually doesn't matter
05:02 diakopter it can be anything
05:02 diakopter on linux, I mean
05:02 diakopter mono <filename>
05:02 diakopter ... but slow to load/run in mono
05:03 eternaleye sorear: nvm, I was misremembering
05:04 eternaleye sorear: I seem to be going senile in my advanced age </deadpan>
05:04 * eternaleye is 19
05:04 sorear so I'm not the only one.
05:05 diakopter sigh.
05:05 * diakopter is 29
05:06 eternaleye What I was remembering turned out to be a specific mention of C<my $foo if 0>'s old behavior in the synopses back in '06
05:06 diakopter apparently, mono JITting a routine that's 120,000 CIL instructions long takes a long time.
05:07 sorear Can't break it up?
05:07 diakopter and in fact, trying to mono --aot it (ahead of time compile to machine code) causes yet another SIGABRT in mono.
05:07 dalek csmeta: r201 | diakopter++ | trunk/Sprixel/Main.cs:
05:07 dalek csmeta: remove debug
05:07 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=201
05:08 sorear mono crashes?  ick
05:08 diakopter it crashes on the aot
05:08 diakopter not on the normal JIT run
05:09 diakopter sigh.
05:09 gruotr joined #perl6
05:09 diakopter ah well, it's still very fast to run the code that *perlesque* compiles
05:09 diakopter that's all that really matters for bootstrapping
05:10 sorear Who generated the oversize function?
05:10 diakopter meeeeee
05:10 diakopter it's the parser/compiler. all in one routine.
05:10 diakopter :|||||
05:10 diakopter 'nite 'afk
05:10 sorear 'nite
05:10 lue afk as well
05:11 kaare joined #perl6
05:14 sorear rakudo: class A { }; ::A.new
05:14 p6eval rakudo a27dfe:  ( no output )
05:14 sorear I wonder if that's supposed to be legal.
05:15 sorear And, if so, why ::A and A are completely different.
05:17 sorear Moreover
05:17 sorear The PDD-21 namespace interface is specced in terms of *methods*
05:18 sorear which is... problematic to reconcile
05:18 spinclad ::A means some class that we're giving the name A to; no idea where rakudo thinks it shows up from.  so yes, legal syntactically i'd say, and of liminal semantic at best.
05:19 spinclad sub-liminal even
05:20 spinclad (*marginal may be a more current term)
05:21 TimToady a leading :: means to presume the type exists; if it doesn't, it'll fail at run time
05:21 phenny TimToady: 04:39Z <sorear> tell TimToady : Should sub foo { } accept statement modifiers?  std accepts it
05:21 TimToady in a declaration, it has the added meaning of capturing a new type 'en passant'
05:22 TimToady so ::A is much the same as ::("A") as a symbolic reference
05:22 TimToady (when used on an rvalue)
05:22 spinclad so... find 'A' (just to the left, here), and call it 'A' ?
05:23 TimToady and sure, 'sub foo { }' is just a term, though it doesn't make a lot of sense to put a statement modifier on something that has no run-time effect
05:23 sorear Ah, I thought sub foo { } was a non-expression statement
05:23 TimToady "assume A is a valid type name even though you may not know it at compile time"
05:24 TimToady no, that's C, and p5 in spots
05:24 spinclad rakudo: class A { }; ::A.new; say 'alive'
05:24 p6eval rakudo a27dfe: OUTPUT«alive␤»
05:24 TimToady rakudo: ::A.new; class A { }; say 'alive'
05:24 p6eval rakudo a27dfe: OUTPUT«alive␤»
05:24 sorear So, if A exists in the package or is in lexical scope at compile time, A and ::A are exactly the same?
05:24 spinclad rakudo: ::A.new; say 'alive'
05:24 TimToady a forward declaration of sorts
05:25 p6eval rakudo a27dfe: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤current instr.: 'perl6;Failure;new' pc 15013 (src/builtins/Seq.pir:115)␤»
05:25 spinclad rakudo: ::A.new; say 'alive'; class A
05:25 p6eval rakudo a27dfe: OUTPUT«Malformed package declaration at line 11, near ""␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
05:25 spinclad rakudo: ::A.new; say 'alive'; class A {}
05:25 p6eval rakudo a27dfe: OUTPUT«alive␤»
05:26 spinclad ic
05:26 TimToady rakudo: say ::A.new.WHAT; class A { }; say 'alive'
05:26 p6eval rakudo a27dfe: OUTPUT«A()␤alive␤»
05:26 sorear TimToady: Is the conflict between ::A as a namespace with a meta API and ::A as a class protoobject with methods real or an artefact of the Parrot embedding?
05:26 TimToady std: my $x = sub foo { };
05:26 p6eval std 30480: OUTPUT«ok 00:01 110m␤»
05:27 TimToady seems like an artifact to me
05:27 sorear rakudo: module A { }; ::A.add_sub('&foo', sub() { say "hi" }); A::foo
05:27 p6eval rakudo a27dfe: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
05:27 TimToady the namespace/package is actually A::, not A
05:27 JimmyZ rakudo: my $x = sub { say 'hi'} if 0; $x();
05:27 p6eval rakudo a27dfe: OUTPUT«invoke() not implemented in class 'Any'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
05:27 sorear rakudo: module A { }; ::A.add_sub('&foo', sub() { say "hi" };); A::foo
05:28 p6eval rakudo a27dfe: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
05:28 sorear what
05:28 JimmyZ rakudo: my $x = -> { say 'hi'} if 0; $x();
05:28 p6eval rakudo a27dfe: OUTPUT«invoke() not implemented in class 'Any'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
05:28 sorear I put a ; after }
05:28 sorear what else do I need to do?
05:28 JimmyZ rakudo: my $x = -> { say 'hi'}; $x();
05:28 p6eval rakudo a27dfe: OUTPUT«hi␤»
05:28 sorear TimToady: Do namespaces have a meta API in Perl 6?
05:29 TimToady no, they're just packages/hashes
05:29 TimToady parrot has historically confused those concepts because of p5 history
05:29 araujo q:x{ls ~/}.say # is this supposed to work yet in rakudo?
05:29 TimToady and we're still trying to detangle code from packages
05:30 araujo I get it working without the ':'
05:30 sorear what was the syntax error in my last rakudo line?
05:30 spinclad sorear: no ; after } there, those are arguments...  no idea of why earlier
05:31 sorear rakudo: class Foo { our $x = 2; }; say ::Foo::<$x>;
05:31 p6eval rakudo a27dfe: OUTPUT«Method 'postcircumfix:<{ }>' not found for invocant of class ''␤current instr.: '!postcircumfix:<{ }>' pc 13978 (src/builtins/Code.pir:39)␤»
05:31 spinclad sub () ?
05:31 sorear rakudo: class Foo { our $x = 2; }; say ::Foo<$x>;
05:31 p6eval rakudo a27dfe: OUTPUT«Method 'postcircumfix:<{ }>' not found for invocant of class ''␤current instr.: '!postcircumfix:<{ }>' pc 13978 (src/builtins/Code.pir:39)␤»
05:31 spinclad sub() calls the sub 'sub'
05:31 sorear rakudo: class Foo { our $x = 2; }; say (Foo)<$x>;
05:31 p6eval rakudo a27dfe: OUTPUT«Method 'postcircumfix:<{ }>' not found for invocant of class ''␤current instr.: '!postcircumfix:<{ }>' pc 13978 (src/builtins/Code.pir:39)␤»
05:31 spinclad rakudo: module A { }; ::A.add_sub('&foo', sub () { say "hi" }); A::foo
05:31 p6eval rakudo a27dfe: OUTPUT«Invalid type 84 in add_sub()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
05:31 sorear rakudo: class Foo { our $x = 2; }; say Foo::<$x>;
05:31 p6eval rakudo a27dfe: OUTPUT«Could not find sub &Foo␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
05:32 TimToady subs don't really belong in packages mostly, since we're doing almost everything with lexical scopes or metaclasses now
05:33 TimToady all function dispatches look only in the lexical scopes, unless the name is package qualified
05:34 TimToady in p5 both functions and methods go in the package; in p6 *neither* of them do, by default
05:34 TimToady globals are bad for concurrency and magical action at a distance
05:35 TimToady sorear: rakduo doesn't really understand Foo:: notation yet
05:35 TimToady rakudo even
05:35 sorear my $x = 'CALLER'; say $::($x)::foo;  # Does this work?
05:36 * sorear leans towards no
05:36 TimToady std: my $x = 'CALLER'; say $::($x)::foo;  # Does this work?
05:36 p6eval std 30480: OUTPUT«ok 00:01 110m␤»
05:36 TimToady well, it parses :)
05:36 sorear yes
05:36 TimToady why shouldn't it work?
05:36 sorear but it could be accessing an outer dynamic scope
05:36 spinclad rakudo: my $x = 'CALLER'; say $::($x)::foo;  # Does this work?
05:36 sorear or it could be accessing a package
05:36 p6eval rakudo a27dfe: OUTPUT«Indirect name lookups not yet implemented at line 11, near "::foo;  # "␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
05:36 sorear I lean towards "a package"
05:37 TimToady yes, but we have no clue what we'll get in $x, so we have to be prepared to deal with it
05:37 sorear the magic $CALLER::x notation feels like it should be static to me
05:37 sorear a grammatical feature
05:37 TimToady well, it can't be bound at compile time in any case
05:37 sorear not a function of name lookup
05:37 TimToady why can't we do name lookups at run time?
05:37 TimToady if you write something pessimal, then it runs slow, is all
05:38 TimToady probably disables tail-call optimization to use ::() too
05:39 TimToady or explicit CALLER
05:39 TimToady or DYNAMIC::
05:39 TimToady well, maybe that's okay
05:39 sorear Exactly
05:39 sorear Why should ::() disable TCO
05:39 TimToady because it's like eval, and you shouldn't use it :)
05:40 TimToady eval might call CALLER too...
05:40 TimToady or CALLER::CALLER::...
05:41 TimToady generally you shouldn't be using symbolic links when hard links would do
05:41 sorear What about say($argument)?
05:41 TimToady what about it?
05:41 sorear $argument might have overloaded stringification which uses CALLER::CALLER::
05:42 sorear wait, ignore me, I just reversed my rhetorical direction in mid-argument
05:42 TimToady :)
05:43 spinclad ( night, all  o/ )  &
05:43 TimToady \o
05:44 meppl good night, spinclad
05:47 am0c__ joined #perl6
05:53 quester_ joined #perl6
05:56 jonasbn joined #perl6
06:00 araujo rakudo: my @arr = 1, 3, 4, 5; q:a{element: @arr[2]}.say
06:00 p6eval rakudo a27dfe: OUTPUT«Colons may not be used to delimit quoting constructs at line 11, near ":a{element"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
06:01 TimToady araujo: rakudo's quoting constructs are hardwired and don't have the flexibility that is specced
06:01 TimToady std: my @arr = 1, 3, 4, 5; q:a{element: @arr[2]}.say
06:01 p6eval std 30480: OUTPUT«ok 00:01 111m␤»
06:02 araujo TimToady, I see..
06:02 TimToady std goes as far as to generate a new slang and parse with that
06:02 TimToady rakudo doesn't yet
06:02 TimToady std: my @arr = 1, 3, 4, 5; q:a{element: $nonesuch @arr[2]}.say
06:02 p6eval std 30480: OUTPUT«ok 00:01 109m␤»
06:02 TimToady std: my @arr = 1, 3, 4, 5; q:a{element: @arr[$nonesuch]}.say
06:02 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $nonesuch is not predeclared at /tmp/Xcqi1INzMw line 1:␤------> [32m 1, 3, 4, 5; q:a{element: @arr[$nonesuch[33m⏏[31m]}.say[0m␤Check failed␤FAILED 00:01 109m␤»
06:03 TimToady std: my @arr = 1, 3, 4, 5; q:a:s{element: $nonesuch @arr[2]}.say
06:03 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $nonesuch is not predeclared at /tmp/y1f2710HS4 line 1:␤------> [32mr = 1, 3, 4, 5; q:a:s{element: $nonesuch[33m⏏[31m @arr[2]}.say[0m␤Check failed␤FAILED 00:01 109m␤»
06:04 TimToady but there are a very large number of possible slangs involved
06:04 araujo I see now :P
06:04 TimToady so we generate them lazily on demand
06:07 uniejo joined #perl6
06:09 sorear TimToady: Is it possible to quote a package name component and put weird characters in it?  Can package name components contain :: if quoted?
06:10 TimToady ::($x) will reparse $x for embedded ::, but PACKAGE::{$x} will not, and just use $x as a lookup key
06:10 sorear I see.
06:10 TimToady different abstraction layers, again
06:10 REPLeffect joined #perl6
06:11 sorear TimToady: Are there any plans to support general grammar mangling from user code?  e.g. ingy's { use Inline 'C'; int x = 10; int y = 1; while (x--) { y *= x } }
06:11 TimToady certainly, that's why STD parses using slangs
06:12 TimToady all languages are just dialects of Perl 6
06:12 TimToady :)
06:13 sorear Has the mechanism for doing so been specced yet, or is it a complier-specific thing?
06:14 TimToady STD has a couple ways of switching languages at the grammar or p6 levels, but doesn't implement 'augment slang' at a user-level yet
06:15 TimToady nor does it have true macros yet
06:15 TimToady since that would involve executing code
06:15 TimToady and STD still just fakes it
06:15 TimToady so we don't do anything with an "is parsed" trait yet
06:16 TimToady but when we get it, "is parsed" doesn't care whether it's switching to a different subrule in the same grammar, or to an entirely different grammar
06:17 TimToady it's not even clear what "same grammar" means anymore, since even STD is a braid of many different slangs
06:17 TimToady the exact language you're parsing at any point depends on the exact pedigree of declarations before that
06:18 TimToady which (hopefully) we've kept entirely lexically scoped
06:18 TimToady and sane
06:18 sorear There seems to be little in the spec on the notion of exporting slangs.
06:18 TimToady well, any time you export a macro, you're kinda doing that
06:18 sorear The spec explains how to change the grammar to C for a lexical block, but not how to reuse that between many blocks
06:19 TimToady well, in essence, it's the same process as using the same slang for parsing, say, all double-quoted strings
06:19 TimToady you just have to have a named slang, and way of calling :lang($dialect) at some point in the match
06:20 TimToady it's just the common ones that are kept in %*LANG, like MAIN, Regex,
06:20 TimToady Q, etc.
06:20 sorear What's the relationship between %*LANG and %?LANG ?
06:21 TimToady in fact, STD derives Q:qq every time you use double quotes
06:21 TimToady one is the compiler's view, and the other is the user's view
06:21 TimToady dynamic variables in the parse look lexically scoped to the user
06:22 sorear To a very loose approximation, then, $?FOO === BEGIN { $*FOO }
06:22 TimToady something that's contextual in the parser, if it's remembered till run-time, becomes a constant
06:22 riffraff joined #perl6
06:22 TimToady yes
06:22 TimToady and I think there's even some code in there to look for $*FOO in the compiler if $?FOO is unrecognized
06:23 TimToady so, as a bad example, you might have the current line number stored in $*LINE, but $?LINE is the actual line number snapshotted
06:23 TimToady since that can't change at run time
06:24 TimToady (we don't actually do it with a $*LINE variable)
06:26 TimToady as a real example, $*CURPKG is the pointer the currently-being-parsed package, which is dynamic in the recursive descent parser
06:26 TimToady but
06:26 TimToady std: $?CURPKG
06:26 p6eval std 30480: OUTPUT«ok 00:01 107m␤»
06:26 TimToady std: $?CURFOO
06:26 p6eval std 30480: OUTPUT«Potential difficulties:␤  Unrecognized variable: $?CURFOO at /tmp/FZsvImWd0s line 1:␤------> [32m$?CURFOO[33m⏏[31m<EOL>[0m␤ok 00:01 107m␤»
06:27 TimToady that one might be hardwired though
06:27 TimToady std: $?SCOPE
06:27 p6eval std 30480: OUTPUT«ok 00:01 107m␤»
06:27 TimToady pretty sure that one is just copying the current value of $*SCOPE
06:28 viklund joined #perl6
06:29 sorear rakudo: my %x = :a(2);  say Q:PIR { $P234 = find_lex "%x"; %r = $P234["a"] }
06:29 p6eval rakudo a27dfe: OUTPUT«error:imcc:syntax error, unexpected ';', expecting '\n' (';')␤     in file 'EVAL_1' line 73␤Null PMC access in type()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
06:30 sorear rakudo: my %x = :a(2);  say Q:PIR { $P234 = find_lex "%x"␤ %r = $P234["a"] }
06:30 p6eval rakudo a27dfe: OUTPUT«get_pmc_keyed() not implemented in class ''␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
06:31 TimToady hmm, actually it's $?PACKAGE that is currently hardwired to be the same as $?CURPKG
06:32 sorear rakudo: $A::x = 0;  say pir::typeof__SP(A::)
06:32 p6eval rakudo a27dfe: OUTPUT«Null PMC access in getprop()␤current instr.: '&infix:<=>' pc 17050 (src/builtins/Junction.pir:224)␤»
06:32 sorear rakudo: $A::x := 0;  say pir::typeof__SP(A::)
06:32 p6eval rakudo a27dfe: OUTPUT«Null PMC access in can()␤current instr.: 'parrot;P6protoobject;ACCEPTS' pc -1 ((unknown file):-1)␤»
06:33 sorear rakudo: module A { our $x = 0; };  say pir::typeof__SP(A::)
06:33 p6eval rakudo a27dfe: OUTPUT«Could not find sub &A␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
06:33 sorear rakudo: module A { our $x = 0; };  say pir::typeof__SP(::A)
06:33 p6eval rakudo a27dfe: OUTPUT«NameSpace␤»
06:33 TimToady don't think rakudo knows the postfix :: to translate type name to name space yet
06:34 sorear so in real Perl 6, A (the protoobject) and A:: (the hash) are non-identified?
06:34 TimToady rakudo: module A { our $x = 0; };  say pir::typeof__SP(A)
06:34 p6eval rakudo a27dfe: OUTPUT«NameSpace␤»
06:34 TimToady correct
06:34 TimToady for one thing, the hash is defined
06:35 TimToady and the type object isn't
06:35 TimToady rakudo: module A { our $x = 0; };  say pir::typeof__SP(%A::)
06:36 p6eval rakudo a27dfe: OUTPUT«Null PMC access in name()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
06:36 TimToady rakudo: module A { our $x = 0; };  say pir::typeof__SP(%A)
06:36 p6eval rakudo a27dfe: OUTPUT«Symbol '%A' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
06:37 TimToady yeah, don't think they've got any way of detangling those yet
06:37 moritz_ good morning
06:37 TimToady rakudo: module A { our $x = 0; };  say A.defined
06:37 p6eval rakudo a27dfe: OUTPUT«Method 'defined' not found for non-object␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
06:37 JimmyZ \o
06:37 viklund good morning
06:39 XaeroOne joined #perl6
06:41 sorear If I'm writing PIR code for Rakudo, how do I decide whether it goes in builtins/, glue/, or cheats/ ?
06:41 moritz_ is it a builtin?
06:41 sorear what's a builtin?
06:42 sorear it has special syntax, does that qualify it?
06:42 moritz_ a function that's called at run time
06:42 moritz_ (indepenent of syntax)
06:42 moritz_ bbl
06:42 sorear All of our pir code is functions called at run time
06:42 TimToady moritz_: (still backlogging to Saturday) there's no p5=> anymore; it can be added by the p5-to-p6 translator if wanted
06:43 TimToady as a macro
06:45 sorear specifically, I'm implementing a super magic tied namespace
06:45 sorear that will be visible as FOREIGN
06:46 sorear so you can do FOREIGN::perl5::MainWindow.new
06:49 TimToady use p5:from<perl5 ::> or some such should just alias p5:: to be the top of p5's global space, methinks
06:50 sorear nice trick, but I think it only works with foreign languages that use hierarchal modules?
06:50 TimToady well, every use can do an alias
06:50 TimToady :from<> contains the foreign name
06:51 sorear 3 things happen in the foreign binding process
06:51 sorear the module $name is loaded
06:51 sorear the alias $aname is installed to package $name
06:51 sorear the imports occur
06:51 sorear there's a trap here though
06:52 sorear modules and packages have a slight difference
06:52 sorear what if I want to access a package for which no corresponding module exists?
06:52 XaeroOne joined #perl6
06:52 sorear when more than one package is defined in a file
06:52 sorear CPAN.pm and Tk do this :/
06:53 TimToady well, that's part of why we split out need vs import
06:53 TimToady need fetches the file, import imports from already loaded packages
06:53 sorear the alias is installed at need time
06:53 TimToady or from modules already defined in the current file
06:53 sorear not import
06:54 TimToady well, we can have more aliases if we need 'em
06:54 * TimToady waves hands vaguely
06:55 TimToady at some point it's all BEGINish code and we can set whatever conventions we like
06:56 sorear Where do we get the aliases, though?
06:56 sorear Do we split need apart into need and alias?
06:56 sorear Also, it feels a bit odd that normal modules can be accessed anywhere, anytime
06:56 sorear While foreign ones require the moral equivalent of an 'our
06:56 sorear '
06:57 TimToady well, we have a hierarchical namespace, and as you say, the foreign code might not
06:58 TimToady but pretty much all module names get aliases, even our own
06:58 TimToady since the full name of a module includes version and auth
06:59 TimToady so if you say Foo::Bar there's still an alias from Foo to Foo:ver<1.2>:auth<SOMEONE>
06:59 TimToady and in a different lexical scope, Foo:: might be aliased to a different longname
06:59 scottamatot joined #perl6
06:59 TimToady so it's not as hypocritical as you might think :)
06:59 sorear in Real Perl 6, is it an error to say Foo without getting an our for it first?
07:00 TimToady std: Foo; class Foo {}
07:00 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegally post-declared type:␤    'Foo' used at line 1␤Check failed␤FAILED 00:01 109m␤»
07:01 sorear std: { our class Foo {} }; Foo
07:01 p6eval std 30480: OUTPUT«ok 00:01 107m␤»
07:01 TimToady and "our" has very little to do with it, since imports are lexical by default
07:01 TimToady std: { my class Foo {} }; Foo
07:01 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ 'Foo' used at line 1␤Check failed␤FAILED 00:01 107m␤»
07:02 sorear std: { our class Foo:ver<1> {}; our class Foo:ver<2> {} }; Foo
07:02 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol 'GLOBAL::<Foo>' (from line 1) at /tmp/0l0Mcc9XsA line 1:␤------> [32mlass Foo:ver<1> {}; our class Foo:ver<2>[33m⏏[31m {} }; Foo[0m␤Check failed␤FAILED 00:01 107m␤»
07:02 TimToady std currently punts on versions
07:02 sorear supposing that it didn't, what would that last Foo do?
07:02 TimToady std: { use Foo; }; Foo
07:02 sorear arbitrarily pick a Foo from the universe?
07:02 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ 'Foo' used at line 1␤Potential difficulties:␤  Can't locate module Foo at /tmp/QuxdJBRP0Q line 1:␤------> [32m{ use Foo[33m⏏[31m; }; Foo[0m␤Check failed␤FAILED 00:01 107m␤»
07:02 TimToady std: use Foo;; Foo
07:02 p6eval std 30480: OUTPUT«Potential difficulties:␤  Can't locate module Foo at /tmp/YOyPawiAw3 line 1:␤------> [32muse Foo[33m⏏[31m;; Foo[0m␤ok 00:01 107m␤»
07:03 TimToady you see the Foo alias is 'my', not 'our'
07:03 TimToady yes, an unqualified name will wildcard
07:03 TimToady presumably much like p5 does today
07:03 TimToady default latest installed version
07:04 TimToady this is all spelled out in S11, except when it isn't
07:04 sorear the action-at-a-distanciness of this disturbs me.  slightly.
07:05 sorear what would a good syntax be, then, for generating an alias to a foreign namespace without importing or 'require'ing?
07:05 TimToady all is fair if you predeclare, and this includes declaring generic code that is in a slightly indeterminate language
07:06 TimToady on the p6 end, that's just a binding, but what returns something bindable may vary from language to language
07:06 sorear perhaps a bit more concreteness is in order
07:07 sorear I'm trying to get Tk working from Perl 6
07:07 TimToady but presumably Foo:from<language module version auth> can be a specific foreign name that you can :=
07:07 sorear when Tk.pm is loaded, it installs a MainWindow package
07:07 sorear use Tk:from<perl5>;
07:07 TimToady it's not necessary that only use/need know about :from
07:07 sorear # What do I do here to make MainWindow accessible?
07:07 sorear ...
07:07 sorear my $mw = MainWindow.new;
07:08 orafu joined #perl6
07:08 TimToady if Tk exports MainWindow by default, seems like it should happen automatically somehow
07:08 sorear there's no concept of exporting packages in Perl5, though
07:08 sorear they just land in the global namespace
07:09 TimToady if it uses the standard Exporter, we could jimmy that, maybe
07:09 sorear Exporter doesn't export packages, only stuff in packages
07:09 sorear the perl 5 namespace is flat
07:10 sorear one global namespace contains packages, which contain everything else
07:10 TimToady maybe we need a hook in at the typeglob assignment level
07:10 sorear *except that the global namespace is identified with main:: for some reason
07:10 TimToady yes, well, main:: is just a link back to the top, so main::main::main::main:: also works
07:11 sorear heh, never knew that
07:11 TimToady package walkers have to be careful of that :)
07:11 sorear if Tk is loaded, MainWindow exists and is visible in every scope
07:12 sorear 'use Tk' doesn't export MainWindow because it's already visible everywhere
07:12 bbkr_ joined #perl6
07:12 TimToady yes, p6 is much more circumspect about creating globals
07:13 TimToady core Perl will have virtually nothing in GLOBAL::
07:13 sorear and it all comes back to this.  a philosophy mismatch.
07:13 sorear if perl5 treats something as global, I initially thought I should expose the p5 global namespace somehow
07:13 TimToady well, I suppose a slow approach would be to do a diff of the p5 packages before and after the use...
07:14 iblechbot joined #perl6
07:14 TimToady or somehow we need to link any new packages made in p5's main:: into GLOBAL::
07:14 quester_ left #perl6
07:15 TimToady or make lexical links like a p6 package would expect
07:15 quester_ joined #perl6
07:15 sorear or expose p5's main:: somehow.  a GLOBAL:from<perl5>.  which is where I first came to FOREIGN
07:15 TimToady those couldn't go any higher than UNIT::
07:16 sorear lexical links?  so 'need' automatically aliases *every* p5 package?
07:16 TimToady yeah, but I'd make something shorter like p5::
07:16 TimToady I don't think need would alias everything
07:17 TimToady but at some point we need to let the p5 exporter run and think it's exporting to p5, then steal some of the links
07:17 TimToady if we alias anything extra, that is
07:17 sorear that's what I'm doing right now
07:17 sorear but it only works for things p5 exports
07:17 TimToady we don't use main:: in p6, so we could even alias that
07:18 sorear (there is a small technical problem here in that rakudo doesn't handle lexical namespaces particularly well)
07:18 TimToady or we could add to the search algorithm, if it doesn't find a name in lexical scopes, or GLOBAL, or PROCESS, then look in @*FOREIGN packages somehow
07:19 TimToady as long as the list is declared at BEGIN time, we can add more searching to package lookups
07:20 TimToady as far as I know, rakudo doesn't handle lexical namespaces at all yet...
07:20 TimToady but I'm talking about how it should end up
07:20 sorear ah
07:20 TimToady it's almost a CANDO from another language
07:21 sorear I like it
07:21 sorear that reminds me
07:21 TimToady perhaps GLOBAL::CANDO is an oracle that tracks what other language's globals are available
07:22 sorear S11 specs that namespaces are cloned
07:22 sorear doesn't that break CANDO?
07:22 sorear if an imported module defines a CANDO, which installs symbols for caching
07:22 REPLeffect joined #perl6
07:22 sorear but they aren't visible in the namespace clones?
07:22 TimToady well, CANDO was actually written before we moved everything to lexical scopes, so it nees some rethinking
07:22 TimToady *needs
07:24 TimToady which I can't do right now because my branes are leaking out my ears
07:26 TimToady at least I got my backlog caught up to Sat morning; more catching up tomorrow
07:26 TimToady zzz &
07:26 sorear sleep well
07:43 hejki joined #perl6
07:44 diakopter joined #perl6
08:05 Guest16851 Can someone tell me (or give a pointer) what's the state of DB integration in rakudo / parrot?
08:05 sorear you can use the Perl 5 DBI
08:06 Guest16851 OK? I see references to DBDI and some to DBI2. But no definitve guide.
08:06 sorear 1. There are a few "DBI but better" projects floating around (DBDI, DBI2, etc).  None is mature.
08:07 sorear 2. You can use the Perl 5 DBI, which is mature, but the binding layer is definitely NOT (it only reached sufficient functionality yesterday)
08:07 sorear 3. You can use $YOUR_RDBMS's API directly through the Parrot NCI
08:08 sorear 4. Parrot has a MySQL binding; alpha had support for using Parrot bindings (this is essentially an older, worse version of #2)
08:09 sorear references: various, me, jnthn, Tene  respectively
08:10 sorear nqp: sub k($x) { sub() { $x } } my $a := k(1); my $b := k(2); say($a())
08:10 p6eval nqp: OUTPUT«Confused at line 1, near "sub k($x) "␤current instr.: 'parrot;HLL;Grammar;panic' pc 500 (src/cheats/hll-grammar.pir:197)␤»
08:10 sorear nqp: sub k($x) { sub() { $x } }; my $a := k(1); my $b := k(2); say($a())
08:10 p6eval nqp: OUTPUT«2␤»
08:10 sorear Does this qualify as a bug?
08:11 Juerd nqp: sub k($x) { sub() { $x } }; my $a := k(21); my $b := k(42); say($a())
08:11 p6eval nqp: OUTPUT«42␤»
08:11 Juerd Wanted to know if that 2 had anything to do with $b. Apparently it does.
08:12 Juerd I've never read any nqp docs but it does look wrong :)
08:14 sorear NQP is leaving out a step, accidentally or deliberately I know not
08:14 sorear nqp: sub k($x) { pir::newclosure__PP(sub() { $x }) }; my $a := k(1); my $b := k(2); say($a())
08:14 p6eval nqp: OUTPUT«1␤»
08:15 dalek csmeta: r202 | anteus4++ | trunk/Sprixel/t/operators.t:
08:15 dalek csmeta: this test fails too
08:15 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=202
08:28 dakkar joined #perl6
08:35 Guest16851 sorear: OK, thanks for the update
08:35 dalek csmeta: r203 | anteus4++ | trunk/Sprixel/t/ (2 files):
08:35 dalek csmeta: controlflow test, fails currently
08:35 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=203
08:35 Guest16851 Not sure I trust anything with MySQL in the guts though ;-)
08:36 snarkyboojum joined #perl6
08:39 fridim joined #perl6
08:53 pmurias joined #perl6
08:54 pmurias diakopter: the mono abort error disappeared
09:16 sorear welp.  It looks like, and #parrot agrees, that the only way to implement a synthetic namespace is in C
09:16 * sorear goes off into Rakudo's src/pmc/
09:22 moritz_ one might think it could be as easy as inheriting from NameSpace and overriding the *keyed* vtables...
09:24 masak joined #perl6
09:24 masak oh hai, #perl6!
09:24 moritz_ \o/ it's masak in his community bonding period!
09:24 jnthn yayitsmasakwhoisbonding!
09:25 * masak starts bonding immediately
09:25 masak hey, buddies.
09:25 JimmyZ hello
09:25 colomon o/
09:25 masak 你好
09:25 frettled Hiho!
09:26 JimmyZ 您好
09:27 * masak 不是"您" :)
09:27 sorear moritz_: That's what I tried first.
09:28 sorear I have a newfound hatred of PMCProxy.
09:28 JimmyZ 为什么呢?
09:28 moritz_ sorear: I think "all core PMCs should be inheritable" is a milestone for... uhm... parrot 3.0 or 3.5 or so
09:28 sorear Also, whatever build system bug is causing src/pmc/* to be built WITH NO SYMBOLS.
09:28 sorear Which makes debugging these problems /slightly/ harder.
09:28 jnthn A platform specific one I'd guess.
09:29 jnthn (Given, certainly until recently, I could debug them just fine.)
09:29 moritz_ chromatic complained about that too
09:29 masak JimmyZ: 我不知道... :)
09:29 sorear Parrot 3.5.  Heh.
09:29 JimmyZ :0
09:29 sorear That's like what, Perl 9?
09:30 masak "There's not going to be a Perl 9" -- Gloria Wall
09:30 moritz_ it's like, expected in one year
09:30 * sorear gives up on implementing pseudo namespaces
09:30 JimmyZ PMCProxy will be killed, IIRC
09:30 moritz_ overridable in PIR, that is
09:32 jnthn sorear: fwiw, I hadn't expected to do pseudo namespaces by writing a custom NameSpace PMC, but rather by spotting the interesting prefixes and doing some different code generation.
09:33 sorear jnthn: I talked to TimToady on this, he says that psuedo namespaces are late bound
09:33 sorear if you generate a fully qualified name and it starts with CALLER::, you get caller stuff
09:33 sorear etc
09:33 clintongormley joined #perl6
09:34 jnthn "late bound"?
09:34 dalek csmeta: r204 | anteus4++ | trunk/Sprixel/t/literalstring.t:
09:34 dalek csmeta: more tests
09:34 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=204
09:34 sorear also, I have no clue how to do interesting hackery with code generation
09:34 jnthn I mean, I know we have to do the lookup at runtime
09:34 jnthn That doesn't mean we can't generate something different at compile time.
09:34 jnthn (that does a lookup using the call stack, for example)
09:35 moritz_ $::($foo) # or however namespace interpolation is specced today
09:35 sorear We don't know at compile time if ::($x) is going to be contextual, global, lexical, or what
09:35 moritz_ but we can make the interpolation do the same magic as the compiler does
09:35 sorear I suppose
09:35 sorear isn't the compiler magic pretty diffuse though?
09:35 jnthn sorear: That's a different issue to pseudopackages though.
09:36 jnthn Plus we don't support that syntax just yet. :-)
09:38 sorear quite a few productions in the grammar refer to <name>, <longname>, <deflongname>, etc
09:38 sorear I would hate to add psuedopackage handling in so many places
09:38 jnthn I'm not sure if we'd need it in all of them.
09:39 jnthn And if so, we can factor it out somewhat.
09:41 Juerd joined #perl6
09:42 jnthn longname parses a name anyway
09:42 jnthn and deflongname parses a longname
09:42 jnthn So in that case you may only need it in name
09:42 sorear yes
09:42 sorear it's well factored in the grammar
09:42 sorear but the actions code mostly just passes off names to PAST
09:43 moritz_ hey, maybe we can add name manging support to to PAST
09:43 jnthn Yes, that's certainly the case at the moment.
09:43 * jnthn needs to worry about some late-bound talk writing for a bit.
09:45 sorear can someone with more advertising skill than me find some shiny, small examples of code using Perl5 libraries with pure OO or functional interfaces (I'm currently focusing on POSIX, CGI, DBI, and Tk) for translation and testing in Perl6?
09:47 * moritz_ will try to think of something
09:48 * JimmyZ hopes can use blizkost on p6eval
09:50 sorear rakudo: use CGI:from<perl5>; say ::CGI.new.header;
09:50 p6eval rakudo a27dfe: OUTPUT«"load_language" couldn't find a compiler module for the language 'perl5'␤current instr.: 'perl6;Perl6;Module;Loader;need_foreign' pc 36574 (src/gen/locator_pm.pir:213)␤»
09:50 sorear someone with feather access will need to install it
09:51 moritz_ well, it comes with some security implications
09:51 moritz_ y'know, most perl 6 implementations eithere were not user friendly enough to pose a real risk, or came with a safe mode
09:51 moritz_ I don't know how to sandbox perl 5 sufficiently
09:52 sorear so p6eval *is* sandboxed?
09:52 moritz_ pugs: open('README')
09:53 p6eval pugs: OUTPUT«*** Unsafe function 'Pugs::Internals::openFile' called under safe mode␤    at Prelude.pm line 308, column 13-61␤»
09:53 JimmyZ by using chroot, I think.
09:53 moritz_ sorear: not properly... it tries to run safe mode when possible, and it's in a chroot under a low-priv user
09:53 moritz_ sorear: but it's by no means really secure
09:54 sorear for a bot in a channel that's probably good enough
09:54 moritz_ maybe I should disable /msg'ing to it
09:54 sorear anyone who feels like writing a spam daemon in perl 6... well there are lots of people here with 'kill' access
09:55 moritz_ current p6eval is also in channels where I'm not in
09:55 sorear I presume it's running heavily niced and with a disk quota / ram ulimit
09:55 moritz_ it has all the limits that BSD::Resource can muster
09:56 * moritz_ can't git pull - github.com doesn't respond :(
09:56 Juerd "not user friendly enough to pose a real risk" - hee hee :)
09:57 moritz_ I think mildew also offers some perl 5 interaction - but nobody reallys knows, except pmurias++ and ruoso++ :-)
09:58 Juerd feather3 is available too of course
09:58 Juerd It is a big sandbox for all kinds of potentially evil/eval code
09:59 Juerd We have 6 backups per day in case things go bad.
09:59 Juerd Er, 4
09:59 colomon rakudo: say (1..8)[*-1]
09:59 p6eval rakudo a27dfe: OUTPUT«Method 'postcircumfix:<[ ]>' not found for invocant of class 'Range'␤current instr.: '!postcircumfix:<[ ]>' pc 10885 (src/builtins/Role.pir:73)␤»
10:01 dakkar joined #perl6
10:01 pugssvn r30481 | colomon++ | [t/spec] Eliminate Range.reverse tests.  Rename Range.minmax to Range.bounds.  Tests for Any.minmax now expect to get a Range returned rather than a list.
10:03 dalek rakudo: 0a04ef3 | (Solomon Foster)++ | src/ (4 files):
10:03 dalek rakudo: Rename Range.minmax to Range.bounds.  Change Any.minmax to return a Range, and take Ranges as arguments, too.  (Though note that in many conditions the Range is expanded to a list going in, which muddles things.)  Add minmax operator which uses Any.minmax internally.
10:03 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​a04ef3c3578836a776fbbd558686fa1110550cd
10:04 ruoso moritz_, you are right... mildew does support "use CGI:from<perl5>" and interacts with the perl5 runloop in a cooperative way (it handles p5 continuations via Coro::State)
10:05 ruoso so both perl5 can call mildew code and vice-versa
10:07 ruoso hopefully, pmurias' gsoc project this year will make that feature more visible...
10:13 dalek csmeta: r205 | anteus4++ | trunk/Sprixel/t/types.t:
10:13 dalek csmeta: added test of types
10:13 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=205
10:14 pmurias ruoso: hi
10:15 ruoso hi pmurias
10:17 pmurias STD nowdays doesn't accept EXTERNAL::eval_perl5
10:20 colomon std: 1 min 2 max 3
10:20 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤"min" and "max" are non-associative and require parens at /tmp/fgb27ISF9G line 1:␤------> [32m1 min 2 max [33m⏏[31m3[0m␤Check failed␤FAILED 00:01 109m␤»
10:21 pmurias std: EXTERNAL::eval_perl5("print 'hi'");
10:21 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ 'EXTERNAL::eval_perl5' used at line 1␤Check failed␤FAILED 00:01 107m␤»
10:21 ruoso pmurias, I think we need a way to inject symbols in STD
10:27 ruoso pmurias, maybe simply having a setting that wraps the code...
10:28 ruoso std: { module EXTERNAL; sub eval_perl5 {}}; EXTERNAL::eval_perl5("print 'hi'")
10:28 p6eval std 30480: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ 'EXTERNAL::eval_perl5' used at line 1␤Check failed␤FAILED 00:01 107m␤»
10:28 ruoso std: { module EXTERNAL { sub eval_perl5 {}} }; EXTERNAL::eval_perl5("print 'hi'")
10:28 p6eval std 30480: OUTPUT«ok 00:01 107m␤»
10:31 ruoso maybe STD even provide a hook to load the setting... (does it?)
10:31 pmurias checking...
10:35 pmurias ruoso: we could make STD use our CORE instead of the dummy setting
10:35 pmurias walk&
10:35 ruoso pmurias, that'd be awesome
10:36 orafu joined #perl6
10:49 quester_ left #perl6
10:58 M_o_C joined #perl6
10:58 Trizen joined #perl6
11:25 * colomon apparently just seriously broke his local Rakudo build.
11:28 colomon oh, I think I somehow made cmp stop working for numbers.  how awkward.
11:29 colomon rakudo: say 4 after 36
11:29 p6eval rakudo 0a04ef: OUTPUT«0␤»
11:30 XaeroOne joined #perl6
11:32 colomon Huh.  Now I don't understand how that ever worked.
11:34 Xaero joined #perl6
11:34 colomon jnthn: ping?
11:36 jnthn colomon: omnonm...pong
11:36 * jnthn can IRC and lunch at the same time.
11:37 colomon I added cmp overloads that take Inf as an argument, to give Inf its proper magical properties.
11:37 colomon somehow that seems to have broken Int cmp Int
11:38 mathw o/
11:38 colomon I'm thinking either dispatch issue I don't understand, or I need a wiser head to think about the problem.
11:39 colomon also, I don't understand how Int cmp Int works in the current build (as opposed to my personal one)
11:39 colomon we've overloaded comparisons for Num and Rat, but not Int.
11:40 colomon that should have stopped working recently...
11:40 colomon rakudo: say 1 ~~ Num
11:40 p6eval rakudo 0a04ef: OUTPUT«1␤»
11:40 moritz_ that's how it works
11:40 colomon oh, that nonsense is still in there.
11:40 moritz_ and it's wrong, by current spec
11:41 jnthn Well
11:41 mathw doesn't Int cmp Int do ~$a cmp ~$b?
11:41 colomon okay, that's how it works "normally"
11:41 jnthn Int current ~~ Num
11:41 orafu joined #perl6
11:41 jnthn *currently
11:41 jnthn We need to break (fix ;-)) that at some point.
11:41 |Jedai| joined #perl6
11:41 jnthn colomon: In what way has it broken in?
11:42 jnthn That is, do you get some error?
11:42 lisppaste3 colomon pasted "The infix:<cmp> multis which break Int cmp Int when uncommented." at http://paste.lisp.org/display/98429
11:42 colomon jnthn: as in
11:42 colomon > say 4 cmp 36
11:42 colomon 1
11:42 colomon ie it appears to be doing string comparison rather than Numeric comparison
11:43 moritz_ which is the fallback for cmp if at least one is non-numeric
11:43 colomon moritz_: which one of 4 and 36 are you suggesting is non-numeric?  ;)
11:43 moritz_ both, more or less :-)
11:44 moritz_ in a broken type system, that is
11:44 frettled heh
11:44 jnthn rakudo: multi foo(+Inf, +Inf) { say 1 }; multi foo($a, $b) { say 0 }; foo(+Inf, +Inf); foo(42, 1);
11:44 p6eval rakudo 0a04ef: OUTPUT«1␤0␤»
11:45 jnthn colomon: Do a:
11:45 jnthn &infix:<cmp>('oh', 'no', '3 args')
11:45 jnthn colomon: To dump a list of all the candidates.
11:45 colomon jnthn: will do after rebuild with the multis back in.
11:45 jnthn (it's actually the error message that includes them, but...)
11:47 jnthn One thing people may not know about that error message is that it doesn't just dump the candidates in any order, but in the order that they will get considered in.
11:47 colomon jnthn++
11:47 jnthn So it can be quite a useful debugging aid. :)
11:48 moritz_ jnthn++ # really awesome error message
11:48 takadonet morning all
11:48 colomon rakudo: &infix:<cmp>('oh', 'no', '3 args');
11:48 p6eval rakudo 0a04ef: OUTPUT«No applicable candidates found to dispatch to for 'infix:<cmp>'. Available candidates are:␤:(Num $a, Num $b)␤:(Rat $a, Rat $b)␤:(Date $a, Date $b)␤:(Rat $a, Any $b)␤:(Any $a, Rat $b)␤:(Any $a, Any $b)␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
11:49 * colomon will probably get rid of the Rat ones soon in a Real patch.
11:49 moritz_ there should really be a (Numeric, Numeric)
11:49 moritz_ or Real, Real, right
11:49 colomon moritz_: TimToady and I have a scheme for Numeric, Numeric, too.  :)
11:50 * moritz_ tries to stop himself from commenting
11:50 frettled Om Num Num?
11:50 lisppaste3 colomon pasted "&infix:<cmp>('oh', 'no', '3 args'" at http://paste.lisp.org/display/98430
11:52 gruotr joined #perl6
11:54 * moritz_ reminds people that there's a #rs meeting tonight
11:54 c9s joined #perl6
11:54 colomon moritz_++ # had forgotten, as usual
11:54 jnthn That's...a really good point.
11:54 jnthn moritz_: In our timezone it's...9:00?
11:54 jnthn as in 2100?
11:55 moritz_ jnthn: I think so... unless its 20:30
11:55 jnthn I think it's ended up being 21:00
11:55 jnthn OK, I *should* be home by then.
11:55 colomon and I won't be gone to the pub yet.
11:55 jnthn (Going to Malmo to give a Perl talk, but it's at 5pm, so even with dinner afterwards, that's still lots of time to be back.)
11:56 jnthn colomon: That ordering looks correct to me.
11:56 snarkyboojum masak: a SIC target for yapsi would be cool :)
11:56 jnthn rakudo: 3 ~~ +Inf
11:56 p6eval rakudo 0a04ef:  ( no output )
11:56 jnthn rakudo: say 3 ~~ +Inf
11:57 p6eval rakudo 0a04ef: OUTPUT«0␤»
11:57 jnthn rakudo: say 3 ~~ -Inf
11:57 p6eval rakudo 0a04ef: OUTPUT«0␤»
11:57 jnthn Hmm.
11:57 jnthn What fails again?
11:57 jnthn ah, 4 cmp 36
11:58 moritz_ rakudo: Int ~~ Real
11:58 p6eval rakudo 0a04ef:  ( no output )
11:58 moritz_ rakudo: say Int ~~ Real
11:58 p6eval rakudo 0a04ef: OUTPUT«1␤»
11:58 masak snarkyboojum: o/
11:59 masak snarkyboojum: how do you mean, 'a SIC target'?
11:59 snarkyboojum yapsi --target=SIC and it dumps the SIC to stdout :)
11:59 masak ooh!
11:59 colomon jnthn: wondering if it's something nasty, like comparing 4 to Inf turns it into an Integer rather than an Int...
11:59 snarkyboojum or --target=sic perhaps :)
11:59 masak snarkyboojum: both :)
11:59 masak snarkyboojum: great idea.
11:59 masak snarkyboojum: by the way, I've merged now.
11:59 bluescreen joined #perl6
12:00 snarkyboojum masak: yeah - would save me hacking yapsi to do @sic.join("\n").say :)
12:00 snarkyboojum masak: noticed - looks cool
12:00 jnthn http://paste.lisp.org/display/98431
12:00 jnthn colomon: That (above) works as expected
12:00 jnthn colomon: No, that shouldn't happen.
12:00 masak snarkyboojum: if you don't beat me to it, I'll add a SIC target later today.
12:00 jnthn colomon: I suspect something weird is going on. :-/
12:01 snarkyboojum masak: sweet!
12:01 masak snarkyboojum: we'll need a ChangeLog for this release :P
12:01 colomon jnthn: agree 100% on the weird
12:01 * masak still hopes to be able to add if statements before Saturday
12:01 snarkyboojum you-can-do-it :)
12:02 moritz_ colomon: does the dispatch work if you use the Int type object?
12:02 moritz_ Int cmp Int
12:02 colomon just like that?
12:02 jnthn colomon: I'm afraid I need to work on the presentation I need to leave here to go and give in ~2 hours at the moment.
12:02 moritz_ just like that
12:02 colomon jnthn: understood
12:02 jnthn colomon: So I can't dig more right now, sorry.
12:02 colomon > say Int cmp Int
12:02 colomon 0
12:03 jnthn Try adding some print statements to the candidates perhaps, to see which one you actually end up in.
12:03 colomon jnthn: good idea.
12:03 masak snarkyboojum: the tricky work for this release is basically done already; mostly downhill from here.
12:03 colomon moritz_: Int cmp Int should equal 0, and does.
12:04 masak snarkyboojum: I'm sure a few bugs must have crept in here and there, though.
12:04 moritz_ colomon: that doesn't tell us if it uses a numeric or a string multi :(
12:04 snarkyboojum I have a question about the stack
12:04 colomon > say Int cmp 0
12:04 colomon 1
12:04 colomon rakudo: say Int cmp 0
12:04 p6eval rakudo 0a04ef: OUTPUT«0␤»
12:05 colomon looks like string probably
12:05 snarkyboojum if only pops the stack when the program completes by the looks of it :)
12:05 snarkyboojum or am I reading that incorrectly
12:06 snarkyboojum rather than popping at the end of each block
12:07 masak snarkyboojum: if you believe it's wrong, please provide a case where it fails :)
12:07 snarkyboojum masak: yapsi -e 'my $a = 5; { say $a }; say $a;' # never gets back to the final say $a
12:07 * masak tries
12:07 snarkyboojum i.e. only one 5 is printed
12:08 moritz_ snarkyboojum++ # submitting yapsibugs
12:08 snarkyboojum hehe
12:08 masak snarkyboojum: works here.
12:08 masak snarkyboojum: sure you have the latest PIR?
12:08 snarkyboojum maybe not :|
12:08 snarkyboojum false alarm perhaps
12:09 masak snarkyboojum: it should now have a Makefile, so be sure to do 'make' regularly.
12:09 snarkyboojum masak: cool - I haven't setup my env for the Makefile to work properly
12:09 snarkyboojum will do
12:09 masak snarkyboojum: there's already a test for exactly that, by the way :)
12:09 snarkyboojum oh :|
12:09 moritz_ masak++ # testing
12:09 masak and it's true that yesterday it didn't return properly from blocks.
12:10 masak but I fixed that.
12:10 snarkyboojum yeah - I looked into it last night and thought "we just need a stack" :)
12:10 moritz_ what does YAPSI emit? some kind of intermediate format?
12:10 snarkyboojum v. cool to see it magically appear overnight
12:10 masak moritz_: that's SIC.
12:10 moritz_ masak: and then you have SIC interpreter written in Perl 6?
12:11 masak aye.
12:11 * snarkyboojum tries to resist the temptation to call it fully SIC
12:11 masak compiler + runtime weigh in at 417 lines, right now.
12:12 masak snarkyboojum: did you see that a SIC output now self-identifies with 'This is SIC v2010.05'? :)
12:12 snarkyboojum masak: yeah - and does some sort of validation too?
12:13 masak the runtime dies if it doesn't get the right version.
12:13 snarkyboojum masak: yeah - pretty cool :)
12:13 masak that's for when we implement saving and loading of SIC files.
12:13 colomon adding  say "Any, Any" to infix:<cmp>(Any, Any) seems to completely break Rakudo
12:13 moritz_ colomon: try DEBUG instead of say()
12:14 colomon rakudo: DEBUG("Any, Any")
12:14 p6eval rakudo 0a04ef: OUTPUT«Could not find sub &DEBUG␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
12:14 colomon like that, or?
12:14 moritz_ uhm
12:14 moritz_ I thought we had something like that for debugging the setting
12:14 jnthn pir::say works easiest.
12:16 snarkyboojum masak: try running this:- yapsi -e '{}; my $a = 5; { say $a };'
12:16 masak snarkyboojum: ah, yes. that won't work :/
12:16 snarkyboojum oh
12:16 masak snarkyboojum: still need to uncheat at that particular spot :)
12:17 * colomon is ecstatic because he just discovered the old Emile Benoit music video is on Youtube in a much higher quality than he has ever seen before.
12:17 masak snarkyboojum: it appends _1 to nested blocks. it should do _2 etc until the next unoccupied name.
12:17 colomon moritz_: I think that might be for nqp?
12:17 masak snarkyboojum++ # bugfinder
12:17 moritz_ masak: do you think Perl 6 is a good language to write a compiler in?
12:17 masak snarkyboojum: please add that as a test.
12:17 moritz_ colomon: maybe
12:17 masak moritz_: so far, it's pretty nice.
12:18 snarkyboojum masak: yep - noticed that re block names. Re test will do
12:18 colomon afk # getting ready for storytime this morning.
12:26 SmokeMachine joined #perl6
12:32 ash__ joined #perl6
12:33 takadonet is ':g' implemented for smartmatching?
12:33 moritz_ no
12:34 masak it's implemented for .subst
12:35 takadonet nuts
12:35 * moritz_ has pondered adding support for s:g/foo/bar/
12:36 masak ++moritz_
12:36 masak moritz_: what would it take?
12:36 masak it'd be a schweet addition to Rakudo Star.
12:36 takadonet here is my problem: I need to break up a long string of character into blocks of 80 characters with new line between them
12:37 masak takadonet: .comb
12:37 takadonet masak: could work :)
12:37 * takadonet ponders....
12:37 moritz_ masak: 1) parsing 2) adding it to the constructor Substitution.new() in the action methods 3) an attribute in Substitution 4) add the attributes to the subst() call
12:37 * masak didn't know about Substitution :)
12:38 moritz_ rakudo: say 'abcdefghijklm'.comb( /. ** 1..4/).join("\n")
12:38 p6eval rakudo 0a04ef: OUTPUT«abcd␤efgh␤ijkl␤m␤»
12:38 moritz_ (example for 4 instead of 80)
12:38 takadonet !!!
12:39 takadonet moritz_: Sometime I feel that I'm not really programming at all but just redirecting all my questions towards you
12:39 moritz_ it's a classic use case for unpack() actually
12:39 moritz_ :-)
12:39 takadonet moritz_: In perl5 ya
12:40 mathw takadonet: you're actually programming moritz_ to solve all your problems for you
12:40 moritz_ unpack '(A80)*', $string
12:40 takadonet mathw: Seems to be working :)
12:40 ruoso joined #perl6
12:40 moritz_ that's called meta programming :-)
12:42 GinoMan joined #perl6
12:43 Trizen joined #perl6
12:51 masak rakudo: my $a = "a"; $a ~~ / $a /; say $/.chars
12:51 p6eval rakudo 0a04ef: OUTPUT«-4␤»
12:52 iblechbot joined #perl6
12:52 jnthn Erm. :-)
12:52 masak I'm slightly uncomfortable with .chars ever returning something negatice.
12:53 masak tempted to submit that as a rakudobug.
12:53 jnthn It has unlength.
12:53 * moritz_ yawns. Another manifestation of $/ not being a proper Match object
12:53 masak "that's the shortest string I've ever seen!"
12:53 moritz_ rakudo: my $a = "a"; $a ~~ / $a /; say ?$/
12:53 p6eval rakudo 0a04ef: OUTPUT«0␤»
12:53 snarkyboojum length with direction :)
12:53 moritz_ so, a failed match
12:53 masak I know.
12:54 moritz_ which has .from > .to
12:54 masak I know.
12:54 masak PGE and GGE do the same.
12:54 moritz_ masak: just submit it; one more ticket I can close when I get proper Match objects running in Perl 6
12:54 masak alpha: "foo" ~~ /bar/; say $/.chars
12:54 p6eval alpha 30e0ed: OUTPUT«0␤»
12:54 masak moritz_: still doesn't manifest that bug.
12:54 * masak submits rakudobug
12:55 bbkr rakudo: my @t = (1, undef, 3); @t>>// "not defined"; # is this valid usage of // operator on every array element?
12:55 p6eval rakudo 0a04ef: OUTPUT«Unsupported use of undef as a value; in Perl 6 please use something more specific:␤        Mu (the "most undefined" type object),␤   an undefined type object such as Int,␤    Nil as an empty list,␤    *.notdef as a matcher or method,␤ Any:U as a type constraint␤       or
12:55 p6eval ..fail() as a failure return␤       …
12:56 moritz_ bbkr: >> only works for methods
12:56 uniejo joined #perl6
12:56 moritz_ maybe you want a magic @t <<//>> "not defined'
12:57 moritz_ rakudo: say ((1, 2, Any, 3) <<//>> "n.d.").perl
12:57 p6eval rakudo 0a04ef: OUTPUT«[1, 2, "n.d.", 3]␤»
12:57 bbkr yay! this is awesome :)
12:58 bbkr thanks
12:58 Guest69093 joined #perl6
12:58 * [Coke] skims the last several hours. Chatty.
12:59 jaffa4 hi
12:59 jaffa4 what does this mean?
12:59 masak woo, [particle] and [Coke] -- two #perl6 people that chose to live in a box :)
12:59 jaffa4 <?before '['>
12:59 masak jaffa4: it's a lookahead.
12:59 masak jaffa4: they are explained in S05.
13:00 jaffa4 no ?
13:00 jaffa4 questionmark
13:00 masak yes.
13:00 jaffa4 what is the questionmark?
13:00 moritz_ 14:59 < masak> jaffa4: it's a lookahead.
13:00 masak hm. it makes it zero-width.
13:00 masak but a 'before' lookahead already is zero-width.
13:01 [Coke] masak: someone ``stole'' our nicks!
13:01 moritz_ and you didn't register with freenode before?
13:01 ReiniUrban joined #perl6
13:01 * [Coke] thinks he might just pick some random CokeFu nick.
13:01 jaffa4 Coke: are the maker of Coke?
13:01 [Coke] moritz_: you mean, 15 years ago? no.
13:02 [Coke] jaffa4: no, merely a one-time reseller.
13:02 * masak is the maker of Coke
13:02 jaffa4 Coke language
13:02 jaffa4 not the drink
13:02 masak oh. I meant the drink.
13:02 masak never mind. :)
13:02 [Coke] never heard of a language called Coke.
13:03 masak http://piumarta.com/pepsi/coke.html
13:05 [Coke] oh, it's related to Cola.
13:05 [Coke] not entirely unsurprising.
13:05 masak "Artificial Sweeteners" :)
13:06 frettled Good thing you didn't mean the drug.
13:06 masak production of the drug isn't restricted to one entity.
13:07 cosimo joined #perl6
13:07 jaffa4 what is the difference between | and || in grammar?
13:07 masak jaffa4: that's also in S05.
13:07 masak jaffa4: but essentially, the first does 'parallel' matching with LTM.
13:08 masak jaffa4: and the second one does serial matching, like in p5.
13:08 masak jaffa4: at least with PGE, they both meant '||' in practice.
13:08 jaffa4 LTM?
13:08 masak don't know what the state is with nqp-rx.
13:08 [Coke] LTM is longest token matching
13:09 [Coke] I don't think nqp does LTM yet either.
13:09 masak jaffa4: LTM is also explained in S05. you should read it someday :)
13:09 [Coke] (to compensate - order your elements longest first manually.)
13:09 moritz_ jaffa4: stop throwing words with question marks in the channel - start to actually read the synopsis
13:09 jaffa4 I read it
13:09 jaffa4 and I forgot it
13:09 masak read it again.
13:09 moritz_ then you must read it again.
13:10 cosimo joined #perl6
13:10 jaffa4 Must I?
13:10 masak jaffa4: you'll find that people are very tolerant on this channel, except perhaps on the point of trying to get others to do your learning for you.
13:11 masak jaffa4: no, of course you mustn't. but it seems that it'd benefit you.
13:12 jaffa4 There are many ways of learning.
13:12 jaffa4 One of them is to ask somebody.
13:12 lrnperl6 joined #perl6
13:13 moritz_ jaffa4: sure. But please don't continue to ask stuff here that's explained in the docs
13:13 masak jaffa4: honestly, you do have the potential to become a productive member of the #perl6 community. but you need to gain some independence to get there.
13:13 moritz_ jaffa4: I find it annoying, and I'm sure others feel the same
13:13 snarkyboojum masak: ok 13 - same-level blocks :)
13:13 masak jaffa4: http://catb.org/~esr/faqs/smart-questions.html
13:13 moritz_ jaffa4: and asking people to write things that are written elsewhere isn't productive for anybody
13:13 masak snarkyboojum: you did it? cool! snarkyboojum++
13:13 pmurias moritz_: to be fare ack LTM doesn't find anything in the spec
13:14 jaffa4 almost all questions are written down somewhere.
13:14 pmurias * fair
13:14 masak pmurias: that's not very fair. we spelled it out too in our explanations.
13:14 moritz_ pmurias: the IRC logs explain it if you mouse-over
13:14 snarkyboojum masak: yapsi -e '{}; my $a = 42; { say $a }' # returns 42 now instead of Any()\n42 ;)
13:14 moritz_ at least mention the full name, which can then be found in the specs
13:14 snarkyboojum masak: but I fear you'll want your lovely numbering to be better than what I've done :P
13:15 moritz_ pmurias: and google for Perl 6 LTM give also good results
13:15 masak jaffa4: now you're not only lazy, but obstinate, too. please try harder to empathise.
13:15 masak snarkyboojum: I'll look at the commit tonight.
13:18 [Coke] I find this search helpful: http://perlcabal.org/  - search box at the top with a custom, narrowed, google search.
13:18 snarkyboojum masak: haven't committed, this is what it does http://gist.github.com/380720 - so can hold off if you want to do it differently
13:18 [Coke] (except when trying to find things like "WHAT" =-)
13:19 snarkyboojum masak: fun to hack around regardless
13:19 * masak looks
13:19 masak snarkyboojum: wow! just seeing that makes me happy :)
13:20 snarkyboojum masak: heh - I didn't even write it and I'm finding it fun :)
13:20 masak snarkyboojum: please commit that. it's not the desired numbering, but it's an improvement on what we have. can be further improved later.
13:20 snarkyboojum masak: cool - will do
13:21 masak snarkyboojum++
13:21 snarkyboojum masak o/ :)
13:22 masak \o
13:25 masak we really could use a p6eval yapsi target :) will try to arrange that for the May release.
13:26 masak it's getting slower, but it's still not horribly slow.
13:26 takadonet rakudo: my $w=5;say 'abcdefghijklm'.comb( /. ** 1..$w/.join("\n");
13:26 p6eval rakudo 0a04ef: OUTPUT«Only integers or '*' allowed as range quantifier endpoint at line 11, near "$w/.join(\""␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:27 takadonet my Int $w=5;say 'abcdefghijklm'.comb( /. ** 1..$w/.join("\n");
13:27 masak takadonet: no variable interpolation yet, methinks.
13:27 takadonet nuts...
13:27 masak takadonet: the workaround is &eval
13:27 moritz_ or to use substr()
13:27 moritz_ and a loop
13:27 moritz_ boring, I know
13:27 takadonet well when it's implemented, the code above should work correct?
13:30 masak std: my $w=5;say 'abcdefghijklm'.comb( /. ** 1..$w/.join("\n");
13:30 p6eval std 30481: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed range at /tmp/hPg8wP2qFq line 1:␤------> [32m$w=5;say 'abcdefghijklm'.comb( /. ** 1..[33m⏏[31m$w/.join("\n");[0m␤    expecting quantifier__S_577StarStar␤Parse failed␤FAILED 00:01 112m␤»
13:30 masak takadonet: I think you need {} around the range.
13:30 masak only ranges with literals as endpoints can do without {}
13:34 takadonet masak: k
13:34 jnthn rakudo: role Drinking { method go-to-bar() {  } }; role Gymnastics { method go-to-bar() {   } }; class DrunkGymnast does Gymnastics does Drinking { }
13:34 p6eval rakudo 0a04ef: OUTPUT«Method 'go-to-bar' collides and a resolution must be provided by the class␤current instr.: 'perl6;Perl6;Metamodel;Rol​eToClassApplier;_block132' pc 9253 (src/gen/RoleToClassApplier.pir:306)␤»
13:34 jnthn \o/
13:35 jnthn rakudo: role Drinking { method go-to-bar() {  } }; role Gymnastics { method go-to-bar() {   } }; class DrunkGymnast does Gymnastics does Drinking { method go-to-bar() { } }; say "alive"
13:35 p6eval rakudo 0a04ef: OUTPUT«alive␤»
13:35 takadonet !!
13:35 takadonet masak: thanks
13:37 masak (drunk gymnast examples)++
13:39 moritz_ fun fact while browsing through my apache log file summaries: 36 people found my website via google searching for   skip perl 5 learn perl 6
13:40 moritz_ and just about as many searching for 'rakudo performance'
13:41 jnthn rakudo: role Drinking { method go-to-bar() { say "glug" } }; role Gymnastics { method go-to-bar() { say "ouch" } }; class DrunkGymnast does Gymnastics does Drinking { method go-to-bar() { self.Gymnastics::go-to-bar() } }; DrunkGymnast.new.go-to-bar
13:41 p6eval rakudo 0a04ef: OUTPUT«Method '!select' not found for invocant of class 'DrunkGymnast'␤current instr.: 'perl6;Perl6Role;!pun_helper' pc 10469 (src/gen/RoleToInstanceApplier.pir:112)␤»
13:41 jnthn oh, damm
13:41 jnthn That's the bit that doesn't work.
13:41 jnthn :-/
13:45 masak odd error.
13:50 IllvilJa rakudo: role DrunkRakudoDeveloper;
13:50 p6eval rakudo 0a04ef:  ( no output )
13:51 IllvilJa (could not resist...)
13:51 masak foo-to-bar()
13:52 jnthn masak: file rakudobug
13:52 jnthn It should work.
13:52 * masak submits rakudobug
13:52 jnthn We don'tahve a ticket for it, and I'm not sure if it ever worked on alpha either.
13:53 Lorn joined #perl6
13:53 plobsing joined #perl6
13:54 jnthn oooh, oops, my train
13:54 jnthn o/
13:55 masak \o
13:55 [Coke] jnthn: RUN
13:56 JimmyZ joined #perl6
14:02 masak alpha: role Drinking { method go-to-bar() { say "glug" } }; role Gymnastics { method go-to-bar() { say "ouch" } }; class DrunkGymnast does Gymnastics does Drinking { method go-to-bar() { self.Gymnastics::go-to-bar() } }; DrunkGymnast.new.go-to-bar
14:02 p6eval alpha 30e0ed: OUTPUT«Method '!select' not found for invocant of class 'DrunkGymnast'␤in Main (file src/gen_setting.pm, line 324)␤»
14:02 masak it didn't.
14:17 rv2733 joined #perl6
14:24 alester joined #perl6
14:29 jaffa4 where can I find the definition of Regex::P6Regex::Grammar?
14:30 moritz_ http://github.com/perl6/nqp-rx/blob/​master/src/Regex/P6Regex/Grammar.pm
14:32 jaffa4 I cannot see it in my local copy
14:32 molaf joined #perl6
14:33 masak of nqp-rx?
14:33 jaffa4 yes
14:33 jaffa4 there is no such directory
14:33 moritz_ then your local copy is either very old or incomplete
14:33 moritz_ or you're looking for a wrong directory
14:34 * masak can see it in his local copy just fine
14:34 jaffa4 I used git clone http://github.com/rakudo/rakudo.git rakudo
14:34 masak that's not nqp-rx.
14:34 masak that's rakudo.
14:34 masak those are in two different repositories.
14:35 jaffa4 Rakudo parses regular expressions
14:35 jaffa4 and uses nqp-rx?
14:35 jaffa4 does it use the grammar of nqp-rx?
14:37 * masak thinks so
14:37 [Coke] but rakudo's copy of nqp-rx comes from parrot.
14:37 masak right.
14:38 [Coke] which in turn is a snapshot of the nqp-rx repo.
14:38 masak often a quite recent one, since rakudo is its main consumer.
14:40 gruotr joined #perl6
14:41 ruoso joined #perl6
14:46 pugssvn r30482 | colomon++ | [t/spec] Change minmax tests to match new behavior, refudge minmax.t a bit.
14:51 dalek rakudo: f8987e4 | (Solomon Foster)++ | src/Perl6/Grammar.pm:
14:51 dalek rakudo: Make minmax have list_infix precedence.
14:51 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f​8987e41c23d3b40f37df381a7661e5917e545e9
14:51 dalek rakudo: cb8446c | (Solomon Foster)++ | src/core/Cool-str.pm:
14:51 dalek rakudo: Add special cases to infix:<cmp> involving +Inf and -Inf (so they can be compared against any type).
14:51 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c​b8446ce343a965b4e8b7de2e862f102c91c6f65
14:51 dalek rakudo: 083e3ea | (Solomon Foster)++ | t/spectest.data:
14:51 dalek rakudo: Turn on S03-operators/minmax.t.
14:51 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​83e3ea44bdc687e63e658d5cd06d51066b3d16f
14:51 dalek rakudo: 1cdbc19 | (Solomon Foster)++ | src/core/Cool-str.pm:
14:51 dalek rakudo: Revert "Add special cases to infix:<cmp> involving +Inf and -Inf (so they can be compared against any type)."
14:51 dalek rakudo: This reverts commit cb8446ce343a965b4e8b7de2e862f102c91c6f65.
14:51 dalek rakudo: Revert patch because it broke infix:<cmp> pretty badly.
14:51 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1​cdbc19937550dd95c0e09cf0aa4d935a842f7bf
14:55 k23z__ joined #perl6
14:58 jaffa4 rakudo: /x/g;
14:58 p6eval rakudo 0a04ef: OUTPUT«Unsupported use of /g; in Perl 6 please use :g at line 11, near ";"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
14:58 jaffa4 rakudo: :g/x/;
14:58 p6eval rakudo 0a04ef: OUTPUT«Confused at line 11, near ":g/x/;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
15:00 colomon jaffa4: I don't think :g is implemented in Rakudo yet.
15:00 moritz_ std: :g/x/
15:01 p6eval std 30482: OUTPUT«[31m===[0mSORRY![31m===[0m␤Bogus term at /tmp/kgMsgngoUJ line 1 (EOF):␤------> [32m:g/x/[33m⏏[31m<EOL>[0m␤Undeclared routine:␤ 'x' used at line 1␤Parse failed␤FAILED 00:01 110m␤»
15:01 jaffa4 it is not even in the grammar definiton
15:01 jaffa4 I think
15:01 jaffa4 Is it possible that I am right?
15:01 moritz_ jaffa4: read S05 - it contains examples of how to use it correctly
15:02 jaffa4 rakudo: m:g//
15:02 p6eval rakudo 0a04ef: OUTPUT«Confused at line 11, near "m:g//"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
15:02 moritz_ std: m:g//
15:03 p6eval std 30482: OUTPUT«[31m===[0mSORRY![31m===[0m␤Null pattern not allowed at /tmp/MbqBEFnAIy line 1:␤------> [32mm:g/[33m⏏[31m/[0m␤Null pattern not allowed at /tmp/MbqBEFnAIy line 1:␤------> [32mm:g/[33m⏏[31m/[0m␤Null pattern not allowed at /tmp/MbqBEFnAIy line 1:␤------>
15:03 p6eval ..[32mm:g/[33m⏏[31…
15:03 jaffa4 It is not in defined
15:03 jaffa4 in the grammar
15:03 masak std: m:g/you must have something inside the regex for it to work/
15:03 p6eval std 30482: OUTPUT«ok 00:01 108m␤»
15:04 masak std: m:g/please look at the error messages before concluding that you are right/
15:04 p6eval std 30482: OUTPUT«ok 00:01 108m␤»
15:04 jaffa4 it is not defined in the Rakudo grammar file rakudo\src\Perl6\Grammar.pm
15:04 masak jaffa4: that's because it's not implemented yet.
15:04 JimmyZ std: m:g//
15:04 p6eval std 30482: OUTPUT«[31m===[0mSORRY![31m===[0m␤Null pattern not allowed at /tmp/7Si0GVm6H0 line 1:␤------> [32mm:g/[33m⏏[31m/[0m␤Null pattern not allowed at /tmp/7Si0GVm6H0 line 1:␤------> [32mm:g/[33m⏏[31m/[0m␤Null pattern not allowed at /tmp/7Si0GVm6H0 line 1:␤------>
15:04 p6eval ..[32mm:g/[33m⏏[31…
15:05 masak jaffa4: and you know that, since people have said it to you 100 times by now.
15:05 JimmyZ rakudo: m:g//
15:05 jaffa4 Yes
15:05 p6eval rakudo 0a04ef: OUTPUT«Confused at line 11, near "m:g//"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
15:05 jaffa4 I know
15:05 masak and I wish 100 was an exaggeration.
15:05 jaffa4 5 times is closer to the truth
15:05 masak jaffa4: all the energy you've expended on asking this question. imagine if you'd actually contributed something instead... :)
15:05 moritz_ if you even remember the count, why bother asking?
15:06 jaffa4 Did I ask?
15:06 ruoso joined #perl6
15:06 moritz_ yes
15:06 jaffa4 Where?
15:06 moritz_ 17:01 < jaffa4> Is it possible that I am right?
15:06 was kicked by moritz_: go play somewhere else
15:06 * [Coke] wonders why jaffa4 is getting under people's skin.
15:07 masak [Coke]: he doesn't the first four times.
15:07 * [Coke] thought this was #perl5 for a second and had to double chek.
15:10 masak [Coke]: maybe you know something about how to treat a person asking the same question at regular intervals that moritz_ and I don't. if so, please share.
15:14 masak for some reason that I still fail to fully grok, jaffa4 really wants the :g modifier on regexes.
15:16 masak and he has a number of un-constructive ways of letting the channel know.
15:19 * IllvilJa contemplates how 'DRY' would be appropriate here...
15:20 masak well, it's ok for a newcomer not to understand something the first time.
15:20 iblechbot joined #perl6
15:20 moritz_ IllvilJa: DRY would be to submit a ticket with a feature request
15:20 masak but this is not a newcomer, and it's not a question of forgetting once and needing to be reminded.
15:22 IllvilJa I understand.  Hope it works out in the long run though.  I really would like to see the general friendliness on this IRC channel prevail.
15:23 moritz_ IllvilJa: me too.
15:23 moritz_ IllvilJa: it's just that in some rare cases, being friendly is detriminal to being good
15:23 moritz_ and in these cases, we try to be good, not friendly
15:25 nihiliad joined #perl6
15:25 masak I have nothing against jaffa4, and would love to see him functioning constructively in #perl6. so far, he hasn't.
15:25 IllvilJa An exercise in balancing different needs, and an exercise in diplomacy.  But I agree those exercises are distracting.  They consume both time and effort.
15:27 IllvilJa Well, I'll keep my fingers crossed.  Me, on my part, have not contributed much either (just one niche perl 6 module which I have not maintained since I created it).
15:27 IllvilJa (But I say 'howdy folks' from time to time)
15:27 masak IllvilJa: in a channel where development, newbie questions and frivolous OT conversation is signal, one person's persistent beating of one dead horse is noise.
15:28 moritz_ masak: don't forget botsnack :-)
15:28 masak :)
15:29 moritz_ phenny: tell pmichaud that I pushed 082caee15e26038b615204b27034563706a16253 without asking you first - hope you like it, if not feel free to revert
15:29 phenny moritz_: I'll pass that on when pmichaud is around.
15:32 dalek rakudo: 8d99ca2 | moritz++ | CREDITS:
15:32 dalek rakudo: update my CREDITS entry
15:32 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/8​d99ca2bc251b9668beb7d551a27ee9448540fe2
15:32 dalek rakudo: c868fc1 | moritz++ | tools/contributors.pl:
15:32 dalek rakudo: [tools] new script contributors.pl
15:32 dalek rakudo: extracts name of contributors from 'git log', to be included in release
15:32 dalek rakudo: announcements
15:32 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c​868fc125cbc90ac6111a91637e1df2deb4dfe16
15:32 dalek rakudo: 082caee | moritz++ | docs/release_guide.pod:
15:32 dalek rakudo: [docs] instruct release manager to include a list of contributors in the announcement
15:32 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​82caee15e26038b615204b27034563706a16253
15:33 masak moritz_++
15:39 masak TimToady: oh hai. what should `for ^3 { my $a; BEGIN { say "!"; $a = 42 }; say $a }` output in Perl 6? in Perl 5, it gives "!\n42\n[warn]\n[warn]\n".
15:43 gurjeet joined #perl6
15:45 gurjeet left #perl6
15:50 M_o_C joined #perl6
15:51 TimToady perhaps the sane thing to do is, rather than initializing 'my $a' to Any always, initialize it to its final value in the compiled lexpad's block, which is *usually* Any
15:52 TimToady but not in this case
15:53 masak hm, seems we're at least using the same primitives in thinking about this :)
15:53 masak specifically, "the compiled lexpad's block".
15:53 TimToady so somehow the above turns into 'for ^3 { my $a = 42; say $a }'
15:54 masak so, "!\n42\n42\n42\n", then.
15:54 TimToady the only other sane thing is to throw the 42 out entirely, and that's going to be Less Expected
15:55 masak what Perl 5 does is also reasonably sane, but still a bit surprising, I guess.
15:55 TimToady p5 is sane there only because some blocks are not closures
15:56 masak right. so that's not even an option in Perl 6.
15:56 TimToady so the first time through, it just uses the compile-time value, and the lexpad resets at the end
15:57 TimToady the also shows up in the infamous 'will not stay shared' message for real closures
15:57 TimToady *this also
15:57 masak I think much of the runtime environment needs to already exist at compile time, for BEGIN to run in. after compilation, the runtime just keeps running on the same environment.
15:57 TimToady but it's kinda like testing your loops at the wrong end
15:59 TimToady so this is a fossil of the pre-closure days of Perl; in the p6 model of everything being a closure, we need to be more consistent
15:59 masak aye.
16:02 masak I'm thinking something like the following happens: (*) compilation starts (*) BEGIN block runs and sets $a in some lexpad (*) compilation ends and runtime starts (*) for each iteration, the lexpad from the compilation phase is cloned and used.
16:02 TimToady for some definition of cloning, yes.
16:03 justatheory joined #perl6
16:03 TimToady it's a funny kind of genericity
16:05 TimToady documenting it that way might help understanding
16:05 masak aye.
16:06 TimToady though next thing you know someone will want a hook that runs at cloning time...
16:06 masak :)
16:06 TimToady ENTER is probably close enough for that
16:07 * masak was just going to suggest that :)
16:07 TimToady though I think cloning happens before ENTER, or we don't have a lexpad that ENTER can see
16:08 masak probably close enough for most people.
16:08 TimToady and probably too close for other people :)
16:09 lichtkind joined #perl6
16:09 * masak looks forward to playing around with phasers
16:10 lichtkind masak: did kirk allow you that?
16:10 masak lichtkind: I'll be making my own, outside of his jurisdiction.
16:12 TimToady we probably need to not use the word "cloned", since closure cloning is a rarer thing than mere activation
16:12 TimToady this is just initializing an activation record
16:13 masak ok.
16:13 TimToady in the for loop, the closure is cloned once, but activated 3 times
16:14 masak there's one variable, but it refers to three different locations.
16:14 masak is it the activation that assigns the name to a location?
16:14 TimToady no, it reuses the same location
16:15 masak that only works if there's no external reference to that closure.
16:15 masak or maybe I'm confused here.
16:16 snarkyboojum rakudo: my @a = <1 2 3>; for @a -> $a, $b { say $a; say $b }
16:16 p6eval rakudo 082cae: OUTPUT«1␤2␤StopIteration␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
16:17 TimToady for ^3 { state $x++ } will use the same location of $x each time because it's only one closure clone, when the {} is evaluated and passed to the 'for'
16:17 masak *nod*
16:18 TimToady for ^3 { my $x = { state $x++ } } will end up with three different state variables
16:18 TimToady sorry, confusing example
16:18 bradb joined #perl6
16:19 TimToady so, unless we put state variables somewhere special outside the active lexpad, we *must* reuse the same lexpad for re-invocation
16:20 TimToady (and then you have to worry about recursion)
16:20 cdarroch joined #perl6
16:20 cdarroch joined #perl6
16:20 masak I can see how this gets tricky.
16:20 gurjeet joined #perl6
16:22 gurjeet moritz_: It seems tha on line 118, ilbot2.pl does not get the nick that was kicked: http://irclog.perlgeek.de/​perl6/2010-04-27#i_2269531
16:22 moritz_ gurjeet: thanks, I'll have a look
16:23 gurjeet The concat operator raises the warning: http://irclog.perlgeek.de/​perl6/2010-04-27#i_2269531
16:23 gurjeet sorry: Use of uninitialized value in concatenation (.) or string at ./ilbot2.pl line 118.
16:23 TimToady actually, I don't think we've properly specced what state vars do on recursion
16:24 am0c joined #perl6
16:26 moritz_ in perl 5, all call frames of the same routine share their state vars
16:36 pugssvn r30483 | colomon++ | [Spec] Note that the various minmax methods, subs, and operators return a Range.
16:38 pugssvn r30484 | colomon++ | [Spec] Range.minmax is now Range.bounds.
16:42 TimToady moritz_: for some definition of "routine"; different clones of a closure do not share
16:43 moritz_ TimToady: ok; I meant things like sub a { state $x; a() if $cond; ... }
16:43 TimToady yes
16:43 TimToady but for (1..3) { my $x = sub { state $s++; say $s }; $x->(); } will print 1 1 1
16:44 TimToady perl6: for ^3 { my $x = { state $s++; say $s }; $x() }
16:44 p6eval pugs: OUTPUT«1␤1␤1␤»
16:44 p6eval ..elf 30484: OUTPUT«Unknown rule: scope_declarator:state␤It needs to be added to ast_handlers.␤ at ./elf_h line 2850␤»
16:44 p6eval ..rakudo 082cae: OUTPUT«Symbol '$s' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
16:44 moritz_ alpha: for (1..3) { my $x = sub { state $s++; say $s }; $x() }
16:44 p6eval alpha 30e0ed: OUTPUT«1␤1␤1␤»
16:45 TimToady perl6: my $x = { state $s++; say $s; $x() if $s < 10; }; $x();
16:45 p6eval elf 30484: OUTPUT«Unknown rule: scope_declarator:state␤It needs to be added to ast_handlers.␤ at ./elf_h line 2850␤»
16:45 p6eval ..rakudo 082cae: OUTPUT«Symbol '$s' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
16:45 p6eval ..pugs: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
16:45 TimToady alpha: my $x = { state $s++; say $s; $x() if $s < 10; }; $x();
16:45 p6eval alpha 30e0ed: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
16:45 TimToady at least everyone is agreed :)
16:46 TimToady well, everyone that implements it
16:49 pugssvn r30485 | moritz++ | [t/spec] turn an example of state variables by TimToady++ into a test
16:52 * TimToady is thinking about state $s; BEGIN { $s = 42; } and how state vars are perhaps just an indirection from the generic activation pad so everyone who copies that pad for activation gets the same state var
16:53 TimToady (closure clones would have to clone the generic pad and create new state vars though)
16:54 TimToady pugs: state $s; BEGIN { $s = 42; }; say ++$s;
16:54 p6eval pugs: OUTPUT«43␤»
16:54 TimToady alpha: state $s; BEGIN { $s = 42; }; say ++$s;
16:54 p6eval alpha 30e0ed: OUTPUT«Symbol '$s' not predeclared in <anonymous> (/tmp/2h36ug4oOY:10)␤in Main (file <unknown>, line <unknown>)␤»
16:54 * diakopter tries to understand the last 10 msgs from TimToady
16:55 * TimToady too
16:56 * diakopter thinks named subs aren't cloned, so they have just one of each state
16:56 diakopter but each clone keeps its state across recursions of it
16:57 isBEKaml joined #perl6
16:57 TimToady I would rather say that named subs are generally only cloned once
16:57 diakopter yes, that.
16:57 diakopter that's what I meant :)
16:59 riffraff joined #perl6
17:01 diakopter named-only subs, that is
17:01 TimToady there is some argument that 'sub foo {...}; my $ref = &foo;' should clone as well
17:01 diakopter yes
17:02 diakopter I'm reading 'clone' as 'take a closure of the surrounding lexical scopes'.
17:02 TimToady though an interesting question is what to do when the 'sub foo' and the '&foo' are in different scopes
17:03 diakopter as in    sub a($x) { return sub { state $s++; say $s + $x }; say a(4)()
17:03 diakopter every time a() is invoked, that inner sub is cloned
17:04 diakopter TimToady: plz no nonlocal closuring :D
17:05 TimToady obviously the &foo's scope doesn't really matter, in the sense that there's no variable refs in the current lexical scope
17:05 TimToady the only lexical scope sub foo has is, well, its own lexical scope
17:05 diakopter <whew>
17:06 TimToady but that could be most anywhere
17:06 TimToady so you can be take a closure over variables you can't see :)
17:06 TimToady *taking
17:06 diakopter so in that sense, &foo becomes sortof a BEGIN block-ish
17:07 diakopter well, I take that back
17:07 bradb joined #perl6
17:07 diakopter the surrounding code (around the foo declaration) will already have run
17:08 diakopter by the time &foo is created
17:08 diakopter at least once.
17:09 diakopter so  &foo  could mean 'take a closure of the deepest invocation of foo's scope that's also still activ'
17:09 diakopter bleh
17:11 colomon rakudo: say "inner" ~~ "inner"
17:11 p6eval rakudo 082cae: OUTPUT«1␤»
17:15 diakopter TimToady: ok, I revise my recommendation such that &foo always everywhere refers to the same closure (and thus state) of foo.
17:19 TimToady in fact, I think pugs desugars inner named subs into closures and bindings; we had a long discussion one hackathon (Toronto?) about when that binding to &foo happens, at ENTER time or when the 'sub' is 'executed'
17:19 TimToady I believe we settled on ENTER time
17:20 TimToady otherwise post-declared subs don't work
17:21 diakopter 'splain more?
17:23 masak [Coke], IllvilJa: just so you know, I've privmsg'd a bit with jaffa4 and asked his forgiveness for giving him impatient and hubristic answers earlier today. :/ he was graciously understanding.
17:26 masak afk &
17:27 avar joined #perl6
17:30 TimToady in pugs, { sub foo {...} } desugars to something like { ENTER my &foo := {...} }
17:30 TimToady so inner subs are cloned every time their outer scope is entered
17:31 stephenlb joined #perl6
17:31 TimToady (this can be optimized away if it's provable that &foo does escape)
17:32 TimToady *doesn't
17:32 TimToady my n't key is busted again
17:33 diakopter ah, yes. but what about our subs
17:34 [Coke] masak: I would like to point out the irony in my world of me being a force for diplomacy.
17:34 [Coke] and masak++
17:34 TimToady well, our thingies officially live in the package, and the lexical name is only an alias
17:34 moritz_ TimToady: can you tell where in STD.pm6 s/// is parsed? I have no idea what to search for :/
17:35 TimToady I do :)
17:35 TimToady you want sibble
17:35 moritz_ thanks
17:35 TimToady that's the 's' nibbler
17:36 moritz_ and babble parses the modifiers, right?
17:37 moritz_ rakudo: say q:x/echo hello/
17:37 p6eval rakudo 082cae: OUTPUT«Colons may not be used to delimit quoting constructs at line 11, near ":x/echo he"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
17:37 moritz_ alpha: say q:x/echo hello/
17:38 p6eval alpha 30e0ed: OUTPUT«operation not permitted in safe mode␤in Main (file /tmp/PoajZwm4nd, line 1)␤»
17:39 TimToady yes, babble tweaks the current slang according to the modifiers
17:39 [Coke] colomon: Range.bound or Range.bounds ?
17:40 colomon bounds, [Coke]++
17:41 moritz_ std: s :g / foo /
17:41 p6eval std 30485: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/LuO4o2gXZo line 1 (EOF):␤------> [32ms :g / foo /[33m⏏[31m<EOL>[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/LuO4o2gXZo line 1
17:41 p6eval ..(EOF):␤-…
17:41 moritz_ std: s :g/ foo /
17:41 p6eval std 30485: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/nf2MHuQHU2 line 1 (EOF):␤------> [32ms :g/ foo /[33m⏏[31m<EOL>[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/nf2MHuQHU2 line 1
17:41 p6eval ..(EOF):␤--…
17:41 moritz_ std: s:g/ foo /
17:41 TimToady missing final /
17:41 moritz_ oh, right
17:41 p6eval std 30485: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/JaK1TVshnJ line 1 (EOF):␤------> [32ms:g/ foo /[33m⏏[31m<EOL>[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/JaK1TVshnJ line 1
17:41 p6eval ..(EOF):␤---…
17:41 pugssvn r30486 | colomon++ | [Spec] .bound should have been .bounds.
17:41 * TimToady channels MJD
17:41 * moritz_ hides
17:42 TimToady #11919 No.  You must believe the ERROR MESSAGE.  You MUST believe the error message.
17:43 TimToady mind you, the ERROR MESSAGE was not exactly AWESOME
17:43 TimToady but it did point to the problem
17:43 moritz_ aye
17:44 TimToady in fact, I'd go as far as to say that the message is WRONG
17:45 TimToady since it's no longer in the regex part...
17:45 moritz_ so I must believe the wrong error message? :-)
17:45 TimToady well, if I change it, you must still believe it :)
17:47 moritz_ there's something to be said for being dictator :-)
17:48 TimToady std: s:g /x/
17:48 p6eval std 30485: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared routine:␤      's:g' used at line 1␤Check failed␤FAILED 00:01 108m␤»
17:48 TimToady overzealous backtracking...
17:48 TimToady bbl &
17:50 nihiliad joined #perl6
17:58 TimToady std: s :g /foo/
17:58 p6eval std 30486: OUTPUT«[31m===[0mSORRY![31m===[0m␤Bogus term at /tmp/gKfoPrAUOX line 1 (EOF):␤------> [32ms :g /foo/[33m⏏[31m<EOL>[0m␤Undeclared routine:␤    'foo' used at line 1␤Parse failed␤FAILED 00:01 111m␤»
17:59 TimToady that's parsed as s( :g / foo
17:59 TimToady and then it doesn't know why you put a / there
17:59 TimToady again, caused by unwarranted backtracking
17:59 bradb joined #perl6
18:01 TimToady sibble is missing an ||panic
18:02 slavik TimToady: this is why we need STAR ;)
18:03 lichtkind moritz_: whats the difference between rx as routine trait and rw parameter trait?
18:03 lichtkind s/rx/rw/
18:04 moritz_ lichtkind: as a routine trait it's an lvalue routine
18:05 moritz_ the kind of accessor you get for   has $.attrib is rw;
18:06 lichtkind ah yes i remember thanks
18:07 lichtkind moritz_: but whyt actually does that?
18:07 moritz_ lichtkind: return an object you can assign to
18:08 lichtkind moritz_: superb so http://wiki.perl-community.de/Wissensbasi​s/Perl6TafelAnhangB#Routineneigenschaften is already correct :)
18:10 lisppaste3 gurjeet pasted "'kicked' patch for ilbot" at http://paste.lisp.org/display/98450
18:10 gurjeet moritz_: ^^^
18:12 moritz_ gurjeet: thanks, pushed
18:12 moritz_ lichtkind: yes
18:22 pugssvn r30487 | lwall++ | [STD] panic on missing replacement parts for s/// and tr///
18:23 TimToady oh, and a moritz_++
18:23 diakopter std: s|a|a|
18:24 p6eval std 30486: OUTPUT«ok 00:01 107m␤»
18:24 TimToady stoppers generally take precedence over infixes
18:25 diakopter is the ENTER thing specd? it'd be naiss
18:25 TimToady which ENTER thing
18:25 diakopter sub bound
18:26 diakopter inner subs bound at ENTER time
18:26 TimToady not sure
18:31 TimToady S04:1617 or thereabouts
18:32 * jnthn back
18:32 jnthn The Perl 6 talks went well. \o/
18:32 jnthn *talk
18:32 masak \o/
18:33 jnthn Got good feedback too.
18:34 masak anything in particular?
18:34 jnthn When going through feedback forms with your boss, if he notes the only slightly negative comment written was, "sometimes a little deep and fast", then it turns out further discussion of the point ends very quickly if you come out with "that's what she said!"
18:35 pugssvn r30488 | lwall++ | [S04] clarify that state is shared by recursion to the same clone
18:35 pugssvn r30488 | remove some ::= fossils
18:35 chitragupt joined #perl6
18:35 jnthn masak: Overall the interest was high, I think people were surprised both by how alive Perl 5 is and how coll Perl 6 is.
18:35 jnthn *cool
18:35 diakopter TimToady: thnx; that's very helpful :)
18:36 diakopter S04++
18:36 masak jnthn: that seems to be a common reaction of outsiders :)
18:37 jnthn One of them was inside enough to know to ask how Perl 6 interop with Perl 5 played out with XS though. :-)
18:37 * moritz_ tried to make s:g/// parse - adding a ':g'? to the quote:sym<s> rule caused a weird parse failure in the setting
18:37 jnthn Anyway, I think it was very well received. :-)
18:38 TimToady moritz_: LTM issue perhaps
18:38 colomon jnthn++
18:39 moritz_ TimToady: maybe
18:39 [Coke] LTM is also Less Than Mawsome.
18:40 jnthn .oO( Less Than Moresome )
18:41 jnthn #rs in 17
18:43 colomon thank you for reminding me!  I've got my nose in a tricky $work problem...
18:43 masak I'm thankful to be reminded, too.
18:44 TimToady std: s :g /foo/
18:44 p6eval std 30487: OUTPUT«[31m===[0mSORRY![31m===[0m␤Bogus term at /tmp/cujS0LGqzO line 1 (EOF):␤------> [32ms :g /foo/[33m⏏[31m<EOL>[0m␤Undeclared routine:␤    'foo' used at line 1␤Parse failed␤FAILED 00:02 109m␤»
18:44 TimToady ENOTYET
18:44 cls_bsd joined #perl6
18:44 TimToady I still love it how the version number lies :/
18:45 moritz_ TimToady: does 'make snap' record the correct version number anywhere?
18:47 [Coke] jnthn: hey, have chromatic's line number fixes helped at all, or are we still stuck on the NS/method issue?
18:47 TimToady moritz_: I doubt it
18:49 jnthn [Coke]: I didn't get us building on latest yest.
18:49 [Coke] jnthn: ok. I'll mention it again in #ps today.
18:49 cls_bsd joined #perl6
18:49 jnthn *yet...though "yest" sounds like the Slovak word for "yet" :-)
18:50 jnthn [Coke]: I think it's something needing fixing in p6object now that :nsentry works rather than a Parrot bug fwiw.
18:52 am0c joined #perl6
18:54 cls_bsd joined #perl6
18:58 ShaneC joined #perl6
18:59 cls_bsd joined #perl6
19:00 jnthn #rs
19:00 jnthn pmichaud: Rakudo Sketch now, if you happen to be about.
19:02 uniejo joined #perl6
19:03 TimToady std: s :g /foo/
19:03 p6eval std 30488: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed replacement part; couldn't find final / at /tmp/yyo5NSmUWg line 1:␤------> [32ms :g /foo/[33m⏏[31m<EOL>[0m␤    expecting escape␤Parse failed␤FAILED 00:01 110m␤»
19:14 SmokeMachine joined #perl6
19:18 smash__ joined #perl6
19:18 smash__ hello everyone
19:20 masak smash__: \o
19:29 * masak finds http://dev.perl.org/perl6/talks/2002/topaz-v2.pdf an archeologically interesting read
19:30 bradb joined #perl6
19:31 masak chip left a comment on my blog the other day, to the effect that he called Topaz Topaz precisely so that it shouldn't taint the name 'Perl 6' with bad PR.
19:31 alester joined #perl6
19:31 masak what happened to Topaz?
19:32 TimToady reimplementing insanity is insane
19:33 masak perlfaq1: '[...] Topaz provided valuable insights to the next version of Perl and its implementation, but was ultimately abandoned.'
19:34 [Coke] TimToady: ... what does that make you? =-)
19:34 masak Ponie has a nice post-mortem document. http://www.nntp.perl.org/group/pe​rl.ponie.dev/2006/08/msg487.html
19:34 masak I guess Topaz never had one of those.
19:37 masak "Sapphire was another early prototype that influenced the shape of Perl 6 internals. It was a one-week project in September 2000. The brainchild of Simon Cozens, Sapphire was another rewrite of Perl 5 internals. It was never intended for release, only as an experiment to see how far the idea could go in a week, and what lessons could be learned."
19:37 masak wow, I'd never heard of Sapphire.
19:39 masak it's from this article: http://www.developer.com/lang/perl/article.php/1​0940_3076571_2/Perl-6-and-the-Parrot-Project.htm
20:00 diakopter '[...] provided valuable insights to the next version[s] of Perl and its implementation[s], but was ultimately abandoned.'
20:03 eternaleye joined #perl6
20:09 dark_soul joined #perl6
20:10 dark_soul left #perl6
20:12 drewk joined #perl6
20:14 sbp- joined #perl6
20:21 dalek csmeta: r206 | diakopter++ | trunk/Sprixel/ (3 files):
20:21 dalek csmeta: [perlesque] fix bug found by jaffa4; thanks!
20:21 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=206
20:26 literal joined #perl6
20:33 rhr joined #perl6
20:36 Guest69093 joined #perl6
20:40 masak snarkyboojum: just added a --target argument to the yapsi script.
20:45 dalek csmeta: r207 | diakopter++ | trunk/Sprixel/src/Perlesque/Operators.cs:
20:45 dalek csmeta: [perlesque] remove ++/--; too tricky at this layer (and easy enough to codegen
20:45 dalek csmeta: at another layer).
20:45 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=207
20:49 uniejo left #perl6
20:50 dalek csmeta: r208 | anteus4++ | trunk/Sprixel/t/controlflow.t:
20:50 dalek csmeta: more tests
20:50 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=208
20:50 moritz_ ++ and -- really just desugar to .succ and .pred anyway, no?
20:52 colomon no
20:52 colomon .succ and .pred don't modify in place.  (I think)
20:52 colomon rakudo: my $a = 1; say $a.succ; say $a
20:52 p6eval rakudo 082cae: OUTPUT«2␤1␤»
20:53 colomon well, okay, for some definition of desugar, I supposed.  :)
20:53 colomon rakudo: my $a = 1; say $a .= succ; say $a
20:53 p6eval rakudo 082cae: OUTPUT«2␤2␤»
20:56 jnthn ++ should be implemetned in terms of .succ, iirc.
20:56 jnthn it's like self = self.succ
20:56 jnthn modulo returning the "what I used to be"
20:56 jnthn for postfix.
20:57 * jnthn reading for a bit
21:01 rurban joined #perl6
21:01 masak both of them return an lvalue, though, don't they?
21:02 masak alpha: my $a; ++$a = 4; say $a; $a++ = 42; say $a
21:02 p6eval alpha 30e0ed: OUTPUT«4␤5␤»
21:02 masak hm, maybe not.
21:02 moritz_ I don't think so
21:02 eternaleye joined #perl6
21:02 masak I'm a bit surprised that $a++ = 42 doesn't blow up :)
21:02 colomon rakudo: my $a; ++$a = 4; say $a; $a++ = 42; say $a
21:02 p6eval rakudo 082cae: OUTPUT«4␤Cannot assign to readonly value␤current instr.: '&die' pc 17354 (src/builtins/Junction.pir:393)␤»
21:03 colomon std: my $a; ++$a = 4; say $a; $a++ = 42; say $a
21:03 p6eval std 30488: OUTPUT«ok 00:01 111m␤»
21:03 masak ah; fixed in master :)
21:03 masak well, it should parse OK.
21:03 moritz_ masak: alpha was never really strict about lvalueness
21:03 masak *nod*
21:03 moritz_ objects are allowed to return lvalues from any operators, really
21:03 jnthn Yes, we switched to "readonly by default" in master. :-)
21:03 jnthn Which works out...rather better. :-)
21:04 moritz_ good default
21:04 jnthn Yes, pmichaud++ for that call.
21:06 masak time to go home. 'night, #perl6
21:06 moritz_ 'night masak
21:06 colomon o/
21:06 colomon how do you return an lvalue?
21:07 rgrau_ joined #perl6
21:08 moritz_ with 'is rw' on the routine
21:09 colomon ah, sensible.
21:09 moritz_ just read #rs backlog...
21:09 moritz_ one things that's really broken with meta operators is slice context (and always has been)
21:09 colomon eh?
21:10 moritz_ things like Z,
21:10 moritz_ can't return somethiing sensible in current rakudo
21:10 colomon oh, yes.
21:10 colomon I think that's just list / iterator issues again.
21:10 moritz_ aye
21:10 colomon but maybe there's something subtle there I don't understand.
21:10 moritz_ I think we can put that into list+slice corner, and mark meta ops as done
21:13 wknight8111 joined #perl6
21:14 colomon It's hard for me to judge -- my feeling is we've probably done 90% of the 10% needed to make 90% of the people happy.
21:14 colomon If you know what I mean.
21:15 bradb joined #perl6
21:15 moritz_ well, can you think of some examples of the 10% we haven't done of the first 10%? :-)
21:17 TiMBuS joined #perl6
21:19 plobsing joined #perl6
21:23 colomon sorry, was ordering noms
21:23 colomon hypers on hashes
21:23 colomon handling multiple Zopzs or Xops in an expression
21:24 colomon like @a Z @b Z @c
21:24 colomon probably can't next them because of the gather/take bug
21:25 colomon *nest
21:26 nihiliad joined #perl6
21:28 Tene is that still an issue.  argh.
21:28 Tene ><
21:30 dalek csmeta: r209 | anteus4++ | trunk/Sprixel/ (3 files):
21:30 dalek csmeta: more operator tests
21:30 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=209
21:30 colomon we allow !op on all sort of operators that shouldn't have it, don't know how much I worry about that.  :)
21:32 colomon do we know if they work on user defined operators at the moment?
21:32 smash__ can't run rakudo's 'perl6' !? fresh checkout&compile
21:33 smash__ "dyld: lazy symbol binding failed: Symbol not found: _tgetent"
21:33 colomon rakudo: sub infix:<∂>($a, $b) { ($a + $b) / 2 }; say 4 ∂ 7;
21:33 p6eval rakudo 082cae: OUTPUT«5.5␤»
21:34 colomon rakudo: sub infix:<∂>($a, $b) { ($a + $b) / 2 }; my @a = 1..4; say (@a >>∂>> 9).perl
21:34 p6eval rakudo 082cae: OUTPUT«Could not find sub &infix:<∂>␤current instr.: '' pc -1 ((unknown file):-1)␤»
21:34 colomon rakudo: our sub infix:<∂>($a, $b) { ($a + $b) / 2 }; my @a = 1..4; say (@a >>∂>> 9).perl
21:34 p6eval rakudo 082cae: OUTPUT«[5/1, 11/2, 6/1, 13/2]␤»
21:34 colomon Ah, so they work with our.  That would be okay for R* IMO.
21:34 colomon gotta go fetch noms.
21:39 dalek csmeta: r210 | diakopter++ | trunk/Sprixel/ (4 files):
21:39 dalek csmeta: [perlesque] fixed yet another bug found/reported by jaffa4 (and his writing of
21:39 dalek csmeta: tests).  thanks!  ++jaffa4
21:39 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=210
22:06 nihiliad joined #perl6
22:09 isBEKaml hello #perl6!
22:09 isBEKaml say doesn't work on lists?
22:09 isBEKaml rakudo: my @lists=(1,2,3); say @lists; print @lists;
22:09 p6eval rakudo 082cae: OUTPUT«123␤123»
22:10 isBEKaml that's odd, I don't see it on my perl6 interpreter...
22:14 dalek csmeta: r211 | diakopter++ | trunk/Sprixel/src/Perlesque/TopLevel.cs:
22:14 dalek csmeta: [perlesque] separate perlesque building from perlesque executing; use the
22:14 dalek csmeta: resulting perlesque.exe now to invoke it.
22:14 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=211
22:14 lichtkind moritz_: ping?
22:30 supernovus joined #perl6
22:31 jnthn Ah, I think I've managed to golf the problem on latest Parrot down to 12 lines of PIR.
22:32 jnthn ah, 11
22:32 jnthn and pure PIR example with no Perl 6 deps.
22:32 jnthn Seems it may well be a Parrot bug after all.
22:35 isBEKaml rakudo: my @lists=('b','a','c'); say "lists: @lists"
22:35 p6eval rakudo 082cae: OUTPUT«lists: @lists␤»
22:35 isBEKaml uhh, interpolation?
22:36 isBEKaml rakudo: my @lists=('b','a','c'); say "lists: ",@lists;
22:36 Tene rakudo: my @lists=('b','a','c'); say "lists: @lists[]"
22:36 p6eval rakudo 082cae: OUTPUT«lists: bac␤»
22:36 p6eval rakudo 082cae: OUTPUT«lists: b a c␤»
22:37 isBEKaml :)
22:37 Tene You need the trailing [] to interpolate arrays in Perl 6.
22:38 kensanata joined #perl6
22:38 isBEKaml I see...  thanks.
22:40 cj mumle
22:40 cj mumble
22:40 cj sorry, I mumbled that.
22:41 cj if I wanted a regular expression test suite, where might I look?
22:41 cj I'm trying to grok pcre's, but I am with the fail currently.
22:42 cj «I am so happy I can type this... now why can't I read it?»
22:52 k23z__ joined #perl6
23:07 _jaldhar joined #perl6
23:08 isBEKaml I'm reading through the perl6book, currently on page 10, is there a typo there in the line: [max] @scores.key.chars ?
23:08 isBEKaml when I try that out on my p6 interpreter, I get this: Method 'key' not found for invocant of class 'Array'
23:08 jnthn I think it wants to me .keys
23:08 isBEKaml I changed the key to keys.
23:09 isBEKaml yes, I was thinking exactly that. :)
23:10 isBEKaml jnthn: how do I get to know the native type of variables? I saw .WHAT, but that seems to apply to objects.
23:11 jnthn isBEKaml: .WHAT is meant to be macro-ish and can thus apply to anything.
23:11 isBEKaml jnthn: working through that example in p6book, after replacing .key with .keys, I get this: Method 'Num' not found for invocant of class 'Pair'
23:11 jnthn isBEKaml: Note that we don't implement in Rakudo yet the native (lowercase) types though.
23:11 jnthn oh
23:12 isBEKaml jnthn: apparently, it seems to be some number format error.
23:12 jnthn er, calling .chars in what .keys returns is...huh.
23:12 * jnthn is confused
23:12 jnthn isBEKaml: I'll have to go look at the example, but i'm sorta tied up with something else ATM.
23:13 isBEKaml jnthn: okay. I'll work it out and let you know if I find anything. Can you tell me what that error means?
23:13 isBEKaml as I said, it appears to be a number format error,  occurs when doing arith operations.
23:13 jnthn isBEKaml: Something is trying to numify a pair object
23:14 jnthn isBEKaml: Perhaps wrongly.
23:14 jnthn It kinda doesn't make sense to do so.
23:15 jnthn isBEKaml: Which chapter in the book?
23:15 isBEKaml jnthn: chapter 3, first page.
23:17 isBEKaml jnthn: does [max] @array return a Pair object?
23:18 isBEKaml rakudo: my @array = a => 1, b => 2, c=> 33; my $ss = [max] @array; say $ss.WHAT;
23:18 p6eval rakudo 082cae: OUTPUT«Pair()␤»
23:19 jnthn oh!!
23:19 jnthn http://github.com/perl6/book/​raw/master/src/operators.pod
23:19 jnthn isBEKaml: bookbug
23:19 jnthn isBEKaml: The PDF misses out some characters that are...very important! :-)
23:19 isBEKaml jnthn: hmm, that's exactly what happened. :)
23:19 isBEKaml jnthn: gee, I hit this on the second day of my initiation to p6! :D
23:20 jnthn Thanks for finding and reporting the bug. Unfortunately, I'm not quite sure how to fix the PDF generation.
23:21 gurjeet joined #perl6
23:21 chitragupt joined #perl6
23:21 jnthn phenny: tell moritz_ if you're in the know at all on the book PDF gen, the operators.pod example loses its » in the PDF, which makes the example have a FAIL. Maybe we could fix it, or even just use the ASCII >> instead, since it's a bit easier for people to type. ;-)
23:21 phenny jnthn: I'll pass that on when moritz_ is around.
23:22 jnthn phenny++
23:22 isBEKaml jnthn: one more minor formatting thing I found in the p6book, chapter 2 last page. Bold text shown as <B somethings>
23:24 jnthn Eww, yes, good catch too.
23:36 isBEKaml jnthn: Can you tell me what that � character mean there?
23:37 jnthn It's another way to write >>
23:37 jnthn Essentially >>. or ». means "call this method on everything in the list"
23:37 jnthn for example
23:37 jnthn rakudo: my @a = -2, -5, -8; my @b = @a>>.abs; say @b.perl;
23:37 p6eval rakudo 082cae: OUTPUT«[2, 5, 8]␤»
23:38 jnthn So it calls .abs on each thing in the list and makes a new list out of the return values.
23:38 isBEKaml jnthn: ah, i see..
23:39 PerlJam isBEKaml: It also has no guaranteed order of execution for potential parallelism
23:39 isBEKaml PerlJam: I don't understand you. Explain further?
23:40 isBEKaml PerlJam: Do you mean to say concurrency takes a hit?
23:40 eternaleye isBEKaml: It doesn't guarantee what order they happen in, so as to allow parallelizing them
23:40 PerlJam isBEKaml: in jnthn's example, it could have computed -8.abs first or -2.abs first, or done all three at once
23:41 TimToady careful, -8.abs is -8  :)
23:41 PerlJam TimToady++ :)
23:41 isBEKaml PerlJam: thanks. :)
23:41 isBEKaml TimToady: :)
23:42 PerlJam TimToady: can't you see those invisible parens that were in my brain?
23:42 TimToady occasionally I wonder if there's a way to fix that
23:43 TimToady crops up all the time with ^$n as well
23:43 TimToady like some unaries would prefer to be tighter than methods
23:46 isBEKaml PerlJam: invisible parens? does abs only work on lists? I mean, if () is in list context?
23:46 PerlJam isBEKaml: no, () are for grouping, not listing
23:46 TimToady he means (-8).abs
23:46 isBEKaml TimToady: I got that when I tried it out on rakudo shell. :)
23:47 TimToady rakudo: say ^10.Str.say
23:47 p6eval rakudo 082cae: OUTPUT«10␤0␤»
23:47 isBEKaml TimToady: I think I'm going to lose it, looking at too many contexts. :D
23:47 TimToady rakudo: say (^10).Str.say
23:47 p6eval rakudo 082cae: OUTPUT«0 1 2 3 4 5 6 7 8 9␤1␤»
23:49 PerlJam TimToady: just make some unicode versions of a different precedence  :)
23:49 TimToady uh-huh
23:51 * PerlJam contemplates a more verbose solution ...  negative.8.abs   hat.10.Str.say
23:51 PerlJam ;-)
23:51 PerlJam I suddenly feel like coding in ruby
23:52 TimToady 10.times.Str.say
23:55 * jnthn takes an early (for some defintion) night
23:55 jnthn o/
23:56 jnthn (ohbtw...there is a Parrot bug keeping us from running on latest Parrot rather than just something I need to tweak.)
23:56 jnthn (filed it...hard to guess at how long a fix will take, given opinions on the bug vary between very hard and not so hard...)
23:56 * jnthn really gone
23:57 ruoso joined #perl6

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs