Feather users: perlcabal.org/~autrijus/ | pugscode.org/ <Overview Journal Logs> | pugs.kwiki.org
Set by autrijus on 26 May 2005.
nothingmuch what I do in perl to get this done: 00:00
my $later = sub { function_call() };
as I said before,
&{ $later }();
wolverian it's just like $foo = { function() }; except the closure is implicitly called when needed
nothingmuch it makes a coroutine that is invisible to the using code, and it executes it as late as possible
Juerd wolverian: I agree that that is useful, but it should not use the word "lazy"
nothingmuch wolverian: not exactly like a closure
Juerd Because it has nothing to do with the laziness that lazy lists have.
nothingmuch why not? isn't that exactly what it is?
Juerd nothingmuch: What is your lazy, and what does it do?
nothingmuch: It's not a context specifier.
nothingmuch it's a context sensitive op, that fudges it's right side 00:01
Juerd Be more precise
nothingmuch like list and scalar and foo,
scalar 1 + 1; lazy scalar 1 + 1; scalar lazy 1 + 1; # all three are the same
Juerd I think the keyword "later" is better for your purpose.
nothingmuch to the right hand side, and also to the left hand side but because it doesn't know
Juerd This has nothing to do with the lazy that I had in mind 00:02
AND - it has nothing to do with the gather/take example we were discussing then
Because your current specs, as I read them, would mean that gather is called whenever the first element is needed.
Gather needs to know it has to yield instead of return
Without that information, it can't delay the creation of the second element. 00:03
wolverian 'later' is a good name for this.
'postponed' is maybe better, except it's too long.
maybe we really want a circumfix op for it.
my $foo = {{ bar() }}; # :)
Juerd That is why "lazy" should be "list but lazy" or something like that, calling gather *immediately*, allowing it to return something based on coros.
wolverian: I've suggested a circumfix op for that even, once 00:04
wolverian: But {{}} is impossible.
wolverian yes.
Juerd my $foo = later { 42 };
This doesn't even need core support probably.
wolverian right. and as a macro it doesn't even need the braces
I'm a bit unclear about your 'lazy'. could you explain it again? 00:05
nothingmuch I don't mind later {}; it's just the same to me
Juerd Just have &later return a variable that is tied
wolverian: Mine?
nothingmuch true, we discussed that here
iblech and myself
for around 5 minutes after it was brought up
wolverian Juerd: oh, is 'lazy' specced?
nothingmuch and then I mailed p6l
Juerd wolverian: No.
nothingmuch i thought at the time that we had the same thing in mind 00:06
but i still really don't see the difference of lazy gather between your and my usage cases
wolverian Juerd: hmm. want.lazy ?? yield :: return?
Juerd wolverian: "lazy" and "list" force list context. Default list context is unlazy. Lazy context is always list context. A sub called in lazy list context, returns a coro, that is then called once per element needed.
nothingmuch except that in my example we know how 'take' will do what it does 00:07
Juerd wolverian: Somewhat like that.
wolverian (the trinary op is horribly ugly now. I won't be using it.)
Juerd wolverian: gather would have "take" only collect in list context, but have it yield immediately in lazy.
nothingmuch i actually think it's a readability improvement... it's more obvious in thick code
Juerd wolverian: I think ??:: is an improvement.
wolverian Juerd: why? 00:08
(re: ??::)
Juerd wolverian: It's easier to spot visually, in a world where ? and : both already have at least three different meanings each.
wolverian right
but in perl5, that's not the situation
Juerd No. 00:09
In Perl 5, ?: works well.
However, we need those characters. Or other characters, but these are probably the best.
nothingmuch anyway, sleep
Juerd Bye, nm
wolverian I'm a bit unclear about the whole gather { take } deal. why can't we just do coro { yield }?
nothingmuch Hope I didn't make your RSI complain
Juerd: i still secretly think we agree 00:10
wolverian: because that's not list-generator-automagical
Juerd What nm said.
nothingmuch @array = gather { }...
wolverian right.
nothingmuch one second, i'll whip up that def of the range operator, and then really go
wolverian good point. :) 00:11
Juerd wolverian: gather can't be coro by default, because the block may access outside variables and depend on certain timing
wolverian: That is why the distinction between lazy and immediate must be explicit
wolverian sure.
Juerd And I think immediate execution is a much better default.
pasteling "nothingmuch" at 212.143.91.217 pasted "sub infix:<...>" (6 lines, 244B) at sial.org/pbot/10546
Juerd If the block used with gather is labeled as pure with "is pure", obviously, it can auto-lazify 00:12
nothingmuch wolverian: the reason i'm scared to death is that i can't sanely use any complicated function in a gather without getting bitten at least once a year
ciao!
Juerd Same goes for 1..number, which can always be lazy.
And 1..Inf will have to be :)
nothingmuch that's because the builtin map ops are pure on Num etc 00:13
Juerd I'm going to bed too 00:16
Unless someone has a question right now
Okay 00:18
Bye
afk
nothingmuch s/map/math/;
robkinyon nothingmuch - yes? 00:57
seen broquaint 00:59
jabbot robkinyon: broquaint was seen 4 hours 25 minutes 55 seconds ago
broquaint Hello?
robkinyon just wondering if you had any ideas re: a module installer/distributor/etc. 01:00
broquaint I wouldn't know where to begin. 01:01
Sounds like lots of system magic.
robkinyon well, would you mind letting me outline what I've got so far?
broquaint Go ahead :)
robkinyon Ok. there's actual 6 different components that need to be designed in parallel 01:02
The first is the distro installer / uninstaller - this is the EU::MM / M::B analog
2) the distro builder - this is what I would use when packaging up my C6PAN modules 01:03
3) The module sourcer - this is the "use" or "require" keywords
4) The distro inquirer - you want to be able to find out about your current installation structure without having to fake up code 01:04
5) The distro repository - this is C6PAN. It's important that it understands how "use" works, for various reasons
6) The distro downloader and uploader - the analog to CPAN/CPANPLUS.
broquaint Sounds involved. 01:05
robkinyon All 6 of them have to understand the new metadata associated with distributions and modules
(Note: a distribution is separate from a module or class, but I'm not sure anyone has realized it yet)
The biggest block I've got is getting the keywords to play nicely with the other stuff
I need @Larry's buy-in - I've got a note on P6L waiting for them to reply 01:06
I think the keywords should call out to some common code for knowledge how to find the right place to source in the code
I don't want to write that code, but I want to know it's accessible by the various components 01:07
So, essentially, there's a 7th component that's shared across all 6.
broquaint The code that accesses/munges that metadata? 01:08
robkinyon nods
that code has to be able to mixin'ed
which means I have to control how it's loaded and, potentially, inherit from it.
or override some of its functioning
(And, no, there isn't a bootstrapping or catch-22 problem ... it just looks that way.) 01:09
broquaint I don't see a bootstrapping problem. 01:10
robkinyon ok. I initially did with how "use" finds the shared component and its programmer-defined mixins, but that's solvable 01:11
autrijus SamB: ping 01:12
SamB: it's okay (and fine) to use TH, but you need to guard the code using #ifdef PUGS_HAVE_TH
robkinyon autrijus - got a moment?
autrijus SamB: some places has no ghci 01:13
SamB: and hence TH won't work
hi robkinyon. I'm about to sleep, but a moment sounds ok
robkinyon do you have any specs on the full syntax for "use"?
autrijus robkinyon: S11 01:14
robkinyon thanks
autrijus np :)
that's all I have.
broquaint Good luck, robkinyon. 01:15
robkinyon thanks
i think i'll need it
autrijus SamB: so using TH blindly will break build on those places. look at Pugs.Compile.Haskell on how to disable it entirely for platforms without TH 01:17
clkao morning autrijus 01:23
autrijus greetings.
clkao did you mention that one should use store_global for creating something in a namespace?
autrijus why, yes, but I believe I mentioned it in a Parrot context. 01:24
clkao ok. what bout perl6 01:25
btw i tried to implement $foo.as and @foo.as but failed. then i i go back reading htut
autrijus heh. 01:27
clkao and did you see the segfault i mentioned?
autrijus there is printf
you can just call to printf.
clkao sure. that's what i was doing
but array and vlist etc hates me
autrijus alright. 01:28
.as is probably a bit challenging as your first Prim
clkao so, segfault: SVN::Client.new.log('svn.openfoundry.org/pugs' , 'HEAD', 'HEAD', 0, 1, sub { say @_ });
call this twice and fscked
autrijus clkao: what does gdb say? 01:29
clkao document op\d a bit? i was lost in Val and VRef Vlist IVal Eval Eval ?
autrijus have you read PA02?
clkao checks with gdb
autrijus and you probably want to grok the entire src/Pugs/AST/Internals.hs too 01:30
clkao strangely i thought i did, but appearantly i didn't see the latter parts
#0 0x28469281 in Perl_sv_isobject () from /usr/local/lib/perl5/5.8.5/mach/CORE/libperl.so
autrijus :)
clkao #1 0x28982972 in svn_swig_pl_make_pool ()
from /home/clkao/work/svn/subversion/bindings/swig/perl/libsvn_swig_perl/.libs/libsvn_swig_perl-1.so.0
#2 0x28e58e8e in _wrap_svn_client_create_context (cv=0x85950ec) at svn_client.c:2943
pool fun 01:31
autrijus yow.
clkao :(
autrijus I'm inclined to say it's outside my reach right now. maybe when I have enough sleep
clkao translates the script back to perl5
autrijus sorry
clkao no worries
autrijus: wha'what's the proper way to get returned hashref more transparent? 01:34
svnbot6 r4083, autrijus++ | * stub implementation for .does
clkao currently you can't do keys.
autrijus clkao: oh. it's easy 01:35
look at src/Pugs/Types/Hash.hs
see line 130 01:36
it needs some haskell-fu
but you can trivially implement fetchKeys etc
using evalPerl5Sub alone
see the other IHash classes above for samples
(and the typeclass definition for the interface spec)
clkao i did try yesterday or so
autrijus that's line 3 01:37
clkao and it hates me for some reasons
autrijus ok. let me do keys as an example...
wait...
...done.
clkao i have tests
autrijus hm, we didn't handle multiple return values from p5 side 01:38
clkao no. not yet
how is that suppsoed to be handled?
autrijus it's supposed to be cased from multiple SV 01:39
clkao because you are getting a sv from perl5_apply
autrijus into a VList that contains those SVs
or you can return a SvAV
and I can detect SvAVness and cast it to VList
clkao ok..
autrijus that is perhaps easiest
anyway I've checked in a stub 01:40
r4084
(untested!)
but that should give you an idea 01:41
clkao hm wit pugs_apply is returning a single sv.
autrijus right, so if I have multiple returns, it will be a SV that is a ref to a VList 01:42
clkao ok
autrijus I think we should also cast that to SvAV
so you can analyse that
and promot it to multiple XSRETURN
there can be other strategies, but I think the SvAV/VList duality is fine
clkao returning with av in perl5_apply done 01:47
svnbot6 r4084, autrijus++ | * first cut at $hash.keys for perl5.
clkao ?? 01:48
Warning: ignoring unrecognised input `-Wl,-R/usr/local/lib/perl5/5.8.5/mach/CORE' 01:49
it was working yesterday
it's in compile.pugs 01:54
summon SamB 01:55
SamB what? 01:56
did I break something?
clkao ya, revert pugscompile/pugs to r4077 works 01:58
pugs_embed=perl5 build.
SamB how can Pugs.Compile.Pugs be considered to work in the first place when it emits "<ref>" all over the place? 01:59
or is that a compile error? 02:01
clkao compile error
it tries to link things
SamB maybe nobody else used a Template Haskell splice before? 02:02
clkao and can't parse the additional linker flag
meppl gute nacht
SamB let me reconfigure then...
clkao autrijus: still: 02:03
*** Not a keyed reference: PerlSV 0x083a9934
SamB okay, how do I turn on Perl 5 embedding?
autrijus clkao: right, have to implement doHash 02:04
hmm no
SamB oh, I see..
autrijus ah it's in Keyed
Prims.Keyed 02:05
SamB had been expecting a --flag, and tried perl Makefile.PL --help...
autrijus clkao: fixed (still untested) 02:07
SamB rebuilds...
clkao i have the tests 02:08
SamB where does it get that -Wl, flag?
clkao SamB: from extutils::embed. 02:10
during makeifle.pl when pugs_embed=perl5
SamB clkao: are you on windows or something? you seem to be case insensitive. I suppose your shift key could be broken...
clkao SamB: freebsd 02:11
i am just trying to help my wrists 02:12
sorry if that bothers you
svnbot6 r4085, autrijus++ | * add PerlSV to keysFromVal
r4086, clkao++ | Make multiple returned value into AV for perl5_apply.
SamB mine has a different problem...
Dynamic linker error message was: 02:13
/usr/lib/libpthread.so: invalid ELF header
Whilst trying to load: (dynamic) pthread
apparantly my /usr/lib/libpthread.so is a linker script 02:15
autrijus: what to do, what to do.
TH splices totally wedge with perl5 embedding... 02:16
in at least two different ways
no wait, did I even commit that part...
okay, yes, I did. 02:17
autrijus SamB: ok, so it isn't a bug. :-/ 02:19
I don't really know how to solve this either.
clkao autrijus: tests committed 02:20
autrijus cool 02:21
SamB wishes Makefile.PL did not trigger buggy syntax highlighting in Emacs... 02:22
svnbot6 r4087, clkao++ | Roundtrip tests for hash and array. 02:24
SamB is there another way to spell s{([\\"'])}{\\$1}g; which might not confuse emacs? 02:25
mauke huhu, time to switch to vim? 02:26
you can replace the { }{ } by almost anything
s|([\\"'])|\\$1|g; for example 02:27
theorbtw1 Are you using perl mode, or cperl mode?
SamB hmm, I think it is the quotation marks that confuse it...
theorbtw1: my status line says (Perl)
mauke doesn't it recognize the s as metaquoting operator?
theorbtw1 M-x cperl-mode, then.
02:28 theorbtw1 is now known as theorbtwo
theorbtwo cperl mode is generally much smarter. 02:28
SamB wow, crazy-looking!
but it does seem better.
theorbtwo Yes, somewhat sadly they have sepperate configuration.
...and some of cperl mode's default faces are rather silly. 02:29
(Bold for arrays? Who thought of that?)
SamB although now half the file looks like it is in a comment, only things are highlighted anyway... 02:30
I guess I should learn vi-style and use Yi, once it actually works.
that is, if it is actually possible to parse perl.
mauke it isn't (without actually executing code)
wolverian Yi?
SamB wolverian: a text editor being written in Haskell which is intended to do syntactical highlighting, among other things 02:31
as opposed to regexp-based highlighting 02:32
wolverian heh. syntax highlighting with side effects!
(in perl, anyway, by necessity.)
SamB that is crazy...
mauke only perl can parse Perl
wolverian although with perl6's grammars being visible to everyone, it's possible to at least ensure grammatical correctness 02:34
theorbtwo SamB: I thought people were working on an emacsish mode?
SamB theorbtwo: true
I guess that might actually work now
theorbtwo SamB: Makefile.PL is a hard case, since it is half-make and half-perl. 02:35
SamB last time I actually touched it I had to add deletion
theorbtwo The things that look like comments are probably really big strings.
svnbot6 r4088, clkao++ | First cut perl5/README.
SamB maybe I should use notepad, I think Wine has one ;-)
huh, WINE's notepad is flickery 02:37
making /usr/lib/libpthread.so a linker script is a nasty hack... 02:40
theorbtwo Oooh. So it is. That's a nifty, and ugly, hack. 02:41
I'd almost rather have seen a proprihetary ELF extension.
SamB yeah, that would have been easier for GHC to deal with ;-) 02:42
though GNU or somebody would no doubt object to the use of the term "proprietary"...
theorbtwo Probably. 02:43
IIRC, though, pthreads needs compiler-level support to be useful anyway. 02:44
SamB well, it has that from GCC.
though how well perl5 threading would interact with GHC's runtime is beyond me 02:45
theorbtwo Doesn't it get /usr/lib/libpthred.so.0 by the time it sees it?
How ithreads does anything is more or less beyond me.
SamB not if it starts GHCi internalyl to handle a TH splice
depending what it you meant
theorbtwo (BTW: you shouldn't say perl5 threading, since there have been two very different threading models during 5's time -- 5005threads and ithreads. 5005threads are obsolete, though.) 02:47
SamB well, I really meant pthread threading...
theorbtwo Hm, I could have sworn that ithreads on linux didn't use libphread, but I appear to be wrong. 02:49
That's a versioned depend, so I don't see why you're getting pthread.so and not pthread.so.0 02:50
SamB theorbtwo: hey, me neither. there is probably a lot of perl code to see through, too... 02:51
theorbtwo Are you sure it comes from the p5 side? 02:52
SamB why would clkao have had that problem with '-Wl,...' if it came from GHC-land? 02:53
theorbtwo Oh!
SamB also, why would it be in the makefile?
theorbtwo It's probably from Config.pm. 02:54
SamB yeah
if ($ENV{PUGS_EMBED} and $ENV{PUGS_EMBED} =~ /\bperl5\b/i) { 02:55
push @prereqs, "src/perl5/perl5.o";
$ghc_output .= " src/perl5/perl5.o ";
$ghc_flags .= " -DPUGS_HAVE_PERL5 ";
my $flags = "$Config{ccflags} $Config{ccdlflags}";
theorbtwo shrugs. 02:57
p5 embedding won't build for me at all.
SamB wonders why cpp doesn't throw a fit over #endiff, only over the unterminated #ifdef 02:58
Khisanth hmm apparently it won't for me either, seems to be a problem with libpthread.so
theorbtwo Khisanth: You probably have ethe same problem as clkao, then.
SamB lets see if it actually will build at all here anyway?
theorbtwo I haven't tried it in a while, so trying again. 02:59
Khisanth actually why the heck is libpthread involved? the Makefile.PL output said it wasn't building with threads
theorbtwo Yep, same as before.
SamB Khisanth: oh?
Khisanth *** Thread support disabled because you are building with embedded perl5 and your perl5 is not threaded. 03:00
theorbtwo Odd.
Khisanth or is that just for p5 embedding?
DynaLoader.a is unrecognized 03:01
SamB okay, I committed that quick fix, what happened to svnbot6 ? 03:02
svnbot6 r4089, scook0++ | #ifndef'd out some TH code for Haddock
theorbtwo SamB: Lag. 03:03
SamB why is svnbot6 more lagged than I am?
theorbtwo Because it only checks for changes every so often.
SamB oh
Khisanth how much memory does the linking step for pugs require anyway? 03:05
SamB wait, my commit failed anyway... 03:06
autrijus SamB: I see. your splicing happens at compile time 03:07
because you use $() as outer quote
SamB: please refactor to use [||] as outer quote 03:08
so that the rest of us can have libperl linked in again
SamB autrijus: wouldn't it take a bit more than refactoring?
I'm just punting and using show when PUGS_HAVE_PERL5 is set
clkao autrijus: kill perl5/README todos 03:09
or push items there
autrijus SamB: ok... if that is the case, test for
PUGS_HAVE_PARROT
PUGS_HAVE_PERL5
or
not PUGS_HAVE_TH
in either of the three cases, fallback to show
SamB also HADDOCK? 03:12
theorbtwo SamB: You don't need code at all in the HADDOCK case, but feel free to provide any code that isn't TH. 03:13
autrijus that too
indeed
SamB theorbtwo: hey, if I have a big long #if line, one more clause in the condition is no trouble
theorbtwo Right. 03:14
Also, haddock chokes on the TH syntax.
SamB yeah, thats why my commit failed 03:15
theorbtwo haddock could really do with a refactor so that it's part of ghc, but that's not really in our scope.
SamB uh, that sounds kind of scary.
theorbtwo It means that haddock stays in sync with ghc's syntax additions. 03:16
It also means that it can resolve types without explicit signatures.
SamB well true.
but then we might start seeing 'forall a b. ...' in haddock docs for things compiled with -fglasgow-exts! 03:17
svnbot6 r4090, SamB++ | More work + quick fix for TH/perl5 embedding conflict in Pugs.Compile.Pugs 03:23
SamB okay, now I want to know why I don't have PUGS_HAVE_TH defined... 03:33
autrijus SamB: it tries to compile 03:37
if you have hs-plugins that is recent enough (from darcs repo)
then it will persumably compile
SamB which tries?
autrijus SamB: makefile.pl line 85 03:39
SamB oh, that works fine. 03:40
its PUGS_HAVE_TH that I want to know about
SamB had already updated to build lambdabot 03:41
there is no mention of PUGS_HAVE_TH in the entire file... 03:42
autrijus right
it's in util/config_h.pl
and it should be unified now
it tries to compile
{-# OPTIONS_GHC -fth #-}
main :: (Monad m) => m ()
main = $([| return () |])
SamB this is worse than Forth! 03:44
(at least in forth you EXPECT words to parse input)
now I see what you guys mean about only perl being able to parse Perl... 03:45
theorbtwo (In soviet forth, input parses words?)
Well, not quite you don't. 03:46
SamB oh?
theorbtwo You see that it is hard. You don't yet see that it is impossible.
SamB if an arbitrary function like try_compile can do it, why not anything else?
or is that from the <<?
theorbtwo The easiest one to see is (cpp-style) macros. 03:48
SamB I guess it is from the <<...
theorbtwo (Source filters in perl5.) 03:49
You can create a macro that feeds back at compile time, so the only way to parse any code after the declaration of the macro involves running the macro. 03:50
The macro is, of course, perl code.
So in order to parse, you must run at compile time.
Scary, no? 03:51
SamB with TH you can at least PARSE without running code at compile-time...
mauke BEGIN { *foo = rand() < .5 ? sub {1} : sub () {2} } foo /3;#/; print "this is even scarier";
SamB is Perl 6 any better?
theorbtwo SamB: Possibly worse. 03:52
SamB figures.
theorbtwo Source filters in perl5 were considered ugly hacks. In perl6, they are much more reasonable to use.
In either case, though, you'll likely not see them used much to create nonbalenced syntatic constructs.
(There's a similar problem with C and CPP. 03:53
You don't see macros like #define FOO ) much, though... and when you do, you expect the syntax hilighter to mess up.
SamB at least cpp doesn't include a way to do 'rm -rf ~'...
theorbtwo This is true. 03:54
SamB which is likely to be scarier than 'rm -rf /'
theorbtwo OTOH, it also doesn't have a way to make it possible to include arbitrary unicode chars in your code by writing U+.
Or gzip-encoding your script. 03:55
(Both of which are not just possible, but easy, in p5.)
Khisanth rm -rf / should include ~ 03:58
theorbtwo Yes, Khisanth, but might die before then.
Khisanth I think I did that once ... 03:59
SamB rm -rf / will only work as root, period... 04:00
Khisanth I'll take your word for it :)
theorbtwo It might do some damage first if you run it as some other user with write access to /bin (generally alpha first).
Hm, I need to write a program named simple light user tty at some point. 04:01
SamB huh? wouldn't it stop upon noticing that / was root.root 0755? 04:02
theorbtwo On some systems /root is 775 root.wheel.
So it'd delete the contents of /bin before trying to do anything that it couldn't do, if run as a member of wheel. 04:03
Hm, should get in the habit of saying root:wheel.
SamB why the colon?
theorbtwo . is depreciated there -- it's a legal, if strange, char for usernames and groups in POSIX. 04:06
SamB does not have POSIXLY_CORRECT in his environment... 04:07
can we get a lambdabot in here? 04:08
theorbtwo We do, sometimes.
It gets annoying when talking about arrays, however.
SamB oh
oh yes
jdv79 is hs-plugins required for embe3dding parrot or perl5?
SamB maybe you could customize it to use a different sigil for commands ? 04:09
such as \
nah.
\foo
well it could work...
theorbtwo The problem is that perl has stolen every metacharacter available on a en-us keyboard, and some that aren't available.
Could make it not respond "I don't know that command", though. 04:10
SamB definately
or it could be modified to only accept commands after its name 04:11
04:58 wolv is now known as wolverian
sri_ my Int $foo = 1; $foo.bar; sub bar { say 'lalala' } # is it right that this works? 05:48
scook0 sri_: what does it do? 05:53
sri_ says lalala :) 05:54
scook0 I can't imagine that being correct 05:55
SamB !eval my Int $foo = 1; $foo.bar; sub bar { say 'lalala' } # is it right that this works?
scook0 which bit are you worried about--the fact that it allows the call before the sub declaration, or the fact that the sub is accepting arguments that it shouldn't be? 05:58
sri_ does that matter? 05:59
Khisanth how about the fact that you can call a method at all?
scook0 I think we can safely say that /something/ is comprehensively broken...
that code should be failing for 3 separate reasons then 06:00
Mind you, using a sub before it's declared might not be an error...not sure 06:01
because the declarations get processed at compile-time anyway, so by the time the code is actually run, bar is already declared
it's just a matter of whether it should be in scope or not
eric256 ?eval my $x = 1; given $x { when Int { say "Hello" } }; 07:00
opps evalbot seems to be gone for now...
Aankhen`` Heh.
eric256 when Foo {}; # still appears to need to be written as when (Foo) {} 07:20
nothingmuch morning 07:22
eric256 morning
svnbot6 r4091, eric256++ | wizard.p6 using the new features that have been added 07:41
08:41 Aankh|Clone is now known as Aankhen``
lathos Can you add methods to anonymous classes? 08:50
Ah, not yet, anyway. 08:52
sri_ dammit, traits are also marked as todo feature :/ 09:04
and i have to explicitly use classes before using them in class traits 09:07
use Cat6; class MyApp is Cat6; # a bit ugly 09:08
lathos Yeah, that's how Maypole is looking at the moment. 09:11
Once we have anonymous classes, the subclassing works fine, though.
sri_ wish my haskell skills were better... :) 09:15
lathos I only want better haskell skills if I could also have thirty extra hours in a week... 09:16
sri_ i heared modafinil works wonders 09:19
09:44 Aankh|Clone is now known as Aankhen``
broquaint Urk, parse errors are hard to track down :/ 10:32
Juerd broquaint: comment... 10:45
broquaint When there's a parse error within a function it reports the error as occuring at the line of the declaration of the function. 10:46
function/anonymous sub etc
Which can be tricky when it's a big sub (am translating some of the HOP code presently).
Juerd Yes 10:50
Then, commenting out bits until it no longer errors helps
When it no longer errors, start removing comments 10:51
It's tedious.
broquaint Yep. That's pretty much what I've done, but it's only been the once so far (small functions++)
Sub prototypes are so nice, so very nice. 10:53
jql indeed 10:54
broquaint The topic variable in for loops is implicitly lexical, right? 10:56
jql yes 10:57
broquaint Good, good.
Is 'g' magical? pugs -e 'sub g { say $_ } sub f { temp $_ = q[in f]; say $_; g() } $_ = q[main]; say $_; f;' # No compatible subroutine found: "&g" 11:24
Or, even, why isn't g() found?
It doesn't matter what the subname is. 11:25
Juerd Sounds like a bug
Is this the minimal case example?
Note by the way that $_ is lexical in Perl 6, not global. 11:26
broquaint pugs -e 'sub f { say $_ } $_ = q[main]; say $_; f();'
pugs -e 'sub f { say $_ } f();'
The $_ seems to mix things up.
Without $_ it works fine. 11:27
revdiablo it seems $_ becomes part of the argument list implicitly 11:31
and since f() has no args, it doesn't match
integral isn't that how: map:{ $_ * 2 } <== ... works?
revdiablo pugs -e 'sub f { say $_ } f("test");' # this works 11:32
hmm, mixing $_ and $^X in one block seems to work, but I wonder if it's a good idea 11:34
e.g. pugs -e 'sub f { say $_, $^a, $^b } f("test", "foo", "bar");' 11:35
broquaint What does the C-style for loop look like in perl6? 11:36
revdiablo my $x; loop $x = 1; $x < 5; $x++ { say $x } 11:37
broquaint Funky.
revdiablo parentheses may be common for that :) 11:38
broquaint Thanks, revdiablo :)
It does look a little odd.
revdiablo no problem
yeah, using it as loop (..;..;..) {} looks better
svnbot6 r4092, iblech++ | * Usual svn properties 12:16
r4092, iblech++ | * src/perl5/README -- More PODification and spelling fixes
Juerd broquaint: It looks odd, because C-style fors are unperlish by definition. 12:30
svnbot6 r4093, iblech++ | Pugs.Compile.Pugs -- Add more #ifs to silence warnings about unused functions.
Juerd broquaint: { init; { ...; incr; cond and redo; } } 12:31
nothingmuch "Here's what's going on: The IO Monad binds blah blah blah that's all in the other tutorials and yet you're reading this. Let's try again."
cute =)
Juerd You're almost always better off with foreach or while, anyway.
Do note that we have 2..10 :by(2) now :) 12:32
(Doesn't work yet)
meppl guten morgen 12:54
svnbot6 r4094, Aankhen++ | * slight modification to tests for HTTP::Headers::Util.
iblech Morgen :) 12:55
meppl good morning iblech
stevan autrijus: I will start the changelog in a hour or so 13:28
stevan has a feeling this is going to be the longest one so far
autrijus stevan: as always. 13:32
stevan :)
autrijus mumbles something about acceleration and singularity
stevan++
stevan autrijus++
stevan is off to buy some food, bbiab & 13:33
scook0 autrijus: I think the change from (list-of-invocants) to (Maybe explicit-invocant) has left stuff subtly broken 13:34
well, I must go...bye 13:38
clkao mumbles something about membling
autrijus: when do you depart? 13:39
autrijus clkao: 7th of June 13:40
Aankhen`` For?
clkao ok
autrijus wonders what "subtly broken" mean 13:41
Aankhen``: Vienna
Aankhen`` Ah.
Holiday? Permanently moving?
clkao Aankhen``: what do you think? hacking of course
Aankhen`` tries to wrap his brain around that.
autrijus Aankhen``: Austrian Parrot/Pugs hackathon
Aankhen`` Ahh. 13:42
Kewles.
Kewlies, even.
autrijus (with a workshop and JA*H contest thrown in)
knewt are these errors expected right now? 14:33
pugs> "abc" ~~ /<alpha>+/
*** Cannot parse PGE: <alpha>+
*** Error: Name 'alpha' not found
pugs> pugs> "abc" ~~ /<+alpha>+/
*** Cannot parse PGE: <+alpha>+
*** Error: PGE Parse error: invalid subrule name at offset 1 (found <<+>>)
iblech PGE doesn't support these yet, I think 14:34
knewt this is the latest parrot trunk, with the pge from that copied across into the latest pugs trunk 14:35
also, just to check, are 4 subtest failures in t/rules/from_perl6_rules/capture.t currently expected? 14:36
hmm, 10 subtests unexpectedly succeeded in my test run :) 14:37
autrijus knewt: itym <[alpha]> 14:38
<-[alpha]>
etc.
iblech I thought Larry changed this, so the brackets are not longe needed? Not sure though
autrijus that is still being debated 14:39
but that's the way it is in pge anyway
(at least this moment)
iblech knewt: Here, with not-so-latest Parrot, all tests successful, 41/65 TODO
Ah, ok
autrijus knewt: please unTODO those unexpected successes. :)
knewt: capture.t is all okay for me 14:40
using old pge
knewt autrijus: i was just following the stuff in docs/quickref/rules re <alpha>
autrijus knewt: nod. maybe fix the quickref to mention the status in pge?
(or ask on p6c)
knewt which says the <[alpha]> would match one of a, l, p, h or a
autrijus ahh.
knewt s/ or a// 14:41
autrijus then maybe I'm borked.
indeed.
sorry, I'm teh borked. you are correct.
so it boils down to a set of default named rules that pugs has to supply pge with.
care to add definitions at quickref? 14:42
i.e. in the line of <alpha>
knewt i'll take a look, see if i can figure out what/where is needed
autrijus add another line that says <[a-zA-Z]>
(that is of course not unicode-correct, but neither is pge for now) 14:43
thanks. I'll bbiab
&
knewt iblech: my test failures from capture.t are nos 61-65 14:44
ah, and there's a nice comment above where it starts failing with [[ # FIXME parsefail ]] 14:45
iblech Here: 61-65 TODO fail, with the exception of 63, which is ok 14:47
knewt anyone here a channel operator? 14:53
meh, never mind for now. i'll just paste the nopaste url myself 14:55
iblech: nopaste.snit.ch:8002/2748 # the end of my capture.t run
iblech Hm, mine finishes cleanly 14:57
knewt must be the updated pge
iblech Yep
hcchien weird, the chomp doesn't work well for me. 15:03
svnbot6 r4095, iblech++ | unTODOs.
knewt re the message about chomp that was sent to p6c earlier, it being and error, and the error being what is reported, feels right to me, but i'm not up on perl6 semantics, so have for loop semantics changed p5->p6 ? 15:10
s/and error/an error/
back to rules, where in the pugs source would i add default named rules? 15:11
iblech I think a "is rw" is needed, but that might still not work, as he tries to chomp a constant, not sure...
knewt because in perl5, a for loop aliases to the items. does perl6 still do that, in which case the error is correct? 15:13
iblech Yes. But by default, the aliases are readonly. To get a r/w alias, one has to write: for ... -> $foo is rw {...} 15:14
knewt a chomp variant that doesn't affect the original variable, but returns ($chomped, $what_was_chomped) might be nice
iblech IIRC Juerd has proposed this (I like it) 15:15
knewt or maybe instead of a variant, alway returning ($what_was_chomped, $chomped), and have a flag to say whether or not to alter the original variable 15:17
s/alway returning/always return/ 15:18
theorbtwo nothingmu!
eric256 can i override FETCH for an object? 15:19
iblech my $proxy_object := new Proxy: FETCH => {...} # do you mean that? 15:20
eric256 i think maybe sort of,but i don't understand why it is a proxy? should my class inherit from Proxy and then define its own fetch? i want to make a range class that when fetched in scalar context returns a random number in the range 15:21
iblech Ah, I unterstand... Use:
knewt grr. still can't figure out where to add default rules. gah. me-- 15:22
iblech class MyClass { method *prefix:<+> { ...return a random number... } } # But this'll only ret a random number in *numeric* context
eric256 oh that is an interseting idea... i was approaching it from a different angle. i think that will work though. 15:23
iblech :)
Aankhen`` Is * supposed to completely flatten arrays, or just one level? 15:25
iblech *IIRC*, only one level. Not sure, though
Aankhen`` I think so too.
Hrm.
integral isn't ** the super-flatten that does all levels? 15:26
Aankhen`` No, I believe ** is for when you want it to be flattened immediately and not lazily.
iblech Right.
integral ah
Aankhen`` Well, Pugs is flattening all levels. 15:27
Aankhen`` goes to check AES.
iblech No: 15:28
pugs> *(1, [2,[3,[4,5]]]).perl
('(1, [2, [3, [4, 5]]])')
Aankhen`` pugs> *([(1, 2), (3, 4)]).perl
('[1, 2, 3, 4]')
Am I missing something?
iblech The ()s inside the [] don't construct a list
They just group 15:29
Aankhen`` Ah.
eric256 hmmm. i'm getting NaN ?
iblech (At least I think that's the correct explanation -- ask Juerd to be sure :))
Aankhen`` Heh.
iblech eric256: IIRC this is not yet implemented in Pugs. Try: multi sub *prefix:<+>(YourClass $self) { $self.get_random_number } 15:30
This should have the same effect
Aankhen`` What about: multi sub *coerce:<as> (::?CLASS $self, Num ::to) { $self.get_random_number; } 15:31
eric256 iblech: that is what i did.
iblech Aankhen``: That should work, too, I think, but is definitely not yet implemented 15:32
Aankhen`` Heh.
eric256 hmm. my overridden methods aren't getting called at all.
i wonder if thats not implemented for classes yet 15:33
from the tests it looks like those aren't implemented yet 15:35
i wanted to make a 'd' operator that creates a dice roll and overload it so you could do Monster.new(:damage(5d6 + 5)) ;) 15:37
Aankhen`` That'd be cool. ^_^ 15:38
iblech sub infix:<d>(Int $a, Int $b) { ... } should work
eric256 yea that part works fine.
but i want it to act just like a number so inside the Monster class you just do return $.damage and it then rolls 5 6sided dice and adds five to the answer. 15:39
iblech Ah, yes 15:40
You might be able to fake it with lazy {...}
eric256 the 5d6 part i could fake with that. but i would need a class in order to overload + and - to behave right 15:41
interesting idea though. i'll play with that for now ;)
iblech (nothingmuch's lazy proposal)++ :) 15:42
Aankhen`` Use an accessor for $.damage? 15:43
svnbot6 r4096, iblech++ | t/operators/short_circuit.t -- EVALed some tests to make it parse again. 15:44
iblech That would still not make + and - work, I think
Aankhen`` Hrm, wait, that didn't make sense.
Aankhen`` takes it back.
Aankhen`` cries.
I spent all day -- and a large part of last night -- trying to debug HTTP::Headers::Util.
eric256 Aankhen yea i can do that. i'm just trying to make an object created with <d> that returns a random number in its range (well not range but you know) then it could be used anywhere (/me sees Aankhen`` understands now but i've already typed all this. ;) 15:45
Aankhen`` A few minutes ago, out of curiosity, I combined a couple of function calls which I had split into two for debugging.
Voila! Everything works.
iblech :)
Aankhen`` I love having a large library of songs. 15:47
A couple weeks back, I added the entire thing to the playlist and shuffled it now.
Now I get to listen to new music everyday. :-) 15:48
eric256 lazy is cool! lol 15:49
svnbot6 r4097, Aankhen++ | * fixed HTTP::Headers::Util.
r4097, Aankhen++ | * fixed test scripts for aforementioned module.
r4098, iblech++ | Make operators/assign.t parse again, too.
r4099, iblech++ | t/pugsrun/10-dash-uppercase-m.t -- Hmm... nothingmuch++'s OSX smoke lists this
r4099, iblech++ | test as skipped, this commit should fix that.
Aankhen`` You know what would be nice? 15:51
A couple new sub traits: `is unimplemented` and `is deprecated`.
`is unimplemented` could die (or raise an exception, if that functionality were in place) when the sub is called. 15:52
`is deprecated` could generate a warning (possibly one that could be turned off).
I guess `is unimplemented` might only be useful in terms of porting modules... `is deprecated` would probably be useful in general, though. 15:53
eric256 infix:<+> isn't dispatching based on the types it is expecting! 15:54
Aankhen`` What does the method look like?
eric256 is unimplemented could be good, but that is a mouth full to type ;)
svnbot6 r4100, iblech++ | examples/network/evalbot -- Added a README.
eric256 multi sub infix:<+> (Range $range, Int $inc) {
Aankhen`` I think you need `*infix:<+>`. 15:55
kelan Aankhen``: is unimplemented is written `...` such as: sub definedlater { ... }
Aankhen`` kelan >> Ah, thanks. I knew I was overlooking something.
kelan if you never gave a real definition, the sub would die when called
eric256 hmm that did make a difference. what does * mean?
Aankhen`` eric256 >> Makes it global in scope.
kelan or warn or raise an exception, i guess, depending on some other things i can't remember
Aankhen`` Otherwise that would only make a difference in the scope of your class, I think. 15:56
eric256 yea but its defined outside the class.
Aankhen`` Oughtn't it be inside it?
eric256 it wasn't working inside... and i didn't see any reason it shouldn't work outside
Aankhen`` I dunno. 15:57
"Global subroutines and variables are normally referred to by prefixing their identifier with *, but it may be omitted if the reference is unambiguous:"
eric256 looks like the scoping part is working but dispatch based on class type is not. 15:58
Aankhen`` Is `Range` a valid class in Pugs?
eric256 i defined it
Aankhen`` Ah. 15:59
It's visible in whatever scope the sub is in?
eric256 yea
guess i'll check back later and see if anyone has hacked it in...wish i knew haskel so i could do it ;) 16:00
Aankhen`` Heh.
eric256 i'm betting that method dispatching is a little beyond someone who can't even read haskel. ;) 16:01
Aankhen`` Looks like ... is unimplemented.
Talk about irony.
eric256 lol 16:02
iblech ;) But "..." should work, as does !!! and ???, last time I checked 16:03
Aankhen`` Remind me not to complain about things not being implemented when I'm tired. 16:04
iblech ;)
Aankhen`` gets back to HTTP::Message.
Would anyone happen to know what all this temp-ex-output and unlink-test-file and insanta and outsanta and golf* are about? 16:05
svnbot6 r4101, iblech++ | Updated examples/network/README.
r4102, autrijus++ | * Perl5Embed: .kv, .keys, .values, .pairs etc now works on Perl hashrefs.
Aankhen`` s/are/is/
mrborisguy was the default split taken out? i can't seem to do @arr = split $str; anymore. i thought calling this would split on spaces. 16:06
iblech Aankhen``: These are temporary files created by some tests, which aren't deleted, either because the test doesn't unlink() them or because the test dies
Aankhen`` Ah. 16:07
autrijus rehi! 16:09
iblech Hi :)
Aankhen`` Hiya autrijus.
autrijus so I checked in this 16:11
svn.perl.org/parrot/trunk/compilers...PGE/Hs.pir
svnbot6 r4103, iblech++ | examples/:
r4103, iblech++ | * Removed three svn:executables, as the rest of the examples aren't
r4103, iblech++ | executable, either (consistency...).
r4103, iblech++ | * Unified the shebang-line of examples/*.p6, too.
r4104, iblech++ | Add/change two shebang-lines of t/ to the default, too.
autrijus vgrep for "add_perl6_builtin_rules"
as a list of the builtin rules that's going to be supported
it's basically a series of add_rule calls 16:12
I wonder if it can be derived from docs/quickref/rules somehow.
clkao autrijus: want to fix keys for p5 returned hash? 16:13
autrijus ponders a bit... hmm also the <ident> definition there (from pmichaud's demo.pir) is different from quickref/rules
clkao: huh?
$ ./pugs -e 'say eval_perl5(q({1,2,3,4})).keys'
13
how is it broken?
are you using ancient pugs again? :) 16:14
Khisanth more than a minute old?
autrijus 9 minutes
clkao autrijus: gah did my test pass?
autrijus which test? 16:15
clkao roundtrip
autrijus: ok, it passes, now the next failed one 16:16
knewt autrijus: if the builtin rules are added at the pge level, does that mean they won't turn up in the p6 global pad?
svnbot6 r4105, Aankhen++ | * moved tests from t/builtins/lists/enum.t to t/data_types/enum.t
r4105, Aankhen++ | * deleted t/builtins/lists/enum.t
autrijus knewt: that is an excellent question. 16:17
knewt: and you convinced me that it's a bad thing to do it at PGE level.
knewt: thanks, I'm reverting the parrot side things :)
knewt autrijus: i was looking around the pugs source, trying to figure out how to manually create a VRule
autrijus VRule $ MkRulePGE "<alpha>" False False 16:18
hcchien: bring p6 discussions here bah :p 16:19
(hcchien was saying that chomp($read) didn't chomp the scalar)
knewt ah, cool. i'm still very much un-knowing about the pugs source :)
stevan ok starting the changelog, wish me luck ;)
Aankhen`` GOOD LUCK STEVAN 16:20
clkao quick, more features while stevan is doing changelog!
Aankhen`` Uhmm.
autrijus stevan: good luck!
Aankhen`` Good luck, stevan
.
stevan clkao: it wouldn't be the first time :)
thank Aankhen`` :)
stevan looks for some good Changelog writing music first 16:21
Aankhen`` "The Times They Are A-Changing'"?
stevan :D
Aankhen`` :-)
hcchien irc.csie.org:8888/124
autrijus Aankhen++ 16:22
Aankhen`` What for?
autrijus the music :)
Aankhen`` Ah.
Thanks. :-)
autrijus hcchien: chomp() worksforme on STDIN... maybe the server is sending \r\n 16:23
hcchien: can you try printing the entire $read?
something like 16:24
say $read.split(rx//).map(&ord).join(' '); 16:25
hcchien does function length exist? :)
autrijus hcchien: yes, it's called .chars
but try using that say line above
hcchien ok, let me try it.
autrijus oh, you may need to use
rx:P5//
or rather, an empty string
say split('', $read).map(&ord).join(' '); 16:26
hcchien autrijus: "105 102 98 109 13" 16:27
for the input "ifbm\n"
autrijus aha. so there's a \r 16:29
iblech FWIW, Net::IRC currently uses a hack: 16:30
$line ~~ s:P5/[\015\012]*$//; # Hack to remove all "\r\n"s 16:31
autrijus hm it's because unlike perl5
ghc doesn't do eol translation for sockets
mrborisguy speaking of split... for some reason i remember there being a default split that split on whitespace (ie "this that".split; would yield ("this","that") ). but obviously it's not anymore. am i imagining things? or was there something like this once? (not that "this that".split( /\s/ ) is that ugly)
svnbot6 r4106, iblech++ | Added a test for getc() (t/builtins/io/getc.t). 16:32
autrijus mrborisguy: I think it's just unimplemented. want to take a stab?
mrborisguy haskell? wouldn't have the foggiest idea where to start 16:33
but it is in the language?
autrijus not sure. I think it's useful
hcchien autrijus: so I should parse it manually?
Orkun_TR perl 6 is out ? :P 16:34
autrijus hcchien: try using what iblech uses
mrborisguy i guess i wonder if split should default as .split( /\s/ ) or .split( /,/ )
hcchien autrijus: sure, it works. just make sure will pugs offer the eol translation. 16:36
autrijus hcchien: I'm not sure about it at all 16:37
iblech: you think it's sane to make getLine kill trailing \r ?
Orkun_TR: well, a preview is
mrborisguy: well, can you help editing docs/AES/S29draft? 16:38
mrborisguy sure
i'll take a look
autrijus mrborisguy: add the correct forms of split
iblech Hmm... I'd rather see a layered IO system eventually. But for now, I think people can s/// away the \r\ns manually.
autrijus okay then. 16:39
mrborisguy: unary split is implemented. tests and docs welcom
mrborisguy autrijus: i have an account on Juerd's feather server... do I still need to use svn to get it in my account, or is there a default place i can edit it.
gaal say, shouldn't $?PUGS_VERSION be renamed to $?PERL_VERSION ? that way code that uses it still works when run under the official perl :) 16:41
autrijus
mrborisguy: see topic 16:42
the url on the topics that is
mrborisguy noted
svnbot6 r4107, autrijus++ | * minor style cleanup on roundtrip.t 16:43
r4108, autrijus++ | * Unary split() is now a synonym of Haskell's "words".
r4109, gaal++ | fix Prim signatures for open and openFile 17:01
r4110, iblech++ | * Added a test testing Pugs' safemode (t/pugsrun/11-safemode.t).
r4110, iblech++ | * Added "ignore_errors_please" to t/builtins/system.t.
r4111, iblech++ | * Moved some builtins/ tests to builtins/io/. 17:08
r4111, iblech++ | * Moved some other builtins/ tests to new dir builtins/control_flow.
r4111, iblech++ | * Moved even other builtins/ tests to new dir builtins/bool.
r4112, iblech++ | More test suite cleanup -- remove svn:executable from four test scripts.
knewt autrijus: is there any way to dump the contents of the globals table? from a haskell point of view 17:17
autrijus knewt: sure... 17:19
print =<< askGlobal 17:20
what do you need that for?
knewt well, i'm managing to get something into the globals table (i think), but it's not being picked up so i want to find out exactly what it was i managed to put in there 17:21
svnbot6 r4113, iblech++ | ext/Benchmark/t/basic.t -- Reduced the number of runs so one doesn't think the test hangs. 17:25
autrijus evalExp $ Sym SGlobal "<*ident" (Syn ":=" [Var "<*ident", Val (VRule ...)]) 17:27
err
evalExp $ Sym SGlobal "<ident" (Syn ":=" [Var "<ident", Val (VRule ...)])
that's an example of adding a subrule
the "<" should really be "<*". fixing
but that's the general idea of adding something to global
obra autrijus: how close is 6.28? 17:28
autrijus obra: another month
obra nids
autrijus then 6.285 may be almost free
obra nods
iblech s/6.285/6.283/? 17:29
autrijus yeah
obra how up to date is PA01? 17:30
svnbot6 r4114, autrijus++ | * global named rules should use `<*foo` in the global pad,
r4114, autrijus++ | not `<foo`.
autrijus obra: almost obsolete by now ;) 17:31
stevan autrijus: the ChangeLog is done, 17:32
however it is not as long as I thought it would be
autrijus ?eval "stevan++" xx 3
oh, evalbot not here
stevan so i am worried i missed something
:)
autrijus hm, I think there's some more bugfixes 17:33
I'll take a look in a bit
stevan ok
autrijus <- still struggling with this Academic Paper Format thing
stevan bugfixes are hard to figure out sometimes, I can't always tell if they are 6.2.5 bugs or post-6.2.5 bugfixes :)
autrijus I'm thinking I should give up any pretense of knowing how to write it, and submit my paper as if it's a TPJ article 17:34
stevan autrijus: yuk, nothing worse than Academic Paper formatting stuff
autrijus: in POD :)
autrijus exactly ;)
knewt autrijus: ah, ok. i was trying to add it to the call to emptyEnv within prepareEnv :/ 17:35
stevan autrijus: sometimes next week i will commit my perl5 meta-model stuff
svnbot6 r4115, Stevan++ | ChangeLog for 6.2.6
stevan actually, its a perl5 implemenation of the perl6 meta-model :) 17:36
I might actually make it into a CPAN module too 17:37
so I can use Perl6-like classes in perl5 :)
nothingmuch_ phew! 17:38
autrijus stevan: good :)
nothingmuch_ just road all the way to work 17:39
stevan nothingmuch_: to work??
autrijus knewt: oh... what are you trying to add? the global rules?
nothingmuch_ if google maps showed israel I could show off
geographically
knewt autrijus: yeah
nothingmuch_ i didn
't go to work now
which means if i leave home at 5:30-6:00 am i can get there before 8
it's 20:39
but i got there
shower, eat
and then work with my brain saturated with oxygen 17:40
autrijus knewt: then just newScalar (VRule...)
and put them into "<*foo"
knewt autrijus: i'm still in the "pretty much guesswork" stage of working with pugs source
nothingmuch_ plus i stay in shape
autrijus in the genSym below
nothingmuch_ and I have fun
autrijus and try it out with "xx" ~~ /<foo>/
be sure to sync up my change of adding the * twigil too
svnbot6 r4116, iblech++ | ChangeLog -- s/\.$//
r4117, iblech++ | ext/Set -- Fix basic.t, operations.t, and hash.t. Set is now "All tests
r4117, iblech++ | successful".
r4118, iblech++ | ext/CGI -- UnTODO a header.t test. CGI is now 100% successful, too.
iblech Ok, all ext/ modules pass all tests, here 17:41
stevan iblech++ # preflighting early :) 17:42
nothingmuch_ iblech++; # i've heard of DECAFBAD but not of DEADBEEF
knewt DEADBEEF is quite common i thought 17:43
iblech will be away the next week (school visit of our capital), so I want to use the last few hours :)
iblech didn't know DECAFBAD ;) 17:44
nothingmuch_ wow, a chance to catch up with iblech's karma =)
iblech ;) 17:45
stevan :D
nothingmuch_ anyway, shower time
too bad we're going to miss you iblech
hope you come back extra motivated
stevan he will have Pugs withdrawl
iblech Yeah... :( 17:46
autrijus iblech++ 17:51
iblech++ # take care, we'll miss ya
you can take svk with you...
iblech No internet, no laptop :/ 17:52
stevan iblech: I have faith your will find a public terminal :) 17:54
ihb stevan: isn't there a Perl6 class module on CPAN already?
iblech I hope so, too :) But we won't have much time
SamB has anyone tried building with perl5 embedding off after building with it on? I've been having trouble with that, even after make clean...
iblech That reminds me of a holiday in a small town in France, we asked in a restaurant: "Do you know whether there's an Internet cafe here?" -- "Um, sorry, we only have Sprite, Fanta..." *sigh* 17:56
stevan ihb: yes there is, but that is different then what i am talking about 17:57
ihb stevan: what's it called so i can check it out when it's released?
stevan ihb: it allows you to write perl6 code, and use it as perl5 object
ihb: no idea yet :)
ihb: I will likely put it in the pugs tree at some point
ihb: it is a meta-meta-model, so it's a little "weird" 17:58
however it does make semi-working classes with no symbol table mangling :) 17:59
ihb stevan: does it rely on AUTOLOAD then? 18:03
stevan ihb: yes, but only as a gateway to the invoke_method() on the MetaClass
ihb ah, so stuff like NEXT works. 18:04
stevan these classes are interpreter level things, so normally the AUTOLOAD junk would never be needed
autrijus SamB: try nuking src/perl5/perl5.o and src/*/Perl5.o
stevan ihb: even better, it will have perl6 style method dispatching (see A/S12) 18:05
ihb: but thats what I am working on now so it doesnt work yet :)
ihb stevan: ok.
robkinyon stevan: ping 18:06
stevan robkinyon: pong
ihb stevan: i haven't designed MI OO classes, so i don't know what i'm talking about, but people tend to not like MI. Some says it solves problems, some say those problems aren't real problems but just consequences of bad designs. i guess my question is: the Perl 6 things: do they solve real problems, or the symptoms of bad design? :-)
stevan ihb: do you mean Roles? 18:07
ihb: I think roles are a great alternative to MI
robkinyon MI tends to solve problems that roles/mixins are a better match
(But, then again, roles/mixins are sometimes viewed as an alternative to classes in general.) 18:08
stevan ideally the language is SI and has something like roles to get the benefits of MI without the pain :)
svnbot6 r4119, autrijus++ | * add src/perl5/*.o etc to "make clean" targets.
robkinyon The prototypers (q.v. class::prototyped) are in this crowd
iblech Does somebody mind if I add ext/ to util/yaml_harness.pl?
stevan "grew up" on Javascript's prototyped OO model
robkinyon too
stevan I knew there was a reason I liked you robkinyon :) 18:09
robkinyon :-p
iblech adds ext/ to yaml_harness and waits for the next automated smoke :) 18:10
gaal when's the next release planned? 18:11
iblech: the safeMode patch makes use/require unsafe. is that's the way you envisioned it? 18:12
ihb stevan: no, i mean the new dispatch thingies.
iblech gaal: Yep. 18:13
svnbot6 r4120, iblech++ | util/yaml_harness.pl -- The ext/ modules should be tested, too.
stevan ihb: MI dispatch is (IMO) fairly simple, it's just very hard to "use"
but Roles have a clearly defined place in the dispatch order
basically IIRC its this: 18:14
search the local class
search the attached roles breadth first
iblech gaal: "Attackers" shouldn't see the error messages if a module can't be found etc. -- they could detect which files exist and which not, for example
stevan search the superclass heirarchy
this makes it easier to "see" where your method will dispatch to given multiple roles
Limbic_Region OT: is anyone familiar with a module that given a music CD UPC can gather info about the CD reliably ? 18:15
ihb stevan: btw, will we see any Learning Perl 6 or something like it anytime soon? 18:16
gaal iblech: i realize that; but doesn't that mean safe code can't use modules?
stevan ihb: ask merlyn :)
ihb stevan: he's the only one that can write books? ;-)
stevan ihb: to be honest, I think the language design needs to be finished first ;) 18:17
ihb stevan: yeah, but are there any plans on any learning material?
stevan ihb: there is the cookbook and quickref 18:18
but other than that I have no idea
I am sure chromatic would love to put some Perl6 articles onto perl.com though
iblech gaal: Yes. Idea: We unsafe use and require, but make sure only [\w0-9-etc.] are in the module name when running under safe mode 18:19
Limbic_Region brian d foy has been asking for p5 articles for TPR
err p6 even
the problem with writing learning material at this point is that the mass majority of people are not comfortable with a "living document" 18:20
gaal iblech, alternatively, is there any chance for lexical as opposed to dynamic safety?
i'm not sure what that means yet *g*, but something like 18:21
iblech gaal: Yeah, that'd be cool. Implement it? :)
gaal { use safe; eval $user_string; }
iblech Yep
gaal *no* explicit "no safe"
autrijus lexical safety is atomic{} :) 18:22
you can of course restrict access to op*
via some kind of masking
but the correct(tm) way is really getting runEvalSTM to work properly, and/or redefine liftIO to watch for safeness flag 18:23
gaal iblech, ext/ doesn't work well in the yaml harnes on win32, i'm investigating. 18:24
iblech gaal: Thanks :) I did a "glob 't/ ext/*/t'" to get the dirs to test, dunno why's that borken on win32 18:28
gaal oh, it globs all right
i think maybe it's my fault and i should have set PERL6LIB correctly
i keep forgetting, and set it to ext/Test/lib
however now i did 'nmake' and that triggered a 'clean', so i'm waiting for a full build :) 18:29
iblech Maybe we should $ENV{PERL6LIB} .= ":blib6/lib" in yaml_harness?
gaal probably! run-smoke used to do that. 18:30
even:
= "blib6/lib:$ENV{PERL6LIB"
iblech Yep
iblech adds that to run-smoke
gaal except w/o my syntax errors
brb 18:31
iblech Done as of r4121 18:32
autrijus yay, finally got the outline in place. 18:33
svnbot6 r4121, iblech++ | * util/run-smoke.pl -- Add blib6/lib to %*ENV<PERL6LIB>.
r4121, iblech++ | * util/livecd/mklivecd.pl -- Adjust the initrd size.
autrijus # autrijus.org/tmp/pugs-paper.txt 18:35
autrijus ponders putting all 107 people in AUTHORS into acknowledgement
svnbot6 r4122, gaal++ | fix smoke on win32 18:45
r4123, iblech++ | util/run-smoke.pl -- qw<$ENV{PERL6LIB}> doesn't interpolate, fixed. 18:55
gaal eventually, we'll get this one right ;-)
iblech :D
gaal of course, i should have been using qw<< >> :-P 18:56
iblech Or even qwĀ«...Ā» ;) 18:57
gaal yeah!
gaal needs a decent editor for win32 that doesn't get confused by utf-8 18:58
vim very unfortunately does
iblech :set fileencoding=utf-8 # works here fine 18:59
Odin-LAP points in the general direction of emacs, before running.
gaal iblech, it almost works here. i dunno, maybe it's just the crummy windows terminal that's giving me grief.
Odin-LAP, :p 19:00
svnbot6 r4124, autrijus++ | * add lib imports to LKT tests so it still works when running 19:18
r4124, autrijus++ | as part of `make smoke` on pugs's base path. We may need a
r4124, autrijus++ | FindBin.pm soon...
gaal feather.perl6.nl/~gaal/smoke_xp.html 19:20
iblech Hm, Benchmark/t/basic.t is 100% ok here 19:21
The other ext/ failures are probably because of . not being ext/... 19:23
gaal iblech, prove -v says it threw an illegal division by zero. 19:24
iblech Maybe the test run too fast...
gaal maybe 100 is too fast?
heh
iblech Fixing Benchmark.pm
gaal yes, that was it. 19:25
500 works here, but it does make the test slower.
knewt ok, i've got most of the built-in rule assertions in now. a couple i can't get to work for some reason though. and my code is horrible, but i can't figure out how to move it out into a seperate function
svnbot6 r4125, iblech++ | Benchmark.pm -- Catch /0. 19:35
r4126, iblech++ | ext/{Test,Config-Tiny,Pod-Event-Parser} -- Hack to either chdir() or use lib
r4126, iblech++ | the correct directory, even when run from `make smoke`.
gaal hey, shouldn't 'while my $x = foo() { ... }' work? 19:48
iblech It should, but doesn't, as my() is currently only parsed on statement-level, not as part of an expression 19:51
gaal ah. thanks.
svnbot6 r4127, iblech++ | libwww-perl -- Modified @*INC to make headers-util.t work under `make smoke`, too. 20:16
Aankhen`` If I have a class property which I would usually mark as `is rw` and use a proxy in, and I need to store instance information in a property by that name, will one of the two clobber the other? 20:21
And if so, should I just, for example, call the method :foo and the property :_foo? 20:22
iblech I'm not sure I understood your question 100%, but I think so -- class methods/properties and instance methods/properties share one namespace
Aankhen`` OK. 20:23
iblech (But you could use multi sub/multi method tricks :))
pasteling "Aankhen``" at 203.101.5.82 pasted "Example class" (9 lines, 202B) at sial.org/pbot/10565 20:25
iblech E_INFINITE_LOOP
Aankhen`` (let's pretend that the data is massaged into some form or the other when storing it, and thus the Proxy is actually needed)
iblech s/$self.bar/$.bar/ 20:26
Aankhen`` That'd still access the instance variables?
Even though the invocant is aliased to $self in the signature?
iblech Yep. $.bar always refers to the $.bar of the invocant 20:27
No matter to what $self or $_ or whatever is set
Aankhen`` Ah, cool.
And if I were to use $self.bar, that'd call the method?
iblech yep 20:29
Aankhen`` Doesn't matter whether it's private, right?
I mean, I could s/\.bar/.:bar/ and not have trouble?
iblech thinks so 20:30
Aankhen`` OK.
iblech++ # for always being patient and answering my lamest question
s|$|s|
iblech Aankhen``++ # for asking the questions everybody wanted to ask but were afraid of :) 20:31
Aankhen`` :-D
svnbot6 r4128, iblech++ | lib/Perl6/Pugs.pm and lib/pugs.pm -- Little more PODification so the docs look 20:46
r4128, iblech++ | prettier on search.cpan.org.
r4129, iblech++ | lib/Inline/Pugs.pm -- Little more PODification to make it look better on 20:53
r4129, iblech++ | search.cpan.org (forget this one in my previous commit).
gaal bug: -- doesn't work on the pugs command line 20:54
./pugs -e 'say @ARGS' -version
iblech Ah... -version is eaten by pugs, so the -e-script doesn't see -version 20:56
gaal errrr 20:57
imean
-e 'say @ARGS' -- -version
pugs still eats the -version
iblech Yep, bug
iblech checks whether there's a Getopt::Long-like module for Haskell 20:58
gaal there is something autrijus metioned once
iblech There's System.Console.GetOpt 20:59
gaal what's the opposite of svn add ?
iblech svn rm
gaal i get an error about "... has local modifications"
about a vim swapfile i accidentally added
didn't ci yet
Aankhen`` In P5, does calling a sub from within another sub, using `&foo;`, pass on all the parameters? 21:00
gaal ah, got it
yes
Aankhen`` OK.
Thanks.
Khisanth Aankhen``: well the current @_ is get used as the @_ for the other sub
gaal you musn't use parens if you want that though.
Aankhen`` OK.
It's been a learning experience just working on HTTP::Message. =) 21:01
obra What is HTTP::Message?
Aankhen`` One of the modules in libwww-perl. I'm porting all of the HTTP::* modules from that distro as per discussions regarding a replacement for CGI.pm. 21:02
obra very cool.
Aankhen`` Well, not really as per the discussions in the strictest sense, but by way of following up on it. :-)
obra Are you preserving the API or updating it? 21:03
Chewie[] If I were to want to start getting involved with the development of Pugs/Perl 6 in general, where would I start?
Aankhen`` I'm preserving the API of the ported modules, if that's what you're asking it; I am P6-ising it wherever there are obvious translations, though.
gaal iblech: btw Damian mentioned he had some work towards an p6 args parsing library.
Aankhen`` Chewie[] >> Learn Haskell. :-D 21:04
svnbot6 r4130, gaal++ | Perl6 Power Tools beginnings.
Aankhen`` Or start porting Perl 6 modules.
Or write tests.
And verify that the existing ones are indeed correct.
obra Or write docs ;)
Aankhen`` Or that.
obra Chewie[]: what are you good at?
Chewie[] Docs would be interesting.. I never was too good, though I do comment my code liberally.
obra: Many common programming languages. Assembly to Brain**** to Perl. 21:05
obra Chewie[]: test suite work may be the best way to get involved
if you're up for trying haskell, find a failing or todo test and see if you can fix it
jql Now that Perl6 is approaching usability, it's getting helpful for people to just try /using/ it and bring up issues which don't work for you 21:06
gaal Gettting to know the t/ directory is invaluable because it has tons of p6 code, plus you can tell what's already implemented and what isn't with it.
Chewie[] jql: I was considering trying to port a few projects.
gaal porting your favorite CPAN module is nice too. 21:07
jql I think porting stuff is a good start. I find it helps to have something motivating me to learn how to fix stuff
Aankhen`` Chewie[] >> Glance through interesting sounding files in t/ and examples/, that should help you gain familiarity with Perl 6. Then you could try porting a few modules or projects.
Chewie[] obra: I may try to pick up Haskell over the summer. My goals are Haskell, Smalltalk, and Calculus for this summer.
jql I didn't learn Perl5 XS until I wrote a module whoch required it
now I know all sorts of gory details about the perl5 implementation... 21:08
Aankhen`` Heh,
jql tries to cleanse his mind
Aankhen`` Heh.
FMTYEWTK?
jql yep
I never read the parser or the re engine, so I still have some sanity 21:09
Chewie[] heh.
I have some gripes with the proposed regex changes, but I think I'll live.
Aankhen`` Dump your knowledge into a text file, put it up on the 'Net somewhere so people can be awed by your wisdom/insanity and replace it mentally with something else. ;-)
BTW, iblech, what happened to evalbot? 21:10
gaal Porting Getopt::Long can be very useful! Although (as i just said mylsef) some people have plans for alternative moduels too
jql en.wikipedia.org/wiki/My_Insanity
Chewie[] Is Pugs going to be "the" Perl 6 implementation? Will Perl 6 require Haskell?
gaal no, and no :)
integral maybe, and no
jql concurs with gaal
Chewie[] Just as I thought.
Aankhen`` Chewie[] >> Actually, Pugs requires a Haskell compiler. :-P
Yey, index() works. 21:11
Chewie[] Aankhen``: I was speaking in a more general sense. "Would Pugs work without anything Haskell?"
Aankhen`` Chewie[] >> I know, I'm just teasing you. :-)
jql Perl6 will be like Python. Lots of implementations. CPython, Jython, PyPy
obra Chewie[]: it's the intent to use haskell to bootstrap a pure perl6 implementation in perl6
gaal Chewie[], you can d/l binaries of pugs today that work w/o having haskell on your box.
Chewie[] jql: I can't wait for the Perl 5 implementation. 21:12
jql Chewie[]: Damian tried that. Didn't work.
Chewie[] jql: Why not? Speed?
jql no, the perl5 re engine couldn't implement the Perl6 rule engine, it seems
integral japhy's Regexp::Parser work might do something in the Perl6::Rules direction
jql Perl6 parsing required a proper grammar engine, and the perl5 re engine couldn't quite bridge the gap 21:13
:(
Chewie[] heh.
integral you can cheat now and use Inline::Pugs :-P
Chewie[] giggle. 21:14
jql true... true
Chewie[] If Perl 6 code is compiled by the Haskell-based Pugs into Parrot code, and the Parrot is run on the platform-specific VM, where does most of the functionality end up grouped? Does Parrot need to have its own grammar engine to handle Perl 6's new engine? 21:15
gaal ZZzzz &
integral Chewie[]: the grammar engine in pugs is PGE which is the "Parrot Grammar Engine". Pugs links in parrot to be able to use rules 21:16
PGE itself is written in parrot, and produces parrot directly
Chewie[] integral: So there's no real dedicated library - the functionality is generated in-line? 21:17
integral hmm, I think the generate code doesn't need any library
Juerd knewt, iblech: chomp should not mutate by default. Nothing should. If you want something to mutate, use .= 21:20
vcv-- $string.=chomp <-will this work? 21:23
jql interesting 21:25
chomp seems to return the chomped bit. is that correct? 21:26
SamB autrijus: I think ./src/Pugs/Run/Perl5_stub.c may be the problem... 21:27
Aankhen`` Do labels work alright in Pugs?
autrijus SamB: nod. it's created by ghc 21:28
SamB I know.
autrijus SamB: maybe I should add it to "make clean" targets
SamB yes, that is exactly what I was thinking.
for cleanliness, probably also the .h
autrijus done. 21:29
svnbot6 r4131, autrijus++ | * from SamB: add the GHC-created stub files to `make clean` targets. 21:34
Aankhen`` goes to sleep. 21:35
iblech Night, Aankhen``
Aankhen`` G'night. 21:36
SamB thinks it a little odd that GHCi does linking *before* compilation... 21:37
Limbic_Region anyone know why I received a bunch of OSSF pugs "test" emails? 21:41
autrijus er. yes. sorry. 21:42
I was deleting old tickets
but forgot to tick off the "don't send to committers" flag.
sorry. won't happen again
Limbic_Region no worries
just found it odd 21:43
Chewie[] Will Parrot have some sort of XS-like thingy? 21:46
iblech Yep, it has got NCI (Native Call Interface)
integral you can link in code as PMCs, and there's the option of NCI
jql Yes, but it'll also be able to make external function-calls by name (with dlopen() and such) 21:47
kinda like ffi
Khisanth NCI looks a lot easier than XS
jql agrees... except for that damned C++ language
jql kicks C++ in the + 21:48
Chewie[] Heh, okay, now I'm just lost. If I wanted to re-do MIME::Base64, what should I use? Should I implement Base64 in Parrot?
iblech Gonna sleep, see you in a week :)
SamB what in the world is it called an NCI for?
integral Native Call Interface
jql Native Call Interface
SamB I mean, why "native"
integral first saw that with java's JNI
jql Chewie[]: Perl6 will be fine 21:49
SamB oh, right.
jql It'll compile down to parrot, and all will be will
well, even
integral and then we can feed it to the JIT, and save it to dist...
Chewie[] jql: If it's all the same to everyone, though, I need to learn Parrot to feel like a man.
integral *disk
Chewie[] Where by "everyone" I mean the interpreters and compilers. 21:50
jql Well, if your manliness is at stake, you must learn Parrot
Chewie[] Indeed. It will also be a bit more optimal than the Perl 6 compilers could make. 21:51
Would it not be better to do it in C, though? Or is it not worth the hassle?
integral ou just add optimisations to the compiler for this specific case ;-)
jql Chewie[]: Honestly, I'd just find the gnome library which does Base64 voodoo and NCI it 21:52
NCI will be the main way of handling Parrot modules. That way, you don't need to learn Parrot internals unless you need it
Chewie[] Assume I really don't know what you're talking about (which may very well be the case, in that I just found myself wanting to do this today.) 21:53
jql the trick there is handling memory. Ain't that always a bitch?
Chewie[]: What I mean is, you write a shared C library which has a single function: const char *encode_base64(const char *). You can ask parrot to call that function by NCI 21:55
SamB that sounds suspiciously like FFI 21:56
Chewie[] I got that far. Should I assume NCI is somewhat like IDL, telling one application where to find another library?
jql because it is. :)
SamB this is why I was wondering why it was called NCI.
jql cause it's not using libffi
SamB why can't you people name things based on what they are? 21:57
jql and we don't wanna steal their name
:)
SamB jql: neither does most FFI I know!
integral hmm, and why is Foreign Function a better name than Native Call? :-P
svnbot6 r4132, iblech++ | examples/ppt/README -- Typo fix.
jql also, with Parrot, Foreign Function could be thought of as a Tcl function as well 21:58
Native Call is always gonna be a C library
SamB Isn't C foreign to Parrot? 21:59
Chewie[] Native Call for assembly code, Foreign Function for another interpreted language?
SamB Parrot is not, after all, C...
Chewie[] (Interpreted because all else boils down to Assembly?)
jql Chewie[]: that's not how it's defined, but that's how I think of it
Chewie[] jql: Ah. 22:00
jql: I'd rather write it in Parrot for the sake of portability, and letting Parrot handle memory in the best way for the platform.
jql indeed
plus, no compiler required
except parrot, of course
integral SamB: parrot is in C, it itself uses C calling convention for implementation, so wrt to parrot it's native
Chewie[] C isn't native to Parrot. Parrot is its own world. 22:02
integral said parrot... 22:03
jql whips out dictionary definition 5a: Being a member of the original inhabitants of a particular place. 22:04
Aboriginal Call Interface, anyone?
Chewie[] Hey, I've got a friend who's really, really angry about the Unicode in Perl. Rambling on about his VTs not supporting it and such. Will there be workarounds or anything like that for non-Unicode devices/applications? 22:06
jql 1. He's a VT user and doesn't use Emacs? 22:10
2. Yes
Chewie[] Heh.. He's a FreeBSD/Vim devotee. 22:11
(and Latin-1, apparently.)
jql scary
Chewie[] (18:11:35) Chris: ... I smell a penguin fucker.
Chewie[] giggles insanely.
jql he doesn't even get to take advantage of Linux console unicode font hackery
SamB emacs actually supports unicode in a way that works? 22:12
jql feels saddened
Chewie[] I've been considering a FreeBSD switch, actually.
jql depends on the meaning of the word 'works' 22:14
Darren_Duncan suggestion re Pugs ext/ module tests ... 23:00
supposedly test file names need to be spelled all in lower case to execute ...
as putting any uppercase characters in them is a signal that they shouldn't be executed yet
I suggest as an alternative that such not-executable files go in a different folder name instead, such as 'todo_t' rather than 't' ... 23:02
then test names can be uppercased again without triggering the special hack that causes them to not execute ...
I would like to be able to use mixed case in my test names and have them still execute
that is all
question ... 23:55
conceptually speaking, if you declare a module 'Foo' containing subroutine 'bar' that is not exported, is it reasonable for user code to say "use Foo; Foo.bar();"? 23:56
I find that I can only get the code to run if I rename 'module' to 'class' and 'sub' to 'method' ... 23:57
this is perfectly fine for a work-around
however, conceptually I thought classes were more for when there were attributes behind the scenes that they were managing, and modules were for when there aren't any state variables or attributes 23:58
hopefully Module.sub() syntax will work soon, since one doesn't always want to pollute the caller namespace with exports 23:59
but as I said, there is a simple workaround that I can use meanwhile
so not top priority