Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2005-05-27

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 autrijus evalExp (App "&meth" (Just $ Val $ VObject obj) [])
00:00 clkao i'm sorry to play the insane part
00:00 autrijus I'm happy to play the game part
00:00 chromatic Ahhh, right.  I had seen that before.
00:00 clkao qukc it's 1am
00:00 stevan let me rephrase
00:00 clkao quick
00:00 clkao got your commit
00:00 stevan some insane C vs. insane Haskell game :)
00:01 autrijus clkao: gah there's no callsv form
00:01 autrijus clkao: we're doomed
00:01 kelan has left
00:01 autrijus clkao: can you fix the api for me?
00:01 svnbot6 r3936, autrijus++ | * obj invocation now carries env around too
00:02 autrijus clkao: add a perl5_call_sv  form
00:02 autrijus the same as _call but gets a SV*sub
00:02 autrijus you do the C side. I'll handle FFI
00:02 clkao eek
00:02 autrijus quick, it's just copy/paste
00:02 autrijus (or refactor if you'd like)
00:02 clkao I TOLD you yuesterady we need a flag to say call_method and call_sv
00:03 autrijus yeah and I FORGOT that
00:03 clkao i'm fixing other stuff
00:03 jannic_ has joined #perl6
00:03 clkao mkvalref is not giving env
00:04 autrijus alright. I'll handle callsv
00:04 chromatic Hm, is src/Pugs/AST/Internals.hs the place for this?  It defines the VObject constructor, but evalExp is out of scope there.
00:04 autrijus chromatic: you probably want Prim
00:04 autrijus chromatic: err, no
00:04 autrijus just define it in AST.hs
00:04 autrijus evalExp is in scope there
00:04 autrijus and you see AST.Internals symbols too
00:04 chromatic Yeah, I have to edit Prim for something else :)
00:05 autrijus alternatively move evalExp into Internals
00:05 autrijus but don't do that unless you have too
00:05 autrijus internals.hs is already too huge
00:05 chromatic I don't think I have to.
00:06 clkao pugs: user error (cannot fetch $pugs::env)
00:06 clkao fubar
00:07 autrijus eh.
00:07 jannic_ is now known as kelan
00:07 autrijus clkao: I'll make the api as such
00:07 autrijus perl5_call(SV *sub, SV *inv, SV** argsSV *env, int cxt)
00:07 autrijus doing so now
00:07 clkao alright
00:07 autrijus come to think about it
00:07 clkao *sigh*
00:07 autrijus I'll call it perl5_apply
00:07 clkao ekk
00:08 clkao autrijus: merge my chagnes
00:10 clkao what's the requirement for 6.28 btw?
00:11 autrijus clkao: OO
00:11 clkao oh we do have. plus legacy perl5 oo :)
00:12 autrijus ;)
00:12 svnbot6 r3937, clkao++ | Apply more ducktapes.
00:12 clkao quick, can't wait
00:16 autrijus almost there
00:17 autrijus merging yours
00:20 * crysflame blinks
00:20 crysflame clkao: porting svk?
00:21 clkao crysflame: not yet
00:21 autrijus but close
00:21 IshaCocoa has joined #perl6
00:21 clkao autrijus: shut up and hack
00:21 crysflame clkao++ # haha
00:21 clkao XD
00:22 * crysflame hands clkao a pompom with horns
00:22 mrborisguy did anybody ever figure out the "Could not find module `System.Eval':" problem?
00:22 autrijus VCode casted
00:22 autrijus mrborisguy: you probably need a new hs-plugins
00:22 clkao not terribly useful
00:22 autrijus and "make install ; make register"
00:22 mrborisguy newer than 20050501?
00:22 chromatic Ugh, addFinalizer wants an IO ().
00:24 autrijus chromatic: runEvalIO
00:24 chromatic runEvalIO App (...) [] ?
00:24 autrijus Out of memory during "large" request for 536875008 bytes, total sbrk() is 268541952 bytes.
00:24 autrijus chromatic: something like that. a sec
00:25 autrijus clkao: I'll commit borken code and you'll debug
00:25 clkao ok. what's obrken?
00:25 autrijus I don't know
00:25 autrijus it looks fine
00:25 autrijus but it complains out of memory
00:25 clkao gah
00:25 autrijus maybe I've written some bad C
00:25 autrijus committed
00:25 clkao getting
00:26 meppl gute nacht
00:26 autrijus meppl: 'nite
00:26 meppl ;)
00:26 autrijus chromatic: ok. what you need to do is to preserve the env context during destroy time
00:26 autrijus chromatic: that is actually nontrivial... hm
00:27 autrijus since the env may have already passed away
00:27 chromatic Let me diff and nopaste what I have so far.
00:27 autrijus so you need to write to some IORef
00:27 chromatic nopaste?
00:27 autrijus as a DoD queue
00:27 autrijus and have the runloop sweep the queue very now and then
00:27 autrijus I think that's the way to go
00:27 osfameron has quit IRC ("Leaving")
00:27 autrijus perlbot: nopaste
00:27 perlbot Paste your code here and #<channel> will be able to view it: http://sial.org/pbot/<channel>
00:29 pasteling "chromatic" at 63.105.17.30 pasted "adding DESTROYALL support" (54 lines, 2.1K) at http://sial.org/pbot/10461
00:29 svnbot6 r3938, autrijus++ | * all should work except this memory overflow thing
00:29 clkao lol
00:29 clkao arg != NULL
00:29 clkao shouldbe *arg != NULL
00:30 autrijus arg
00:31 * autrijus waits clkao to fix
00:31 clkao hate
00:31 clkao Bus error (core dumped)
00:32 chromatic Gah, I'm in over my head here.  :)
00:33 autrijus chromatic: ok
00:33 autrijus chromatic: you do this
00:33 autrijus env <- ask
00:33 SamB why does it say "Bus error"? wouldn't the kernel be just about the only thing that would have those?
00:33 chromatic Yeah, I have that.
00:33 chromatic now.
00:33 autrijus just before addFinaliser
00:33 autrijus now you curry it
00:33 autrijus (objectFinaliser env)
00:34 autrijus objectFinalizer :: Env -> VObject -> IO ()
00:34 chromatic Ohh, I was doing it on the definition of objectFinalizer.
00:34 autrijus objectFinalizer env obj = runEvalIO env ...
00:34 autrijus that will work
00:34 clkao autrijus: same
00:34 clkao pugs: user error (cannot fetch $pugs::env)
00:34 autrijus because "ask" only work in the eval monad
00:34 autrijus clkao: commit first
00:35 clkao committed
00:35 chromatic Right, and currying there makes it available later.
00:35 autrijus yeah. isn't currying fun?
00:36 chromatic I've always liked it.
00:36 autrijus clkao: so everything returned from eval_perl5 is a CODE now? wtf?
00:36 clkao ??
00:36 autrijus oh nvm
00:36 autrijus it's just debug msg
00:36 autrijus ;)
00:36 chromatic I hate the "The last statement in a 'do' construct must be an expression" message though.
00:37 clkao autrijus: od you run method.t for testing?
00:37 autrijus clkao:
00:37 autrijus $ ./pugs -e '(eval_perl5 q[sub { print 1 }]).()'
00:37 autrijus 1
00:37 autrijus I think that means something.
00:37 autrijus namely VCode deref works
00:37 clkao hang on
00:37 autrijus chromatic: that message says "you forgot to return something"
00:38 clkao ok 7 - invoking p5 coderef
00:38 autrijus clkao: it compiles! ship it!
00:38 chromatic It's complaining about addFinalizer (objectFinalizer env) obj
00:38 clkao no
00:38 autrijus clkao: also take the debug msg away
00:38 clkao fix the eng crap
00:38 clkao env
00:38 mauke do {} is just syntactic sugar for chained >>= calls
00:39 autrijus chromatic: liftIO it
00:39 svnbot6 r3939, clkao++ | autrijus++ needs to learn how to use pointers.
00:39 svnbot6 r3940, clkao++ | test for invoking p5 coderef.
00:39 chromatic Wait, I had a bad pattern match in objectFinalizer.
00:39 autrijus I won't want to learn how to use pointers ;)
00:39 autrijus the compiler should tell me ;)
00:40 clkao it did
00:40 clkao you didn't listen
00:40 autrijus then it should forbid it
00:40 * autrijus mumbles something about weakly typed languages
00:40 clkao quick
00:40 clkao oh sure, cc --pedantic
00:40 mauke gcc -W -Wall -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -std=c89 -pedantic -O2
00:40 mauke FOR GREAT JUSTICE
00:40 clkao autrijus: qucik , ifx that env and i can go sleep
00:40 autrijus yeah yeah
00:40 autrijus fixing
00:41 SamB autrijus: what did you do?
00:42 clkao shssh, don't talk!
00:42 autrijus SamB: hm?
00:43 theorbtwo Hmm, clkao?
00:43 SamB autrijus: what bad thing did you do that the compiler should have refused to go along with?
00:43 clkao SamB: read my commit
00:43 autrijus SamB: using pointers to pointers as pointers
00:43 SamB oh
00:44 clkao or actually the other way around. so he doesn't really know what he is tlaking about
00:44 clkao "don't shoot! I am a table"
00:44 SamB well, you know how most C programmers are. most don't even know a pointer from an int!
00:44 svnbot6 r3941, clkao++ | use less 'debug';
00:44 SamB its really quite appalling.
00:45 SamB although on the other hand it would be handy if they were defined to be bijectively castable...
00:45 SamB and storage compatible
00:45 clkao autrijus: if i pass a hash to p5something funny will happen
00:46 SamB today I learned that you aren't even really assured of the safety of casting function pointers to void* and back...
00:47 autrijus clkao: I got the bug.
00:47 autrijus finally.
00:47 * autrijus hates tracing XS
00:47 clkao autrijus++
00:47 autrijus fixing
00:47 clkao you can tell me where things are and i can fix
00:47 autrijus clkao: doubleboxing
00:47 autrijus the env got back was a sv boxing val boxing env
00:47 autrijus and deref is just one layer
00:48 autrijus it's complicated. I'll fix
00:48 clkao k
00:49 autrijus I have this feeling I'm going to find parrot's C code much more appealing after this
00:49 clkao of course
00:49 SamB why don't these commits ever seem to have descriptions?
00:49 chromatic Parrot nicer than Perl 5?  Nah.
00:49 chromatic The lack of macros can't possibly help!
00:50 clkao because autrijus will summarize later
00:50 IshaCocoa has quit IRC (Connection timed out)
00:51 * clkao use more 'tea';
00:51 SamB clkao: but then I get a bunch of patches named r3939, r3940, r3941...
00:51 clkao ?
00:51 * SamB uses darcs
00:51 clkao poor you
00:52 SamB yeah, I guess it wasn't designed for projects with this much code...
00:53 autrijus clkao: fixed... but it segfaults XD
00:53 clkao *sigh*
00:53 autrijus looking
00:53 clkao then what does it mean by 'fixed' ?
00:53 perlbot has quit IRC (K-lined)
00:53 clkao commit it?
00:54 autrijus k, in a bit
00:54 autrijus "fixed" means it's the right place
00:54 clkao if it's right enought it hsouldn't segfault :P
00:55 chromatic Ugh, objectFinalizer needs to return an IO (), but I'm returning an IO Val.
00:55 theorbtwo Odd... Am I the only one getting a compile error?
00:56 theorbtwo src/Pugs/AST/Internals.hs:318:29: Couldn't match `Maybe PerlSV' against `PerlSV'
00:56 theorbtwo svn diff -rHEAD doesn't show any difference to explain it.
00:56 theorbtwo (Note that I am /not/ using perl5 embedding.)
00:56 clkao maybe some ifdef was missing
00:57 SamB I get that too
00:58 SamB I was just thinking of asking that question, only without the "Odd..."
00:58 theorbtwo Who k-lined perlbot?
00:59 autrijus theorbtwo: fixed
00:59 * SamB tries changing nullSV to (Just nullSV)
00:59 autrijus the prototype was wrong
00:59 elmex has joined #perl6
01:00 autrijus clkao: I got to bottom of this
01:00 clkao k
01:00 svnbot6 r3942, autrijus++ | * fix prototype for theorbtwo
01:00 autrijus executive summary is that we can't use $pugs::env.
01:00 autrijus have to use PL_modglobal.
01:00 autrijus fixing
01:00 clkao GAH
01:01 autrijus don't blame me, I didn't design this jenga thing!
01:01 clkao ok, let's keep playing jenga
01:01 * autrijus pulls another block away
01:01 clkao (for the very last times)
01:03 SamB Is it just me or is Pugs.AST.Internals awfully big?
01:04 Jonathan_ has quit IRC ("Leaving")
01:04 SamB going by compile time
01:05 mrborisguy has quit IRC ()
01:07 autrijus implemented.
01:09 theorbtwo autrijus: Thanks.
01:09 clkao autrijus++
01:09 justatheory has quit IRC ()
01:09 clkao meanwhile i've implement svn.p6 using svn::client
01:10 clkao pastebot?
01:11 clkao clkao.eat('fish')
01:11 chromatic Grr, stumped again.
01:11 mugwump clkao, pastebot is at http://nopaste.snit.ch:8002/, but it isn't joined to this channel
01:12 mugwump SamB: it's certainly memory hungry, too.  check you're not swapping..
01:12 pasteling "chromatic" at 63.105.17.30 pasted "Almost there with DESTROYALL" (59 lines, 2.3K) at http://sial.org/pbot/10463
01:13 chromatic I *think* I'm on the right track, but I'm really not sure it's even happy enough to give addFinalizer what it wants.
01:13 mugwump oh, there you go clkao, there's the real pastebot at http://sial.org/pbot/
01:14 elmex_ has joined #perl6
01:14 b00t has joined #perl6
01:15 autrijus clkao: commited.
01:15 Limbic_Region has joined #perl6
01:15 theorbtw1 has joined #perl6
01:16 castaway has joined #perl6
01:16 svnbot6 r3943, autrijus++ | * switch to use PL_modglobal.
01:16 theorbtwo has quit IRC (Nick collision from services.)
01:16 theorbtw1 is now known as theorbtwo
01:16 * clkao compiles
01:17 chromatic Ahh, it can't curry that because ... nuts.
01:17 elmex has quit IRC (Read error: 60 (Operation timed out))
01:20 * Odin-LAP throws a squirrel at the nuts.
01:20 clkao what defer dfer and segfault?
01:21 autrijus "DEREF #3"
01:21 autrijus Segmentation fault
01:22 autrijus that's args.
01:22 autrijus investigating
01:22 autrijus did you null-pad it?
01:23 mrborisguy has joined #perl6
01:24 clkao yes
01:24 clkao wait which?
01:24 autrijus no.
01:24 autrijus you didn't.
01:24 autrijus pugs_guts_invoke
01:24 clkao bah
01:24 clkao fixing
01:24 vcv- has joined #perl6
01:25 chromatic I need something like runEvalIO :: Env -> Eval Val -> IO ()
01:25 clkao same
01:25 autrijus chromatic: hm? just slap a (return undef)
01:25 autrijus clkao: WORKED
01:25 autrijus ok, I'll commit
01:27 castaway_ has quit IRC (Read error: 110 (Connection timed out))
01:28 autrijus $  ./pugs -e 'eval_perl5(q|sub {$_[0]->()}|).({ say 123})'
01:28 autrijus 123
01:29 clkao not ok
01:29 chromatic has quit IRC ("need supper; brain hurting")
01:29 clkao i haven't handle the return value yet
01:29 autrijus heh.
01:29 autrijus not my problem
01:30 * autrijus fixes some more env marshalling
01:30 clkao only return one value?
01:30 clkao what's the context?
01:32 autrijus ah right. you should be able to specify cxt too
01:32 autrijus missed that in the pugs callconv
01:32 autrijus by default it inherits the caller's
01:32 svnbot6 r3944, autrijus++ | * various callconv fix.
01:32 autrijus but yes
01:32 clkao k
01:32 autrijus it always only return on Val
01:32 autrijus regardless of cxt
01:32 autrijus (because multi retval is represented as VList)
01:34 elmex_ has quit IRC ("cu")
01:35 autrijus ok, env marshalling solved
01:35 autrijus need to fake local() semantic too
01:35 autrijus hate
01:35 clkao return value became CODE
01:35 autrijus oh?
01:35 clkao weird
01:36 theorbtwo autrijus: I'd just document that...
01:36 autrijus be sure to pull and merge
01:36 autrijus theorbtwo: nice!
01:36 clkao i did
01:36 clkao oh not yet
01:36 clkao try method.t
01:37 autrijus I tried
01:37 autrijus only 1 fail
01:37 clkao ya. thats the return value thing
01:37 autrijus commit whatever you got
01:37 clkao i returned it now but became code.
01:37 clkao commit
01:39 clkao it hsould be a plain pv
01:39 svnbot6 r3945, autrijus++ | * env is nor marshalled.
01:39 svnbot6 r3946, clkao++ | propogate return value from pugs
01:41 autrijus so you just throw it to ST?
01:41 autrijus after ValToSV it?
01:42 clkao *nod8
01:43 autrijus ok. I'm changing callconv
01:43 clkao the return value in the last test should be called with newsvpv.. but never
01:44 autrijus callconv changed. _Apply now returns sv
01:45 autrijus hm, instant segfault. fun
01:45 svnbot6 r3947, autrijus++ | * PerlSV now does Hash and Array
01:47 autrijus bah. that doesn't work.
01:48 clkao returngs svn?
01:49 clkao sv
01:49 clkao i changed things ito assume it as sv but seems to get warnings
01:49 autrijus right, can't do that
01:49 autrijus have to ret vl
01:49 autrijus I think your stack manip is bogus
01:50 clkao ok
01:50 clkao revert that
01:52 clkao in haskel i do Sohw(ptr) to debug?
01:54 autrijus print ptr
01:55 clkao i want to see what's actually returned in pugs land in valToSv
01:55 IshaCocoa has joined #perl6
01:55 clkao any dump function?
01:57 autrijus sv_dump
01:57 autrijus you can add it to conv
01:58 clkao i mean in the sense of pugsval of course
02:01 autrijus but I think I fixed everything already. so don't bother ;)
02:02 clkao is that isa prboelm?
02:03 autrijus lots of problems.
02:03 autrijus all fixed.
02:03 autrijus r3948!
02:03 clkao you++
02:03 autrijus in particular
02:03 autrijus +    sv_setsv(ST(0), ret);
02:03 autrijus instead of
02:03 autrijus -    ST(0) = ret;
02:03 autrijus I don't know why really.
02:04 clkao mm
02:04 svnbot6 r3948, autrijus++ | * method.t all pass!
02:05 clkao yay!
02:05 autrijus hm, nvm, you don't need ret inbetween free
02:05 autrijus    ST(0) = pugs_Apply(val, inv, stack);
02:05 autrijus thinks works just fine. r3949
02:05 autrijus whew!
02:05 autrijus now port svk over!
02:06 clkao :)))
02:06 gaal has joined #perl6
02:06 clkao not yet. more tests coming
02:07 autrijus come to think about it, it's a good idea to add cxt into callconv now
02:07 autrijus pugs_Apply will take one more GIMME
02:07 autrijus that good w/ you?
02:08 SamB src/Pugs/AST/Internals.hs:317:27: Not in scope: `mkVal'
02:08 * SamB impersonates a buildbot
02:09 autrijus SamB: fixed.
02:09 svnbot6 r3949, autrijus++ | * remove debug from method.t
02:09 svnbot6 r3950, autrijus++ | * save a tmp.
02:10 SamB autrijus: it doesn't look like it!
02:10 SamB okay now its earlier
02:10 SamB src/Pugs/Embed/Perl5.hs:38:29: Not in scope: type constructor or class `PugsVal'
02:11 clkao autrijus: in obj invoke, what should the val forapply be?
02:11 clkao &methodname ?
02:13 autrijus clkao: right, "&method"
02:13 autrijus casted from pv
02:13 gaal_ has quit IRC (Read error: 60 (Operation timed out))
02:14 autrijus if you feed it a val, it may be able deref later too
02:14 svnbot6 r3951, autrijus++ | * fix nonembed
02:14 svnbot6 r3952, autrijus++ | * typo.
02:14 autrijus but don't rely on it
02:14 autrijus SamB: better?
02:16 SamB src/Pugs/Embed/Perl5.hs:39:15:
02:16 SamB    Couldn't match `IO PugsVal' against `()'
02:16 SamB      Expected type: IO PugsVal
02:16 SamB      Inferred type: ()
02:16 SamB    In the first argument of `return', namely `()'
02:16 SamB    In the definition of `mkVal': mkVal = return ()
02:16 SamB src/Pugs/Embed/Perl5.hs:42:18:
02:16 SamB    Couldn't match `IO PerlSV' against `()'
02:16 SamB      Expected type: IO PerlSV
02:16 SamB      Inferred type: ()
02:16 SamB    In the first argument of `return', namely `()'
02:16 SamB    In the definition of `mkValRef': mkValRef = return ()
02:16 clkao autrijus: huh? so first arg of piugs_apply can also be cstring?
02:17 autrijus clkao: no, you need to cast pv to it
02:17 clkao yes, pv to cstring or to val ?
02:17 autrijus to val. always to val
02:17 autrijus cstring is same as pv!
02:18 autrijus type CString = Ptr CChar
02:18 meppl has quit IRC (Remote closed the connection)
02:18 autrijus SamB: I _think_ it's fixed ;)
02:18 * autrijus is no longer sure
02:18 autrijus clkao: so in callconv apply, you throw GIMME_V usually
02:19 autrijus but if you want specific context, use G_SCALAR etc.
02:19 mrborisguy karma you
02:19 jabbot mrborisguy: you has karma of 4
02:20 svnbot6 r3953, autrijus++ | * restore old context properly.
02:20 svnbot6 r3954, autrijus++ | * even more nonembed fix.
02:20 mrborisguy it was worth a shot
02:22 Limbic_Region mrborisguy == borisz ?
02:22 clkao getting prelude mepty list
02:23 autrijus $ ./pugs -e 'eval_perl5(q|sub {print while $_ = $_[0]->()}|).(coro {yield 1; yield 2})'
02:23 autrijus 121212121212
02:24 autrijus clkao: that usually means the inv slot is empty during a meth call
02:24 Limbic_Region autrijus++
02:24 SamB well everything in and before Pugs.AST.Internals seems to be fine
02:24 Limbic_Region now if only it worked on Win32
02:24 SamB at least, it hasn't given me any scope errors
02:24 autrijus Limbic_Region: if you have a mingwperl
02:24 autrijus it may even work
02:24 autrijus I think rgs's fix makes mingwperl fine now
02:25 clkao method call from p5. doesn't work.
02:25 clkao committed
02:25 svnbot6 r3955, clkao++ | pugs method call from p5.
02:25 svnbot6 r3954, autrijus++ | * even more nonembed fix.
02:25 Limbic_Region ok - I am not going to build it tonight
02:25 Limbic_Region but I have built mingwperl in the past
02:26 clkao autrijus: take a look? there's new test
02:26 SamB on the other hand, it is taking forever to build!
02:28 autrijus SamB: "make unoptimised"
02:28 Limbic_Region question - should Pugs be failing to build currently on Win32 even without p5 embbeding?
02:28 autrijus Limbic_Region: should not.
02:28 Limbic_Region ok - I see several recent commits
02:29 Limbic_Region I will sync up and try again but it isn't looking good
02:29 clkao $ ab -clkao- [~/work/pugs] ./pugs svn.p6
02:29 clkao 1.3.0
02:29 clkao ,,3955,clkao,2005-05-27T02:25:14.124482Z,pugs method call from p5.,_p_apr_pool_t=SCALAR(0x83a3c58)
02:29 Limbic_Region I'm at 3952
02:29 pasteling "clkao" at 82.35.81.242 pasted "svn now" (10 lines, 213B) at http://sial.org/pbot/10464
02:29 SamB well it is only taking forever in Pugs.AST.Internals
02:31 clkao autrijus: come on, method call
02:31 autrijus GIMME fixed
02:31 autrijus or rather implemented
02:32 Limbic_Region still blowing up autrijus
02:32 autrijus Limbic_Region: nopasre the err?
02:32 pasteling "Limbic_Region" at 24.35.57.240 pasted "Win32 build blowing up" (17 lines, 651B) at http://sial.org/pbot/10465
02:33 autrijus Limbic_Region: that's fixed as of r3954
02:34 clkao autrijus: callback to pugs with sub having param binding fails
02:34 Limbic_Region I synced though
02:34 clkao er, hangs.. use up all memory
02:34 Limbic_Region let me double check
02:35 * SamB sticks {-# OPTIONS_GHC -v #-} at the top
02:36 Limbic_Region ok - svk log is yelling about revision being too large
02:36 svnbot6 r3956, autrijus++ | * new callconv -- pugs apply now takes Cxt
02:36 Limbic_Region hmm
02:36 clkao Limbic_Region: maybe you are using something too old
02:36 * SamB adds -dverbose-core2core
02:37 Limbic_Region clkao - by something you mean svk?
02:37 * SamB takes it out again
02:37 clkao Limbic_Region: ya. or you actually gave it too large a revision
02:37 SamB I think that module should be split into pieces if possible
02:38 Limbic_Region *shrug* - I will beat it into submission - brb
02:38 * SamB decides on {-# OPTIONS_GHC -v -O0 #-}
02:40 clkao autrijus: chained invocation uses all memory
02:40 autrijus clkao: so you define mex
02:40 autrijus and call me
02:40 autrijus what gives?
02:40 clkao mex?
02:40 autrijus method mex
02:40 SamB hmm, -O0 doesn't actually seem to work
02:41 Limbic_Region autrijus - no sure what is b0rked about my svk
02:41 Limbic_Region but after convincing it to see things my way
02:41 Limbic_Region no more problems
02:41 Limbic_Region at least not with embed
02:41 * Limbic_Region gives up and goes to bed
02:42 Limbic_Region has quit IRC ("tiuq\")
02:42 SamB okay, it finally made it into cc1
02:42 autrijus clkao: you forgot &
02:42 autrijus clkao: since this is so common an error I'll remedy it in callconv
02:42 SamB cc1 was using a lot of RAM
02:42 SamB its in the evil mangler now...
02:43 clkao autrijus: no, that doewn't work yet.
02:43 clkao autrijus: and what i was saying is that chainged p5 mehtod call from p6 doesn't work
02:43 SamB finished building
02:44 SamB (of Pugs.AST.Internals)
02:44 autrijus clkao: is there a test?
02:45 clkao autrijus: which one?
02:46 clkao p5 method call from p6, not yet
02:46 clkao but use my svn script
02:46 clkao chain the svn::client.new.log
02:46 clkao it dies
02:46 autrijus clkao: this worksforme
02:46 autrijus use Digest::SHA1--perl5;
02:46 autrijus my $x = Digest::SHA1.new;
02:46 autrijus say $x.add("X").hexdigest;
02:46 autrijus but yes, if you do
02:46 autrijus .new.add
02:46 autrijus then it dies
02:47 * clkao mimics autrijus
02:47 svnbot6 r3957, autrijus++ | * allow omitting '&' from pugs_apply callconv.
02:47 svnbot6 r3958, autrijus++ | * fix typo
02:47 clkao journal up, sleep&
02:47 autrijus roflmao
02:47 autrijus clkao++ # nice work
02:47 clkao autrijus++ # doesn't work without you
02:47 clkao method.t now passes?
02:47 autrijus no.
02:48 clkao it spins
02:50 revdiablo has quit IRC (Remote closed the connection)
02:50 * clkao really sleeps &
02:53 vitaminmoo has quit IRC ("2.6.12-rc4 -> rc5")
02:53 svnbot6 r3959, autrijus++ | * remove the test to despin it
02:53 svnbot6 r3960, autrijus++ | * remove sv_dump
02:54 SamB hmm, I want to send a couple of darcs patches...
02:55 vitaminmoo has joined #perl6
02:56 autrijus sure, send them to perl6-compiler@perl.org
02:56 autrijus I should set the darcs sendto addr thing to there
02:56 autrijus but I forgot how to set it
02:57 SamB cool
02:59 SamB I think it is _darcs/prefs/email in the exposed repo
03:01 metaperl has joined #perl6
03:01 autrijus set. try it?
03:04 SamB it picks it up fine ;-)
03:06 SamB I figured it out by looking at _darcs/prefs/ in lambdabot's repo (by directly visiting the url in links)
03:07 autrijus nice
03:12 mrborisguy has quit IRC ()
03:13 SamB perl.org must have a really wierd email setup
03:13 SamB its probably extensively scripted in perl
03:18 SamB what is Pugs.AST.Internals supposed to do?
03:20 autrijus SamB: read PA02 yet?
03:20 autrijus docs/02Internals.pod
03:21 autrijus perl 5 hash and array refs are now accessible from pugs.
03:21 * autrijus starts writing some DBI apps
03:22 SamB that doesn't seem to mention Pugs/AST/Internals
03:23 autrijus ah. it's part of AST.hs
03:23 autrijus the convention is that we aggressively factor out bigger modules
03:23 autrijus to sub namespaces
03:23 SamB well, yeah.
03:23 autrijus there's also haddock :)
03:23 autrijus # http://nothingmuch.woobling.org/pugs_test_status/haddock/Pugs.AST.Internals.html
03:23 svnbot6 r3961, autrijus++ | * Perl 5 Array and Hash are now accessible from Perl 6.
03:24 SamB there don't appear to be any section headings in the export list
03:28 SamB hmm, is it possible that those are stale?
03:28 IshaCocoa has quit IRC (Read error: 104 (Connection reset by peer))
03:30 IshaCocoa has joined #perl6
03:32 SamB hmm, is it just me or does Pugs.Prim also take a long time to compile?
03:35 SamB well its started mangling it now...
03:36 autrijus "make unoptimised" will be faster :)
03:36 autrijus for development it's probably best.
03:37 SamB fine...
03:37 pasteling "autrijus" at 220.132.132.105 pasted "DBI test works!" (16 lines, 452B) at http://sial.org/pbot/10468
03:37 nothingmuch morning!
03:37 autrijus hey nothingmuch. see nopaste :)
03:38 nothingmuch yes, i was just "holy crapping" to some of the "wow! cool" people
03:38 autrijus clkao also got callback working so you can even pass coro{} into it
03:38 nothingmuch what else is there to do?
03:38 autrijus and lazy{} too
03:38 autrijus oh, lots of things
03:39 autrijus cross inheritance, shared runloop
03:39 autrijus lots of syntax level details as well
03:39 autrijus support for tied variables
03:39 nothingmuch what does shared run loop mean?
03:39 autrijus it means that you can yield() from perl5
03:39 autrijus or return() from perl 6 on behalf of perl5's caller
03:39 autrijus i.e.
03:39 nothingmuch ah
03:39 autrijus $CALLER::x
03:39 autrijus can see perl5's lexical
03:39 autrijus and vice versa
03:40 SamB linking also seems slow and memory-hungry :-(
03:40 * nothingmuch continues documenting code
03:41 nothingmuch i want to throw this at CPAN
03:41 joepurl has quit IRC ("Lost terminal")
03:42 joepurl has joined #perl6
03:42 SamB nothingmuch: what are you documenting?
03:45 nothingmuch SamB: it's a one of those top level namespace thingies
03:45 nothingmuch specifically a framework for doing make(1) like things in perl
03:45 nothingmuch without the shell mindset getting in the way,
03:45 revdiablo has joined #perl6
03:52 ijoyce like ant?
03:53 nothingmuch_ has joined #perl6
03:53 nothingmuch has quit IRC (Read error: 113 (No route to host))
03:54 SamB doesn't ant have XML get in the way instead?
03:55 nothingmuch_ did i miss some context?
03:57 SamB <nothingmuch> without the shell mindset getting in the way,
03:57 SamB --> revdiablo (diablo@revdiablo.user) has joined #perl6
03:57 SamB <ijoyce> like ant?
03:57 SamB <SamB> doesn't ant have XML get in the way instead?
03:57 nothingmuch_ ijoyce: not really like ant
03:57 nothingmuch_ less specific
03:58 nothingmuch_ SamB: i think i agree about XML getting in the way with ant, but I can't really say, haven't used atn
03:58 SamB it gets in the way in just about every other application where you write it by hand...
03:59 * luqui despises ant
03:59 luqui you shouldn't have to install a build module for every builder program you use
03:59 SamB I mean XSLT is crazy, and Relax NG would be unusable without a Compact form (which has actual syntax!)
04:00 luqui I think the shell mindset is rather appropriate for make
04:00 luqui you just have to get around the platform dependent syntax somehow
04:01 nothingmuch_ luqui: for make yes
04:01 nothingmuch_ since you run commands
04:01 luqui i mean for make-like utilities
04:01 nothingmuch_ but this is to run perl code
04:01 luqui hmm
04:01 SamB nothingmuch_: oh
04:01 SamB why is it to run perl code?
04:01 luqui what sorts of perl code?
04:02 nothingmuch_ well, basically, you give it a wad of objects
04:02 nothingmuch_ and you tell it how they relate
04:02 nothingmuch_ deps and stuff
04:02 SamB I don't think having to install a module is so bad, unless installing a module is a pain...
04:02 nothingmuch_ and then the dispatcher calls the appropriate methods in order
04:02 luqui ohhhh
04:02 luqui so you want the graph deps stuff without the command running stuff
04:03 luqui that should be fairly easy
04:03 SamB which, for Java, it is.
04:03 nothingmuch_ not only that
04:03 nothingmuch_ it's already done, and it was pretty easy =)
04:03 nothingmuch_ anyway, enough talk, code speaks much better, especially with docs
04:03 SamB for things like Python and Perl it isn't that bad. I mean it isn't much harder than installing the build tool itself...
04:03 nothingmuch_ so i'll go back to working on that, and hopefully it will be CPAN worthy soon
04:11 formalin14 has joined #perl6
04:12 joepurl hello formalin14
04:12 formalin14 hello
04:12 formalin14 is there some edit support perl6?
04:12 formalin14 editor
04:13 ijoyce not yet
04:13 ijoyce afaik
04:13 SamB is anybody signed up to do the emacs mode?
04:13 SamB at least for ASCII stuff?
04:16 formalin14 is there some article about how to deploy freestand program that develop by perl6?
04:16 ijoyce has quit IRC ("Leaving")
04:16 SamB are you kidding? perl6 itself is not freestanding yet!
04:18 nothingmuch_ formalin14: there's a vimmode for perl6, in util
04:18 autrijus formalin14: you can make freestanding programs with pugscc
04:18 autrijus install pugs, "perldoc pugscc" for details
04:18 formalin14 I think it is possible to tar all the necessary file(include pugs,perl5,lib) and then untar on another mechine and run.
04:19 formalin14 thinks autrijus
04:19 nothingmuch_ formalin14: don't forget the GHC runtime
04:19 autrijus GHC runtime isn't a shared library :)
04:19 autrijus pugs is always static
04:19 nothingmuch_ and parrot if pugs was linked to it
04:19 nothingmuch_ ah, i didn't know that
04:19 autrijus and parrot is also static.
04:19 autrijus and you can build your perl5 to be static as well.
04:19 autrijus so. :)
04:20 nothingmuch_ the darcs build I use on OSX requires GHC to be install for the runtime
04:20 formalin14 ok, that is good, so I can do product use perl6.
04:20 autrijus theoretically yes. :) nobody has really done end-user products in perl6
04:20 SamB if you want dynamically linked haskell code with GHC, you need to use either GHCi or hs-plugins...
04:20 autrijus for my $work it's all server side where I have better control.
04:21 autrijus SamB: pugs only supports hs-plugins
04:21 autrijus I can't wait for libGHC to be available in GHC 6.6 :)
04:21 SamB I wasn't talking about pugs
04:21 SamB I was talking about GHC
04:21 nothingmuch_ formalin14: the problem is that pugs changes so fast that you would feel bad 2-3 days after deploying a build
04:21 formalin14 Is there a word in English: green software, that means unzip to anywhere then is can run?
04:21 autrijus ah. yes then. hs-plugins or DynamicLoader
04:22 nothingmuch_ autrijus: libGHC will make Inline::GHC easy?
04:22 autrijus nothingmuch_: like, trivial
04:22 nothingmuch_ coolness
04:22 nothingmuch_ how soon? =)
04:22 SamB is DynamicLoader what hs-plugins was based on?
04:22 autrijus no idea :)
04:22 autrijus SamB: I don't know if there's shared code
04:23 autrijus need to ask dons
04:23 autrijus but probably not
04:23 SamB formalin14: self-contained?
04:23 SamB formalin14: freestanding?
04:23 SamB formalin14: standalone?
04:23 formalin14 yes
04:23 nothingmuch_ formalin14: get autrijus to make PAR support pugs
04:24 autrijus use PAR--perl5;
04:24 autrijus next question?
04:25 autrijus (and pugscc already handles dependencies)
04:26 SamB I think Pugs.Prim's use of pattern-matching on strings is likely part of why it compiles slowly...
04:26 autrijus SamB: that may be the case.
04:28 SamB hmm. is it possible that GNU ld does not scale well?
04:28 nothingmuch_ what's "pattern-matching on strings"?
04:30 autrijus nothingmuch_: op1 ""
04:30 nothingmuch_ oh
04:30 nothingmuch_ why did i read that as parser?
04:30 nothingmuch_ prim.hs is not that slow to compile, is it?
04:31 * nothingmuch_ ought to shower & sleep
04:31 SamB well maybe not with 1 GiB RAM and 2 GHz, but with 256 MiB and 450 MHz...
04:32 autrijus ...you really want "make unoptimised".
04:35 SamB okay, so it takes a respectable 25 seconds or so with make uinoptimized. but then linking takes forever and thrashes so much I can't get x-chat in the foreground
04:35 SamB granted it would seem a lot less like forever if x-chat would move to the foreground and paint and work...
04:36 SamB hmm, it isn't doing it this time quite...
04:37 SamB maybe that doesn't happen if I bring xchat back before lots of its stuff gets swapped out...
04:42 SamB or maybe it is all this initSyms stuff...
04:44 SamB what are all these #includes in Pugs.AST.Internals for?
04:47 saorge_ has joined #perl6
04:51 SamB autrijus: ?
04:55 saorge has quit IRC (Operation timed out)
04:58 viirya has joined #perl6
05:03 jql when I'm faced with a slow computer and a high load, I ship out my root privileges and renice -10 my shell
05:03 jql the one NOT running the compiler, of course
05:26 scook0 has joined #perl6
05:26 vcv-- has quit IRC (Read error: 104 (Connection reset by peer))
05:43 vcv- has quit IRC (Read error: 110 (Connection timed out))
05:43 jql has quit IRC (Read error: 110 (Connection timed out))
05:46 Shachaf has quit IRC ("[<>]")
05:47 viirya has quit IRC ()
05:49 SamB Okay, I think I've figured out why all those files were included... just trying to make a single one a module is a complete mess...
05:50 SM_ax has joined #perl6
05:51 IshaCocoa has quit IRC (Read error: 110 (Connection timed out))
05:55 chromatic has joined #perl6
05:56 chromatic Anyone here know much about runEvalIO?
05:56 IshaCocoa has joined #perl6
05:57 scook0 chromatic: what are you trying to figure out?
05:57 SamB all I know is that Pugs.AST is a mess!
05:58 SamB I think I will give up for now.
05:58 SamB maybe try again tomarrow.
05:58 chromatic I'm trying to call DESTROYALL when Haskell GC claims a VObject.
05:58 chromatic DESTROYALL is a Perl 6 method, I mean.
05:59 scook0 SamB: trying to split up AST?
05:59 SamB scook0: I was.
05:59 SamB I feer it is about ten times harder than I thought...
06:00 SamB er, fear.
06:00 scook0 SamB: I take it you were looking at AST/Internals
06:00 SamB yes, I was
06:00 scook0 hmm, I'll give it a look
06:00 scook0 it /is/ rather big
06:01 SamB especially if you consider that it includes Plugs/Types/*.hs
06:01 chromatic The types are pretty short though.
06:01 chromatic They're mostly just constructors, aren't they?
06:02 SamB basically all you have to do is figure out how to untangle it without getting totally lost...
06:02 * SamB reverts his tree
06:03 SamB I wish there was an easy way to visualize the lexical dependencies of things
06:03 chromatic Yeah, I haven't figured out Haskell's scoping rules either.
06:04 chromatic scook0, are you pretty lambda-savvy?
06:04 SamB I understand the rules, its just that I would like to see the dependencies in some kind of visual form
06:04 SamB what about the rules don't you understand?
06:05 chromatic It's the visibility of functions.
06:05 chromatic I'm not quite clear on what's visible to what where and when.
06:05 scook0 chromatic: I started about a month ago, but I'm progressing
06:06 chromatic If I pasted my current (failing) patch, is there a chance you could help me figure out what's wrong?
06:06 chromatic (or anyone reading this in the summaries or backlogs in the future)
06:06 SamB there is indeed
06:07 SamB especially if you also pasted the error message
06:07 formalin14 can perl6 call java jar now ?
06:08 pasteling "chromatic" at 63.105.17.30 pasted "DESTROYALL Patch (third attempt) and compilation error" (142 lines, 7.2K) at http://sial.org/pbot/10470
06:09 chromatic Ahh, now the error is clearer to me.
06:09 Alias_ has joined #perl6
06:09 SamB that isn't even a scope error!
06:09 chromatic No, I fixed my scope errors much earlier.  :)
06:10 scook0 chromatic: so it can't reconcile an (Eval a) with an (IO a)
06:10 chromatic The problem is that addFinalizer wants an IO (), while runEvalIO produces an IO Val.
06:10 chromatic If I turn objectFinalizer into a one-liner without the do and the return, it's a lot clearer with the error.
06:11 SamB I don't think so
06:11 svnbot6 r3962, scook0++ | Haddock tweaks
06:12 chromatic Hm, you're right.  That gives two errors, not one.
06:12 SamB I think you need to add 'liftIO $ ' before 'addFinalizer obj (objectFinalizer env obj)'
06:12 scook0 chromatic: could you chain the IO Val into a return using >> ?
06:12 formalin14 has left
06:13 scook0 chromatic: ultimately, you're trying to turn an Eval Val into an IO (), right?
06:13 chromatic Yes, that's right.
06:13 viirya has joined #perl6
06:13 chromatic It's certainly taking longer to fail with the liftIO...
06:13 chromatic Ah, it compiled that one.  Nifty.
06:13 SamB are you building with 'make unoptimized'?
06:13 chromatic Yes.
06:14 chromatic I don't understand the $ syntax, but I'm still fuzzy on the . syntax too.
06:14 scook0 chromatic:  foo $ bar x  is like  foo(bar x)
06:14 SamB Prelude> :i $
06:14 SamB $ :: (a -> b) -> a -> b         -- Imported from GHC.Base
06:14 SamB infixr 0 $
06:15 kelan $ just helps reduce parens
06:15 scook0 chromatic:  (foo . bar) x  is like  foo(bar(x))
06:15 chromatic Ah, it's associativity hints for the parser.
06:16 scook0 basically, if you write "foo bar x", it thinks 'bar' and 'x' are args to 'foo'
06:16 scook0 whereas if you write "foo $ bar x", it evaluates 'bar x' and gives the result to 'foo'
06:16 kelan unless foo is defined as only taking one arg, tho, right?
06:16 SamB we say that $ has the loosest possible associativity
06:17 scook0 kelan: AFAIK no -- that just gives you a type error (not sure though)
06:17 chromatic I can see that being useful when you want to curry one of them too.
06:17 SamB kelan: even then!
06:17 saorge_ has quit IRC ("Leaving")
06:17 kelan ok
06:17 SamB it might or might not be a type error
06:17 chromatic Hm, t/oo/destruction.t still fails.
06:17 chromatic Is that because there's no guarantee of when GC will collect unused objects?
06:17 SamB chromatic: this is the hard part.
06:18 SamB chromatic: it might be
06:18 chromatic I'm willing to blame my bugs on non-determinism.
06:19 SamB look at the output of 'ghc +RTS --help'
06:20 SamB if you prod it enough it may collect your objects
06:20 nothingmuch has joined #perl6
06:20 chromatic Shouldn't it collect them at the end of the program anyway?
06:21 chromatic Or does it just to a POSIX-like _exit?
06:21 f0rth is pugscc broken?
06:21 SamB it still might not manage to get them all, I saw something in GHC.IOBase or someplace like that...
06:24 gaal is & (quantum) tighter than || (classical)?
06:24 gaal $mode = "rw" if $rw || $r & $w; # correct?
06:27 scook0 gaal: S03 says yes
06:27 gaal good. :)
06:27 gaal thanks!
06:29 chromatic Ahh, it worked.
06:29 chromatic I added a loop to t/oo/destruction.t to create 10,000 objects.
06:29 chromatic *That* triggered GC, at least to collect 9918 of them.
06:29 ingy chromatic!
06:29 chromatic ingy-pu
06:30 ingy chromie: you never answered my email :(
06:30 nothingmuch i need some perl 6 module help
06:30 chromatic I don't call my mother often enough either.
06:30 nothingmuch I want to write a publisher/subscriber thing
06:30 chromatic ingy, I remember thinking "Yeah, that sounds good".
06:30 nothingmuch i'm thinking Class::Publisher is a role
06:31 nothingmuch Class::Subscriber is maybe a role
06:31 ingy chromatic: so i should just send you an article?
06:31 nothingmuch Class::Events::Subscription
06:31 nothingmuch Class::Events::Notification is dispatched by looking at subcriptions
06:32 nothingmuch how would I organize it in files?
06:32 svnbot6 r3963, scook0++ | Oops, I broke Haddock
06:32 chromatic Let me pull up the message again.
06:32 SamB chromatic: did you look at the RTS options?
06:32 chromatic ingy, it looks good.  Write it!
06:33 ingy ok
06:33 chromatic SamB, I did, but I'm not sure how to set any of those from the test suite.
06:33 nothingmuch_ has quit IRC (Read error: 113 (No route to host))
06:33 SamB chromatic: oh, right.
06:34 chromatic ingy, if you go to St. Louis, you won't see my new house.
06:35 chromatic Curtis and Josh H. and the Walls have, but Schwern hasn't.
06:42 cookys has quit IRC (Read error: 110 (Connection timed out))
06:43 chromatic DESTROYALL fires in the wrong order, I think, but that's a fix for another time.
06:43 ingy chromatic: I'll be at oscon
06:44 chromatic Yeah, I saw.
06:44 ingy maybe i can see it then
06:44 chromatic Someone said I should have a big barbecue here.  I'll have to mow my lawn.  blah
07:03 vcv-- has joined #perl6
07:03 svnbot6 r3964, chromatic++ | Add DESTROYALL support (with help from autrijus++, scook0++, and samB++).
07:03 svnbot6 r3964, chromatic++ | Make t/oo/destruction.t trigger GC to fire destruction (and untodo).
07:03 svnbot6 r3964, chromatic++ | Make ext/Test-Builder/t/010_Test_Builder.t trigger GC.
07:03 jql has joined #perl6
07:03 vcv- has joined #perl6
07:06 chromatic has quit IRC ("zzz")
07:13 ingy yay. Test::Chunks just got to 300 tests (in 55 files)
07:18 gaal what's the Right Way to make sure the what's in src/perl6/ ends up in blib6/lib? add a it to build_subdirs in Makefile.PL and give it a makefile of its own?
07:20 pasteling Someone at 212.143.91.217 pasted "Class::Events" (89 lines, 2.4K) at http://sial.org/pbot/10471
07:20 nothingmuch s/Someone/nothingmuch/
07:23 Jouke has joined #perl6
07:25 Aankhen`` has joined #perl6
07:25 larsen has joined #perl6
07:26 Jouke has left
07:26 f0rth has quit IRC ("leaving")
07:30 pasteling "nothingmuch" at 212.143.91.217 pasted "use v6; # the object model is" (111 lines, 3K) at http://sial.org/pbot/10472
07:30 drbean has quit IRC (Read error: 110 (Connection timed out))
07:31 nothingmuch oi, that's silly
07:31 Aankhen`` Does that code work in Pugs?
07:31 nothingmuch pbotutil.pl is confusing
07:31 nothingmuch didn't try it yet
07:32 nothingmuch i'd like someone to comment on the design
07:39 sekimura0 has joined #perl6
07:39 nothingmuch oh, i think i see how
07:40 sekimura0 has quit IRC (Client Quit)
07:42 IshaCocoa_ has joined #perl6
07:47 Aankhen`` I'm thinking the replacement for CGI.pm could start with porting the HTTP::* modules from LWP.
07:47 Aankhen`` Any comments?
07:47 nothingmuch i think that's a very good idea
07:48 nothingmuch do you know Catalyst/Maypole etc?
07:48 nothingmuch the model for request handling is very consistent there
07:48 nothingmuch all based around the HTTP::* stuff from LWP
07:48 Aankhen`` Not really.
07:48 Aankhen`` Ah.
07:48 Aankhen`` I had one question which I was hoping to answer through discussion here though: what should the package be called?
07:48 nothingmuch oi vey
07:48 Aankhen`` Should it continue to be LWP?
07:48 IshaCocoa has quit IRC (Read error: 110 (Connection timed out))
07:49 nothingmuch i think that literally it's the WWW lib for perl
07:49 nothingmuch it covers HTTP, and UA abstraction, and what not
07:49 nothingmuch as long as the modules are independant enough, i don't care what the package is
07:49 Aankhen`` I'm not planning to port LWP::* at first, I just want to get the HTTP::* modules into P6.
07:49 nothingmuch if they are all heaped together: URI, HTTP::Headers, HTTP::Request, HTTP::Response, all under LWP
07:50 nothingmuch or each with their own package, i don't really mind
07:50 Aankhen`` As far as the name goes, I'm only asking because I need a dir to throw it all under. :-)
07:50 nothingmuch they will probably be std in the distro of perl i will use
07:50 nothingmuch i'd say keep LWP for now
07:50 Aankhen`` A'right.
07:50 nothingmuch or maybe if you want to be more impressive, make one for each
07:50 nothingmuch and then if someone gets annoyed merge them
07:50 Aankhen`` Heh.
07:50 nothingmuch that would look like there are many more modules for perl 6 already ;-)
07:50 Aankhen`` I think I'll just put them under ext/LWP/.
07:51 Aankhen`` LOL.
07:51 Aankhen`` nothingmuch++
07:51 nothingmuch okay, i think i got the Class::Events thing now
07:52 nothingmuch by doing it with roles
07:52 nothingmuch err, by appending to roles
07:52 Aankhen`` Heh.
07:52 * nothingmuch tired, many hours sans sleep
07:52 Aankhen`` They Do It With Roles.
07:52 nothingmuch =)
07:53 nothingmuch this is really fun stuff
07:53 * Aankhen`` tries to remember what his other question was.
07:54 * Aankhen`` fails miserably.
07:55 Aankhen`` autrijus, you around?
07:56 pernod has joined #perl6
07:56 nothingmuch okay, adding this dummy into modules
07:57 Aankhen`` It works?
07:57 nothingmuch damnit, i hate recursive svn add
07:58 Aankhen`` Heh.
07:58 pernod has quit IRC (Client Quit)
07:58 nothingmuch no
07:58 nothingmuch starting with tests now
07:58 Aankhen`` OK.
07:58 nothingmuch s/no/no clue/
07:59 nothingmuch actually i'll do tests when I wake up
07:59 osfameron has joined #perl6
07:59 Aankhen`` Going to sleep?
07:59 nothingmuch yes
07:59 nothingmuch 11AM
07:59 Aankhen`` Sleep well. :-)
07:59 nothingmuch it's a holiday
07:59 nothingmuch where we make fires, and stay up all night
08:00 nothingmuch and then pretend we can last all day long
08:00 Aankhen`` LOL.
08:00 nothingmuch and thus not screw up our sleep cycle
08:00 nothingmuch now, i'm a very bad case
08:00 nothingmuch because work celebrated it the day before yesterday
08:00 nothingmuch and friends celebrated it yesterday
08:00 Aankhen`` Owa.
08:01 nothingmuch so in the last 40 hours or so i've had 4 hours of sleep
08:01 Aankhen`` That sounds ever so slightly tiring.
08:01 nothingmuch but I soooo don't want to ruin my weekend by sleeping all day
08:01 nothingmuch and staying up another night
08:01 Aankhen`` Ah.
08:02 nothingmuch but anyway, i'll sleep some now
08:02 nothingmuch good luck with HTTP foo
08:02 Aankhen`` Thanks. :-)
08:02 Aankhen`` Sweet dreams. ;-)
08:02 nothingmuch IMHO, btw, the current modules are pretty good
08:02 nothingmuch all they will need right now is named params in addition to positional ones
08:02 nothingmuch and i think they will be perl6ish enough
08:02 svnbot6 r3965, nothingmuch++ | Initial design draft of Class::Events
08:02 Aankhen`` I shall massage them.
08:02 nothingmuch because they are very lean already
08:02 nothingmuch ciao!
08:03 Aankhen`` Ciao.
08:05 Aankh|Clone has joined #perl6
08:13 viirya has quit IRC (Remote closed the connection)
08:13 svnbot6 r3966, nothingmuch++ | Make the useless abtstract Class::Events baseclasses have a semi-useful default behavior.
08:14 Aankh|Clone Lots of unexpected successes today.
08:14 viirya has joined #perl6
08:24 Aankhen`` has quit IRC (Read error: 110 (Connection timed out))
08:33 Aankh|Clone is now known as Aankhen``
08:33 svnbot6 r3967, nothingmuch++ | Class::Events makes use of delegation
08:33 svnbot6 r3968, nothingmuch++ | Delegation typo fixed
08:33 svnbot6 r3969, nothingmuch++ | multimethods in Class::Events were utter crap
08:33 Aankhen`` What was that nonsense about sleeping, nothingmuch? :-P
08:34 clkao *yawn*
08:35 * Aankhen`` stuffs spinach down clkao's throat.
08:47 kungfuftr shit... i actually have to write a talk now
08:49 nothingmuch http://nothingmuch.woobling.org/yapc-slides/slides/start.html
08:49 nothingmuch shyte, wrong window
08:49 nothingmuch no one look, it's a surprise
08:49 nothingmuch plus i don't have enough BW
08:51 crysflame has quit IRC ("&")
08:52 nothingmuch hey! someone from fotango is cheating!
08:53 * nothingmuch makes log-watcher pose
08:53 Aankhen`` How come t/oo/class/nested_use.t is showing everything as TODO?
08:53 nothingmuch oh crap, people, seriously my server can't hanlde it
08:54 Aankhen`` Uh.
08:54 Aankhen`` lives_ok means TODO?
08:56 BigBear has joined #perl6
08:58 dada has joined #perl6
08:59 clkao autrijus: you didn't fix method.t? and chained p5 object invocation now doesn't work at all
09:04 jql has quit IRC (Read error: 110 (Connection timed out))
09:05 vcv- has quit IRC (Read error: 110 (Connection timed out))
09:06 elmex has joined #perl6
09:09 sekimura has quit IRC ("zzz...")
09:09 elmex has quit IRC (Client Quit)
09:16 IshaCocoa_ has left
09:26 Aankhen`` This doesn't seem to work: my @foo = <a b c>; my %bar = @foo.map:{ uc($1) => 1; }
09:26 Aankhen`` However, it works when you put another statement before `uc(...)`: my %bar = @foo.map:{ 1; uc($1) => 1; }
09:27 Aankhen`` Is that supposed to happen?
09:29 nnunley has joined #perl6
09:43 Aankhen`` Do we have tr///?
09:49 Juerd Have you tried it?
09:51 Aankhen`` I'm not sure of the syntax.
09:51 Aankhen`` Will it also use ~~?
09:52 Aankhen`` And it seems to give an error which I don't really understand.
09:53 Juerd I don't know.
09:57 revdiablo has quit IRC (Remote closed the connection)
09:59 chady has joined #perl6
09:59 chady has quit IRC (Client Quit)
10:05 chady has joined #perl6
10:08 viirya has quit IRC ()
10:18 clkao hmmmm
10:18 svnbot6 r3970, nothingmuch++ | `role Class::Events::Publisher is extended`
10:18 clkao ./pugs -Iext/Test/lib -Iext/Benchmark/lib fight.t
10:18 clkao hyper: 1013.5884711203811660260956460597711094242747 / s
10:18 clkao normal: 369.7574631384163029023557432855280071866061 / s
10:18 clkao p5: 327.7763980212401072576151716943578176948974 / s
10:19 nothingmuch are units of time that small even measurable in theory?
10:20 nothingmuch or is the speed of light insufficient to travel a measurable distance, say smaller than a quark, in order to notice the granuality?
10:21 clkao autrijus: btw, roundtrip now fails
10:21 nothingmuch clkao: nopaste fight.t?
10:22 pasteling "clkao" at 80.169.162.72 pasted "fight.t" (33 lines, 529B) at http://sial.org/pbot/10473
10:23 clkao but i have to remove the overhead stuff in benchmark, otherwise it becomes negaitive value for perl5 ;)
10:24 nothingmuch how fast is that in "real" perl 5?
10:24 chady has left
10:24 nothingmuch i.e., without the invocation overhead
10:25 nothingmuch because I reckon timethese is a tight loop much like the loop you're testing is
10:25 dakkar has joined #perl6
10:25 clkao Benchmark: timing 100000 iterations of me...
10:25 clkao        me:  1 wallclock secs ( 0.59 usr +  0.00 sys =  0.59 CPU) @ 170666.67/s (n=100000)
10:25 clkao XD
10:31 TheBigBear has joined #perl6
10:32 nnunley has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 BigBear has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 nothingmuch has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 metaperl has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 b00t has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 bd_ has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 spinclad has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 tcliou has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 Qiang has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 wolverian has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 erxz_paste has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:32 TheBigBear is now known as BigBear
10:33 wolverian has joined #perl6
10:33 Qiang has joined #perl6
10:33 nothingmuch has joined #perl6
10:34 tcliou has joined #perl6
10:35 jql has joined #perl6
10:35 vcv has joined #perl6
10:36 nnunley has joined #perl6
10:37 broquaint has joined #perl6
10:38 metaperl has joined #perl6
10:38 b00t has joined #perl6
10:38 bd_ has joined #perl6
10:38 spinclad has joined #perl6
10:38 erxz_paste has joined #perl6
10:38 bd_ has quit IRC (No route to host)
10:40 toadflax has joined #perl6
10:42 bd_ has joined #perl6
10:42 svnbot6 r3971, nothingmuch++ | Fix yet another typo. nothingmuch--
10:42 metaperl has quit IRC (Client Quit)
10:42 metaperl has joined #perl6
10:45 vcv has quit IRC (Nick collision from services.)
10:45 vcv has joined #perl6
10:46 toadflax has quit IRC ("ircII EPIC4-1.1.2 -- Are we there yet?")
10:48 spinclad has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:48 b00t has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:48 erxz_paste has quit IRC (kornbluth.freenode.net irc.freenode.net)
10:50 b00t has joined #perl6
10:50 spinclad has joined #perl6
10:50 erxz_paste has joined #perl6
10:52 rafl has joined #perl6
10:52 vcv has quit IRC (Nick collision from services.)
10:53 vcv- has joined #perl6
10:53 elmex has joined #perl6
11:01 rafl__ has joined #perl6
11:06 rafl__ has quit IRC (Remote closed the connection)
11:06 wilx has quit IRC (Read error: 54 (Connection reset by peer))
11:07 rafl__ has joined #perl6
11:08 rafl has quit IRC (Read error: 104 (Connection reset by peer))
11:08 rafl_ has quit IRC (Connection reset by peer)
11:10 wilx has joined #perl6
11:17 spinclad has quit IRC (kornbluth.freenode.net irc.freenode.net)
11:17 b00t has quit IRC (kornbluth.freenode.net irc.freenode.net)
11:17 erxz_paste has quit IRC (kornbluth.freenode.net irc.freenode.net)
11:19 b00t has joined #perl6
11:19 spinclad has joined #perl6
11:19 erxz_paste has joined #perl6
11:20 Aankhen`` How do I assign an arbitrary property "bar" to an object "$self" from within a method such that I can access it using $self.bar?
11:21 Juerd $self.bar = 15;
11:21 broquaint $self.bar = 'stuff';
11:21 Aankhen`` That gives me something about not finding a compatible subroutine.
11:21 broquaint has quit IRC ("Firefox.reboot()")
11:21 Juerd (Incidentally, this SUCKS because you get no typo checking at all this way...)
11:21 Juerd Aankhen``: That's lack of feature then, probably
11:21 Aankhen`` Ah.
11:22 dakkar $self but :bar(stuff) ??
11:22 Aankhen`` And if the property name is contained in a variable?
11:23 Juerd $self.$var = 15
11:23 Juerd BUT - obviously, that's very bad style.
11:23 Aankhen`` What are the alternatives?
11:23 Juerd Use a hash.
11:23 Juerd $self.foo{$var} = 15
11:23 Aankhen`` Hrm, nevermind, actually, I forgot that those properties ought to have accessors anyway.
11:24 TheMaaaa has joined #perl6
11:24 Aankhen`` I'm working on porting HTTP::Headers; any suggestions for the name of the hash?  I'm a little hesitant to just use "headers" since then you'll access it using: $headers.headers<foo> # assuming $headers is an HTTP::Headers object
11:25 Juerd Ideally, the object itself will in the future behave like a hash, making this a non-issue
11:25 Aankhen`` Alright.
11:25 Aankhen`` I'll stick it in $object.data for now, then.
11:25 Juerd And you're forgetting that you CANNOT use a simple hash for this
11:26 Juerd Because there can be several of a given header.
11:26 Aankhen`` I'm planning to store arrayrefs in each key.
11:26 Juerd I wonder if that isn't needlessly inefficient
11:26 Aankhen`` What would you suggest?
11:27 Juerd Storing it as a single value until a second enters
11:27 rafl__ has quit IRC (Network is unreachable)
11:27 kolibrie has joined #perl6
11:27 Aankhen`` That seemed a little inconsistent to me, which is why I was planning to do it for all the headers.
11:27 Aankhen`` Ah well.
11:27 Juerd And have $headers.header('Set-Cookie') be smart about context
11:27 Aankhen`` Yeh.
11:28 broquaint has joined #perl6
11:28 Juerd (in scalar context: any(@cookies).pick, in list context: @cookies)
11:28 Juerd (Random in scalar context to discourage actually using it, without making it useless.)
11:28 Aankhen`` OK.
11:30 Juerd And have these arrays do the same in non-array context :)
11:30 Juerd Hm
11:31 Juerd Aankhen``: The headers can't be in a hash, by the way, because order can be important!
11:31 Juerd (Officially, order must be ignored, but practically, it matters sometimes)
11:31 Aankhen`` Well, the P5 HTTP::Headers puts them in a hash.
11:32 Aankhen`` It has this array which contains the headers in "Good Practice" order.
11:32 Aankhen`` Or rather, the names of the headers.
11:32 Juerd Fortunately, Perl 6 should make creating a hasharray or arrayhash trivial :)
11:32 rafl has joined #perl6
11:32 Aankhen`` That's nice to know. :-D
11:32 Aankhen`` So how do you do it? :-D
11:32 Juerd That I don't know
11:33 Aankhen`` Heh.
11:33 Juerd I can imagine several ways.
11:33 wolverian I don't quite understand the whole Proxy.new business.
11:33 Aankhen`` Or are you talking about taking a normal array or hash and using a Proxy interface?
11:34 Juerd Probably class HashArray does Hash does Array { ... }
11:34 Alias_ ugh
11:34 Juerd class HTTP::Headers does HashArray { ... }
11:35 Juerd And you're practically done.
11:36 Alias_ A HashArray is an ordered associative array?
11:36 Juerd class HeaderValue does Str does Hash does Array { ... }
11:36 Juerd Alias_: Yes
11:36 iblechbot has joined #perl6
11:36 Alias_ neato
11:36 Alias_ I've been waiting for this for ages
11:36 broquaint Reckon we could get Hugs on feather, Juerd? And what's the best way to get modules installed, ask you or do it ourselves?
11:36 Alias_ I use something similar in a object persistance layer named OKVP
11:36 Juerd What is hugs?
11:37 Alias_ For "Ordered Key-Value Pairs"
11:37 Juerd And re modules: if there are debian package, ask me. Otherwise, install locally.
11:37 Aankhen`` It's like Tie::IndexedHash.
11:37 broquaint Haskell interpreter, but I forgot about it already has ghc, so no matter.
11:37 Alias_ But having something to inherit from directly would be great
11:37 Aankhen`` (or something like that, I can't quite remember the name)
11:37 Juerd Aankhen``: IxHash
11:37 Aankhen`` No, IxHash is different.
11:37 Aankhen`` A different module, atleast.
11:39 broquaint K, thanks again, Juerd.
11:45 Aankhen`` Juerd >> So should I just use a "HashArray" class for it right now?
11:45 Juerd If it exists
11:45 Aankhen`` I'll create it, of course. :-)
11:46 * Aankhen`` fires up pugs and checks it out.
11:46 Aankhen`` Darn, it doesn't work.
11:50 Aragone is now known as Arathorn
11:54 BigBear has quit IRC (Read error: 60 (Operation timed out))
11:59 TheBigBear has joined #perl6
11:59 TheBigBear is now known as BigBear
12:08 Limbic_Region has joined #perl6
12:16 pupilzeng has joined #perl6
12:24 Aankhen`` How do I get the class of an object so I can create a new one?
12:24 Aankhen`` (I don't want to clone it since that would copy existing attributes)
12:24 Aankhen`` s/attributes/properties
12:24 Aankhen`` s|$|/| # stupid keyboard
12:27 Aankhen`` Ah, $obj.ref works.
12:29 castaway darn, shoulda suggested it when I thought of it ,)
12:31 Aankhen`` Heh.
12:31 Aankhen`` I got confused at first and didn't quite understand what was happening.
12:31 Aankhen`` All well now though. :-)
12:34 castaway goodgood
12:38 Limbic_Region Juerd - http://perlmonks.org/index.pl?node_id=461041
12:38 Limbic_Region oops meant that as a message
12:49 * Juerd installs almost all available debian cpan module packages on feather
12:49 Juerd 606 MB including dependencies
12:49 Alias_ Are you going to do a comparison of what percentage that is?
12:50 Juerd No
12:50 Juerd It's just so that many modules will be installed and ready to use :)
12:52 broquaint Juerd++ # installing modules
12:52 Juerd broquaint: I saw you busy installing lots of modules, and thought I could preempt on that ;)
12:53 broquaint Thanks :)
12:54 Juerd debian++
12:56 Juerd done.
12:57 broquaint Hurrah!
13:05 b00t has quit IRC (Remote closed the connection)
13:06 defitro has joined #perl6
13:08 nothingmuch sigh
13:08 nothingmuch i feel warnocked again
13:13 dakkar has quit IRC ("e via, verso nuove avventure")
13:26 Limbic_Region does 10 .. 1 work in p6 or do you still need reverse 1..10 ?
13:27 Alias_ I hope not
13:27 Alias_ might cause unexpected behaviour in something like 1 .. $x for low values of $x
13:29 broquaint How do you do backtick-esque stuff in perl6?
13:35 vcv- has quit IRC (Read error: 60 (Operation timed out))
13:36 viirya has joined #perl6
13:44 jql has quit IRC (Read error: 110 (Connection timed out))
13:44 Khisanth Alias_: how about 1..10:by(-1) ?
13:45 Limbic_Region Khisanth - BASIC rules
13:45 Khisanth eh? I am not that fond of BASIC
13:46 Arathorn L~R is alluding to FOR I=1 TO 10 STEP -1
13:46 Arathorn i think
13:46 Arathorn or whatever the syntax was :)
13:46 Arathorn 10 TO 1 STEP -1, even
13:47 Khisanth can't really decide what might be correct with that
13:47 metaperl has left "So Long, and Thanks for All the Fish!"
13:47 Aankhen`` STEP -1, I think.
13:47 Aankhen`` It basically adds the step.
13:48 Khisanth I meant for perl6!
13:48 Aankhen`` I was talking about BASIC, heh.
13:48 * Arathorn grins
13:48 Khisanth 1..10 to get 10 to 1 just doesn't feel right though :p
13:49 Aankhen`` Yep.
13:49 Aankhen`` Which is why it ought to be 10..1:by(-1).
13:49 Aankhen`` 10 + (-1) = 10 - 1 = 9 and so on, in case anyone here forgot their addition. :-D
13:49 Khisanth yeah ... seems better but that :by(-1) should be required
13:50 * Arathorn isn't so sure
13:50 Khisanth hrm actually no
13:50 Arathorn is .. defined for fractional numbers?
13:50 Aankhen`` I'd think that the basic mechanism of the range operator would make it required -- it just keeps adding one till it gets to the end, right?
13:51 Arathorn why not just keep adding sign($b-$a)? (in the case of $a..$b, whatever the basic-style sign() function is in perl6)
13:51 Arathorn (until you hit the endstop)
13:52 Aankhen`` Noooooooo!
13:52 Aankhen`` Evvviiillll!
13:52 Aankhen`` EVIL I SAY
13:52 * Aankhen`` coughs.
13:52 Aankhen`` Yes, that sounds perfectly reasonable.
13:52 Arathorn why, though?
13:52 Arathorn <Alias_> might cause unexpected behaviour in something like 1 .. $x for low values of $x
13:52 Arathorn how low? $x<0 or 0<$x<1 ?
13:52 Aankhen`` Anyway.
13:52 Aankhen`` BBL.
13:53 nnunley has quit IRC (Read error: 113 (No route to host))
13:59 defitro Hey hey, good morning all.  Is there, or are there plans for a Data::Dumper in perl6?  Thought I'd seen mention of a dump() somewhere...
13:59 Arathorn you just do .perl() on whatever you want to dump, i believe
13:59 Arathorn (although i think that's a pugs-proprietary-extension)
14:01 defitro excellent!  Also, is there full socket support in pugs as of yet?
14:02 Arathorn there's certainly enough to write IRC bots
14:03 Arathorn c.f. http://search.cpan.org/src/AUTRIJUS/Perl6-Pugs-6.2.5/ext/Net-IRC/lib/Net/IRC-OO.pm
14:03 f0rth has joined #perl6
14:04 defitro doh, I ran into that the other day, didn't put two and two together..
14:11 cfranks has joined #perl6
14:11 svnbot6 r3972, autrijus++ | * guarantee a GC run before and after INIT and END.
14:12 cfranks is now known as fireartist
14:15 gaal i added a Prim but it's not getting recognized. any ideas how to debug this?
14:15 Alias_ Plus we have CPAN support, so I imagine one could use POE anyway?
14:15 viirya has quit IRC ()
14:16 gaal ..actually i'm reviving a Prim that I'd already added and which used to work...
14:16 gaal the interesting lines are
14:16 gaal op2 "Pugs::Internals::openFile" = \x y -> do
14:16 gaal \\n   IO        pre     Pugs::Internals::openFile    (Str,Str)\
14:16 gaal anyone see something wrong with that?
14:18 gaal also: is there currently a way from p6 code to see all the available builtins? sorta like peeking at %:: in p5, only... for builtins ;-)
14:18 hlafarge has joined #perl6
14:18 fireartist Hi folks, recently joined 'pugs commiters' - just dropping by to see what's happening
14:19 gaal i gotta run now, i'll backlog. &
14:20 hlafarge hi everyone, i'm getting "Could not find module `System.Eval'" error when trying to compile pugs
14:20 sproingie has joined #perl6
14:20 hlafarge anything obvious i'm missing ? (i can provide more info if needed)
14:21 hlafarge first, i'm compiling under "export PUGS_EMBED=parrot" control
14:21 gaal hlafarge, try unregistering hs-plugins and rebuilding
14:22 gaal i'm out for real now. see ya. &
14:22 Alias_ Arathorn: Currently, 3 .. 0 does nothing, which is good for things like "Do something to all of the 4th or later elements"
14:22 nothingmuch would anybody be willing to discuss Class::Events to death?
14:22 hlafarge gaal: how do i do that (unregistering) ?
14:22 SM_ax has quit IRC ("ChatZilla 0.9.61 [Mozilla rv:1.7.7/20050420]")
14:22 Alias_ Arathorn: It works very well, and doesn't do unexpected things. What I wouldn't expect would be for it to do something to the 4th, 3rd, 2nd, etc...
14:25 Arathorn well, it's only because you're used to the perl5 semantics of it
14:25 Arathorn and i have to admit that i've used 3..0 to return () in perl5 quite a bit
14:25 * Arathorn shrugs
14:25 Alias_ Arathorn: True, but also because I'm used to it being a flip flop and not a "range" operator
14:25 Arathorn hasn't the bistable functionality been dropped for it for perl6?
14:25 Arathorn (and does reverse (0..100000) happen lazily under perl5, out of interest?)
14:26 PerlJam Arathorn: I hope not
14:26 Arathorn i'm prolly imagining that, then
14:26 Alias_ foreach ( reverse 0 .. 100000 ) { ... } has been explicitly optimized since 5.8.something
14:26 * Arathorn nods
14:26 Alias_ it's turned into $what_you_expect
14:27 Alias_ I've never seen anyone use a flip flop properly in Perl 5 except me anyway :)
14:27 svnbot6 r3973, autrijus++ | * fire DESTROYALL in reverse order of BUILDALL.
14:27 Alias_ foreach my $line ( @perlcode ) {
14:28 Arathorn i've written in perl5 for years and I only noticed the flipflop behaviour of .. a few months ago
14:28 Alias_    next unless $line =~ /^=\w/ .. $line =~ /^=cut\b/;
14:28 Alias_    ...
14:28 Alias_ }
14:28 PerlJam heh
14:28 PerlJam Arathorn: Have you ever used the ... operator in perl5?
14:28 Alias_ Standard "do stuff while in POD" flip flop
14:28 PerlJam Arathorn: have you ever used the match-once pattern matcher?   ?pat?
14:29 Arathorn didn't know there was a ... :)
14:29 PerlJam Arathorn: have you ever used reset() or dump()?
14:29 Arathorn recognise ?pat? from some perl4, though
14:29 Arathorn and never used reset() or dump().
14:29 Arathorn (not sure what that tells you...)
14:29 Alias_ I should run a PPI tinderbox scan to see if anyone uses ?pat?
14:29 PerlJam Arathorn: Perl is big enough that there are probably lots of things that you'll never use or even know exist unless you happen upon them in some stray bit of code.
14:30 Alias_ PerlJam: Or write a Perl parser ;)
14:30 Alias_ The flip flop is kind of cool, but absolutely write-once code
14:31 Alias_ I recomend against using it even when it's appropriate
14:31 PerlJam Arathorn: ... is just like .. mostly, except it modulates the behavior of the flip-flop version.
14:31 PerlJam Alias_: what?!?  you're clearly insane.
14:31 Alias_ PerlJam: I'd rather maintainable code than small code
14:31 PerlJam Alias_: .. *is* maintainable.
14:31 Alias_ Hell, _I_ have trouble reading flip flop code
14:31 Alias_ 1 .. $x is maintainable.  next unless $line =~ /^=\w/ .. $line =~ /^=cut\b/;
14:31 Alias_ ... is less so
14:32 Alias_ I mean when you actually use flip flops full on, not when you it in it's "range" thinkalike
14:33 Alias_ Because there's invisible state
14:33 Alias_ the flip flop holds state over the calls, and invisible state is nasty stuff
14:34 PerlJam how is the state invisible exactly?
14:34 broquaint Yeah, filehandles suck ...
14:34 Alias_ It isn't stored anywhere you can see
14:34 PerlJam you don't think the flip-flop syntax is distinctive enough?
14:35 Alias_ or manipulate, or pass around
14:35 broquaint And /.../g too ...
14:35 Alias_ broquaint... huh?
14:35 PerlJam Alias_: He's pointing out other instances of "invisible state"
14:35 Alias_ I don't see any invisible state there...
14:35 broquaint e.g /.../g also holds state invisibly.
14:35 Arathorn capture groups are fairly visible..
14:35 Arathorn oh, the /g
14:35 Arathorn point
14:35 Alias_ broquaint: Since when...
14:36 Alias_ $_, $1, $2
14:36 Alias_ ...
14:36 broquaint Have you not done while(/.../g) {} before, Alias_?
14:36 Arathorn i think he's referring to the current position in $_
14:36 Alias_ yep, and you can always see the current value in $_
14:36 Alias_ or the position magic, which I can't remember right now
14:36 Arathorn (which is accessible visibly through some random punctuation $variable, surely?)
14:37 broquaint pos()
14:37 Alias_ right, or that
14:37 Alias_ Tell me how to find the current value of a flip flop
14:37 broquaint But it is implicitly maintained state nonetheless.
14:37 Alias_ except by implication
14:37 PerlJam And you evaluate the flip-flop  :-)
14:38 broquaint I'm not arguing for flip-flop though. There's a way of accessing it's state but it's fairly magical.
14:38 svnbot6 r3974, autrijus++ | * add correct probing of hs-plugins so we don't trip over
14:38 svnbot6 r3974, autrijus++ |   older versions of it.
14:38 svnbot6 r3975, autrijus++ | * refactor newSVval to handler Val->PerlSV casting.
14:38 svnbot6 r3975, autrijus++ | * beginning of unifying two GCs together.
14:38 svnbot6 r3976, iblech++ | modules/Class-Events -- Usual svn properties.
14:38 svnbot6 r3977, iblech++ | A handy utility added for screen(1) users --
14:38 svnbot6 r3977, iblech++ | examples/network/screen-nodestatus.p6 monitors the status of your hosts.
14:38 Alias_ regardless, I've abused flip flops before, and even I couldn't read my own code when I came back to it
14:39 Alias_ I prefer to write Perl at one level below my skill level, so debugging is possible and less skilled people can maintain it
14:39 PerlJam Alias_: so ... because *you* abuse it, it shouldn't be part of the language?
14:39 Alias_ PerlJam: You think it shouldn't be part of the language?
14:39 PerlJam It's a useful tool that I've grown accustomed to you might say.
14:40 Alias_ It has it's place, but I still recommend not to abuse it, because it's very write-once
14:40 PerlJam It's like having a tack hammer.  It's something you rarely need but when you need a tack hammer it's the right tool.  Never mind that you can also use it to drive other things.
14:40 Alias_ Range-like uses are fine, but algorithmic ones are less so
14:41 PerlJam I will admit that the difference between  .. and ... is to subtle for most people
14:41 Alias_ And it's often fairly easy to implement the same thing as you would abuse a flip flop for using 2 or 3 additional lines
14:41 Alias_ I'd rather do that and retain readability
14:41 PerlJam (this is why most perl programmers who know about .. as flip-flop have no clue about ...)
14:41 sproingie i grew to hate the .. operator
14:42 sproingie its extent is apparently global
14:42 Alias_ as range or otherwise
14:42 sproingie as flipflop
14:42 PerlJam sproingie: really?  I've been using it for nigh on 15 years now.  I like it alot :-)
14:42 sproingie it's good in scripts, not programs, because it has global extent
14:42 Alias_ I've used it enough times to know that it's hard to debug easily...
14:42 Alias_ And that alone is enough for me to avoid it
14:42 * PerlJam boggles
14:43 PerlJam debug?  I've never had a problem with it.
14:43 PerlJam Even when I was a perl newbie.
14:43 Alias_ as in, running through the debugger and understanding what's going on
14:43 sproingie it's quite nice for text munging scripts ... that operate on one file, and one only
14:43 sproingie because it doesn't reset
14:44 PerlJam sproingie: do you mean one filehandle?
14:44 Alias_ Doesn't it reset when it loses scope?
14:44 PerlJam (including ARGV for the magic <>)
14:44 sproingie Alias_: it apparently never loses scope
14:44 Alias_ hmm... that seems odd
14:44 sproingie i dont know the precise rules, but the behavior is mysterious
14:44 Alias_ right
14:44 Alias_ I don't like mysterious
14:44 PerlJam sproingie: It's simple!
14:45 PerlJam It's true as soon at the LHS is true and stays that way until the RHS becomes true.
14:45 PerlJam the difference between .. and ... is when the RHS is first evaluated.
14:45 sproingie right, but i had thought when it went out of scope, it would reset
14:45 sproingie it does not.  it has global extent
14:45 PerlJam what do you mean by "scope" in this instance?
14:45 sproingie put it in a function
14:45 integral err, that would break: while (<>) { //..// } since it would reset on every loop
14:45 Alias_ he means it never resets
14:45 Alias_ integral: You never leave scope in loops
14:46 Alias_ not till the end
14:46 Alias_ which is why you 'my'ed variables aren't re-initialised each loop
14:46 scook0 has quit IRC ("Leaving")
14:46 Alias_ errr.. not reallocated rather
14:47 integral oh, ok.  I really hate that bit of perl's pads.
14:47 nothingmuch /me never sufferred from it
14:47 nothingmuch do you mean at the XS level?
14:48 Alias_ nothingmuch: From time to rare time you can encounter memory bloating of a type
14:48 svnbot6 r3978, iblech++ | Makefile.PL -- It's not "you are building perl5", but "building with embedded
14:48 svnbot6 r3978, iblech++ | perl5".
14:48 Alias_ because things aren't cleaned up exactly like you would initially expect
14:49 Alias_ It's one of those very rare gotchas
14:49 Alias_ I've hit it once in 7 years
14:49 nothingmuch isn't that perl's memory allocation behavior in general?
14:49 Alias_ what, bloat? :)
14:49 nothingmuch do you remember the scenario?
14:49 Alias_ not the particulars any more
14:49 Alias_ I think it had something to do with a 100meg memory construct
14:49 Arathorn i got the impression that perl5 basically never gc'd :)
14:49 Alias_ And it built into another 100meg construct
14:49 nothingmuch hmm
14:49 Alias_ but I was careful to reduce the first one as I went
14:49 nothingmuch destructors were called, but data not deleted?
14:50 nothingmuch since scope was not exited memory was not reusable, so more was mallocced?
14:50 PerlJam nothingmuch: debugging someone's imagination isn't very productive :)
14:50 Alias_ and then on the next loop, the next 100meg thingy was built, but the previous end one wasn't cleared until I started reallocating to it
14:50 Alias_ But it was a couple of years ago, so I'm guessing a little
14:51 nothingmuch PerlJam: i'm still working on the context switch
14:51 hlafarge has quit IRC ("KVIrc 3.2.0 'Realia'")
14:51 nothingmuch define reallocating and cleared
14:52 Aankhen`` What is the signature of `join`?
14:52 * PerlJam still doesn't understand what people were expecting of flip-flop and not receiving.
14:52 nothingmuch reallocating is creating new perl values on memory space that was prevously mallocced?
14:52 PerlJam Or even why they were expecting flip-flop to be that way.
14:52 nothingmuch this discussion is about ..?
14:52 Alias_ nothingmuch: The 'my' variable didn't cease to exist at the end of the loop. Perl kept it to avoid having to create it again
14:52 nothingmuch err, C<..>?
14:52 PerlJam nothingmuch: no no, that was the previouis discussion that segued into scope and allocation
14:53 nothingmuch so, for example, a reference to it was still the old value?
14:53 Alias_ But again, I'm really guessing here. You'd need to search the newsgroups and mailing lists
14:53 nothingmuch i'll pass, i think
14:54 integral perl -le 'sub foo { scalar($_[0] .. $_[1]) } print foo(1, 0); print foo(0, 1); print foo(0, 0)' # hidden global state... "bad"
14:55 sproingie nice example
14:55 sproingie what gets me is that the documentation for .. doesn't seem to let on to this
14:55 sproingie or perhaps it does and i ignored it
14:57 integral perl -le 'sub f { sub{scalar($_[0] .. $_[1])} } sub foo { my $f = f; &$f } print foo(1, 0); print foo(0, 1); print foo(0, 0)' # very hidden global state
14:57 sproingie i wonder if it would reset if i evaled it
14:57 PerlJam you know ... maybe the docs don't explain it clear enough and I'm just so used to the behavior that it's not a problem for me to figure out what's going on.
14:57 sproingie integral: while you're testing it, could you try eval?
14:58 nothingmuch anybody got a comment on this: http://www.nntp.perl.org/group/perl.perl6.language/21560 ?
14:58 integral the .. state is just stored in the OP for the .. (the flip or flop?), isn't it?
14:58 Alias_ PerlJam: Or you've just never hit the corner cases
14:58 nothingmuch it's really bugging me
14:58 integral PerlJam: it's not a problem at all when you don't have subroutines
14:58 PerlJam Alias_: um ... there *aren't* any corner cases  as far as I'm concerned ;-)
14:58 integral PerlJam: ever used .. in a module?
14:58 PerlJam integral: many times!
14:58 sproingie huh
14:58 sproingie .. basically isn't reusable from what i've seen
14:58 Alias_ PerlJam: Then you obiously aren't looking hard enough :)
14:59 PerlJam sproingie: sure it is.
14:59 PerlJam crap ... I'm missing a meeting.
14:59 PerlJam we can argue later :)
14:59 sproingie carp("missing a meeting")
15:00 integral perl -le 'sub foo { my $x = 0; for(@_) { $x++ if $_..0 } return $x } print foo(0, 0, 0); print foo(0, 1, 0); print foo(0, 0, 0)' # hmm
15:01 fireartist Is anyone working on implementing "has $.attrib" in pugs ?
15:01 Aankhen`` Isn't that already working?
15:01 integral perl -le 'sub bar { scalar($_[0]..$_[1]) } sub foo { my $x = 0; for(@_) { $x++ if bar($_,0) } return $x } print foo(0, 0, 0); print foo(0, 1, 0); print foo(0, 0, 0)' # !
15:01 integral err, no, that's not surprising.   err.
15:02 sproingie perl -le 'sub foo { eval { scalar($_[0] .. $_[1]) } } print foo(1, 0); print foo(0, 1); print foo(0, 0)' # really REALLY hidden global state... "bad"
15:03 fireartist (it's marked :todo<feature> in attribute.t)
15:03 sproingie however: perl -le 'sub foo { eval q[ scalar($_[0] .. $_[1]) ] } print foo(1, 0); print foo(0, 1); print foo(0, 0)' # no hidden global state here
15:04 sproingie er actually, doesnt seem to work at all :)
15:05 jhorwitz has joined #perl6
15:05 Aankhen`` ok 5 - .. autogenerated accessor works
15:05 Aankhen`` ok 6 - .. autogenerated accessor works w/out parens
15:05 svnbot6 r3979, iblech++ | screen-nodestatus.p6 -- Added a link to a screenshot.
15:05 sproingie should be getting 1E0, right? .. seems to work if i use qq
15:06 Aankhen`` BBL.
15:07 fireartist thanks Aankhen`` - I'll see if there's enough implemented for my needs!
15:13 vcv- has joined #perl6
15:13 jql has joined #perl6
15:15 cdpruden has joined #perl6
15:17 ninereasons has joined #perl6
15:29 fireartist has quit IRC ("Leaving")
15:31 broquaint Aren't all operators reduceable now?
15:35 madhause has joined #perl6
15:36 broquaint i.e my $str = ', ' [~] @arr;
15:36 clkao seen autrijus
15:36 jabbot clkao: autrijus was seen 11 hours 4 minutes 14 seconds ago
15:36 clkao i guess it's time to wake up
15:37 vcv- has quit IRC (Read error: 145 (Connection timed out))
15:38 nothingmuch clkao: actually he committed changes up to around 2 hours ago, i think
15:39 Juerd broquaint: All infix and postcircumfix operators
15:39 nothingmuch but i don't think that invalidates your remark
15:39 Juerd broquaint: However, [op] itself is prefix, so ', ' [~] @arr is wrong
15:39 Juerd That should be either ', ' ~ [~] @arr or simply [~] ', ', @arr
15:40 broquaint Aha, thanks, Juerd.
15:45 iblech has joined #perl6
15:45 iblech Aankhen``: (backlogging) HTTP::Headers is already ported, see ext/LWP-Simple/HTTP/Headers.pm
15:46 clkao yay, more perl5 fixes
15:46 ingy anyone here want to help me test a subethaedit connection?
15:46 nothingmuch ingy: sure
15:46 ingy nothingmuch: one sec
15:47 jql has quit IRC (Read error: 110 (Connection timed out))
15:47 ingy nothingmuch: try connecting to freepan.org
15:47 TheMaaaa has quit IRC (Read error: 110 (Connection timed out))
15:47 nothingmuch works
15:48 ingy type something?
15:48 nothingmuch see it?
15:49 sproingie has quit IRC (Read error: 104 (Connection reset by peer))
15:53 madhouse has quit IRC (Connection timed out)
16:02 pupilzeng has quit IRC ("See you!")
16:02 madhause has quit IRC ()
16:04 broquaint Shouldn't this work?: pugs -e 'class foo {} foo.can("bar")'
16:05 broquaint Currently it complains: *** No compatible subroutine found: "&can"
16:06 Limbic_Region correct me if I am wrong, but while my @foo = $sub() { ... } is valid syntax, it just means that @combo is going to persist beyond the loop?
16:07 iblech broquaint: I'm not sure if .can works on Class objects, too (but, for consistency, it should).
16:07 iblech broquaint: But IIRC .can isn't implemented yet.
16:07 iblech Limbic_Region: Yep, should work.
16:08 Aankhen`` iblech >> I really should check for prior art... :-) Mind if I move LWP-Simple/* to libwww-perl/?
16:08 iblech Aankhen``: Go ahead :)
16:08 Aankhen`` Thanks.
16:08 Limbic_Region iblech - should, but IIRC isn't currently supported in Pugs
16:09 * Limbic_Region has given up waiting for stuff and am just writing his cribbage solution as if it were
16:09 broquaint Ok, thanks, iblech.
16:09 iblech Limbic_Region: I think it's because of the my(). my is currently only supported on statement level, e.g. "my $a = 3;", it doesn't work yet in expressions (there's already a test for it, t/pugsbugs/parsing_my.t IIRC)
16:09 revdiablo has joined #perl6
16:10 Limbic_Region no worries iblech
16:10 Limbic_Region I plan on having a few people review my code for obvious errors and suggestions
16:10 Limbic_Region and then check it in
16:10 Limbic_Region hopefully someday it will run
16:11 iblech Limbic_Region: I'm sure it will, eventually :)
16:12 Limbic_Region well - I have p6ified it quite a bit with the help of revdiablo and dragonchild - but I still feel it has room for improvement
16:12 Limbic_Region perlbot nopaste
16:13 Limbic_Region err um
16:14 revdiablo Limbic_Region: sial.org/pbot/perl6
16:14 pasteling "Limbic~Region" at 129.33.119.12 pasted "Work in progress so far" (89 lines, 2.7K) at http://sial.org/pbot/10482
16:15 Limbic_Region about to start working on new_deck() and then going to look at incorporating gather/take
16:25 Aankhen`` I think I messed up something.
16:25 Aankhen`` I `svn move`d all the files from LWP-Simple/ to libwww-perl/... then I tried to remove LWP-Simple/, but I get an error saying that it isn't a working copy directory...
16:26 gaal someone remind me what's the "usual svn properties" incantation for new files?
16:26 broquaint Where's all the OO code in pugs located?
16:26 clkao autrijus: still spins
16:26 clkao and coredmp
16:26 pasteling "Limbic_Region" at 129.33.119.12 pasted "Please review for syntactic correctness and any suggestions for inclusion as an example" (82 lines, 2.3K) at http://sial.org/pbot/10485
16:26 clkao maybe because the coderef is gc'ed?
16:27 clkao hm, or because there's no &
16:27 gaal is it just "eol-style native" ?
16:28 clkao autrijus: btw roundtrip fails now
16:29 iblech gaal: See docs/other/development_tips
16:29 gaal just found it, thanks :)
16:29 iblech Aankhen``: IIRC this is normal, after a directory mv you'll have to rm -rf the original dir by hand
16:30 Aankhen`` C:\DEVELO~1\pugs\ext>rm -rf LWP-Simple
16:30 Aankhen`` rm: cannot remove directory `LWP-Simple/lib/HTTP': Operation not permitted (EPER
16:30 Aankhen`` M)
16:30 Aankhen`` rm: cannot remove directory `LWP-Simple/lib': Directory not empty (ENOTEMPTY)
16:30 Aankhen`` rm: cannot remove directory `LWP-Simple': Directory not empty (ENOTEMPTY)
16:30 Alias_ has quit IRC ()
16:33 iblech Aankhen``: Huh? I don't know what rm you have, but mine does delete non-empty dirs (when executed with -rf) :)
16:34 Aankhen`` Hrm.
16:34 Aankhen`` Strange.
16:34 Aankhen`` Apparently it's being used by another process.
16:35 knewt i find that sort of thing on windows all the time. nothing running that should have possibly been anywhere near a folder other than explorer, but explorer still complains that the folder is in use and can't be removed :(
16:35 svnbot6 r3980, gaal++ | Unicode editing quickref
16:35 Aankhen`` Yea.
16:36 knotty has quit IRC (Read error: 60 (Operation timed out))
16:36 knewt i should get round to grabbing the program to tell me exactly /which/ bloody program it is. of course, knowing microsoft it'll be explorer itself keeping the folder open
16:36 gaal can someone with Haskell-fu try svn uppping and see why Pugs::Internals::openFile doesn't work?
16:38 iblech gaal++ # svn props :)
16:38 integral do I need a even newer hs-plugins for System.Eval?
16:38 gaal integral, i *think* it's the newest ones that are broken
16:39 gaal but i may be wrong.
16:39 Aankhen`` Hmm.
16:39 gaal iblech, heh, thanks
16:39 integral oh, ok
16:39 Aankhen`` knewt >> You have AV software running?
16:39 gaal what the velvety antlers is wrong with my code?
16:40 integral hmm, it seems that enabling perl5 embedding for me (10.3) puts a '-optl' arg on the ghc command line which it chockes on
16:40 svnbot6 r3981, gaal++ | openFile updates (doesn't work yet, but shouldn't break anything)
16:41 knewt Aankhen``: ah, yeah. SAV. thing is, this only happens sometimes. i can be dealing with lots of different folders, and then randomly 1 or 2 will refuse to be deleted
16:41 Aankhen`` Same here.
16:42 Aankhen`` I think I'll have to reboot for this to work.
16:42 Aankhen`` And I can't do that for another 1 1/2 hours.
16:42 knewt have you tried killing explorer, just to see if that will help?
16:42 Aankhen`` No.
16:43 Aankhen`` Ah, let it be.
16:43 Aankhen`` I'll try later.
16:43 Aankhen`` BTW, you wanna see the most useless "troubleshooting" article ever?
16:43 Aankhen`` http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/w2000Msgs/3729.asp
16:45 knewt Aankhen``: explorer is great as a source for hate. the other day it decided to totally lock up one of the several instances of itself it had randomly decided to create. killed all of the explorer processes, and then ran a new instance, but all i got was an explorer window. no taskbar at the bottom. had another look at the task manager and found it had managed to spawn a new instance of itself in between me killing them all and starting a new one
16:46 Aankhen`` I will be so happy when we move abroad and I get a computer of my own on which I can run Linux. :-)
16:46 knewt well, this is my dads computer which i (ab)use for p2p use
16:46 Aankhen`` LOL.
16:47 Aankhen`` This is really annoying though.
16:47 Aankhen`` I can't even `svn up`.
16:47 knewt i've managed at least to convert him from IE/OE to Firefox/Thunderbird
16:47 Aankhen`` Good work. =)
16:47 knewt he hates having to use IE nowadays
16:47 Aankhen`` Heh.
16:47 knewt his two main reasons being tabs and popups
16:48 knewt but lots of other little things as well which just add up to a much nicer experience
16:52 perlbot has joined #perl6
16:52 broquaint has quit IRC ("BEGIN { Weekend.new }")
16:54 gaal btw, today i noticed Prim.hs was hampered by tabs somebody had left in it. should we perhaps put in emacs and vim magic lines to prevent that kind of thing? at least in haskell source.
16:54 gaal the vim line is      vim: set ts=4 et :
16:55 gaal actually, we can s/vim/vi/g that
16:56 iblech FWIW, I use tabstop=8 shiftwidth=4 expandtab smarttab softtabstop=1
16:56 iblech So I can use <Tab> and <Backspace> for indenting, but Vim indents only 4 chars
16:56 gaal okay -- the really critical bit is expandtab.
16:56 iblech Yep
16:56 gaal so i propose we add it to all .hs files
16:56 gaal what's the equivalent emacs incantation?
16:58 osfameron has quit IRC ("Leaving")
17:00 pjcj perl5 uses:
17:00 pjcj * Local variables:
17:00 pjcj * c-indentation-style: bsd
17:00 pjcj * c-basic-offset: 4
17:00 pjcj * indent-tabs-mode: t
17:00 pjcj * End:
17:00 pjcj *
17:00 pjcj * ex: set ts=8 sts=4 sw=4 noet:
17:01 gaal in perl the code itself doesn't break as easily. before pugs i always used noet for my own projects, but it looks like it's just dangerous in haskell code.
17:02 wilx noet?
17:02 iblech noexpandtab, I thin
17:02 iblech noexpandtab, I think
17:02 pjcj that's for perl's C code - just for reference, not copying
17:02 gaal yes. == leave a literal ^i in the file
17:03 gaal er, yes, c isn't fragile that way either.
17:03 mauke that's why perl's C code sucks so much
17:03 mauke it uses mixed spaces and tabs
17:03 gaal encouraging *just* expandtab sounds like a good idea to me
17:03 gaal because it avoids getting into religious wars
17:03 mauke I use tabs only
17:04 pjcj mauke: so if we run it through expand perl5 will be maintainable?
17:04 gaal everyone can have their favorite tab width
17:04 mauke pjcj: huhu
17:04 PerlJam gaal: nah, perl should do like guido wants to do in python:  all indentations must be spaces and come in multiples of 4
17:04 knewt the topic of tabs came up recently elsewhere. some tabs had managed to work there way into some python code on another project. and apparently python evaluates tabs as being "up to the next 8 character division"
17:04 gaal mauke, you do that in haskell?
17:04 mauke wait, let me check
17:04 Aankhen`` Nooooo!
17:04 SamB knewt: what did you expect?
17:04 Aankhen`` 8 character Tabs!
17:05 SamB you aren't supposed to use tabs in python anyway
17:05 pjcj s/in python anyway//
17:05 integral PerlJam: no, no, rather than waste space with 4 spaces, use a special "indent" character! :-P
17:05 knewt converting is theremore more interesting than it otherwise would be, because you can't just convert the tabs into a fixed number of spaces, you have to know where in the line the tab occurs
17:05 * luqui decides he's going to try to learn Haskell again
17:05 luqui does anybody here know it?
17:05 knewt pjcj: linux insists on tabs :)
17:05 PerlJam integral: Any good unicode candidates?
17:05 SamB pjcj: well yeah, but its harder to convince people of that!
17:05 gaal no, pjcj PLEASE let's not do the war thing.
17:05 integral PerlJam: \t !
17:06 mauke gaal: yes, my haskell settings are ts=3 sw=3 noet
17:06 * integral &
17:06 PerlJam mauke++ a man after my own heart
17:06 luqui what is op2Cast?
17:07 wilx GNU style!
17:07 * wilx runs for cover
17:08 Juerd 19:11 < integral> PerlJam: no, no, rather than waste space with 4 spaces, use a special "indent" character! :-P
17:08 Juerd That would work, if tab wasn't whitespace.
17:08 Odin-LAP wilx: While calling out 'fire in the hole'?
17:08 wilx While calling "GNU style" :)
17:08 svnbot6 r3982, ninereasons++ |  add :todo<bug>s to relational operators
17:08 Odin-LAP Tab is the most spectacularly messed up character found in ASCII. And that's saying something.
17:09 wilx Anyway. Many people thing it is odd one while I really like it :)
17:09 Odin-LAP (It's messed up because of what people have done to it, not because of how it's specified.)
17:09 Juerd Odin-LAP: It should not have been specified as displaying as whitespace
17:09 PerlJam Juerd: I nominate ` as the indent char :-)
17:09 Juerd PerlJam: It's too small
17:10 gaal my, where's the UNDO button on this tab debate thing?
17:10 wilx Using \t is odd too. It breaks the intended look in any editor with different tab width.
17:10 wilx Spaces everywhere!
17:10 Odin-LAP wilx: Huh. Frankly, I tend to more positive towards it with Linus's comment on the GNU coding standards, but that's just the oppressed-minority-whore in me, I think...
17:10 wilx :)
17:10 Odin-LAP Juerd: Hm. Maybe not...
17:10 SamB wilx: and it breaks the code in Haskell!
17:11 wilx Right!
17:11 gaal luqui, see Prim/Lifts.hs:52
17:11 pjcj Juerd: I set vim to display tabs as » - so Perl6 messed that up.
17:13 SamB let them play with their silly unicode chars for a while
17:13 luqui how do I get the haskell list out of a VList?
17:14 gaal hl <- fromVal vl
17:14 Limbic_Region ok - now that more people are talking
17:14 Limbic_Region http://sial.org/pbot/10485 - Please review for syntactic correctness and any suggestions for inclusion as a Pugs example
17:14 luqui mk
17:15 Limbic_Region warning - it won't run on Pugs now as several features are unimplemented (which is why I need help verifying syntax)
17:16 Juerd    next if none( @combo>>.<val> ) == 5;
17:16 Juerd I'd personally write that the other way around
17:16 Limbic_Region which other way?
17:16 Juerd any( @combo>>.<val> ) == 5 or next;
17:17 Limbic_Region ok - but it equates to the same thing - so that's personal preference
17:17 Limbic_Region I am more interested in things that are flat out wrong - or could be re-written better using a different p6 feature
17:17 vcv has joined #perl6
17:17 jql has joined #perl6
17:18 Juerd Limbic_Region: Well, instead of the while, a real iterator, used with =, would be better
17:18 Juerd But I don't know how to write that
17:18 Limbic_Region I agree - I would like to use something with lazy gather/take
17:18 Juerd        ?? [eq] @hand[3,4]>>.<suit> ?? 5 :: 4
17:18 Limbic_Region but also don't know the right way to do it
17:18 Juerd Just because nobody actually can remember the precedence of the ternary operator, use parens around the inner.
17:19 Juerd    say join ' ', @combo.map{ $_<suit> };
17:19 Juerd Just ~ it.
17:19 Juerd say ~@co...
17:19 gaal actually Juerd, i think there's an open bug right now there.
17:19 Limbic_Region that's a space
17:19 gaal (in ?? :: precedence)
17:19 Juerd Limbic_Region: Yes.
17:19 Limbic_Region so ~ doesn't work Juerd
17:19 Juerd Limbic_Region: ~@array joins on the exact same string.
17:19 Juerd A single space.
17:20 Limbic_Region oh
17:20 Limbic_Region news to me
17:20 Limbic_Region thanks
17:20 Limbic_Region will change
17:20 Limbic_Region but I also need to deref
17:20 Limbic_Region how does that work?
17:20 Juerd Well, . is tighter
17:20 Limbic_Region ~@array>>.<suit>
17:20 Limbic_Region ?
17:21 Juerd Yes
17:21 revdiablo perhaps ~@combo.map{ $_<suit> }
17:21 Juerd And $_<suit> can be written as .<suit>
17:21 revdiablo ah, hyper ops
17:21 Limbic_Region say ~@combo>>.<suit>;
17:22 Juerd    for %ordval.values { $score += [*] $_, $_ - 1 }
17:22 Limbic_Region that's how I am doing it now
17:22 Juerd That's just obfuscation
17:22 Limbic_Region if that works
17:22 Juerd Use $_ * ($_ - 1) instead
17:22 Limbic_Region well, it wasn't originally
17:22 Limbic_Region there was more to it before
17:23 Juerd    $score += [eq] @hand[0..3]>>.<suit>
17:23 Juerd        ?? [eq] @hand[3,4]>>.<suit> ?? 5 :: 4
17:23 Limbic_Region but I agree - with only 2 elements it makes sense to be explicity
17:23 Juerd () around both [eq] list
17:23 Juerd You do want "say $foo ?? 3 :: 5" to be parsed as "say ($foo ?? 3 :: 5)", don't you?
17:23 Limbic_Region ok - so what you are saying is add parens to make it clearer
17:23 Juerd [op] is a listop just as say.
17:24 Juerd No, to make it work.
17:24 Limbic_Region I'm not sure I agree with you
17:24 Limbic_Region let me explain in english
17:24 Juerd See precedence table.
17:24 Limbic_Region you tell me if the code is right or wrong
17:24 mauke would $score += map { $_ * ($_ - 1) } %ordval.values; work?
17:24 Juerd mauke: No, comma is required after the closure, I think.
17:24 Limbic_Region score should be   4,  5, or  0 depending on a couple of tests
17:24 mauke ah, right :-)
17:24 Limbic_Region grrr - no plus symbol in this client
17:25 Limbic_Region score should be incremented by 4, 5, or 0 depending
17:25 Limbic_Region if the first test is false - then 0, if it is true then need second test, if second test is true then 5 if false 4
17:25 Juerd Limbic_Region: [op] foo ?? bar :: baz is parsed as [op] (foo ?? bar :: baz)
17:25 Juerd Limbic_Region: So here you need ([op] foo) ?? bar :: baz.
17:25 PerlJam Limbic_Region: Just use %2b everytime you want to type +
17:26 Juerd I'm really not interested in even thinking about what the code actually does
17:26 Limbic_Region %2b won't work
17:26 Limbic_Region unless you know what I mean
17:26 Juerd The way you lay out the code makes it clear, but perl isn't quite so whitespace sensitive that it will dwym just because of that.
17:26 Limbic_Region ok - let me update again and see if what I did makes sense
17:26 mauke is this with CGI:IRC?
17:27 Limbic_Region Juerd (and everyone) - new version is at http://perlmonks.org/index.pl?node_id=461131
17:27 Limbic_Region mauke - yes
17:27 _SamB_ has joined #perl6
17:28 mauke weird, it worked with elinks IIRC
17:29 SamB has quit IRC (Nick collision from services.)
17:29 Limbic_Region Juerd - do those parens now make it work correctly?
17:29 _SamB_ is now known as SamB
17:29 Arathorn stupid question: what do the rightangled brackets in a .<val> or .<suit> mean?
17:29 Juerd        ?? ([eq] @hand[3,4]>>.<suit>) ?? 5 :: 4
17:29 Juerd Still could use extra parens :)
17:30 PerlJam Arathorn: It's a form of quoting.
17:30 Juerd    # Count 15's
17:30 Juerd 15s
17:30 Juerd    my @vals = @hand.map:{ $_<val> };
17:30 Aankhen`` has quit IRC ("Reboot [Time wasted online: 9hrs 24mins 52secs]")
17:30 Juerd @hand>>.<val>
17:30 Juerd Be consistent...
17:30 Limbic_Region oh yeah
17:30 Limbic_Region sorry
17:30 wolverian I despise the ascii hyper ops.
17:30 Juerd if [+] @combo == 15
17:30 Juerd huh?
17:31 Limbic_Region if the sum of @combo == 15
17:31 Juerd if ([+] @combo) == 15 then
17:31 Limbic_Region k
17:31 Juerd list ops have very low precedence
17:31 Juerd print and say are listops.
17:31 Juerd [op] is a list op
17:32 Limbic_Region changed
17:33 Juerd                $score += [*] %ordval{$start .. $start + $span}, $span;
17:33 Juerd needless obfu again
17:33 Limbic_Region I don't see that as obfu
17:33 Juerd    return map -> $num {
17:33 Juerd        map -> $suit {
17:33 Juerd Everywhere you use the .map method
17:34 Juerd Obviously, here, that would be ugly
17:34 Juerd But you can maintain left-to-right reading...
17:34 Juerd with ==>
17:34 Limbic_Region ok - take a step back
17:34 Limbic_Region $score  = [*] %ordval{$start .. $start   $span}, $span;
17:34 Limbic_Region what wouldn't be obfu to you?
17:34 svnbot6 r3983, ninereasons++ | perl6.vim: small improvement to pod matching
17:34 wolverian ninereasons++ # yay, someone works on it!
17:34 Juerd [op] with only 2 *literal* elements is better written as el op el
17:35 Limbic_Region that's not 2 statements
17:35 Limbic_Region that's a hash slice
17:35 BigBear has quit IRC (No route to host)
17:35 Juerd Ohhh
17:35 Limbic_Region each one of the returned values is going to be multiplied together
17:35 Limbic_Region along with $span
17:35 Juerd You're right.
17:35 luqui okay, how do I get a list out of a VList without using monads
17:35 luqui (I think that's the problem)
17:35 Limbic_Region Juerd - finally, WRT map consistency
17:35 Juerd Change of sigil use threw me off
17:35 Juerd (I still don't like that change, really)
17:35 Limbic_Region those two maps are the only two maps left
17:36 Limbic_Region the rest were turned to hyper dereferencing
17:36 Juerd Oh, okay
17:36 Juerd I still like left-to-right reading better though
17:36 Limbic_Region ok - your preference
17:36 Juerd Because for works that way too
17:36 iblech luqui: That's not possible, IIRC
17:36 Limbic_Region as long as what I have isn't wrong
17:37 Juerd for list -> var { action }
17:37 Juerd list ==> map -> var { action }
17:37 iblech luqui: Ok, it is possible: case vlist of Val (VList hlist) -> ...do sth. with hlist
17:37 Juerd map -> var { action } list
17:37 iblech luqui: But hlist <- fromVal vlist is nicely polymorphic, I think
17:37 Juerd Limbic_Region: There are many levels of wrong in this universe
17:37 luqui yeah, but I think I'm in a context that doesn't allow monads
17:37 Limbic_Region yeah, I agree Juerd
17:38 Juerd Limbic_Region: And I do consider style one of them, when we're discussing non-production code :)
17:38 Limbic_Region people are more then welcome to change it to their personal preference once I check it in
17:38 Limbic_Region but for now (while it is on PM anyway) - I just want it to be able to run
17:38 Juerd You use qw
17:38 Juerd That's unperl6ish
17:38 Juerd Just use <H D C S>
17:39 Juerd Or better, a global @SUITS
17:39 Limbic_Region thought so but wasn't 100% positive
17:39 Juerd H D C S is far removed from $suit
17:39 svnbot6 r3984, Aankhen++ | * moved ext/LWP-Simple/* to ext/libwww-perl/.
17:39 Juerd That's my main argument against right to left with specified variables
17:40 Aankhen`` has joined #perl6
17:40 Juerd It isn't immediately obvious that they're suits
17:40 Limbic_Region I do appreciate your time - we will just have to agree to disagree with style/clearness
17:40 Limbic_Region -> $suit and suit => $suit isn't obvious?
17:40 Juerd (In code, I want everything that CAN BE obvious to BE obvious, so that comments are needed less - I do think that for this H D C S, a comment is needed.)
17:41 Limbic_Region the key to the hash says what it is
17:41 Juerd Limbic_Region: As said, the <H D C S> is too far removed from the -> $suit to be visually linked.
17:41 Juerd compare:
17:41 Juerd map -> suit {
17:41 Juerd    aoeuaoue
17:41 Juerd    aoeuaoeu
17:41 Juerd    aoeu {
17:41 Juerd        aoeuaoeu
17:41 Juerd    }
17:41 Limbic_Region hang on - real $work
17:41 Juerd } <H D C S>
17:41 Limbic_Region bbiab
17:41 Juerd versus:
17:42 Juerd <H D C S> ==> map -> suit {
17:42 Juerd    aoeuaoeu
17:42 Juerd    aoeuaoeu
17:42 Juerd    aoeu {
17:42 Juerd        aoeuaoeu
17:42 Juerd    }
17:42 Juerd }
17:42 Juerd where suit should have been $suit
17:42 luqui iblech, vCast did the trick
17:42 Juerd Declaration and definition shouldn't be spread apart when that isn't necessary
17:43 Juerd Limbic_Region: Now, to be honest, I'd have written this entire thing as a gather/take
17:43 Juerd Limbic_Region: return gather { for 1..13 -> $num { for <H D C S> -> $suit { take { ... } } }
17:43 RixiM has joined #perl6
17:44 RixiM is there a #parrot someplace?
17:44 svnbot6 r3985, ninereasons++ | hyper.t: todo failing hyper-dereferencing tests
17:45 iblech RixiM: Yep, on irc.perl.org
17:45 RixiM ah.
17:45 RixiM thanks.
17:45 RixiM has quit IRC (Client Quit)
17:49 Aankhen`` iblech >> In HTTP::Headers, what do you think of making @header_order, %header_order and %standard_case private members of the class?
17:51 luqui hmm, I wrote a new op2 entry in Prim.hs, but it says it can't find the operator
17:51 svnbot6 r3986, Aankhen++ | * ext/libwww-perl/lib/HTTP/Headers.pm: flatten arrays when creating @header_order.
17:52 iblech Aankhen``: Feel free to do everything you want with HTTP::Headers :)
17:52 iblech luqui: You have to add it to the big table at the end of Prim.hs
17:52 Aankhen`` That's all very well, but I'd rather not do stupid things. :-)
17:52 luqui right... I remember now
17:52 luqui tahnks
17:52 luqui s/ah/ha
17:53 ramzi has joined #perl6
17:54 SamB is there any particular reason for showType to be exported from Pugs.Types?
17:56 gaal iblech: actually i was doing that earlier today and it didn't work, strangely.
17:56 svnbot6 r3987, Aankhen++ | * made @header_order, %header_order and %standard_case private members of HTTP::Headers.
17:57 gaal i know that sounds insane :)
18:04 luqui I'm getting a lookahead conflict
18:04 svnbot6 r3988, iblech++ | Add the svn props for libwww-perl.
18:04 svnbot6 r3988, iblech++ | Why doesn't svn keep the properties when moving dirs?
18:04 Aankhen`` Ah, sorry, iblech.
18:04 luqui When I say 1 ^.. 5, it dies, because it sees the ^ as a junctive xor
18:04 luqui any idea how to fix?
18:07 integral SamB: remove the export, and see what the compiler complains about
18:07 integral SamB: if it doesn't complain, commit :-)
18:07 iblech Aankhen``: np
18:07 integral SamB: and of course if nothing inside or outside the module uses it, delete the code :-)
18:08 iblech luqui: Hm... you have to move "^.." further up in some list, I think. But I don't really know Parsec
18:08 SamB integral: well the Show instance for Type does. I was just thinking it might make sense to s/showType/show/ everywhere something referred to it.
18:08 integral SamB: hmm
18:09 SamB I don't think anything would be slower, though it is of course possible in theory that this would result in some typing ambiguity...
18:09 svnbot6 r3989, Aankhen++ | * re-applied changes clobbered by previous commit.
18:09 dada has quit IRC ("Schneeschlag")
18:10 SamB anyway, I guess one thing at a time is good, so I just wrote a whole export list and didn't take anything out.
18:11 integral SamB++
18:12 SamB now my question is why is it taking so long to hit my inbox from darcs send (via perl6-compiler@perl.org)
18:13 integral hmm?  you're not a SVN committer?
18:13 SamB nope
18:14 * SamB doesn't even have svk yet
18:18 * SamB wishes apt would not insist on upgrading perl before installing svk
18:18 integral hmm, what's the difference between: my $a ::= foo(); and my $a = BEGIN { foo() } ?
18:18 luqui The :
18:18 luqui Well, nevermind
18:18 luqui The latter is like:
18:19 luqui my $a;  BEGIN { $a := foo() }
18:19 luqui While the former is like:
18:19 luqui my $val;  BEGIN { $val = foo(); } my $a = $val;
18:20 integral hmm, is that the right way around?
18:20 SamB neato. I wish C had blocks as expressions...
18:20 luqui Yeah, I said latter first.
18:20 luqui er
18:20 luqui no
18:20 mauke SamB: gcc has them
18:20 integral jmm, err,
18:20 luqui yeah, it's the right way around if you take them respectively rather than antirespectively (switch former and latter)
18:21 integral *nod*
18:21 SamB masak: yes I know that!
18:21 integral the first though is the issue I tried to raise on the list though
18:21 integral About accessing variables that don't really exist at compile-time
18:21 SamB but I am reluctant to use such obscure GCC features, especially ones as syntactical as that one
18:21 luqui Hmm... yeah, that my is a bit disturbing
18:22 integral but, of course, that thread was warnocked.
18:22 luqui Well, it's a hard question, and one whose answer will come with the implementation (I think)
18:22 integral hmm, well autrijus chose the perl5 route, but it complicates the internals
18:22 integral so the whole point of asking was to find out if it needed to be complicated
18:23 luqui ahh
18:23 luqui I suppose we'd like:  my ::Foo ::= MyClass  to work
18:23 luqui because otherwise ::Foo doesn't have compile-time meaning
18:23 luqui ... I don't know
18:23 SamB how do you define functions in perl?
18:24 luqui what do you mean?
18:24 luqui SamB, are you a perl5er?
18:24 wolverian hmm, I just converted this 52-line C routine to 19 lines of a lot clearer perl6, with less idiotic requirements on the user. yay.
18:24 SamB like in Haskell I would do foo x = x+1
18:25 integral sub foo($x) { return $x + 1 }
18:25 integral &foo ::= -> $x { $x + 1 } # ...
18:25 feb has joined #perl6
18:25 luqui You can leave out the return if you like
18:25 luqui sub foo ($x) { $x + 1 }
18:25 SamB no
18:25 SamB this is why my example was in Haskell
18:26 knotty has joined #perl6
18:26 luqui ?
18:27 wolverian SamB: you'll have to be a bit more informative than that :)
18:27 * integral thinks these are just like the haskell
18:27 iblech SamB: Perl-return only returns from the current sub, it does not make a monad or so...
18:28 SamB I'm lagged. The "no. this is why my example was in Haskell." were in response to '<luqui> SamB, are you a perl5er?'
18:28 svnbot6 r3990, luqui++ | Implemented ..^ ^.. and ^..^, but the latter two don't work because of &infix:<^>.  Needs parsing fixes.
18:29 luqui ahh I see
18:29 integral what's ..^ and co ?
18:29 wolverian ouch, that's some serious lag.
18:29 * theorbtwo wonders what ..^, etc, are.
18:29 theorbtwo Heh.
18:29 wolverian integral: exclusive ranges
18:29 luqui exclusive range
18:29 Forth they look cute......
18:29 integral ah
18:29 luqui 0..^5  <=>  0..4
18:29 vcv 1..^ eq 1..Inf?
18:29 vcv oh nm
18:29 luqui uh, no
18:29 integral but .. are still ranges on enumerable types,  not intervals on continuous ones?
18:29 wolverian well, 1...^ would be 1..Inf-1 ...
18:30 luqui integral, yeah
18:30 * Juerd thinks ^.., ..^ and ^..^ are bloat.
18:30 luqui continuous intervals are tricky to implement
18:30 Juerd And unperlish.
18:30 luqui I think ^.. and ^..^ are bloat
18:30 integral well, they'd be sets not lists
18:30 luqui But I think ..^ is wonderful
18:30 SamB what is the difference between -CPugs and -CHaskell?
18:30 luqui And we should have ^.. and ^..^ by symmetry, maybe, then
18:30 SamB luqui: especially with finite-precision numbers!
18:30 Juerd luqui: Yes, if one, then all
18:31 Juerd luqui: Same goes for if ->, then <-> too :)
18:31 Juerd (<- has very little practical use, and is ambiguous with qw)
18:31 luqui hehe.  Yeah, I like that operator too
18:31 SamB continuous intervals are un-almost any language I've ever seen-ish
18:31 luqui Mathematica?
18:31 integral hmm, well they go with sets fine if you allow infinite sets
18:32 Juerd infinite sets
18:32 Juerd oh my.
18:32 luqui are there languages that allow infinite sets?
18:32 * luqui thinks that such languages would make you prove everything useful about them
18:32 integral perl hopefully,  just an object which does Set
18:32 theorbtwo luqui: Yes, perl6.
18:32 Juerd Great in theory, but trying to figure out if $element is in $set is hardly possible.
18:32 integral hmm?   Just define it using a predicate...
18:32 Juerd It can be done only if you know how the set was built.
18:33 theorbtwo $element ~~ $set
18:33 autrijus greetings lambdacamels.
18:33 luqui How about:  { Rational $x : $x**2 < 2 }
18:33 wolverian Juerd: is it possible to get a UTF-8 locale on feather?
18:33 integral but is-a-member-of is just a method on an object and can do anything
18:33 Juerd wolverian: Have you tried?
18:33 Juerd luqui: That would work.
18:33 wolverian Juerd: no. I don't know anything about the locales system, beyond dpkg-reconfigure locales.
18:33 * luqui needs to think of a more convoluted example
18:34 Juerd wolverian: locales wasn't installedh
18:34 SamB huh, this is odd
18:34 SamB where are we pasting things?
18:34 integral the only thing you lose over finite sets is simple ways to iterate over them
18:34 theorbtwo Ho, autrijus, alpha and omega of lambda!
18:34 integral perlbot paste
18:34 perlbot Paste your code and #perl will be able to view it: http://sial.org/pbot/perl http://dragon.cbi.tamucc.edu:8080 http://erxz.com/pb
18:34 integral err, http://sial.org/pbot/perl6, SamB
18:34 Odin- Next step ... making Perl6 into one of those computer algebra thingamajigs? :p
18:34 luqui Odin-, clearly
18:34 luqui :-)
18:34 theorbtwo It isn't already?
18:35 theorbtwo Seriously, ^?..^? seems like the better WTDI.
18:35 luqui Hi autrijus. How do I get ^.. to parse?  (Right now it thinks it's infix:<^> then ..)
18:35 theorbtwo Er, being noncore seems like the better wtdi.
18:35 autrijus α^..^Ω
18:35 Odin- theorbtwo: Nah. I don't think it does integration of mathematical functions ... yet.
18:35 Juerd wolverian: Generating locales. This can take a few hours.
18:36 Odin- (And other such fun thingies.)
18:36 gaal ./pugs -e 'my $h = Pugs::Internals::openFile("AUTHORS", "r"); say =$h'
18:36 gaal *** No compatible subroutine found: "&Pugs::Internals::openFile"
18:36 autrijus luqui: ah. that's because ^ is tighter
18:36 gaal why?
18:36 autrijus luqui: so the usual longest-string rule fails at that level
18:36 luqui how to fix it?
18:36 autrijus luqui: if you have tuit you can redo the lexical scanner to consider all strings
18:36 wolverian Juerd: thankyou.
18:36 Juerd longest-string should come before precedence
18:36 autrijus luqui: but a cheap fix is in Lexer.hs line 122
18:36 luqui agreed
18:37 * luqui goes for the cheap fix
18:37 theorbtwo Odin-: If we have full reflection, defining inegration and derivitive-finding (how do you verb that, anyway) shouldn't be too hard.
18:37 autrijus luqui: add ^. to aheadSym and you're done
18:37 * luqui has forgotten enough Haskell not to want to do a lexical scanner quite yet
18:37 integral derivation
18:37 autrijus luqui: that's fine... usually the prec is sane enough
18:37 autrijus but there are a handful of exceptions, ^.. being one
18:38 autrijus luqui: hey. I'd like some way to force GC run.
18:38 theorbtwo Isn't that the what you get when you derive, not when you take the derivitive?
18:38 vcv 1>..<5
18:38 autrijus what would you suggest it in syntax level?
18:38 theorbtwo Make it a method on a singleton pugs object?
18:38 autrijus Internals::perform_gc(); # ?
18:38 pasteling "SamB" at 64.0.112.225 pasted "wierdness" (20 lines, 306B) at http://sial.org/pbot/10492
18:38 * theorbtwo smacks himself.
18:38 wolverian Internals::GC::collect?
18:38 autrijus gaal: let me check..
18:38 theorbtwo Bad orb.  Multipragmatic.
18:39 Arathorn has quit IRC ()
18:39 luqui autrijus, in parrot?
18:39 autrijus luqui: no, in p6 level
18:39 autrijus luqui: one way or another we need a language level thing to force GC run
18:39 autrijus because there's no timely destruction anymore
18:39 luqui how come?
18:39 luqui oh
18:39 luqui We might just make it sweep
18:39 autrijus and sometimes you want to run finalisers
18:39 autrijus sweep() ?
18:39 wolverian there's timely destruction when you tag an object with a flag that says it needs that
18:39 autrijus that sounds like bad huffmanise
18:40 integral and namespace polluting...
18:40 autrijus right
18:40 luqui I would put it in Parrot::sweep, but maybe that's tying it down to the implementation too much
18:40 autrijus wolverian: but you cannot tag them recursively
18:40 wolverian autrijus: hmm. okay.
18:40 theorbtwo Internals::do_gc sounds good to me.
18:41 theorbtwo ("Perform" when "do" will do seems like overkill.)
18:41 SamB autrijus: any idea why patches I darcs send to perl6-compiler might be taking a long time to get back to my inbox?
18:42 autrijus SamB: no idea
18:44 autrijus SamB: also, parrot codegen currently doesn't handle the various Syn constructs properly
18:45 SamB oh, that would explain that.
18:45 autrijus SamB: that will be fixed next week when I'm in Vienna
18:45 autrijus where I can work with two parrot hackers
18:46 Shillo has joined #perl6
18:46 Shillo Hullo, all!
18:46 autrijus greetings Shillo-san
18:46 Juerd Hello
18:46 SamB any chance of a human readable but not incorrect output format?
18:47 Shillo autrijus: Konbanwa!
18:47 autrijus SamB: not sure what you're after
18:48 feb has left "Client exiting"
18:48 knotty_ has joined #perl6
18:48 SamB well, when I do:
18:48 SamB ./pugs -CPugs -e 'sub foo() { 1 }' -e 'my $a ::= foo();'
18:49 autrijus SamB: if you want a AST, dump, use interactive pugs
18:49 knotty has quit IRC (Nick collision from services.)
18:49 SamB I get a line that is, well, huge.
18:49 autrijus it has the :d and :D mode
18:49 knotty_ is now known as knotty
18:49 SamB its over 7000 characters wide
18:49 autrijus SamB: if you'd like tp prettyprint the -CPugs output, feel free to hack Pugs.Compile.Pugs
18:50 autrijus it's just Text.PrettyPrint
18:50 svnbot6 r3991, luqui++ | Fix ^.. and ^..^ .
18:50 autrijus luqui++
18:50 Juerd wolverian: locale generation done
18:50 autrijus SamB: can I make you a committer, and are you willing to use svn to commit?
18:52 SamB autrijus: you can
18:52 autrijus gaal: space after comma
18:52 autrijus SamB: ok. email?
18:53 SamB but I don't have svk installed yet
18:53 gaal huh? where?
18:53 autrijus gaal: Str,Str won't split
18:53 autrijus it's all isAlpha
18:53 integral you just need svn, SamB
18:53 autrijus I mean not isSpace
18:53 SamB dialup is slooooow
18:53 autrijus gaal: in the Prim prototype
18:53 gaal ahhh, i see it now. thanks!
18:54 autrijus np :)
18:54 qmole has joined #perl6
18:54 gaal hmm, shall i hack it so that ',' is enough?
18:55 autrijus gaal: I don't think it's worth it ... that table wants to be shifted to parse prototypes in Prelude.pm
18:55 autrijus gaal: but if you really want to do so, feel free
18:55 SamB naesten at gmail dot com
18:55 gaal anyway, the next problem is that when i modified code (eg. builtins/io/io.t to use this openfile, it was *way slow* on an unoptimized pugs.
18:56 ninereasons iblech, and autrijus: t/builtins/map_constant_list.t is an eval test that fails.  It does not fail if uneval'ed
18:56 gaal rather: to use the Prelude openfile which calls openFile
18:56 luqui eval_is looks broken
18:56 autrijus luqui: hey. how can I unbreak eval_is from a lang pov?
18:57 autrijus luqui: that is, how can I enter the lexical context of my caller?
18:57 autrijus %OUTER:: := %CALLER::;
18:57 autrijus probably doesn't wor
18:57 autrijus k
18:57 autrijus but what does?
18:57 luqui Your &is.goto looked good
18:57 iblech ninereasons: I think this particular bug has the same reason as the bug causing many unexpected suceedings lately
18:57 luqui but it's not an ordinary method
18:57 autrijus luqui: it doesn't fix the eval problem
18:57 ninereasons ok, iblech.
18:57 luqui what's the eval problem?
18:58 luqui oh
18:58 autrijus luqui: say you have my_eval''
18:58 luqui I get it
18:58 autrijus good.
18:58 ninereasons iblech, where does that corner-case test belong?  It doesn't seem to merit its own file (imho)
18:58 luqui Ruby has a WTDI, doesn't it?
18:58 autrijus luqui: I don't know about about ruby to answer this
18:58 luqui I think an option to eval might be in order
18:59 luqui Give it a ref to a lexical pad or some such
18:59 meppl has joined #perl6
18:59 autrijus mmmm.
18:59 integral like scheme's eval?
18:59 luqui sure (/me knows not scheme)
18:59 iblech ninereasons: map.t probably... (It was originally a pugsbugs test, which just got moved because it passed)
18:59 ninereasons iblech, yes, now that it succeeds.  Ok, I'll move it then.
19:00 luqui A related question: does %CALLER:: give the immediate lexical variables, or the entire pad stack, of the caller
19:00 svnbot6 r3992, ninereasons++ | builtins/map_constant_list.t: hmm.  failing test succeeds if unevaled
19:00 luqui because if it's the latter, you might do:  eval 'foo', :pad(%CALLER::)
19:01 autrijus luqui: I think only immediate.
19:01 autrijus you need %CALLER::OUTER::
19:01 integral does %CALLER:: also hold details about what pragmas are in effect?
19:01 autrijus to get to outer of caller
19:01 luqui right
19:01 luqui well, maybe
19:01 autrijus but you can argue that %CALLER:: contains a %OUTER:: entry.
19:01 autrijus much like how perl5 globs are handled
19:01 autrijus in any case it sounds like either a p6l or a cabal question :)
19:01 luqui Yeah.  And you'd expect:  my $x = 4;  { foo() }
19:02 luqui to give foo() 4 for %CALLER<$x>
19:02 autrijus will I? hm.
19:02 luqui As far as access, making it "deep" seems right.  As far as keys, though..
19:02 luqui Well what if they're saying $CALLER::_ and the immediate block isn't a topicalizer?
19:03 autrijus I don't know. :) currently in pugs
19:03 autrijus all pads are cumulative
19:03 autrijus so your %MY:: pad inherits all nonshadowed %OUTER:: syms
19:03 luqui I think that's correct
19:03 autrijus I'm doing it only because it seems sane
19:03 autrijus but it's unspecced as such
19:04 luqui Well, this reflection-like stuff doesn't need as much speccing as the rest of the language
19:04 Juerd Miscellaneous advice of the day: do NOT spray silicone spray in the direction of a fan.
19:04 luqui we're in the "possible" realm, out of the "easy" realm
19:04 autrijus sure, that's why I felt comfortable of implementing it without asking :)
19:04 Juerd Question of the day: how the heck can one remove silicone spray from a mirror?
19:04 * autrijus ponders &call_with_current_continuation();
19:05 Juerd autrijus: $?CONTINUATION
19:05 autrijus Juerd: not exactly the same thing
19:05 Juerd Oh
19:05 autrijus and we have &?CALLER_CONTINUATION as escape-only thing too
19:05 luqui apparently $?CONTINUATION is a bit scary to work with
19:05 Juerd Can't it be made the same thing?
19:05 autrijus that should maybe called &?RETURN_CONTINUATION
19:05 autrijus Juerd: callcc is more generatl than $?CC.
19:05 integral are shift/reset exposed too?
19:06 autrijus integral: they are exposed as "sub {}" and "return" :)
19:06 integral ah.
19:06 autrijus er, no, "return" is hardly shift.
19:06 autrijus it's shift with a const ret.
19:06 autrijus but I don't know how to expose a full shift.
19:06 autrijus that sounds very dangerous :)
19:06 luqui I think your lexical stacking is good, and we should go with %MY{'%OUTER::'}
19:07 autrijus tho if we have that we can do eval is caller pad
19:07 autrijus sub my_eval ($str) { &Internals::shiftT({ eval $str }) }
19:07 autrijus will easily DWIM.
19:07 autrijus except we probably don't get to call it shiftT.
19:08 luqui what are you talking about?
19:08 luqui (shiftT?)
19:08 autrijus luqui: so you're familiar with delimited continuations
19:08 luqui delimited?
19:08 autrijus in the form of a function call (enter dynamic scope)
19:08 luqui oh.. I think so
19:08 autrijus and a return() call (escape dynamic scope)
19:08 luqui okay
19:09 autrijus now return() is defined as
19:09 autrijus \x -> shiftT $ const $ return x
19:09 autrijus that is, "evaluate in outer dynamic scope"
19:09 autrijus "take the continuation as argument"
19:10 autrijus "ignore the continuation and just yield x"
19:10 luqui hmmm
19:10 autrijus so shiftT is like invoking a continuation
19:10 autrijus but it's delimited
19:10 svnbot6 r3993, ninereasons++ | move a map test from bug file to main file
19:10 autrijus so you can't escape all the way to program exit
19:10 luqui weird
19:10 autrijus you can just act in the caller's scope
19:10 luqui that's pretty cool
19:10 autrijus pretending you have already returned
19:10 autrijus and do things.
19:11 autrijus sure. shift/reset can be used to model all control flow structurs
19:11 autrijus as Ken Shan showed a while ago
19:11 autrijus so if you expose shiftT, then it can do strange things on the caller's continuation
19:12 autrijus such as suspending it and reactivate it as a callback -- instant coroutines
19:12 autrijus as well as other more interesting things.
19:12 luqui maybe this should be in Perl::Control::shift   or Perl::Continuation::shift
19:12 autrijus *nod*
19:12 autrijus Control::call_cc
19:12 autrijus Control::shift
19:12 autrijus or is the Perl:: namespace the new Internals:: ?
19:12 luqui dunno
19:13 autrijus sure. we can improvise
19:13 autrijus iblech: so do you have an idea why :todo is suddenly being set?
19:13 integral hmm, well Perl is being used on CPAN at the moment
19:13 autrijus iblech: I think it might be the single-invocant fix I did a while back
19:13 luqui I think we get veto power over that module :-)
19:13 autrijus I'll try to track it down if you don't have already
19:13 IshaCocoa has joined #perl6
19:14 autrijus mm I also have Inline::Perl
19:14 theorbtwo I'd prefer it not be named "shift", since then importing it overwrites the shift builtin.
19:14 jhorwitz has quit IRC ("Chatzilla 0.9.67 [Firefox 1.0.4/20050511]")
19:14 luqui (there is a Perl:: namespace, for perl grammars and whatnot)
19:14 autrijus call_shift_cc etc
19:14 iblech autrijus: I think so, too. I did a little bit of investigating only -- is 1, 1, "..." works fine, the only things which are broken, I think, are dies_ok and friends. Not sure, though
19:17 cognominal_ has joined #perl6
19:18 iblech autrijus: It seems that the test descriptions are used as todo reasons
19:18 iblech autrijus: But I didn't investigate more
19:20 Limbic_Region has quit IRC ("weekend")
19:21 autrijus oh, there's a perl task
19:21 autrijus perl5 rather
19:21 autrijus the current Makefile.PL should be factored to enable EMBED_PERL5 for parrot and perl5 by default
19:21 autrijus if it can probe for it correctly
19:21 integral oh, btw my pugs isn't compiling with embedded perl5
19:21 autrijus if anyone wants to take a stab, I'd be grateful, otherwise I'll try to do it around release time
19:22 autrijus integral: what's the errmsg?
19:22 integral my perl link flags have a "-optl" in them that ghc doesn't grok
19:22 integral or, that's what I'm guessing, because it seems to be ignoring the -o and saying that "pugs" is a module to chase from
19:22 gaal autrijus, how to do that w/o a PARROT_PATH ?
19:24 autrijus gaal: look for parrot in PATH and query it... or just fail the probe and warn as we do now
19:24 * luqui pianos &
19:24 autrijus integral: try quote the optl
19:24 autrijus in line 134 Makefile.PL
19:24 integral quote it with what?
19:24 autrijus try escaping it somehow and put the entire thing in double quote
19:24 autrijus or something. improvise
19:25 integral GHC has something like -Wl ?
19:25 Juerd So far, feather holds just fine with people aggressively running only bash :)
19:25 autrijus i.e. if your ccdlfags is "foo bar"
19:25 autrijus it currently is
19:25 integral oh, right
19:25 autrijus -optl foo bar
19:25 autrijus but it should be
19:25 autrijus -optl "foo bar"
19:25 autrijus but foo may contain double quote etc
19:25 autrijus so need a bit munging. commits welcome
19:25 integral I know what is is, there's nothing after my -optl
19:25 autrijus then the quoting will also fix that.
19:26 * Juerd wonders if during the weekend, feather will be used more
19:27 integral ty, autrijus that fixed it
19:28 autrijus woot. commit? :)
19:28 autrijus (that will also likely fix it for some other people)
19:28 integral r3994
19:29 autrijus integral++
19:32 cognominal_ juerd, I need to build a submission system for the JAPH constest, do you mind if use feather?
19:32 cognominal_ I will probably write it first as perl5 thing though
19:33 cognominal_ and may be I will use my fresh knowledge of mozile to create a sexy firefox-based interface.
19:33 svnbot6 r3994, bsmith++ | Quoting the argument to -optl.
19:34 iblech has quit IRC ("off &")
19:35 autrijus the apw/fpw ja*h contest?
19:35 autrijus that sounds like definitely p6 related :)
19:35 cognominal_ yes
19:36 cognominal_ I am currently writing an article about ajax and mozile. So I could revamp the code to use it as gui.
19:36 autrijus I like mozile. I think it's neat.
19:37 cognominal_ but I see that one can access DBI from Perl6 know
19:37 SamB how hard would it be to make it possible to build pugs without actually statically linking more than a few modules?
19:37 integral SamB: pugs can run under ghci
19:37 cognominal_ do we have a database system on feather?
19:38 autrijus SamB: "make ghci"
19:38 svnbot6 r3995, ninereasons++ | pairs.t: add a pod section to an interesting test, and move some comments around to make them stand out.
19:38 SamB I also want to avoid invoking ld on everything, because it eats so much ram...
19:39 autrijus SamB: adding more ram will likely to help also
19:39 SamB but I do want to be able to run something like ./pugs_dynamic or ./pugs_ghci
19:39 cognominal_ I have a page about perl6 in linuxmag that has been published in linuxmag French, I submitted it four weeks ago. It seems so much out of date now.
19:39 SamB I don't want to buy another 128 MiB...
19:39 autrijus SamB: "make ghci" then type "main"
19:40 Juerd cognominal_: No, it has to somehow be good for perl 6
19:40 autrijus cognominal_: ooh. may I look at it? :)
19:40 SamB autrijus: what about command-line-args
19:40 cognominal_ I said no rules and no object yet :)
19:40 autrijus SamB: withArgs
19:40 Juerd cognominal_: And you're probably best off using sqlite
19:40 autrijus heh. so out of date. we have rules and objects and cpan
19:40 Juerd cognominal_: So the system is very portable
19:40 cognominal_ autrijus: I need to hook to find where is my scanner to hook it to my computer
19:41 autrijus cognominal_: you mean you did not write it in a text editor? :)
19:41 SamB what is withArgs?
19:41 autrijus withArgs :: [String] -> IO a -> IO a
19:41 cognominal_ autrijus: I thought you wanted the real published thing
19:42 SamB where is withArgs?
19:42 autrijus SamB: it's available in the ghci prompt
19:42 autrijus SamB: so you can do something like
19:42 autrijus ghci> withArgs ["foo.p6"] main
19:42 autrijus to get what you would get for "./pugs foo.p6"
19:42 autrijus "make ghci" will launch you to that prompt.
19:42 SamB oh, sorry, I had Main loaded without *
19:42 autrijus need the *
19:47 integral bother that patch doesn't fix it.  I get an exciting "gcc:  : No such file or directory" at the link phase
19:48 integral guess I need to use an if statement
19:48 autrijus nod
19:49 cognominal_ autrijus: http://stefp.dyndns.org/news6-0605.pod
19:49 autrijus merci
19:50 Corion has joined #perl6
19:50 cognominal_ he, you use freebsd?
19:51 cognominal_ "Mozilla/5.0 (X11; U; FreeBSD i386; zh-TW; rv:1.7.6 :)
19:51 integral hmm, I guess it shouldn't be trying to link both src/perl5/perl5.o and src/Pugs/Run/Perl5_stub.o
19:51 SamB autrijus: are you going to apply that Pugs.Types export list patch?
19:52 autrijus SamB: hm, on p6c? had not seen it
19:52 autrijus cognominal_: yes
19:52 autrijus SamB: you are a committer now anyway... you can use svn/svk to commit that yourself :)
19:53 autrijus in generaly yo udon't need reviews before committing, as long as it doesn't break the build in a horrible way
19:53 autrijus (but your patch may be reverted too -- in that case discussion on #perl6 is useful)
19:53 cognominal_ I can't believe it, googlebot has already scanned my page!
19:53 cognominal_ do they spy our channel?
19:54 autrijus the channel is logged on web
19:54 SamB would I have to check out the repository again to use it with svk if I check it out now with svn?
19:54 integral well the logs are online
19:54 autrijus SamB: yes. but feel free to just check in with svn
19:54 * integral mutters about his build
19:55 integral it now can't find _pugs_Apply, _pugs_MkSvRef and _pugs_PvToVal
19:55 Shillo has quit IRC ("Leaving")
19:56 autrijus integral: with or without embperl?
19:56 integral with
19:56 integral it may just be my build dir being broken...
19:57 integral yep, it was. committing fix
19:58 kolibrie is it currently possible to get humanly-readable time()
19:58 svnbot6 r3996, bsmith++ | Fixed -optl again. (if statement to only add if needed)
19:58 autrijus kolibrie: you mean like scalar localtime?
19:58 autrijus not sure
19:58 kolibrie or any type of localtime
19:59 kolibrie array is fine
19:59 autrijus no. you can hack in localtime with calendarTimeToString
19:59 autrijus Prim.hs would be the place to do so
19:59 autrijus or, at least write a test
19:59 luqui localtime will probably be done a bit different this time
20:00 kolibrie are there specs on localtime, so I can write a correct test?
20:00 chromatic has joined #perl6
20:00 SamB autrijus: if only it were "just". it is not "just" on dialup...
20:00 luqui look at s29
20:00 luqui haven't looked there in some time
20:00 * chromatic suspects that Pugs doesn't currently call new() on objects.
20:00 kolibrie luqui: looking
20:00 luqui chromatic, is it supposed to?
20:01 chromatic When I write a constructor, I intend for *something* to use it!
20:01 luqui you mean BUILD
20:01 wolverian BUILD is the constructor.
20:01 * wolverian feels like a bot
20:01 luqui haha
20:01 chromatic I want a singleton.
20:02 luqui wolverian, seen nothingmuch?  :-p
20:02 jabbot luqui: nothingmuch was seen 4 hours 13 minutes 43 seconds ago
20:02 chromatic I don't want to allocate an object I'm never going to use.
20:02 Corion Shouldn't localtime() return a DateTime object?
20:02 luqui something like that
20:02 Corion (not that I like everything about DateTime)
20:03 integral ah, bug, use Data::Dumper--perl5; Data::Dumper.Dump("hello") throws a perl5 exception which exits the pugs REPL
20:03 autrijus chromatic: you mean you define new for your own class?
20:03 autrijus chromatic: which test in t/oo/ is that?
20:04 chromatic ext/Test-Builder/010*.t
20:05 chromatic ext/Test-Builder/020*.t
20:05 autrijus danke
20:05 kolibrie localtime() is listed under Time::Local in S29draft.pod, but no particulars
20:05 autrijus I'm fixing the misTODO bug first
20:05 autrijus turns out .goto is broken
20:05 chromatic Test::Builder creates and returns a singleton, while Test::Builder::Test is a facade factory.
20:06 bd_ has quit IRC (" ")
20:06 * luqui dunnos the facade pattern
20:06 kolibrie so does anyone know of a thread about localtime() ?
20:07 chromatic Just consider it a factory then.
20:07 chromatic When you call Test::Builder::Test.new() it returns a different kind of object based on the arguments.
20:08 luqui ahh
20:10 Juerd Hi, chromatic
20:12 Juerd autrijus: Does pugs have something like Data::Swap?
20:12 chromatic Hi, Juerd.
20:12 Juerd autrijus: That is: something that entirely swaps containers' contents
20:13 Juerd Keeping containers themselves, and references/names to them, untouched
20:13 autrijus Juerd: why do you want that?
20:13 autrijus and why can't you use use ($a, $b) := ($b, $a) ?
20:14 Juerd autrijus: To change the invocant.
20:14 Juerd autrijus: So that afterwards, it's an entirely different object
20:14 Corion Oooo - I get parsefails in the tests :)
20:14 Juerd So the REAL object can be stored in a cache for re-use
20:14 autrijus yeah. again, why not := ?
20:14 Juerd autrijus: because that does things with names only
20:14 autrijus Corion: all over the place?
20:15 Juerd It simply swaps the names, not the contents of the containers
20:15 Corion autrijus: No, just a few tests: t/operators/short_circuit.t, t/operators/assign.t
20:15 autrijus Juerd: how is it operationally different.
20:15 autrijus Corion: ok. may be related to luqui's change of ^..
20:15 autrijus or not. not sure
20:16 svnbot6 r3997, autrijus++ | * move GC run into end of runEvalIO.
20:16 svnbot6 r3997, autrijus++ | * fix .assuming and .goto.
20:16 Corion I think Data::Swap was written to (re)implement $a := $b :)
20:16 autrijus the TODO bug should be fixed
20:16 integral no, Data::Swap is different from $a := $b
20:16 Juerd autrijus: $foo.bar(), and I want bar() to change what $foo represents entirely. Another object, with another class, but still that $foo, and everything else pointing to that container.
20:17 Juerd Corion: := swap swaps names
20:17 Juerd Corion: = swap swaps primitive values
20:17 Juerd Corion: What I want is containers to be swapped without damaging the containers
20:17 Juerd This includes the value, but also any properties
20:17 SamB so basically you want become:
20:18 autrijus Juerd: I think pugs's := does that. and I can't still see a difference.
20:18 integral it's like updating in the STG-machine (and I use it to implement that in perl5)
20:18 Juerd If you talk about harbor containers, it would be swapping the contents entirely, and painting them both in the other's colour.
20:18 autrijus or rather, i thought that was what := is about.
20:18 Juerd autrijus: If it does that, it does the wrong thing. := only aliases/binds. I actually want something destructive.
20:18 autrijus := in pugs does _not_ switch names.
20:18 Juerd Oh
20:19 luqui if you switch names and containers, don't you end up doing nothing?
20:19 autrijus it repoints references into containers
20:19 Juerd autrijus: So ($self, $new_object) := ($new_object, $self) does what I want?
20:19 autrijus Juerd: I really think so, yes.
20:19 Juerd autrijus: That's not Perl 6 then...
20:19 autrijus Juerd: if you uncomment line 481
20:19 chromatic If you had a reference to $self, it'd be a reference to $new_object after that?
20:20 autrijus then it becomes name binding.
20:20 Juerd chromatic: Yes.
20:20 autrijus Juerd: but larry ruled explicitly against that
20:20 Juerd autrijus: It is meant for name binding
20:20 Juerd autrijus: Huh?
20:20 Juerd o...kay.
20:20 Juerd That's weird.
20:20 autrijus $x := @y[1];
20:20 SamB man, Pugs.AST.Internels even takes a long time to compile in GHCi
20:20 Juerd That'd have to *copy* then.
20:21 Juerd Either it makes $x point to @y[1]'s container
20:21 Juerd Or it copies its value...
20:21 integral ./pugs -e 'my $a = [123]; my $b = [456]; my $c = $a; say "$a[0] $b[0] $c[0]"; ($b, $a) := ($a, $b); say "$a[0] $b[0] $c[0]";' # $c doesn't change
20:21 Juerd But you say it copies the value with all the container's properties?
20:21 autrijus pugs> my (@y, $x); $x := @y[1]; $x = 3; @y.perl
20:21 autrijus '[undef, 3]'
20:22 Corion Hmm - either we get lots of unexpected successes, or :todo is broken: http://datenzoo.de/pugs/win2k.html
20:22 chromatic autrijus, isn't that binding an alternate name to an existing container?
20:22 integral perl -le 'use Data::Alias qw/swap/; my $a = [123]; my $b = [456]; my $c = $a; print "$$a[0] $$b[0] $$c[0]"; swap($a, $b); print "$$a[0] $$b[0] $$c[0]";' # $c changes
20:22 Juerd autrijus: Yes, that's binding, isn't it?
20:22 Juerd binding a name to a container.
20:22 integral Hence := currently doesn't do the same as Data::Alias::swap.
20:22 autrijus integral: how would Data::Swap do it?
20:22 autrijus I'd like to see code where I can tell the difference
20:22 integral there you go.
20:23 chromatic My TODO problems went away with 3997.
20:23 Juerd autrijus: Data::Swap uses a perl 5 specific trick, copying the raw scalar into the other's memory space.
20:23 Juerd autrijus: Such code I can't currently think of, except how DBIx::Simple uses it
20:23 chromatic I'd also like to see code where that's the best way to do something.
20:23 chromatic It feels somewhat face-stabby to me.
20:23 Juerd chromatic: DBIx::Simple
20:24 luqui I think pugs's current semantics are correct
20:24 Juerd It replaces the existing object with a DeadObject, so that next uses give you very useful debugging info
20:24 autrijus luqui: me too :)
20:24 integral I use it for lazy evaluation
20:24 autrijus Juerd: I see what you mean.
20:24 autrijus you want destructive type-violating pointer assignment.
20:24 Juerd Without needing checks for that in every single method, which would make the entire module much less efficient
20:24 Juerd autrijus: If I knew what that meant, I'd probably acknowledge :)
20:25 autrijus Juerd: i.e. you can use it to violate type constraints at runtime
20:25 chromatic It doesn't necessarily have to be type-violating.  You could use a null object with a similar interface.
20:25 pasteling "integral" at 131.111.8.102 pasted "swap sample" (12 lines, 316B) at http://sial.org/pbot/10502
20:25 Juerd I have little notion of types, autrijus
20:25 integral in that one I have an interface where objects has a "to_ops" method
20:26 Juerd Damn, I have to go
20:26 Juerd I'll try and explain it better later
20:26 Juerd afk
20:26 autrijus Juerd: ok...
20:26 autrijus "This module allows you to swap the contents of two referenced variables, even if they have different types."
20:26 autrijus that's what I get from Data::Swap
20:26 autrijus swap() has a type of
20:26 autrijus a -> b -> Eval ()
20:26 integral the type bit isn't really critical, it's just nice.  Since you can implement objects with either arrays or hashes
20:26 autrijus but a will become b
20:26 autrijus and b will become a
20:26 autrijus and that's patently weird :)
20:27 integral it's perl ;-)
20:27 autrijus I don't think perl let you do that.
20:27 autrijus perl is a strongly typed language.
20:27 integral well it does :-)
20:27 integral But it's *very* not good to use it on named arrays/hashes.
20:27 autrijus heh. Data::Swap::PP
20:27 autrijus how do you write that?
20:27 integral It's safe enough on anonymous ones
20:27 Limbic_Region has joined #perl6
20:27 autrijus Data::Swap::PurePerl that is
20:27 autrijus if you can't, perl doesn't let you that.
20:27 integral hmm, tieing and indirecting?
20:28 autrijus then it's swapping Dynamic variables
20:28 autrijus which is fine
20:28 autrijus Dynamic -> Dynamic -> Eval ()
20:28 nnunley has joined #perl6
20:28 chromatic Perl doesn't let you do that unless you always do named lookup.
20:28 autrijus right.
20:28 chromatic Or if you have another similar type of indirection.
20:29 luqui though you can rebless
20:29 autrijus anyway, in parrot level you can get by using pointer assignment on PMCs
20:29 autrijus luqui: you can't rebless across types
20:29 chromatic Yeah, I'd rebless into a null object.
20:29 autrijus (here types means array/hash/code)
20:29 integral "null object"?
20:29 * integral doesn't see what null has to do with swapping...
20:29 autrijus and in haskell level you can use unsafeCoerce
20:29 luqui i mean in perl 5, and no, you can't change a hash-based object to an array-based one
20:29 chromatic The ultimate in passive-aggressive.
20:29 autrijus but neither is supported in pugs -- I'm not even sure how to support that in perl 6 syntax level.
20:30 autrijus so a definite "not core" thing I'd argue.
20:30 luqui but also keep in mind that perl 6 lets you use references as if they weren't references
20:30 chromatic integral, it's what I might do if I were to do what Juerd needs to do in DBIx::Simple, based on me skimming the code.
20:30 autrijus luqui: that's syntax sugar.
20:30 autrijus luqui: esp now larry ruled deref is only one level and not infinite
20:30 cdpruden has quit IRC ("Leaving")
20:30 integral chromatic: oh, ok.
20:30 luqui he did?
20:30 luqui where?
20:30 integral swap's a bit more general though (see my code paste)
20:30 autrijus luqui: yes and it caused me great grief
20:31 autrijus luqui: http://www.mail-archive.com/perl6-language@perl.org/msg19462.html
20:31 autrijus luqui: *sigh*
20:31 autrijus it's not yet in pugs
20:31 autrijus because it will mean yet another total rewrite of Eval/Monad logic.
20:31 chromatic Don't fret.  There's more grief to come.
20:32 autrijus (the part that deals with casting, anyway)
20:32 autrijus chromatic: oh?
20:32 luqui hmm
20:32 luqui I hated that at first, but then grew to see its merit
20:32 luqui and now it's gone again
20:32 chromatic Unless you already believe that signature types check roles first, then inheritance.
20:32 luqui Hmm...............
20:32 autrijus chromatic: I believe that it checks .does.
20:32 autrijus and .does checks roles first, no?
20:32 luqui I wonder if we could just have two reference types
20:33 chromatic It ought to.  Inherits is a more specific case of does.
20:33 autrijus chromatic: so no grief for this
20:33 luqui one that infinitely derefs and one that single derefs
20:33 autrijus luqui: ...principle of most surprise, eh?
20:33 chromatic Darn.  How about grief from people who want to override new()?
20:33 luqui except that the one that infinitely derefs would only single deref, but transparently
20:33 autrijus chromatic: I'll fix. bbiab
20:33 chromatic How about lazy derefs?
20:33 luqui well not really
20:33 Qiang has quit IRC (Read error: 110 (Connection timed out))
20:34 luqui there are two kinds of references:  concrete and abstract
20:34 luqui abstract references just provide a transparent level of indirection when you really need it
20:34 luqui concrete ones work like perl5ers expect "references" to
20:34 chromatic autrijus, is it something like checking if there's a &new in op1 "new" and calling that and potentially walking up SUPER if the method calls that and using the old behavior if not?
20:34 luqui like pointers
20:35 chromatic luqui, which one do you get when you take a reference?
20:35 luqui dunno
20:35 chromatic I like the idea except for that part.
20:36 luqui yeah.  well we could deem one inferior, and give it a longer name
20:36 luqui like makeref or somesuch
20:36 chromatic Maybe that's an argument for a bit of syntax that indicates how far you want to dereference a reference.
20:36 chromatic 1, many
20:36 luqui but I think the decision is really up to the person making the reference, not dereferencing it
20:37 luqui especially in the transparent case, you would use those for what juerd is wanting
20:37 chromatic I still think what Juerd wants is pretty face-stabby.
20:37 luqui give somebody a reference to an object when they're expecting a real object, so that you can change it underneath them
20:37 luqui I would think so too, but I've done it, and it has been good to me
20:38 chromatic Yeah, now I think of proxies and pools.
20:38 luqui (in the ODE module, when you destroy something explicitly, it replaces it with a ODE::Dead object)
20:38 chromatic Where's Parrot ODE?
20:38 luqui Perl5 ODE
20:38 chromatic Yes.  Where's Parrot ODE?
20:38 luqui huh?
20:39 luqui oh
20:39 chromatic I want a port, darnit.
20:39 integral (lazy proxy objects)++
20:39 luqui man, ODE's interface is probably easy enough to do with nci alone
20:39 luqui but I object-orientated it
20:39 chromatic Opaque pointers?
20:40 luqui well, we can pretend they're not opaque
20:40 luqui if ODE changes the interface, we'll just have to change with them
20:40 chromatic I like opaque pointers.  Don't make me define structs.
20:41 luqui er
20:41 luqui I'm not sure what you're talking about anymore
20:41 chromatic Instead of making the user allocate data structures, you call a function in the library which returns the data structure for you and you use functions to get and set its members.
20:42 luqui oh, right
20:42 chromatic Sure, it's a struct underneath, but you don't have to fiddle with it.
20:42 svnbot6 r3998, Aankhen++ | * small formatting changes to HTTP::Headers.
20:42 luqui I think ODE actually makes it a C++ class underneath
20:43 luqui but it's a C library interface, so you can't rightfully touch it
20:43 chromatic That's the best thing to do with C++ libraries.
20:44 chromatic Not coincidentally, it's the best thing to do with C libraries.
20:44 luqui heh
20:50 autrijus back.
20:50 svnbot6 r3999, iblech++ | examples/network/screen-nodestatus.p6 -- Added a usage().
20:50 svnbot6 r4000, iblech++ | Implement nothing().
20:50 svnbot6 r4001, iblech++ | * Implement evalfile()
20:50 svnbot6 r4001, iblech++ | * Added a test for evalfile (t/builtins/evalfile.t).
20:50 svnbot6 r4001, iblech++ | * Test for nothing() added, too (already in the previous commit, sorry)
20:50 svnbot6 r4001, iblech++ |   (t/builtins/nothing.t).
20:50 autrijus chromatic: so class method and object method invocation are still mixed in p6?
20:51 autrijus Foo.blah and Foo.new.blah calls the same thing?
20:51 chromatic In what sense do you mean, autrijus?
20:51 autrijus in that sense
20:51 chromatic I believe so.
20:51 autrijus oh well.
20:51 autrijus then you want to fix the dispatch code in Eval.hs.
20:51 autrijus I'll attempt a fix.
20:51 chromatic As I understand it, you can specify more specific invocants in the method signatures.
20:52 autrijus so basically
20:52 autrijus evalExpType (Val (VType typ)) = return typ
20:53 autrijus because otherwise it will look at type of Foo
20:53 autrijus and dispatch to "Class"
20:53 autrijus because that's the class of ::Foo
20:53 chromatic Right.
20:53 chromatic See?  More grief.  I promised.
20:54 autrijus pugs> class Foo { method bar { 3 } }; Foo.bar
20:54 autrijus 3
20:54 autrijus happy?
20:55 chromatic Yep, that fixes what I need.
20:55 chromatic Does it break new() though in the absence of a defined new()?
20:55 autrijus no. it will fallback to the builtin Class::new
20:55 chromatic Beautiful.
20:56 * autrijus praises the maintainable hackability of the pugs codebase
20:56 chromatic Did you replace evalExpType (Val val) = evalValType val?
20:56 autrijus no, it turns out it's simpler
20:56 autrijus I can intercept it at type variable level.
20:57 autrijus basically assuming, for type dispatch purpose, that ::Foo is Foo
20:57 chromatic Yeah, I can see that.
20:57 autrijus not Class
20:57 chromatic Which file is that?
20:57 autrijus Eval.hs
20:57 autrijus evalExpType (Var (':':typ)) = return $ mkType typ
20:57 autrijus I added one line
20:57 autrijus that's all
20:58 autrijus it's not neccessarily correct
20:58 autrijus because that rule only applies on the invocant position
20:58 autrijus I'll refix
20:59 chromatic Ahh, very clever.
20:59 chromatic The charlist/string thing still confuses me sometimes.
20:59 wolverian I've missed walking outside a lot. slightly rainy is the best weather ever.
20:59 ninereasons iblech++, I tried the livecd yesterday.  There's potential for something very interesting, there.  But ...  
20:59 wolverian (I also enjoy saying OT things in channels when I'm bored.)
20:59 ninereasons anyone who's tried it, when I tried to build my own, it complains that there is "kernel panic: not syncing, no init found"  .  What did I do wrong?
21:00 dbarth has joined #perl6
21:00 autrijus chromatic: properly fixed. r4003
21:00 svnbot6 r4002, autrijus++ | * Class methods like `Foo.bar` now dispatches to Foo::bar
21:00 svnbot6 r4002, autrijus++ |   instead of to Class::bar.  Requested by chromatic.
21:00 svnbot6 r4003, autrijus++ | * properly fix for class objects in invocant position
21:00 svnbot6 r4003, autrijus++ |   to assume a type of itself; otherwise it should still
21:00 svnbot6 r4003, autrijus++ |   be of Class type when used in MMD -- consider `foo(::Int, ::Int)`
21:00 svnbot6 r4003, autrijus++ |   when foo is a normal sub.
21:00 autrijus chromatic: I believe that's correct.
21:00 autrijus i.e. `multi sub foo (Class, Class) ` will be invoked
21:01 autrijus not `multi sub foo (Int, Int)`
21:01 autrijus when you do `foo(::Int, ::Int);`
21:01 dbarth hi all
21:01 autrijus hi dbarth
21:01 eric256 has joined #perl6
21:01 autrijus chromatic: sounds sensible to you?
21:01 chromatic Yes, it does.
21:02 eric256 how do i tell vim that .p6 files should have perl highlighting?
21:02 Corion r3997 - http://datenzoo.de/pugs/win2k.html - 5620 ok, 273 failed, 738 todo, 314 skipped
21:02 chromatic I'm not 100% confident about the MMD, but it sounds sensible.
21:02 dbarth it seems I have the same pb as integral, trying to link with PUGS_EMBED="perl5" : my suse ld breaks with -Wl,-E : unknown option
21:02 autrijus cool.
21:02 autrijus dbarth: does the newest trunk fix it?
21:02 autrijus dbarth: I think theorbtwo did some Makefile.PL fix
21:02 dbarth i've done a svk pull a few minutes ago, but not sure about the 'trunk' :
21:02 autrijus ooh t\builtins\system\01-strings-with-spaces.t parsefail
21:03 autrijus dbarth: ah. trunk is merely newest version of svk repo
21:03 autrijus dbarth: did you rerun makefile.pl?
21:03 dbarth yes
21:03 dbarth what is the repo URL for trunk ?
21:03 autrijus Corion: wait, what is 01-strings-with-spaces.t ?
21:03 autrijus Corion: is it another of your local invention?
21:03 Corion autrijus: My (preliminary) test for system(@LIST)
21:03 autrijus dbarth: http://svn.openfoundry.org/pugs/
21:03 autrijus ah k.
21:03 Corion not yet working, thus not yet committed :)
21:04 autrijus so 273 failures isn't what it seems
21:04 Corion Ah - errr, true ...
21:04 autrijus since 228 of it is that test
21:04 autrijus we're more like 45 failures :)
21:04 chromatic Excellent, it's calling my new() now.
21:04 autrijus <- was briefly worried
21:04 autrijus chromatic: cool!
21:04 chromatic Failing on SUPER, but that's one step closer!
21:04 kolibrie I give up for now - I don't see any localtime() specs on any of the perl6 lists
21:04 autrijus kolibrie: that means you get to write the spec
21:04 kolibrie :)
21:05 autrijus kolibrie: and post to p6l and maybe patch s29 locally
21:05 kolibrie I'll think about it over the weekend
21:05 autrijus chromatic: so. what does SUPER mean?
21:05 autrijus chromatic: does it mean NEXT now?
21:05 autrijus or is there NEXT support separately? or not at all?
21:05 dbarth autrijus: I confirm I'm using trunk (did a 'svk cp http://svn.openfoundry.org/pugs pugs')
21:05 kolibrie has quit IRC ("leaving")
21:06 autrijus dbarth: ok... give me the first line when you type make
21:06 autrijus the ghc invocation line
21:06 chromatic SUPER and NEXT are separate.
21:06 Aankhen`` Does the "/x by default" behaviour of Perl 6 rules extend to comments within rules?
21:06 autrijus Aankhen``: I believe so. but I'm
21:06 autrijus not very sure
21:07 Aankhen`` OK.
21:07 autrijus chromatic: why not adopt ruby's super?
21:07 autrijus chromatic: it strikes me as very sensible
21:07 chromatic MMD.
21:07 autrijus point.
21:07 autrijus sigh.
21:07 dbarth I'm doing a make clean; + reconfigure + make cycle, just to be sure
21:07 chromatic You may want to call all or some of the several candidate methods.
21:07 autrijus yeah already grokked.
21:08 autrijus ok. let's implement SUPER.
21:08 autrijus what happens when you have no superclass?
21:08 autrijus i.e. you're Any
21:08 autrijus is the SUPER of Any Any?
21:08 chromatic I say it just stops.
21:08 autrijus as in not calling anything
21:09 chromatic You're at the top floor.  That elevator's staying put.
21:09 chromatic Yeah, if there's no parent, there's nothing else to call.
21:10 chromatic Ahh, now I understand (':':typ).
21:10 chromatic It just needs to have at least one leading colon.
21:11 autrijus yup.
21:11 svnbot6 r4004, eric256++ | Fixed some spacing issues, removed some debuging output.
21:11 svnbot6 r4005, Aankhen++ | * HTTP::Headers -- fixed a few errors in porting.
21:11 svnbot6 r4005, Aankhen++ | * modified bits to use OO on builtins.
21:11 autrijus since I hear you can use :Int.
21:12 luqui Is using those cascaded :s really the best way to strip a prefix?
21:12 autrijus luqui: no.
21:12 Shachaf has joined #perl6
21:12 autrijus luqui: you can use break and span etc
21:12 autrijus or just isPrefixOf
21:12 luqui I'm just surprised that foo ("bar" ++ x)  doesn't work
21:12 luqui on the lhs
21:12 autrijus you can do
21:13 autrijus foo arg | "bar" `isPrefixOf` arg, x <- drop 3 arg = ...
21:13 iblech has joined #perl6
21:13 autrijus allowing ++ on lhs will amount to prolog.
21:13 autrijus so maybe you can write it in Curry, but not Haskell
21:13 luqui ... hmmm, I guess that's true
21:14 luqui bar (x ++ y) = ...
21:14 autrijus right.
21:14 autrijus how very confusing.
21:14 chromatic No reversable guard clauses!
21:14 mauke but they could allow it with constant strings
21:14 dbarth is hs-plugins required to get an embeded perl5 ?
21:14 autrijus dbarth: nope
21:14 autrijus mauke: (x ++ "bar" ++ y) ?
21:14 mauke succ' (n-1) = n works too
21:14 autrijus mauke: it's too inconsistent.
21:15 autrijus and n+k patterns are considered by many as mistakes :)
21:15 iblech ninereasons: Hmm, I've just tried it -- purged livecd/ and svn up'd again, then ./mklivecd.pl, and finally qemu -cdrom cd.iso -- works as it should...
21:15 luqui sqrt (n*n) = n
21:15 luqui hmm.. this is getting, er, tricky for a compiler
21:15 autrijus luqui: Curry and Oz can all do that
21:16 autrijus luqui: maybe Perl 6 should too ;)
21:16 autrijus (but not by default)
21:16 mauke I wanted to do something like that in perl5
21:16 autrijus mauke: AI::Prolog on cpan
21:16 mauke except without all the features
21:16 mauke just stuff like sqrt($n) = 3;
21:16 luqui there's no ebuild for curry
21:17 eric256 should defined() work on $_ if not specificed so that given $x { when defined {} default {} } would work?
21:17 luqui yeah, I wrote Logic.pm which does that sort of stuff too
21:17 luqui but the syntax frontend didn't end up being very pretty
21:17 * chromatic &
21:17 luqui I'm going to be writing a logic module for parrot, because I need it for a game I'm writing
21:18 chromatic luqui, talk to Ovid about that
21:18 dbarth has left "Leaving"
21:18 luqui ovid?
21:18 chromatic Curtis Poe
21:18 Limbic_Region curtis poe
21:18 IshaCocoa has quit IRC (Connection timed out)
21:18 Corion "Just" implement a WAM in Parrot
21:19 autrijus chromatic: what happens when you have multiple parent types?
21:19 luqui WAM?
21:19 autrijus chromatic: does SUPER:: check each of them in turn?
21:19 Limbic_Region luqui - see http://www.fcnp.com/448/restaurant.htm
21:19 Limbic_Region err - not that
21:19 autrijus chromatic: does SUPER::SUPER:: check recursively two level?
21:19 Limbic_Region oops
21:19 luqui SUPER probably ought to die then
21:19 Corion Warren Abstract Machine - the usual way of implementing Prolog
21:19 Limbic_Region luqui - see http://use.perl.org/~Ovid/journal
21:19 chromatic No, I don't think SUPER::SUPER:: checks recursively.
21:19 autrijus luqui: p5's SUPER certainly does not die :)
21:20 Corion Pretty fast from what I know, at least for the commercial Prologs
21:20 Corion Ovids WAM is fast. For Prolog in the 90s. :)
21:20 chromatic http://dev.perl.org/perl6/doc/design/apo/A12.html#___top
21:21 luqui oh the warren abstract machine or something
21:22 luqui autrijus, but maybe perl6's should, so that you have to be more specific
21:22 luqui perl 6 gives you a lot of ways to walk superclasses, and SUPER doesn't make sense for more than one
21:22 * luqui is behind in the irc reading
21:23 chromatic SUPER is just syntactic sugar for $self.WALK[:super]::method( @args ) anyway.
21:23 Aankhen`` We broke 4,000 commits?  Yay! :-D
21:23 Aankhen`` Par-tay!
21:23 * luqui wants forward-chaining logic too, so he might have to settle for a simpler algorithm
21:23 chromatic "Call method with $self as the invocant on the first parent found that has it defined."
21:23 * luqui will research WAM (he read the beginning of it once)
21:23 * chromatic really &
21:24 eric256 with pugs can i tell what type of object something is? ... like $x.isa("Whatever"); ?
21:24 Aankhen`` eric256 >> $x ~~ Whatever
21:24 eric256 i tried $x ~~ Whatever. and the above. and neither work
21:24 Aankhen`` Like $x ~~ Array
21:24 Corion luqui: I'm told that you need to read it two or three times, because while it implements everything as needed the explanation of why is lacking.
21:25 Aankhen`` Well, is Whatever a class that's being `use`d?
21:25 eric256 yes
21:25 * Corion falls asleep
21:25 Corion has quit IRC ("Chatzilla 0.9.68a [Firefox 1.0.4/20050511]")
21:25 eric256 :q
21:25 eric256 opps.
21:25 Aankhen`` And you're sure the object is of that class?
21:25 eric256 yes.
21:26 Aankhen`` Hrm.
21:26 Aankhen`` Could you try: say $object.ref
21:26 autrijus pugs> class Foo { method z { 3 } }; class Bar is Foo { method z { ./SUPER::z } } Bar.new.z
21:26 autrijus 3
21:26 autrijus chromatic: oh, you're gone.
21:26 ninereasons iblech, belated thanks !
21:27 autrijus pugs> 1.isa(Int)
21:27 autrijus bool::true
21:27 svnbot6 r4006, Aankhen++ | * docs/other/porting_howto: added translation of "scalar @foo".
21:27 svnbot6 r4006, Aankhen++ | * translation of length("foo"): use "foo".chars instead of "foo".bytes
21:27 svnbot6 r4006, Aankhen++ | * added note about using m// with split().
21:27 svnbot6 r4006, Aankhen++ | * added section about arrays and hashes turning into references in scalar context.
21:27 svnbot6 r4007, autrijus++ | * SUPER:: implemented.
21:27 autrijus eric256: ahh. sorry. a new bug. fixing
21:28 Limbic_Region oh, crossed the 4000 mark
21:28 Limbic_Region woo hoo
21:28 Aankhen`` Ah, that /x does extend to comments.
21:28 Aankhen`` From S05: # now always introduces a comment.
21:28 luqui I think our bot should be able to execute pugs code
21:28 autrijus like rm -rf etc
21:29 luqui hmm
21:29 iblech If you are willing to host the server for it :)
21:29 luqui I guess we need a Safe.pm-like thing first
21:29 autrijus lambdabot has a @plugs for eval
21:29 autrijus but that's because you can't feed it monadic type :)
21:30 * luqui wonders what it would take to keep things safe
21:30 iblech What happens if one says @plugs sum [1..]?
21:30 Limbic_Region has quit IRC ("tiuq\")
21:30 autrijus iblech: it timeouts
21:31 autrijus resource starvation are easier to counter
21:33 eric256 autrijus what bug did you find?
21:33 iblech Hm, if we had (for now) a simple --safe switch, which'd simple die() on things like system and open...
21:34 autrijus eric256: Foo.isa(Foo) was false
21:34 eric256 that list of things like gets long though.
21:34 autrijus iblech: we actually do
21:34 eric256 yea autrijus i guess that would count as a bug. ;)
21:34 autrijus iblech: just change runEvalIO to runEvalSTM
21:34 autrijus iblech: and all IO things will magically die.
21:34 autrijus I intended to implement atomic {} with that
21:35 autrijus but had not have tuits
21:35 Aankhen`` G'night.
21:35 Aankhen`` has quit IRC ("Quote: "Too many scientists on the w3c and not enough literature graduates. (That's why, if you read out the xhtml 1 spec, it)
21:35 autrijus iblech: so you can do a eval_safe
21:35 autrijus by copying "eval" op code
21:35 autrijus and change runEvalIO to runEvalSTM
21:35 iblech Hm, that's seems easy :)
21:35 autrijus all the debug statements etc are liftIO though so you need to watch out
21:35 autrijus but yeah, it's not hard
21:35 autrijus certainly much easier than Safe.
21:35 autrijus isn't effect typing great? :)
21:36 iblech Hm, I'll ponder this tomorrow then, probably :)
21:36 autrijus :)
21:37 iblech Gonna sleep...
21:37 iblech has quit IRC ("sleep &")
21:37 autrijus nite
21:40 autrijus eric256: fixed as r4008
21:40 svnbot6 r4008, autrijus++ | * `isa` now handles class names are the invocant, so
21:40 svnbot6 r4008, autrijus++ |   `Foo.isa(Foo)` is now always true.  eric256++ for reporting this.
21:42 autrijus breakfast &
21:43 cognominal the sun never sets on perl6 realm :)
21:43 autrijus :)
21:43 autrijus parrot is now at r8185
21:44 autrijus we still have some way to go :)
21:44 nnunley has quit IRC (No route to host)
21:49 * luqui wonders if it is time to finally install windows
21:49 svnbot6 r4009, ninereasons++ | tidy up a little
21:49 * luqui cringes
21:49 IshaCocoa has joined #perl6
21:49 autrijus luqui: why?
21:50 luqui my composition programs are windows only
21:50 luqui and I have an urge to play counterstrike
21:50 autrijus oh. have fun then
21:50 autrijus you may find Flyakite useful.
21:51 luqui yummy
21:51 * luqui goes off to do the unspeakable
21:51 luqui has quit IRC ("Leaving")
21:57 chromatic Hmmm.
21:58 autrijus chromatic: SUPER:: is in. what else you need?
21:59 chromatic I'm running 010*t right now to see.
21:59 autrijus seen on #ruby-lang:
21:59 jabbot autrijus: I havn't seen on , autrijus
21:59 autrijus 05:56 < Aredridel> Hehe. lucsky: it's matz' least surprise, not yours ;-)
22:01 chromatic Ah, there was an error in that test.
22:03 chromatic There was also an error in Test::Builder::TestPlan.
22:06 elmex has quit IRC ("leaving")
22:08 chromatic If I do $Test = Test::Builder.new(), what should $Test.ref return?
22:11 autrijus ::Test::Builder surely?
22:11 svnbot6 r4010, naesten++ | Add export list to Pugs.Types
22:11 svnbot6 r4011, autrijus++ | * Patch from Samuel Bronson to add export list to Types
22:11 svnbot6 r4011, autrijus++ |   ...but he already committed it.  Oh well. add Samuel to AUTHORS.
22:12 chromatic I would have thought so too, but it's returning Class.
22:13 autrijus because you told it to.
22:13 autrijus ah.
22:13 autrijus I see.
22:13 autrijus you have rebound ::Class.
22:13 autrijus clever, but not yet supported.
22:14 chromatic In the BUILD signature, you mean?
22:14 autrijus if you had said
22:14 autrijus method new ( Test::Builder $Class: *@args )
22:14 autrijus    return $:singleton //= $Class.SUPER::new( @args );
22:14 autrijus then it would work.
22:14 autrijus and I think it's valid anyway
22:14 chromatic Good question on that.  I stole that code almost directly from Damian.
22:14 autrijus I think $class
22:15 autrijus is better.
22:15 autrijus makes more sense to me anyway.
22:15 autrijus otherwise it's very confusing
22:15 autrijus because there's a builtin ::Class too.
22:15 chromatic Me too.  Let me see if he explained his reasoning.
22:15 autrijus anyway I'm not going to be able to implement rebindable class space right now :)
22:15 chromatic No, that's a biggie.
22:15 autrijus if you insist, write a separate test under t/oo/.
22:16 nnunley has joined #perl6
22:16 chromatic I imagine you probably want separate tests for some of these anyway, including the wrong order of DESTROYALL?  :)
22:16 autrijus the wrong order is already fixed.
22:16 autrijus :)
22:16 autrijus I slapped a reverse on your code.
22:16 chromatic Yes, I saw.
22:16 autrijus but sure.
22:16 autrijus oh also, a GC run is performed during each runEvalIO now
22:16 chromatic I tried to refactor out the duplication, but it's hard to reverse an Eval [Val].
22:17 autrijus so in interactive shell or in ghci it's very convenient
22:17 autrijus because  DESTROYALL is always called between evals
22:17 autrijus chromatic: huh? you pass in another ([a]->[a])
22:17 autrijus and in buildall's case pass in "id"
22:18 autrijus and in destroyall's case parameterise it with "reverse"
22:18 chromatic Okay, it was hard for me.
22:18 autrijus and call that argument "f" :)
22:18 autrijus that's fine :)
22:18 chromatic I'm going to see what low-hanging fruit this picks in the T::B suite and I'll check in my modifications.
22:19 autrijus refactored done
22:19 autrijus op1 "BUILDALL" = op1WalkAll id "BUILD"
22:19 autrijus op1 "DESTROYALL" = op1WalkAll reverse "DESTROY"
22:20 chromatic That's what I had in mind for the results.
22:21 eric256 should
22:21 eric256 when $_.isa(Weapon) { } work? when $_.ref = Ref Weapon, and $_.say = <obj:Weapon>
22:21 svnbot6 r4012, autrijus++ | * refactor BUILDALL and DESTROYALL into op1WalkAll
22:22 autrijus you can use .isa(Weapon) :)
22:22 autrijus but yes
22:22 autrijus oh wait
22:22 autrijus not really
22:23 autrijus fixing
22:23 eric256 lol.  i was just about to commit my wizard.p6 displaying this problem....i should right tests ;)
22:24 eric256 is there a good place in oo for these?
22:24 autrijus it's not a oo bug
22:24 autrijus it's a when bug
22:24 autrijus it was parsed as
22:24 autrijus if ($_ ~~ $_.isa(Weapon)) { ... }
22:25 eric256 that won't work
22:25 eric256 ;
22:25 autrijus right. and fixed.
22:25 autrijus r4013.
22:25 eric256 thanks
22:25 autrijus np :)
22:25 eric256 should i go ahead and right a test to make sure it doesn't break in the future?
22:25 autrijus btw it's really clearer to write
22:25 autrijus when .isa(Weapon) { ... }
22:25 autrijus sure, go ahead
22:25 eric256 i tried that
22:25 autrijus yeah, now it's fixed, you can use that :)
22:25 eric256 and $_.isa and Weapon and $_ ~~ Weapon. ;)
22:26 autrijus sorry ;)
22:26 autrijus oh right. when Weapon
22:26 autrijus that should work, no?
22:26 eric256 np. i just thought i was crazy
22:26 eric256 i thought it should
22:26 autrijus fixing
22:27 autrijus oh wait
22:27 autrijus it already works, lol
22:27 svnbot6 r4013, autrijus++ | * `when .isa(Foo)` is no longer parsed as `when $_ ~~ .isa(Foo)` now.
22:28 autrijus but you need to write
22:28 autrijus when (Weapon) { ... }
22:28 autrijus currently
22:28 autrijus there's a space globbing bug somewhere.
22:29 autrijus not too worried, though. I'll really find food now :)
22:29 autrijus bbl &
22:29 autrijus eric256++ # first Perl 6 OO guinea^Wpioneer
22:29 chromatic Sure, just because his code *works* :P
22:30 autrijus :)
22:30 eric256 lol
22:30 eric256 how do i convince my feather acount that it knows where the Test module is?
22:32 autrijus set PERL6LIBS env var?
22:32 autrijus er, PERL6LIB
22:32 chromatic Hm, do roles compose in methods yet?
22:32 chromatic I *think* they do, but I'm seeing weird failures.
22:33 autrijus pugs does not support roles yet ;)
22:33 autrijus roles are just classes, and "does" is just multiple inheritance.
22:33 chromatic That explains a lot of these failures then.
22:34 autrijus I'm going to pick up MetaModel works
22:34 autrijus and inject them to haskell lnad
22:34 autrijus but perl5embed took away that batch of tuits
22:34 iblechbot has quit IRC (Read error: 110 (Connection timed out))
22:34 autrijus so if you'd like to help, audit MetaModel docs
22:34 autrijus to make sure it agrees with design
22:34 chromatic Yep, it must not be injecting the BUILD submethod.
22:34 autrijus because that's ultimately what I'm going to base on
22:35 autrijus esp. ext/Perl-MetaModel/perl6*
22:35 autrijus ext/Perl-MetaModel/docs/perl6* even.
22:35 autrijus really &
22:40 mrborisguy has joined #perl6
22:40 svnbot6 r4014, eric256++ | Testings some tests for given and OO
22:40 svnbot6 r4015, eric256++ | Second to last test is causeing Heap exhausted error!
22:40 eric256 could someone review \t\statments\given.t  second to last test is dieing and i'm not sure why.
22:41 Juerd chromatic: What does "face-stabby" mean?
22:41 chromatic It means it makes me want to stab myself in the face with a fork instead.  :)
22:41 Juerd And why is that?
22:43 chromatic It feels dirty to me.
22:43 Juerd It is dirty.
22:43 Juerd However, it is a useful technique that in this case adds functionality
22:43 Juerd Although I've been wondering lately if reblessing could suffice
22:44 chromatic I don't like reblessing much, but in this case it seems appropriate.
22:44 Juerd When you're working with connections, something can invalidate an object
22:45 Juerd It's then very useful to have the reason for that in the error message when the object is used
22:46 Juerd Wouldn't it be terribly useful if you knew when printing to a closed filehandle, not only that it was closed, but also WHEN it was closed, if that was because the virtual filesystem ceased to exist?
22:46 Juerd $db->disconnect makes all statement handles useless
22:46 Juerd However, they're not yet officially finished, on your side
22:46 chromatic Yeah, it's nice to store that information somewhere.
22:46 Juerd Now, if you explicitly disconnect, you probably know what's going on
22:47 Juerd But this one's subtle to newbies: my $result = DBIx::Simple.new.query('...');
22:48 Juerd I actually implemented it in DBIx::Simple after writing $r = DBix::Simple->new(...)->query(...) myself.
22:48 Juerd It was in a rather huge script, and the $r was initialized in the beginning, and then later on used often.
22:49 Juerd But even the first failed, and before I had better error reporting, I couldn't figure out why my dbh had gone. When I found it, it was all too obvious, of course.
22:50 chromatic Yeah, the Portland Pattern Repository has a good page about the null object pattern for that reason.
22:50 Juerd brb
22:51 eric256 given $t { when .isa(TestIt) { $passed = 1;}} causes some sort of infinite loop to happen. any ideas?
22:55 chromatic I'm seeing infinite loops in SUPER calls too, but I don't know if that's related.
22:55 eric256 that would make sincen. i'm sure isa must use SUPER in some form
22:56 chromatic Revert to 4006 and see if that helps maybe.
22:56 eric256 hmmm..  $_.isa() alone works fine.  when .isa() failes though
22:57 chromatic Could be something wrong in findSuperSub in Pugs.Eval.
22:58 eric256 seems wierd for it to only occur in the When block
22:59 Juerd roe
22:59 Juerd ehh
22:59 eric256 ?
22:59 Juerd s/roe/re/
23:00 eric256 error with smartmatch? ~~ ?
23:00 Juerd .method() is special cased for smartmatch
23:01 Juerd But in this case that shouldn't matter, because $_ and the LHS of the implicit ~~ are both the same $t
23:07 chromatic Hm, in a submethod BUILD, a signature member of $expect = 0 doens't work, while $:expect = 0 does.
23:07 chromatic Curious.
23:07 chromatic s/ens/esn/
23:09 zn- has joined #perl6
23:10 IshaCocoa_ has joined #perl6
23:10 SamB autrijus: so that darcs thing doesn't go both ways?
23:15 kelan the darcs repo is read-only
23:16 kelan although 'darcs send' defaults to sending to perl6-compilers, where i'm sure someone would see the patch and maybe apply it
23:16 larsen has quit IRC ("later")
23:17 SamB kelan: yeah, but it would then conflict with the sent patch...
23:17 Juerd Every time I read things like 'bidirectional' and 'both ways', or the opposites, 'unidirectional', 'one way', and 'read only', I think about how much I want <->.
23:17 Juerd And that's often.
23:18 kelan what would conflict?
23:19 SamB kelan: the darcs patch resulting from the svn commit would conflict with the darcs patch that was sent
23:19 * eric256 debates wether to use any([//]<<<<@x) or @x.map:{$_[0]}.any  ..one is pretty, one is readable. ;)
23:19 IshaCocoa has quit IRC (Read error: 110 (Connection timed out))
23:20 SamB I don't think either of those is terribly pretty
23:20 SamB but @x.map:{$_[0]}.any looks like it might be easier to decipher
23:20 kelan i meant maybe autrijus would use darcs to apply it, too
23:20 eric256 you have no flair for art! ;)
23:20 kelan not sure
23:22 Juerd @x.squish.any :)
23:22 Juerd Or whatever the method name for recursive flattening is.
23:23 eric256 except i just want the first element of each sublist. yea i know i'm picky
23:23 Juerd eric256: Then I don't understand how the first works.
23:23 Juerd As it has no index.
23:23 SamB eric256: well, I don't know how to read folds or maps or anything like that in Perl 6 yet...
23:24 Juerd Shouldn't that be @x>>.[0].any then?
23:24 Juerd Which I expect to be writeable as @x>>[0].any too
23:24 eric256 [//] will pick off the first defined value of the list. ;)
23:24 Juerd That's obfuscation.
23:25 Juerd And will hurt when you change your mind about whether the first has to be defined.
23:25 Juerd It makes the code much less generic.
23:26 eric256 and who says obfuscation isn't pretty. ;) like i said one is pretty one is readable. don't worry i went with teh more readable of the two.. actualy i made it two steps....my @choices = @x.map:{$_[0]}; until ($choice eq any(@choices) {
23:26 Juerd I don't agree about the other one being particularly readable. I think a hyperop version of that, so @x>>[0].any is much prettier and morre readable.
23:27 Juerd Why is your array called @x?
23:27 Juerd And if only the first element matters, why are you using an array, not a hash?
23:27 eric256 its not.  it is called @data. which is clear enough at the time
23:27 Juerd "data"
23:27 Juerd Right.
23:27 SamB Juerd: why do we call all our lists xs in haskell?
23:28 mauke because we treat them as generic lists without looking at their content
23:28 Juerd I still need to encounter an array that doesn't hold data, data for sake of simplicity being able to be 0 elements.
23:28 Juerd If you use only the first element, it's no longer a generic list.
23:29 mauke (\@function)->("hello");
23:29 mauke (perl5 code)
23:29 Juerd not a CODE reference ...
23:29 SamB mauke: for a half second that looked like haskell
23:30 mauke Juerd: just bless \@function into a package with an overloaded &{} operator
23:30 eric256 hehe. you can look at the commit of wizard.p6 i just made.  in short it is a prompt sub that takes an array of data, the first element can be a key or undef, it then takes that and makes the first element an integer if it is un specified. so a list of weapons can be given and it assigns them 1..5 or some of them can have designated shortcuts.... like f for flee! ;)  it is definitly a work in progress and suggestions are welcome
23:30 kelan SamB: lists are called 'xs' because its the plural of 'x'
23:30 eric256 okay so that wasn't soo short.
23:30 Juerd eric256: Names.
23:30 SamB kelan: I know that!
23:31 kelan oh
23:31 Juerd eric256: My primary suggestion is that you use names. Not meaningless indices that make sense only to you, only this month.
23:31 kelan nevermind, i didnt read far enough back:)
23:31 SamB kelan: ;-)
23:31 Juerd If the first element is a key, then call it key.
23:32 eric256 read my code. you will see that one array is probably the worse named.  and it is named as such because it is good enough for the few line sub it is in.
23:32 Juerd And @data for this sub should probably be called @options
23:32 eric256 better names are welcome... @options is certainly a better one...i thought of prompts at first but didn't like it.
23:32 eric256 in hindsight either are better than @data.
23:32 Juerd Everything is better than @data.
23:33 Juerd $data sometimes makes sense
23:33 eric256 lol. i noticed you have no love for @data
23:33 Juerd Of course not.
23:33 svnbot6 r4016, eric256++ | Some updates and a bug work around
23:33 Juerd It's like naming your sub "function"
23:33 Juerd function(@data)
23:33 wolverian open "file";
23:33 Juerd Now what the heck does that do, and what is the data it uses for that?
23:34 Juerd It's generally better to use foo(@bar) instead
23:34 pjcj $datum  </pedant>
23:34 mauke well, it's better than data(@function);
23:34 Juerd pjcj: Then it's a given, thus input, or a date.
23:35 Juerd mauke: Yes. That's why we have sigils for this
23:35 mauke meaningless names > misleading names
23:35 Juerd Certainly.
23:35 kelan Juerd: wouldn't it have to be `any(@x>>[0])`?
23:35 kelan sorry to back up so much
23:35 Juerd Thanks for not using >>. Although mathematically appropriate, it'd be very confusing and make me think about hypering the two sides.
23:35 Juerd kelan: Why specifically that?
23:36 Juerd As far as I know, hypers don't change precedence. I may be wrong,
23:36 Juerd s/,$/./
23:36 SamB what is >> anyway?
23:37 Juerd SamB: Hyper operator
23:37 Juerd SamB: Also known as ».
23:37 SamB the singular of data is bit
23:37 SamB not datum
23:37 Juerd SamB: No, it's datum.
23:37 kelan `@x>>[0]` is just a list of elements, isnt it? do lists have methods?
23:37 Juerd Although data is used singular.
23:38 Juerd kelan: Lists, when used with a dot operator, turn into arrayreferences
23:38 svnbot6 r4017, eric256++ | wizard.p6: renamed @data to @prompts, to satisfy Juerd++ ;)
23:38 kelan ah
23:38 SamB Data has morphed into an aggregate noun in programerly usage...
23:38 Juerd kelan: This is why you can use (1,2,3)[1] to get 2.
23:38 Juerd SamB: In English.
23:38 SamB and I can't spell
23:39 Juerd eric256: multi sub infix:<<.?.>> ($low,$high) {int( rand($high - $low) + $low ) + 1; };
23:39 SamB Juerd: In standard english maybe.
23:39 Juerd eric256: That really needs a comment explaining why, and probably what too.
23:39 SamB if there is such a thing as standard english
23:40 wolverian isn't that the same as any($low, $high).pick?
23:40 Juerd eric256: This is efficient, but a comment in the form of [$low .. $high].pick
23:40 Juerd wolverian: No, s/,/../
23:40 wolverian er, yes.
23:40 wolverian thanks for spotting that :)
23:40 eric256 any($low..$high).pick but without building the whole list in memory
23:40 Juerd eric256: This is efficient, but a comment in the form of [$low .. $high].pick would be very useful.
23:40 wolverian Juerd: is .pick a method on arrays too?
23:40 Juerd eric256: Do you ever maintain code? :)
23:41 Juerd wolverian: Yes
23:41 wolverian oh. then what you showed is probably nicer.
23:41 Juerd wolverian: Because it'll be used much, and skipping the any means a huge efficiency gain :)
23:41 wolverian yes. :)
23:42 eric256 Juerd: only my own
23:42 Juerd Does .chomp mutate?
23:42 Juerd It shouldn.t
23:42 kelan does the dot operator infer scalar context, then?
23:43 kelan which is what turns the list to an arrayref?
23:43 Juerd eric256: @prompts is a bad name. They're options, not prompts
23:43 Juerd eric256: The same goes for @choices, which is a name used for the same thing
23:44 Juerd eric256: But more importantly: you have two names for the same thing in different places. Use one name to improve legability...
23:44 Juerd kelan: Sort of.
23:44 kelan legibililty
23:44 Juerd kelan: It doesn't hurt to think of it that way
23:44 Juerd Eh, yes.
23:44 kelan well tell me what it really does:) i like knowing the details
23:45 Juerd kelan: It's what makes the list not a list and my previous statement rather incorrect :)
23:45 Juerd kelan: You're right.
23:45 eric256 two names for one thing?
23:45 eric256 which one thing?
23:45 Juerd eric256: @choices and @prompts
23:45 Juerd When you call prompt, you use @choices, and then in prompt, you alias it to @prompts
23:45 Juerd That's awful :)
23:46 eric256 @choices are what can be typed in. @prompts are the actual prompts include they key, they prompt, and the return object
23:46 Juerd And an option is a choice only when it's chosen </nitpick>
23:46 Juerd eric256: They are the same thing!
23:46 Juerd multi sub prompt ($prompt, @prompts is copy) {
23:46 Juerd    ...
23:46 Juerd }
23:47 Juerd            $choice = prompt("Your choice?",@choices);
23:47 eric256 well feel free to rearrange it if you like
23:47 Juerd (Okay, not alias, but copy)
23:47 Juerd Why would a choice, when copied, become a prompt?
23:47 eric256 because it takes the choices they could chooce and gives them to the user in a prompt. ;)
23:48 eric256 the prompt takes a set of choices and returns them.. perhaps it should be @choices instead of @prompts. dunno.. you seem to care alot more than me though so feel free to fix it up, it would be interesting to see what you do with the same code to make it more readable
23:48 eric256 gtg now though. later
23:48 eric256 has left
23:58 Juerd Oh my
23:59 svnbot6 r4018, chromatic++ | Untodo passing tests.
23:59 svnbot6 r4018, chromatic++ | Use $Class as invocant in Test::Builder, not ::Class.
23:59 svnbot6 r4018, chromatic++ | Use attribute as potential default variable container in T::B::TP::BUILD().
23:59 svnbot6 r4018, chromatic++ | Use SUPER() instead of WALK:: in T::B::TP.
23:59 Juerd That script is awful :|
23:59 Juerd Inconsistent style, code that never runs, meaningless variable names

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

Perl 6 | Reference Documentation | Rakudo