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