pugs.blogs.com/dist/Perl6-Pugs-6.2.13.tar.gz released! | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com
Set by audreyt on 17 October 2006.
svnbot6 r14646 | audreyt++ | * MiniPerl6: EOL fixes; fix emitted code to be valid mp6 00:08
svnbot6 r14647 | fglock++ | MP6 - adding <%hsh> parsing 00:35
eviltwin_b is testing a quick fix to the filetest parsing issue 00:46
audreyt meanwhile is hacking in ::Dog(heads => 3) 00:49
eviltwin_b so far, so good; it compiled and the initial sanity tests didn't chunk :)
audreyt my Dog $Cerberus .= (heads => 3) 00:50
and I'm hacking it in on all three implementations :) 00:51
(MP6, P5, Hs)
GeJ new is now optional? 00:57
damn, it's moving too fast...
eviltwin_b I'm thinking that's confusing 00:59
::class(initializer) looks too much like :key(value) given how easy to miss a colon is 01:00
(or am I misunderstanding what's going on?)
audreyt no you are not
you can omit the ::
Dog(heads=>3) 01:01
provide ::Dog is in scope
which should remind you of certain other languages...
clsung GeJ: hi, good to see you here :)
GeJ clsung: always been here idling in the corner trying to follow what's happening. But boy sometimes it's hard 01:02
GeJ clsung: talking about things happening here, maybe someone(tm) should get in touch with people from haskell@ to get the new GHC in the ports ;) 01:04
GeJ ok, I'm getting parrot fixed in FreeBSD... next step pugs and then take over the world 01:07
eviltwin_b ah, ok 01:08
svnbot6 r14648 | audreyt++ | * Pugs::Compiler::Perl - Implement ::Class( field => 'val' ) construction syntax. 01:11
r14649 | audreyt++ | * MiniPerl6::Grammar - Remove the v5 helper blessers and consistently
r14649 | audreyt++ | use the new ::Class(field=>'val') syntax.
audreyt fully implemented. 01:37
fglock just fried his brain for the day... I'm going to fade too 01:38
more hacking tomorrow morning :)
audreyt waves &
svnbot6 r14650 | audreyt++ | * Pugs.AST.Internals: Allow prototype objects to act as Code 01:39
r14650 | audreyt++ | objects, which for now simply delegates named parameters to
r14650 | audreyt++ | the .new call. (In the future it may also serve as coercion.)
r14650 | audreyt++ | my $cerberus = ::Dog(heads => 3);
r14650 | audreyt++ | my $cerberus = ::Dog.new(heads => 3); # same thing
r14650 | audreyt++ | This is semi-specced, but not really formalized, but extremely
r14650 | audreyt++ | handy, so we implement it anyway.
r14650 | audreyt++ | * Pugs.Parser.Operator: Correctly parse for "$x .= (1,2,3)"
r14650 | audreyt++ | to mean "$x = $x.(1,2,3)", so we can write:
r14650 | audreyt++ | my Dog $cerberus .= (heads => 3);
r14650 | audreyt++ | and save three characters of typing.
r14650 | audreyt++ | * Pugs.Parser: Adjust a comment about canonical status as
r14650 | audreyt++ | the ".=meth" term is now canonical in S03.
r14651 | lanny++ | * clean up unexpected passing TODOs 01:54
aufrank ?eval class Foo { method bar { say "baz" } } my $foo = Foo.new; $foo.bar; $foo.can("bar"); 02:09
evalbot_r14651 OUTPUT[baz␤] Error: No compatible subroutine found: "&can"
aufrank ?eval class Foo { method bar { say "baz" } } my $foo = Foo.new; $foo.bar; $foo.^can("bar");
evalbot_r14651 Error: ␤Unexpected "^"␤expecting ".", "\187", ">>", "=", operator name, qualified identifier, variable name, "...", "--", "++", array subscript, hash subscript or code subscript
aufrank oh, just found can.t 02:12
cmarcelo @tell audreyt i'm home and safe :) _thank you_ for helping me out with MOH and "walking" thru the details of the bootstrap plan [btw, remember to commit that file]. I'll work out my english skills so next time we see I'll be more "talkative", like I was with .br mongers :o) 02:13
lambdabot Consider it noted.
cmarcelo nothingmuch++ # MOH is MO ;) 02:14
svnbot6 r14652 | audreyt++ | 03:13 < cmarcelo> [btw, remember to commit that file]. 02:24
GeJ parrot 0.4.5 back in FreeBSD
waiting for a bison upgrade to import 0.4.6
audreyt GeJ++ 02:27
lambdabot audreyt: You have 3 new messages. '/msg lambdabot @messages' to read them.
audreyt @massages 02:28
lambdabot TimToady said 19h 17m 24s ago: aforementioned bug now infests examples/algorithms/fibonacci_memoization.pl
cmarcelo said 11h 42m 8s ago: I pushed mi.t equivalent for MOH. Now Roles are on the way. I'll leave Sao Paulo tonight around 9-10pm, so if afternoon you have time i'll be happy to see how/where
this will get into pugs
cmarcelo said 15m 20s ago: i'm home and safe :) _thank you_ for helping me out with MOH and "walking" thru the details of the bootstrap plan [btw, remember to commit that file]. I'll work out my
english skills so next time we see I'll be more "talkative", like I was with .br mongers :o)
eviltwin_b still running full test on my parser change. still looking good --- some unexpected test failures but they look related to others' work (eg regex tests)
GeJ audreyt: you're not running FreeBSD anymore, correct? 02:31
audreyt GeJ: my old laptop still does
but this one is darwinports, aye
GeJ If I can't lobby FreeBSD people to upgrade ghc, could I come back to you as my "Help us Audrey Tang, you are our only hope." chance? 02:34
audreyt you can also lobby Igloo and JaffaCake. 02:35
JC is busy. Igloo is paid to care.
clsung upgrade ghc?
GeJ I mean for pushin a bootstrap image on the ghc repo, from there I should fill a PR and use the regular process to upgrade the port
audreyt that'd be Igloo's job. find him on #ghc and #haskell
also note you _can_ use the same boot image as 6.4.
6.4 can boot 6.6 just fine.
so maybe you don't need that.
GeJ clsung: unless I missed it during the slush craze, I didn't see ghc move to 6.6 02:36
clsung ah ha
GeJ audreyt: thanks for the tip, I'll look into that and see if I can send a PR
audreyt ok. have fun!
svnbot6 r14653 | aufrank++ | added tests for $foo.^can('bar') and $foo.^isa('Foo') syntax for introspection metamethods
audreyt sleeps for real &
GeJ thank you
nighty night 02:37
aufrank gnight audreyt
audreyt aufrank: cool, that means we'll get more yellow boxes once MO is rolled in
aufrank yellow is pass :todo<feature> ?
audreyt pass :todo<anything> 02:40
aufrank neat :)
eviltwin_b freshports shows it still at 6.4.2_1
aufrank macports got bumped to 6.6 last week 02:41
eviltwin_b hrm. guess I need to understand the parser a bit better 02:46
didn't break anything; also didn't fix anything
GeJ eviltwin_b: true, and I intend to get this fixed (ghc-related) 02:53
eviltwin_b foolishly realizes what he did was actually a no-op, and the real problem is somewhere else 02:54
hm, but that leaves me wondering why the file test ops parse differently than e.g. -= 02:57
svnbot6 r14654 | aufrank++ | added tests for .^does to go along with .HOW.does
eviltwin_b hm. think I know. parsec docs are at work, though 03:05
...or online 03:09
aufrank is there sugar getting the last index in an array 03:24
@array.elems - 1 works, but I thought I remembered having a sugary substitute 03:25
lambdabot Unknown command, try @list
aufrank thanks for nothing, lambdabot
eviltwin_b if you're using it as an index (and not part of a range), index -1 should work I think 03:31
aufrank eviltwin_b: can you put that in code? @array... 03:32
eviltwin_b ?eval my @a = <1 2 3>; @a[-1] 03:33
evalbot_r14654 \"3"
aufrank oh, right
thx
aufrank could @array[0].exists ever be made a synonym for @array.exists(0) ? 03:53
eviltwin_b ew 04:17
aufrank ew what? 04:20
avar aufrank: ew as in that would be horrid 04:55
hrm, or maybe not
avar remembers that @a[0] is not a slice anymore:)
TimToady the problem with .exists (and .deletes) is that it has to retroactively change the meaning of the subscripting operation, and that basically makes it a macro 04:56
aufrank TT: that makes sense 04:59
it's pretty least-surprising to me, but I see why it's a complicated addition 05:00
maybe a .exists? macro to go along with .exists() method ? 05:01
TimToady more likely would be a :exists and :delete modifier on ordinary subscripting 05:05
aufrank how does that work on nested lists, for example?
TimToady depends on what the slice digs up, just like ordinary subscripting 05:06
having the @foo[@list]:delete form also would emphasize that the deleted elements are returned (as they are in Perl 5) 05:07
the main thing I don't like about @foo.delete(@list) is that the right side doesn't look like a slice 05:08
aufrank yeah, I agree
TimToady one could make a .delete or .exists method that gives a different "view" of the array to the subscript: 05:09
%hash.delete{@keys}
but that gets a bit tricky if you don't actually do the delete right away.
and potentially involves you with proxy overhead
aufrank I like &h.delete{} and @a.delete[] better than the .() form 05:10
s/&/%/
if that's what you were suggesting 05:11
TimToady but again, it's more like a macro modifying the subscript there.
aufrank yup
TimToady and then you don't have to worry about people saying $ref = %hash.delete;
aufrank the deleted items are returned but you think you're getting a hashref of the altered hash? 05:12
TimToady problem I see is returning a self-deleting hash to someone unsuspecting
so macro view is safer 05:13
question is whether we can have a .delete{} macro that doesn't interfere with .delete()
.foo implies run-time dispatch, and macros tend to interfere, unless this macro just remapped .delete{} to .delete([]) or some such 05:15
I said that deleting and existing are just modifiers to subscripting, but practically speaking you might not want to clutter your normal subscripting code with optional control flow. 05:17
aufrank you'd tend to only use the modifiers to be explicit about getting Bools for tests, though, right? 05:18
oh, that's true for exists but not delete
TimToady contextual 05:19
aufrank is stuck on the one I'm trying to use now ;)
man, my person-foo is weak this evening
TT: feeling better after whatever kept you out of Brazil? 05:24
TimToady it's more of a long-term thing, but I think I'm improving. Part of it was my wife was also sick for a month, and between the two of us we almost make one human being... 05:27
I just think the summer schedule took a lot more out of us that we realized at the time. 05:29
and when I do that to myself, my body has lots of ways to tell me it's time to back it off a notch or two for a while. 05:30
aufrank glad to hear you're improving. I hope you get a chance to catch up to yourself now. 05:31
TimToady well, this whole Perl 6 thing has taught me that I have to pace myself. I'm the only person who's not really allowed to quit, after all. :)
aufrank granted :)
?eval my @tmp; @tmp<foo>.push('bar') 05:34
evalbot_r14654 Error: Cannot cast into Hash: VRef <Array:0xb67d8720>
TimToady ?eval my %tmp; %tmp<foo>.push('bar') 05:35
evalbot_r14654 1
aufrank ?eval my @tmp; @tmp[0]<foo>.push('bar')
evalbot_r14654 1
aufrank that's what I meant
TimToady I think autoviv is saner in P6 than in P5
aufrank I'm with you there 05:36
though I wouldn't pretend to know either completely ;)
TimToady but it's one of the reasons exists has to know that it's doing that and not an assignment, say
aufrank yup 05:37
TimToady though I suppose the real P5 autoviv problem comes before the final subscript op
cascading subscript ops need to propagate the rvalue/lvalue context up, and P5 botched that 05:38
svnbot6 r14655 | lwall++ | [t/var/state.t] fib test that fails 05:52
r14655 | lwall++ | [examples/algorithms/fibonacci_memoization.pl] work around state=list problem
r14656 | lwall++ | Off by one on previous test 05:56
svnbot6 r14657 | lwall++ | Might as well add test of workaround variant to make sure that doesn't break 05:59
aufrank TimToady: still around? 06:44
eviltwin_b hm. I don't think you want to parse the leading hyphen of a file test op with @name@ 06:47
TimToady aufrank: vaguely 06:53
eviltwin_b misread it. still looks like it's being parsed with the wrong verb, but at 2am I'm too fuzzy 06:54
aufrank TimToady: have you had reason to do any command line parsing for your $job p6 code? 06:56
with GetOpt and friends?
I've had trouble getting perl5:Getopt::Long to work correctly here
TimToady not really. I tend to avoid getopts of all sorts. 06:57
and the particular program doesn't need args 06:58
(except a filename)
aufrank and you're just doing $*ARGS.shift or somesuch for that?
eviltwin_b right. "symbol name" parses the "-"... and eats trailing whitespace. (makeOp1) 07:00
TimToady yeah. I'm kinda waiting for someone to implement S06:2468
in fact, the last line of my proggie currently reads: MAIN(); exit; # should be automatic some day 07:02
@tell audreyt interesting factoid: when I was profiling the "if->" patch, it came to my attention that about 90% of our current test failures are caused by that patch--seems to give Span and Span::Num fits somehow. But it's not obvious from the failures how they're related to "if->". 07:05
lambdabot Consider it noted.
TimToady 'z' xx * & 07:08
aufrank gnight 07:10
gaal mmm, that means "sleep for as long as desired" 07:11
aufrank hmm. should I be able to call split on =<> ? 07:12
my ($foo, $bar) = =<>.split(",") #doesn't work 07:13
gaal does (item =<>).split work?
eviltwin_b gives up for the night. &
aufrank gnight etb 07:14
yes, yes it does
aufrank thanks gaal
gaal sure thing :) it was a wrong context 07:19
aufrank is there a reason to prefer @list.grep():{$_ ~~ /foo/} to @list.grep( {$_ ~~ /foo/} ) 07:31
aufrank if anyone's still around, can you explain this to me? 08:10
?eval class Bar { has @.x is rw; has $.y; $.y := @x[0]; } 08:11
evalbot_r14657 Error: Cannot bind this as lhs: Syn "${}" [App (Var "&y") (Just (Var "&self")) []]
aufrank $.y is an accessor, not a real variable. But I'd still like to bind it as if it were a variable. 08:13
lumi Maybe you can bind $!y? 08:46
Unless it's been renamed; at any rate it doesn't seem to work 08:47
aufrank lumi: I think the problem is that $.x and $!y aren't really Scalars, they're Code. That's why the error is about not being able to bind &x 08:57
$.x is actuall method x { return $x } or something like that 08:58
s/actuall/actually/
lumi I thought $!y is supposed to be the actual variable, with $.y being the generated accessor 09:01
aufrank $!y is definitely private. I don't know if that means it's a plain old Scalar or not 09:02
lumi Oh, you don't bind scalars, do you? You bind names
So it mostly can't bind it because it gets desugared too early 09:03
aufrank I think I follow 09:05
lumi I don't know what would be correct behaviour.. maybe to do what you want you need: method y is rw { return @.x[0] } or something? 09:07
aufrank makes sense, yeah
lumi Also it seems to work now 09:10
?eval class Bar { has @.x is rw; method y is rw { return @.x[0]} }; my Bar $x .= (); $x.y = 2; say $x.x;
evalbot_r14657 OUTPUT[2␤] Bool::True
aufrank ?eval class Baz { has @.x is rw; method y is rw { return @.x[0] } }; my $qux = Baz.new( :x(1,2,3) ); $qux.y; $qux.y = 'foo'; 09:13
evalbot_r14657 Error: Can't modify constant item: VInt 1
aufrank anyway, I think I'd better sleep now 09:14
lumi Looks like $.x got set to a list, instead of an array, maybe?
Night
aufrank ?eval class Baz { has @.x is rw; method y is rw { return @.x[0] } }; my $qux = Baz.new( :x(1,2,3) ); $qux.x[0]; 09:15
evalbot_r14657 \1
aufrank ?eval class Baz { has @.x is rw; method y is rw { return @.x[0] } }; my $qux = Baz.new( :x(1,2,3) ); $qux.x[2];
evalbot_r14657 \3
aufrank ?eval class Baz { has @.x is rw; method y is rw { return @.x[0] } }; my $qux = Baz.new( :x(1,2,3) ); $qux.x;
evalbot_r14657 [1, 2, 3]
lumi ?eval class Baz { has @.x is rw; method y is rw { return @.x[0] } }; my $qux = Baz.new( :x(1,2,3) ); $qux.x.WHAT;
evalbot_r14657 ::Array::Const
svnbot6 r14658 | lumi++ | Added tests for $foo .=() construction, and for lists initiated in the constructor being mutable. 10:15
nothingmuch hola 10:37
lumi Morning, nothingmuch 10:54
nothingmuch hola lumi
GnuVince ?eval ~(1.1 .. 3) 15:04
evalbot_r14658 "1.1 2.1 3.1"
GnuVince is that proper behaviour?
how about this: 15:05
[particle] no, i don't think it is
GnuVince ?eval (~(1..3.4), ~(1..3.5))
evalbot_r14658 ("1 2 3", "1 2 3 4")
GnuVince Both seem incorrect to me, however no tests mention floats. I'll need to talk to audreyt or TimToady to know for sure. 15:10
[particle] i think you should add failing tests 15:11
that way they'll get corrected either way 15:12
GnuVince I have added them to my working copy
Okay
I'll do that
[particle] did you look at the spec?
GnuVince Yeah, no mentions
I assume the behavior should be like Perl 5, to truncate
the 1.1 .. 3 seems especially wrong, it goes beyond the upper limit 15:13
[particle] yes indeed
svnbot6 r14659 | gnuvince++ | Added test cases for the range operator with floating point numbers. 15:32
r14660 | gnuvince++ | Shamelessly added myself to AUTHORS 15:35
nothingmuch nekokak: you mean proudly =)
err 15:36
GnuVince: that was for you, not nekokak
lumi_ Surely there's no shame in it, so it's shameless 15:40
nothingmuch compare:
Your mother is uglyness-less
Your mother is pretty
the first one is a borderline insult
nothingmuch because it hints of the bad that was expected but in fact was not present 15:41
xinming ...
lumi_ It's more borderline weird
GnuVince nothingmuch: Proudly, yes. Shamelessly too. I didn't wait to have a few commits before adding myself. Bang, on the first one :)
nothingmuch GnuVince: in that case it was a bootstrap
lumi_ GnuVince: That's the proud (shameless?) Pugs tradition
nothingmuch that way we guilt people into actually making changes afterwords =) 15:42
GnuVince Hahaha :) 15:42
Well I look forward to having more commits, that's for sure.
But for now work (PHP :( ) calls
bbl 15:43
gaal mooses 15:50
kolibrie_ released DateTime::Format::Oracle in perl 5 land 15:52
aufrank hey folks 16:14
rodi salut, aufrank 16:15
lumi Hi aufrank
aufrank: I added a test for the borkage you found 16:16
aufrank lumi++ # checked in tests last night
this is sort of a basic question, but for a file foo.pl where I 'use v6-alpha' should I be able to do run 'perl fool.pl' or is 'pugs foo.pl' all that works now? 16:18
nothingmuch aufrank: perl foo.pl
aufrank I get an error that v6.pm isn't in @INC 16:18
nothingmuch install v6 then =)
aufrank should make install install v6? 16:19
nothingmuch whose make install?
search.cpan.org/~fglock/v6-alpha-0.015/
lambdabot Title: Fl&#225;vio Soibelmann Glock / v6-alpha-0.015 - search.cpan.org, tinyurl.com/yxjxfd
aufrank in a pugs checkout 16:20
nothingmuch *nod*
v6 is not pugs
nothingmuch i'm not sure if it'll install 16:20
but you can install v6 from the cpan
aufrank goes to perl -M'CPAN' -e'install v6'
TimToady I don't know how up-to-date the CPAN version will be 16:21
nothingmuch oh, right
it's been almost two months
Debolaz Our friend on wikipedia has vandalised the perl 6 page again. en.wikipedia.org/w/index.php?title=...d=85984845
lambdabot tinyurl.com/y58znp
aufrank so what's the approved way of getting v6.pm into @INC?
nothingmuch aufrank: osrry, i'm not very up to date 16:22
maybe pugs' own make install will install it as well
i never ran that though =(
TimToady me either
I don't think so, but I don't do "make install" these days 16:23
I think if I were gonna do it, I'd either go down into pugs's perl5 dir and try to install stuff from there, or I'd try to add those blibish directories to @INC 16:24
aufrank it seems not to, as I've done a make install from a recent checkout but can't run v6-alpha modules with perl 5.8
TimToady or copy the file I want to run down into the directories.
pasteling "nothingmuch" at 84.108.53.74 pasted "v6.pm" (6 lines, 236B) at sial.org/pbot/20930
nothingmuch i don't know which one is the True™ version
i suppose the top level
aufrank TimToady: do you mostly just use pugs to run p6 code, or is there some better option to get it working with perl5 that I am not considering? 16:25
nothingmuch oh
This is not the perl5 v6-alpha, see perl5/Pugs-Compiler-Perl6 for that.
TimToady the stuff in toplevel v6/ is the new v6 in MiniPerl6, I think
nothingmuch *nod*
that line i just pasted was from ./v6/README
TimToady I mostly just use the Haskell runtime currently
nothingmuch mostly uses MO nowadays 16:26
actually nowadays I mostly sit and "hmmm"
TimToady aufrank> is there a reason to prefer @list.grep():{$_ ~~ /foo/} to @list.grep( {$_ ~~ /foo/} ) 16:26
with the latter you have to remember to put the paren at the end 16:27
plus you don't get the magic } line-ending parsing where you might want it
[particle] my editor reminds me of that
TimToady so it really depends on how big the block is and whether it's final
aufrank TT: thanks
TimToady but it's not a grep-only thing 16:28
it's a general method: @ARGS thing
nothingmuch finds @list.grep():{ } extremely confusing
the "stuff that is given to grep" intuitively extends up to the closing )
dmq waves hello
nothingmuch hola dmq
TimToady I always put a space between the : and the {
: turns a method into a listop
Debolaz That whitespace sensitivity is pretty much my only objection to perl6. It makes things occationally difficult to read.
For me. 16:29
dmq I thought id note for those not following p5p that I posted a redo of my earlier stack control verbs for the regex engine today.
TimToady it's all driven by the need to be able to add postfix operators
Debolaz knows. :-/
dmq I tried to incorperate what feeback ive received so far.
TimToady < aufrank> ?eval class Bar { has @.x is rw; has $.y; $.y := @x[0]; } 16:31
it would be very difficult to make that mean something
because attributes are generic until BUILD time
nothingmuch always kinda thought that all actions on $.foo in the class decl are saved as continuations to be invoked during BUILD for every object 16:32
TimToady nope 16:33
nothingmuch so they are special cased?
TimToady has is a declarator and can do whatever it wants to "rechronify" its actions, including its = clause 16:34
TimToady but the class's code only runs when the class itself is constructed 16:34
it's just a method on the metaclass, I think 16:35
nothingmuch ++
TimToady if the class body ran at BUILD time we wouldn't need BUILD 16:35
nothingmuch i sort of meant that the rechronification could be implemented in terms of continuations and thus could support e.g. $.y := @x[0];
oh, no 16:36
not the entire body
just the actions on future variables
at class construct time $.y doesn't exist
it's a place holder for every $.y that will exist
TimToady I think it would be very easy to intermix things inconsistently
nothingmuch *nod*
Limbic_Region TimToady - thanks for the insight on the fibonacci memoization
TimToady and it would be much better to put them somewhere where the temporal context isn't implicit 16:37
xinming TimToady: Is there a way to get the "class" using .perl?
nothingmuch but then again saying class Foo { has $.x = 1 } is sort of the same as class Foo { has $.x; submethod BUILD { $.x = 1 } }
xinming Since we can easily get an object using .perl
TimToady I think "insight" is perhaps too dignified a word for what I do...
xinming I wonder if we would have a method get the code it self... :-) 16:38
nothingmuch that's a matter of good programming standards =)
i don't think $.x := @y[0] is good style
it's just that intuitively i saw no reason for it to not be supported technically
in a predictable way
Limbic_Region well in any case, I clearly wasn't thinking clearly
Limbic_Region wanders off after kicking off a smoke 16:39
TimToady xinming: whether you can get at the class of an object probably depends a little on whether the object actually has a class. 16:40
dmq the posting can be found here if anybody wants to see: aspn.activestate.com/ASPN/Mail/Mess...rs/3328324
lambdabot Title: [PATCH] New regex syntax omnibus :: ASPN Mail Archive :: perl5-porters, tinyurl.com/y87qu8
xinming TimToady: what do you mean please? >_< 16:43
TimToady P6 supports both class and prototype paradigms 16:44
prototype objects don't really have classes.
kolibrie aufrank: I installed v6.pm and dependencies from CPAN, and then go into pugs/perl5 and install from there to keep up-to-date
TimToady also, since the body of a class is a run-once thing, whether you can get at it depends on whether the metaclass keeps the closure around.
xinming ... 16:45
Ok,
nothingmuch aufrank: ping
err
audreyt: ping
TimToady if you want to be able to take a snapshot of a class and use it as a role, then you probably do need to keep the class definition closure
nothingmuch || cmarcelo for that matter
TimToady but P6 does not guarantee this behavior 16:46
xinming TimToady: What I wonder is if we can pass the whole "object"-implementation and object to another machine. :-P
TimToady that will depend more on what nothingmuch is working on...
aufrank kolibrie: thanks, that helps 16:47
xinming TimToady: Just a crazy idea comes out of my mind. If we can do that, We can write a very short code and eval remotely. :-P
TimToady: hmm, Thanks for your explanation. ;-)
nothingmuch xinming: that has lots and lots of issues beyond serialization
look at the E language
for some insight on this
aufrank kolibrie: which modules in perl5/ do you end up building by hand?
nothingmuch suppose you have two models, thick and thin proxying 16:48
whereby in thin proxying proxy objects on the other side are created for every local value
and an RPC call is made for every access
and thick proxying serializes the whole thunk and it's env and thaws it on the other side, optionally syncing back when done
kolibrie aufrank: Pugs-Compiler-Perl6, Pugs-Compiler-Rule, and I'm sure there's one more... 16:49
nothingmuch under the first model it's "easy" but you don't gain much
TimToady the second model breaks === equivalence
at least temporarily
nothingmuch of course
proxying is yucky any way you look at it
=( 16:50
under the second model, if you haven't instructed your compiler to remove meta data
then it can deduce the meta object fgrom the type box
and simply serialize that
since it's a simple object it doesn't need to compile to a perl 6 class definition
just a serialized representation of the finished meta object
a perl 6 class definition could be pretty printed, of course, but that's only supported for meta class instances which can be expressed declaratively 16:51
?eval sub { 1 }.perl
evalbot_r14660 "sub \{Syn \"block\" \{1}}"
nothingmuch if that is supported and the remote side trusts the local side, and will execute arbitrary code on it's behalf it should be very easy 16:52
xinming thanks, I think I know, as HOW and WHICH would be useless in that case. Hope what I understand is correct. :-P
nothingmuch why useless?
.HOW is the type box meta data 16:53
kolibrie aufrank: maybe that's it, looks like Pugs-Emitter-Perl6 moved in with Pugs-Compiler-Perl6
nothingmuch if the object in .HOW can b e serialized
and the meta-meta-class can be assumed to exist on the other side
(or any n-order of meta-meta-meta) then there's no bootstrap problem
nothingmuch with these two prerequisites you can theoretically serialize any arbitrary object along with it's class for remote execution 16:54
aufrank kolibrie: do you get "Warning: prerequisite Pugs::Emitter::Perl6::Perl5 0 not found." when you make Pugs-Compiler-Perl6?
nothingmuch what I doubt is not the technical feasability but the usefulness 16:54
TimToady similarly for the identity expressed by .WHICH, in which case you're getting identities more of the URI persuasion
though having the same .WHICH should hopefully also make some guarantees about eventual resyncing 16:55
then you get into timing issues like a Palm Pilot... 16:56
nothingmuch i think that is more of a per-bridge policy
kolibrie aufrank: it appears to be in pugs/perl5/Pugs-Compiler-Perl6/lib/Pugs/Emitter/Perl6/Perl5.pm
nothingmuch automagical remote execution that Just Works will Just Work for about 5% of the cases ;-)
i'
TimToady yeah, well, per-bridge policy is how we ended up with uucp instead of the internet...
nothingmuch heh
kolibrie aufrank: but it used to be a separate package
xinming well, Yesterday, What my crazy idea is... We process different objects on different machine, Just pass the Whole object to the first machine, and the first machine run the object once. and then, pass the newly created object to another machine. and at last. we'll have the result return. :-) 16:57
hmm, well, It's just kind of dream... :-P forget it.
nothingmuch *nod*
that should be supported 16:58
but the different mkachine must trust the first machine, or it must already know of the class the object is in
and know it's definition
otherwise you have security issues
again, see the E language info
www.erights.org/
lambdabot Title: Welcome to ERights.Org
TimToady basically you get tribal semantics where you were hoping for individual semantics
xinming nothingmuch: Security issue is ignored in that case. Since, we can only see only one computer, the one which sends objects to other machine. 17:00
nothingmuch ?
are you saying that the slave machines necessarily trust the master?
xinming nothingmuch: yes, the code only executes from the trusted host. 17:01
nothingmuch so short answer: yes, it should Just Work to some limited extent of Work
(e.g. breaking === semantics, synchronization, and all the other issues related to freeze-thawing) 17:02
xinming and another issue is, the dynamicly created object. So, if we pass the source to another machine, another can eval it. 17:03
nothingmuch anonymous classes should also Just Work 17:04
also classes that cannot be represented using a class { } declaration (at least not trivially)
TimToady depends on how abstractly you represent "the source"
nothingmuch also classes with dependencies on other (meta-)classes
TimToady C's include model is based on "the source", and breaks badly 17:05
source filtering is another source-based approach that frequently breaks
you'd have to treat the source as immutable, and you have to guarantee that it gets evaluated in the same context, or it means something different 17:06
that's hard
nothingmuch whereas serialzing the metaclass is more in tune with the actual meaning of thje class, context free 17:07
metaclasses instances are jsut data structures
dinnertime
TimToady assuming all the dependencies are data-driven, and not temporal
showertime & 17:08
xinming ...
bed time &
nothingmuch a meta class with a temporal dependency is the type of magic you shouldn't mix with magic like transparent object proxying =) 17:14
cj could I get some comments on this, and perhaps some ideas about how to implement? 18:49
cjcollier.livejournal.com/231863.html
ingy hi cj 18:54
seen [particle]
seen [particle]?
Debolaz usrbinpurl seems to want references to the claim that static typing is beneficial. I didn't remove this from the article since it's not outright vandalism but it should probably be dealt with. 18:58
(Perl 6 article @ Wikipedia)
TimToady you probably want to google for "gradual typing" 19:19
Limbic_Region I had to re-read Debolaz's comment a few times to understand what it was that should be considered vandalism 19:26
it isn't that static typing is beneficial - it is that someone is asking for a reference because they don't believe it is true
the wp article talks about dynamic and static typing and indicates perl 6 is using hybrid 19:27
which is accurate
at least, that's the way I understand it
Debolaz Limbic_Region: I didn't consider it vandalism, but the user has vandalised the page before. 19:28
Limbic_Region Debolaz - all I meant was it wasn't clear WHAT was undesireable content. It took me several passes to get your intended meaning 19:42
TSa HaloO 20:07
audreyt TSa: greetings 20:31
lambdabot audreyt: You have 1 new message. '/msg lambdabot @messages' to read it.
svnbot6 r14661 | audreyt++ | * Pugs.Parser.Operator: "state (...) = ..." now desugars correctly.
audreyt TSa: a new object system with roles and introspection and runtime augmentation is arriving to Pugs
I'm tidying it up, but it should arrive within this week
once tests pass with it I'll call it 6.28.0 :) 20:32
cj heya ingy 20:32
audreyt @tell cmarcelo I took your MOH and mutated into thoroughly monadic :) 20:43
lambdabot Consider it noted.
Limbic_Region woot - I have a project lying in wait audreyt
audreyt @tell cmarcelo I'll not commit back to feather; rather, this is going into src/MO/ directly in a bit -- please put your further hacking in the main Pugs repo. great work, btw :) 20:44
lambdabot Consider it noted.
audreyt TimToady: dynamic defaults are not part of the default Class clas right? 21:04
audreyt class C { has $.x = rand }; C.new.x === C.new.x 21:05
cmarcelo: heya. I'm about to commit monadic MOH to pugs
cmarcelo audreyt: ola :) nice, i waiting to see it. 21:06
lambdabot cmarcelo: You have 2 new messages. '/msg lambdabot @messages' to read them.
cmarcelo @moosages 21:07
lambdabot audreyt said 23m 11s ago: I took your MOH and mutated into thoroughly monadic :)
audreyt said 22m 33s ago: I'll not commit back to feather; rather, this is going into src/MO/ directly in a bit -- please put your further hacking in the main Pugs repo. great work, btw :)
audreyt cmarcelo: ok... I'll commit things under src/MO/, including the sketch-tests such as roles.hs
audreyt cmarcelo: feel free to play with it: perlcabal.org/~audreyt/tmp/for-cmarcelo 21:19
lambdabot tinyurl.com/yl9dem
audreyt cmarcelo: I think it's all working correctly, but please sanity check before I commit it back to Pugs
I'm going to dinner now; be back in a bit :) 21:20
cmarcelo oka
TimToady audreyt: yes, that's correct according to current thought, use { rand } to go dynamic, and { { foo() } } to init code with a closure. though I don't feel strongly about it if we came up with a reason and syntax to do it the other way. 21:29
and after all, there's the autoclosing of s[foo] = rand on the other side 21:30
but part of the reason we didn't make = autoclose is that "will first" and "will build" are intended to be be the real way to supply a closure with explicit {...} if you want that. 21:32
can't quite see s[foo] will {...} though...
actually, with "will build" we could just say that = is never dynamic, and throw out the magical get one .() free semantics 21:33
I'm not sure we actually have a name for the time that = runs, though. 21:37
has $.x = $y is something like has $.x will build { $!x = COMPOSE { $y } } 21:38
where COMPOSE really means something more like OUTER, insofar as it isn't really composition time either, but when the "has" is being executed just prior to composition. 21:40
has $.x will now { $tmp = $y } will build { $!x = $tmp } 21:42
except with correct scoping...
TimToady I suppose an argument could be made that declarators that run = earlier than "now" are already autoclosing, so "has" should just autoclose and run at build time. 21:47
then you'd have to say "has $.x = FIRST { rand }" to get a single one. 21:48
that would fit better with the autoclosing of s[foo] as well.
SamB like run = "yesterday"? 21:49
TimToady not sure what you're asking... 21:53
svnbot6 r14662 | lwall++ | fib memo can now use list assignment, audreyt++ 22:05
TimToady if we did autoclose "has=", it's an interesting question what the visibility of $r would be after 22:08
has $.x = constant $r = rand;
or whethe we have an anonymous syntax of
has $.x = constant $ = rand; 22:09
which I also wanted for (state @ = 0,1,1).[$n] //= fib($n - 1) + fib($n - 2)
after all, if we allow a sig like ($,$,@), and the declarator introduces a sig... 22:10
but it's currently a syntax error.
TimToady I'm starting to think that ={...} vs ={{...}} is a design smell. 22:18
cmarcelo @tell audreyt in MO/C/Class.hs line 201, don't you want "return (name, val)"? 22:31
lambdabot Consider it noted.
audreyt cmarcelo: er, right :) 22:38
lambdabot audreyt: You have 2 new messages. '/msg lambdabot @messages' to read them.
audreyt @massage
lambdabot TimToady said 15h 32m 36s ago: interesting factoid: when I was profiling the "if->" patch, it came to my attention that about 90% of our current test failures are caused by that patch--seems to give
Span and Span::Num fits somehow. But it's not obvious from the failures how they're related to "if->".
cmarcelo said 6m 56s ago: in MO/C/Class.hs line 201, don't you want "return (name, val)"?
davidfetter seen audryt 22:40
audreyt davidfetter: greetings.
davidfetter hi :)
i'm in rio :) :)
audreyt so where di you end up staying?
davidfetter copacabana rio hotel
nsa. sra. copacabana 1256 22:41
audreyt is quite satisfied with le meridien :)
davidfetter w00t
audreyt oh, so we are close ish
davidfetter i may want to move elsewhere. the internet is not so great here :P
as in it's not in my room
pasteling "TimToady" at 64.0.7.8 pasted "proposed S12 patch making has= autoclose" (34 lines, 1.5K) at sial.org/pbot/20932
SamB you have to carry it in buckets?
audreyt oy. I got the hotel to relocate me to another room to get internet, also
davidfetter but at least i'm not sleeping on the beach this evening :)
i'll have to change hotels to get that. the internet is 8 floors down from my room 22:42
SamB, bit buckets ;)
SamB you have to carry the internet in buckets up eight flights of stairs?
audreyt TimToady: I like that more. I'll model it in MOH; please checkin :)
SamB how toilsome! 22:43
audreyt SamB: they have buckets of pigeons
davidfetter it's good exercise. maybe i'll be able to see my toes when i look down...
audreyt each carrying RFC 1149 packets
davidfetter i hope they won't be pigeon toes...
SamB hmm. thats a new one. 22:44
audreyt but having them flying around in the hotel causes trouble
so they're put into buckets
SamB IP over dead avian carriers?
davidfetter heh
audreyt no, just with contrainted mobility
SamB how is that better than having a person carry a briefcase full of packets?
davidfetter ah, so there's a venting & feeding spec for the buckets. ok :)
SamB, more geek cred. 22:45
audreyt SamB: that wouldn't be RFC complaint
I mean, compliant
SamB well, wait till april
audreyt and Standards is very important!
SamB submit proposal for "IP over bussiness carriers"
or something like that
audreyt . o O (IP over disease carriers) 22:46
davidfetter IP over Pointy-Hairs. i like it already
audreyt bird-flu-network
TimToady IP over IP lawyers...
audreyt TimToady++
davidfetter IP/SARS
lol
audreyt so you submit a patent to SYN and file a lawsuit to ACK?
davidfetter audreyt, how was your flight/transit to hotel? 22:47
audreyt davidfetter: flight got delayed 1hr. otherwise uneventful 22:48
davidfetter i had a bizarre little while @ the hotel. they hadn't heard about my reservation. 22:49
SamB IP over IP lawyers would have a patently absurd cost... 22:50
davidfetter <pt_BR>legal</> 22:51
SamB it would probably also take an awful lot of paper to write packets in legalese
TimToady never overestimate the bandwidth of a briefcase full of legal documents... 22:52
davidfetter hereinafter, notwithstanding the foregoing...
audreyt TimToady: class C { has $.x = die } C.new(x=>1) 22:53
won't die, correct?
SamB davidfetter: how many bits was that?
TimToady that is correct.
has= only fires if no explicit init
davidfetter 40000. at the usual rate of $500/hour, 1 hour minimum. 22:54
audreyt cmarcelo: still there? 22:55
TimToady $.x = die unless self.exists<$.x> or some such.
audreyt cmarcelo: perlcabal.org/~audreyt/tmp/for-cmarcelo-2 22:56
lambdabot tinyurl.com/y98ftz
audreyt cmarcelo: I think it's correct and useful enough to go in as Pugs 6.28 :) but quick sanity check still welcome 22:57
audreyt works on the glueing bits
TimToady hmm, if the topic is the currently initing attribute, it's almost $.x = die unless .exists;
audreyt TimToady: currently it's simply merged into a (:$x =) Signature part. 22:58
and let normal binding deal with it
since the default clause in Signature is also autoclosing and trigger each run
TimToady binding at beginning of BUILD call? or after?
has to take into account that body might have $.x = 123 22:59
cmarcelo audreyt: i'm here reading the changes. (btw, i'm keeping feather repo updated until you commit on pugs)
audreyt has to be beginning I think, since by BUILDALL time it's all done
if I understand correctly
i.e. it's done in BUILD binding time, essentially
and the body of BUILD is too late to change it
must do it in the sig dircetly:
submethod BUILD ($.x) { ... } # is fine 23:00
submethod BUILD { $.x = 10 } # is too late
TimToady that's when it's specced, though, or at least apo'd 23:00
submethod BUILD { { user-stuff } implicit init stuff } 23:01
audreyt oh hm.
TimToady including all the implicit BUILDs supplied by roles
audreyt that doesn't quite work on value objects... 23:02
i.e. this assumes a mutable hash as layout
that you can test for .exists and do overriding updates
TimToady submethods can be special
that's why we distinguish infrastructural methods
I'm using .exists metaphorically there 23:03
audreyt but within BUILD you can already call self.normal_method
so that means at user-stuff time it's already a full instance
davidfetter seen fglock
cmarcelo audreyt: what shell magic you use to make tags file? just "find | xargs hasktags -c" isn't enough for my vim, neither sorting the tags file [some tags wont work]..
audreyt or do you think tat it can be a partially-filled-in-prototype-thing ?
cmarcelo: "make ghci" and then ":ctags"
TimToady it's always been my assumption that BUILD should not assume a complete object in user code
audreyt ghci has builtin ctags and emacstags
TimToady: but $.x is a normal method 23:04
only $!x is not
and if we restrict BUILD to only operate on $!x then that is fine to have it incomplete
TimToady which is why at one point I conjectured that submethod requires $! instead of $.
audreyt since you are working on a staging-copy of the object
I think it's wise, as people will be confused when we say
TimToady or force $. to mean $! there, but only on known attrs 23:05
audreyt "$.x inside BUILD is really $!x and too bad if you had a virtual rw somewhere"
I think having $.x to force into $!x but $.x() diying
is awfully inconsistent
[particle] agrees. SWYM trumps DWIM here 23:06
TimToady it's fine by me too
construction time ops on "real" object can go in "new".
audreyt which means you will control BUILDALL by yourself 23:07
right?
if you override new, that is
TimToady the default BUILDALL is completely implicit generally
yes, explicit override of new
audreyt so new calls bless, bless calls BUILDALL 23:08
TimToady we expect people to redefine BUILD more often than BUILDALL
yes
audreyt and in the BUILDALL part, which visits BUILD for each segment of layout
and inside that segment, the object metaclass is constrained to only contain the layout of the already-built part (i.e. its superclasses) 23:09
and knows nothing about the yet-to-be-filled-in part
TimToady so perhaps we allow SUPER but not self
audreyt and so trying to use "self" as a full-fledged layout always fail
TimToady (calls, that is)
audreyt or maybe we don't have self.
er, jinx.
so submethod are even closer than subs this way 23:10
TimToady just got through speccing that self means the newish object...
self!privmeth would be okay
audreyt as is SUPER and quantified calls
TimToady since those are just subs
audreyt ok, maybe not quantified calls
but if 23:11
D is C; E is D;
and in D::BUILD time we actually have a D object
even if it's E.new calling it
TimToady well, my first inclination is to err on the side of "enough rope"
audreyt that may still work, as the layout match at that stage for D 23:12
mm, what is on that side again? :)
TimToady on the other hand, this is a good time to be conservative.
well, if someone is willing to go the trouble of saying self.MyClass::method to get at their own methods ahead of time, we should probably let 'em. 23:13
audreyt I think the problem largely goes away if SomeClass::BUILD always just see a SomeClass object as self
not as in liskov but as in concrete class
i.e. it's not a ChildClass-instance-being-filled-in operating under ParentClass's method table when ParentClass::BUILD is run 23:14
TimToady if we just disallow $.foo where $.foo is known to be $!foo here, that's probably okay for now.
audreyt but actually it's just a ParentClass instance, to be later augmented by ChildClass
this is strictly inheritence-is-delegation view 23:15
TimToady and maybe submethods merely carp a lot when you use $.foo where they think you should use $!foo. 23:16
audreyt but you can't use $!foo to assign to your parent class's slots
you have to use $.foo=
TimToady that's correct 23:17
audreyt even inside BUILD
TimToady that's not somehting a BUILD would carp about
audreyt so that use is lega
legal
cj audreyt: you mentioned that using mono as a runtime isn't out of the question. What steps need to be taken to get things moving?
TimToady my SUPER comment above
audreyt class C { has $.x is rw }; class D is C { has $.y is rw }; class E is D { has $.z is rw }
in D::BUILD
$.x=1 # is fine 23:18
$.y=1 # not fine; please write $!y
TimToady right 23:19
audreyt $.z=1 # not even possible
neither is $!z possible
TimToady though probably $.z isn't caught till pet peeve time. 23:20
audreyt cj: find someone to fly the #moose team and/or cmarcelo or me to the Ximian team (Boston? Utab?) :)
TimToady: point is that $.z fails with "method not found"
not "slot uninitialized"
I think.
TimToady "compatible with what?" 23:21
cj audreyt: Boston
audreyt TimToady: ok, I think we agree. will go make it happen at the code front :)
TimToady audreyt += * 23:22
audreyt TimToady: consider this:
class C { has $.x is rw }; class D is C { has $.x is rw } 23:23
does C::BUILD still fire and allowcate something
only to be later overriden?
i.e. if C is "has $.x is rw = die", it still dies
I think it's consistent, and natural fallout from the algorithm above
TimToady makes sense 23:24
audreyt nothingmuch: ^^backlog cursor^^^ TimToady ruled that Layout is determined per-class, and shadowing happens only on derived class, never globally. cheers :)
TimToady: and thanks for whack it out on spec-front :) 23:25
TimToady: the fun thing is that that means 23:26
class C { has $.x is rw = 1; method foo { $!x } } class D is C { has $.x is rw = 2 }
D.new.foo will be 1
D.new(x=>9).foo will still be 1
but it's probably natural. 23:27
"if you write $!x you give up on extensibility"
TimToady !extensible
audreyt hm wait. maybe the latter case is 9 after all
since C::BUILD also gets the x=>9 message
TimToady true 23:28
audreyt it's just the later assignment can't ever change that from outside
TimToady anyway, C's methods can still get at $!x despite override
audreyt but only C can do that
TimToady yup
audreyt which is excellent, because MP6 can represent this despite having no inheritence at all :) 23:29
audreyt remembers A12 said that was the plan all along.
TimToady yes, well, that was one of the basic design goals, to make sure private attributes have no influence on inheritance
indeed
aufrank takes back requests for class C { has @.x; has $.y := @.x[0] }, btw 23:37
svnbot6 r14663 | gnuvince++ | Added tests to t/operators/range.t to make sure that lists were forced to scalar context. 23:38
audreyt aufrank: hm? that is completely kosher except you have to write = $!x[0] 23:41
not :=
audreyt and not @.x 23:42
but @!x[0] should work just fine.
in general you can't := to either $.x or $!x unless you have a friendly layout 23:43
but p6opaque as I'm writing it is not friendly to that :)
aufrank is this idea of layout defined somewhere?
audreyt yes it's specced in S12 :repr 23:44
TimToady A12 originally
aufrank I confess I don't know when the term started springing up, but I haven't seen it until today
aufrank goes to look
audreyt layout is nothingmuch's term
it means a metaobject responsible for a representation
ie. :repr is a map from string names into layout objects
aufrank ok
so MOH is a layout for pugs 23:45
audreyt no, MOH is object model for pugs
in it I define a P6opaque layout
that is currently
TimToady most OO systems don't let you have pluggable layout, but this is specced in A12
aufrank gotcha
audreyt { staticSlots :: (Array Int Object), dynamicSlots :: (HashTable ID Object) }
aufrank so we could have all object as records like in OCaml if someone wrote the layout
audreyt where dynamicSlots is for the rubyish case of
eval " class C is also { has $!extra_field } " 23:46
audreyt aufrank: however, all I've said only applies if you called C.new(x=>1). 23:54
if you had instead written 23:55
C.bless({x=>1})
then none of it apply; you can always rebind $!x happily
because its layout is a Hash object that happily responds to mutable assignment.
the difference between C.bless(x=>1) and C.bless({x=>1}) is a subtle one :) 23:56
audreyt ( S12:497 ) 23:56
zptao like chicks with surprises inside? 23:57
audreyt heh :)