Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net Set by autrijus on 4 August 2005. |
|||
svnbot6 | r6262 | fglock++ | * added perl5/Hash Container; tests | 00:42 | |
r6263 | putter++ | Prelude.pm: Added support for regex :overlap modifier. But it's disabled until Rul infix:<~~> works in Prelude. | 01:10 | ||
putter | Supaplex: parrot is immature. it does not yet _run_ any interesting language. let alone run so well that the issue of releases would arise. tcl (in the parrot distribution), p6 (pugs), p5 (ponie, somewhere), and perhaps python (in parrot) are perhaps the most serious efforts. With p6/p5 having a community intent to run on parrot. My guess is it will end up being easier for languages to target parrot via p6, rather than directly. | 01:11 | |
Supaplex | ok | 01:14 | |
putter | autrijus, everyone: a worrisome observation - I'm seeing localized test instability (sometimes succeeds, sometimes fails) in some rules tests. There is a pugsbug illustrating pod contents determining success/failure, but this is unchanging test files. Perhaps the new use of macros is tickling the earlier problem. Or perhaps this is something new. | 01:16 | |
There is always the possibility that significant rules work should be deferred a bit longer, until the new runtime is in. | 01:17 | ||
Good night all. & | 01:30 | ||
Supaplex: thanks for your interest. | |||
autrijus | rehi | 05:21 | |
obra | reautrijus | 05:23 | |
QtPlatypus | Hi autrijus | ||
Khisanth | A! | 05:25 | |
autrijus | :) | ||
autrijus @ work | 05:26 | ||
vkon++ # pugscode.org/images/lambdacamels.png revised to have the greeks resemble "Perl" | 11:48 | ||
dinner & | 11:51 | ||
Aankh|Clone | autrijus: Good job on the XML backend. :-P | 12:12 | |
12:13
Aankh|Clone is now known as Aankhen``
|
|||
nothingmuch | autrijus: is the lambdacamels picture OK with oreilly? | 12:22 | |
nothingmuch just whored massive amounts of office supplies | 12:30 | ||
fglock | ping | 12:45 | |
nothingmuch: ping | 12:51 | ||
nothingmuch | pong | 12:58 | |
fglock: pong | 12:59 | ||
fglock | nothingmuch: I'm working on the runtime, but I need objects to define Pair and Hash - is it possible to use the metamodel for this? | 13:00 | |
nothingmuch | fglock: you want to implement Pair and Hash within the metamodel? | ||
that's very possible | |||
probably easy, too | |||
fglock | I want to "use" the metamodel to create Int, Str, Pair, ... | ||
nothingmuch | s/create/implement/ or s/create/instantiate/ ? | 13:01 | |
fglock | I have to "box" things before inserting in the Container | ||
nothingmuch | fglock: nopaste some pseudocode for how you want the interface to look, i'm not sure I understand what advice I can give yet | 13:02 | |
fglock | I've got native "int" and "str", and I want to create a Pair ('a' => 3) - I need "Str" and "Int" objects to do this | 13:04 | |
I need Int->new( 3 ) and Str->new( 'a' ) | 13:05 | ||
nothingmuch | right | ||
so there is a class Int which has some convenient methods | |||
and 'has int $:value;' | 13:06 | ||
right? | |||
and you want to know how this might be implemented in the metamodel? | |||
or you want to know if it's already been done? | |||
or...? | |||
fglock | Yes, I want to implement this class, probably inside the Perl6::Value modules | 13:07 | |
nothingmuch | ah | ||
so how would you like me to help? | |||
fglock | but it should use the object model from the metamodel, not Perl5's | ||
nothingmuch | okay | ||
in the minimetamdeol this is very very easy, and I'm now well versed in it | |||
in the real perl 6 metamodel it's probably more sugared | 13:08 | ||
but i need to reread it, as I'm out of date | |||
fglock | I just need a small example on how to start - It can be modified and refined later | ||
nothingmuch | basically the process is: you instantiate the class "Class", and get a new class | ||
you fill it up with methods and attributes and stuff | |||
this new class is a subclass of the class "Object" | 13:09 | ||
then you can instantiate this new class, and get an object | |||
fglock | I'll do some tests | ||
nothingmuch | in the minimetamodel this would look a bit like my $PairClass = $Class->new('$:name' => 'Pair', '%:methods' => { first => sub { ... }, second => sub { ... } }); | ||
uh, '$:superclass' => $object; | 13:10 | ||
then you can say 'my $this_is_a_pair_instance = $PairClass->new(...)'; | |||
you edit the attributes using ::opaque_instance_attrs, (maybe it has a diff name, I can't recall) | |||
want me to walk you through what I wrote yesterday? a good enough intro is the autoloading metaclass | 13:11 | ||
svn.openfoundry.org/pugs/perl5/Perl...loading.pl | |||
$Class->new creates a class.. This new class is a subclass of 'class'. From this class you create new classes, so it is, in fact, a metaclass too | 13:12 | ||
it has a name, and some methods | |||
it alters the way method dispatching is performed | |||
then we create $MyAuto, a class that has some_method, and AUTOLOADER | |||
it is a subclass of $Object | |||
and it's metaclass is $Autoloading | |||
instead of being a simple class, $MyAuto is an autoloading one | 13:13 | ||
thne we create $iAuto, an instance of $MyAuto | |||
and call methods on it | |||
is this becoming clear? | 13:14 | ||
fglock | cool - thanks! I think I can start coding an example | ||
nothingmuch | fglock: if something doesn't work nopaste it | 13:15 | |
it's slightly confusing at first | |||
but the moment you "get" it things start being easy | 13:16 | ||
C3 was by var the hardest example | |||
fglock | it would be nice to have a common API for the metamodels (it may be too early for that) | ||
nothingmuch | fglock: look at what stevan comitted yesterday | 13:17 | |
it should be similar to the minimetamodel because it's based on it | |||
it probably has nice sugar to let you create classes in a more declarative way | |||
13:45
Aankh|Clone is now known as Aankhen``
|
|||
fglock | MiniMetamodel doesn't run - "undefined value as a HASH reference", line 33 | 13:47 | |
autrijus | rehi. | 13:53 | |
www.cafepress.com/pugscode | |||
fglock | hi autrijus | ||
I'm working on the Str, Int .. boxed types | 13:55 | ||
autrijus | cool! | 13:57 | |
stevan | fglock: you should likely use the Metamodel 1.0 | ||
morning all :) | |||
fglock: 2.0 is in very early stages,.. | |||
fglock | stevan: yes, it passes all tests here | ||
autrijus | hey stevan :) | ||
stevan | nice t-shirts autrijus :) | 13:58 | |
autrijus | :D | ||
Limbic_Region | autrijus - did you see the question from nothingmuch about O'Reilly being ok with one of the images (presumably it had a camel on it) | 13:59 | |
<nothingmuch> autrijus: is the lambdacamels picture OK with oreilly? | |||
mjl69 | t-shirt? where? I need more. I wear my black and green perl shirts way too much. | ||
stevan | Limbic_Region: that version is not on cafepress | ||
Limbic_Region | stevan - I didn't say it was | ||
I was repeating a question to autrijus now that he is here | |||
stevan | Pugs t-shirts www.cafepress.com/pugscode | Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net | 14:00 | |
Limbic_Region | on nothingmuch's behalf | 14:00 | |
autrijus | Limbic_Region: I asked permission to use that camel when I worked on par.perl.org a while ago | ||
stevan | Limbic_Region: ahh, sorry :) | ||
autrijus | Limbic_Region: and I don't plan to sell that :) | ||
so I presume it's cool | |||
mjl69 | t-shirt link? Need more shirts... | ||
stevan | mjl69: see the title | 14:01 | |
autrijus | mjl69: www.cafepress.com/pugscode | ||
mjl69 | oh, dumb me again. | ||
autrijus | mugwump: you okay if I put the "powered by phd" there too? | ||
stevan | nice | 14:02 | |
mjl69 | I want to find one of those t-shirts that shows the geometric proof of the pythagorean theorem. I heard they are out there. | 14:04 | |
then a t-shirt to match all of the language books on my shelf I plan to study some day. | 14:05 | ||
I do always work the first chapter at least on the day they come in. Then on the shelf they go. | |||
autrijus | mjl69: you mean this? www.cut-the-knot.org/pythagoras/abc.gif | 14:06 | |
stevan: I'm uploading the metamodel.png :) | 14:08 | ||
Limbic_Region | mjl69 - geometric proof of the pythagorean theorem - which one, I know of several | 14:12 | |
in fact, there are an infinite number of them www.jimloy.com/geometry/pythag.htm | 14:14 | ||
autrijus | stevan: metamodel mouse pad + sticker is on :) | 14:19 | |
castaway_ | cool! | 14:21 | |
autrijus reboots and goes back to coding :) | 14:29 | ||
cafepress is fun though :) | |||
fglock | I've got "Int" working! | 14:31 | |
autrijus | fglock: woot! | ||
svnbot6 | r6264 | iblech++ | * Usual svn props. | 14:32 | |
r6264 | iblech++ | * PIL2JS: s/-CPIL/-CPerl5/, i.e. PIL2JS can "parse" PIL again. Next step is to | |||
r6264 | iblech++ | (e.g.) s/->[0]/->{pExpr}/. | |||
autrijus | iblech: if you'd like to fix it to use ->{expr}, that could work too | ||
iblech: what do you think? or pExpr is fine? | |||
iblech | autrijus: pExpr is absolutely fine | ||
autrijus | 'k | 14:33 | |
fglock | where can I find object hierarchy docs? | 14:36 | |
iblech | TSa posted his type lattice to p6l | ||
autrijus | fglock: there... is none. | ||
fglock | :) | ||
what's the difference between Bit and Bool? | 14:37 | ||
svnbot6 | r6265 | fglock++ | * perl5/ "Int" boxed value, using the MetaModel | ||
autrijus | fglock: bool is an enum subtype on Bit | ||
I think | |||
there's a synopsis that talks about it | 14:38 | ||
mjl69 | autrijus: That's the one! Just need to find the t-shirt. | 14:41 | |
thanks also Limbic_Regi (delay due to pesky day job, sorry!) | 14:42 | ||
svnbot6 | r6266 | fglock++ | * perl5/ Value - boxed type conversion "$i = $n->int()" works | 14:50 | |
14:51
autark is now known as jp-autark
|
|||
autrijus | mjl69: ping | 15:03 | |
mjl69 | autrijus: hi! | ||
mjl69 goes back to work again | 15:05 | ||
autrijus | mjl69: is this what you want? | ||
cafepress.com/autrijus/ | |||
mjl69: I _think_ that's the layout of the original Pythagoras proof | 15:06 | ||
not sure though | |||
fglock | autrijus, stevan: take a look at Perl6-Value-List/t/item-boxed.t | ||
mjl69 | wow, you can just put a shirt together just like that? | ||
autrijus | mjl69: yeah :) | ||
took me some time to draw that Visio thing though | 15:07 | ||
mjl69 | autrijus: I can really order that shirt? | ||
autrijus | mjl69: sure! | ||
svnbot6 | r6267 | iblech++ | DrIFT.Perl5: Escape \$@%" in double-quoted strings. | ||
r6268 | fglock++ | * per5/ Value - boxed types mostly done | |||
mjl69 | autrijus: you are the ultimate t-shirt man! | ||
autrijus | :D | ||
fglock | can you assign to a Pair's value - "$x.v = 10"? (I think not, because Pair are not containers, right?) | 15:23 | |
autrijus | fglock: Pair, like Ref, can point to a container | ||
svnbot6 | r6269 | fglock++ | * perl5/ Value - added Num->Inf; Num->NaN | 15:24 | |
autrijus | and I think it was ruled that $x.value is rw. | ||
which is to say, it returns a lvalue. | |||
which is to say, it can be assigned to | |||
fglock: but I think the .key is a singular value | |||
so you can't assign to .key | |||
fglock | Pugs doesn't permit assignment to .value | 15:26 | |
autrijus | the current runcore doesn't do that, yup. | ||
that's a known bug | |||
fglock | ok | 15:27 | |
you don't modify an Int - you modify the container, right? | 15:29 | ||
autrijus | right. | ||
see the container.png | |||
fglock | isn't Pair a container, then? | 15:30 | |
autrijus | I tend to think of it like | ||
class Pair { has $.key; has $.val is rw } | 15:31 | ||
so it's not itself a container | |||
but it does refer to a container | |||
fglock must go for lunch now & | 15:33 | ||
svnbot6 | r6270 | iblech++ | * util/drift.pl: Made it work here. | 15:41 | |
r6270 | iblech++ | * PIL2JS: Modified ~~50% of the *.pms to work with the new -CPerl5. | |||
coral | -CPerl5? | 15:49 | |
dudley | coral: compiles to perl5 data structures | 15:50 | |
coral | interesting | 15:51 | |
dudley | indeed | ||
coral | SV or PMC p5? | ||
that is, perl5 or ponie | |||
autrijus | coral: eval p5 | ||
coral | ok | ||
autrijus | as in , "bless(...)" | ||
ods15 | i never did get bless(), i thought it was some kind of bad perl joke | 15:52 | |
integral | if you've read SICP, <SICP> =~ s/tag/bless/ | 15:54 | |
iblech | autrijus: What's PPos' pExp? (It seems to be always undef...) | 16:04 | |
autrijus | iblech: it's because Exp doesn't derive Perl5 yet | 16:11 | |
iblech: it's the original syntax tree | |||
iblech | autrijus: ah, ok | ||
autrijus | I presume you don't actually use it | ||
iblech | yep | ||
autrijus | so all's well then | ||
svnbot6 | r6271 | iblech++ | PIL2JS: Ported PStmt, PPos and PStmts to -CPerl5, too. Only PVal, PVar, and | 16:25 | |
r6271 | iblech++ | Subs need work now (and bugfixing, of course). | |||
xinming | ?eval { 3+5 } | 17:40 | |
evalbot6 | 8 | ||
svnbot6 | r6272 | fglock++ | * perl5/ Value - "Pair" type | ||
xinming | ?eval { my $x = 3; "a" => 1, $b, $c ==> print }; | ||
evalbot6 | Error: unexpected ">" expecting term | ||
xinming | ?eval { my $x = 3; "a" => 1 }; | ||
evalbot6 | ('a' => 1) | 17:41 | |
xinming | ?eval { my $x = 3; "a" => 1; return $x ;}; | ||
evalbot6 | \3 | ||
xinming | ?eval { my $x = 3; "a" => 1; return bless $x,"haha"; }; | ||
evalbot6 | Error: No compatible subroutine found: "&bless" | ||
xinming | ?eval { my $x = 3; "a" => 1; }; | 17:42 | |
evalbot6 | ('a' => 1) | ||
xinming | ?eval { my $x = 3; "a" => 1; return $x ;} | ||
evalbot6 | \3 | ||
xinming | anyone here can tell me what that expression exactly returned? a closure or a ref to a scalar ($x) or a hash ref which contains {'a' => 1}? | 17:44 | |
autrijus | xinming: it returns a scalar $x. the ref thing merely indicates it's lvalue | ||
fglock | 'undef' is just an empty Scalar? or is it an object itself? | 17:45 | |
xinming | autrijus: may I refer the value of the key 'a'? | 17:46 | |
Or,If there is a way to get the value of it. | 17:47 | ||
ods15 | geez | ||
that crap looks like perl | |||
autrijus | fglock: undef is an empty anything. :) | 17:48 | |
fglock: think of it as C's null. | 17:49 | ||
fglock | ok | ||
autrijus | ?eval ("a" => 1).key | ||
evalbot6 | 'a' | ||
autrijus | xinming: like that? | ||
xinming | autrijus: hmm, that's what I want to know | 17:50 | |
if my $t = { my $x = 3; "a" => 1; return $x ;}; | 17:51 | ||
fglock | does .ref returns the class object, or is it always just the class name (string)? | ||
xinming | then $t<a> will get the value of a? | ||
iblech | fglock: class object, never string | 17:52 | |
xinming: No, $t will be a Code ref | |||
But if you wrote my $t = ("a" => 1) then $t<a> would give you 1 | 17:53 | ||
xinming | iblech: so the kv pair will be parsed but ignored. right? | ||
iblech | xinming: Right. | ||
autrijus | fglock: the current implementation is broken, but it's supposed to return a class object. | ||
iblech | xinming: That's similar as "sub foo { 1; 2; 3 }" -- the 1 and 2 can safely be optimized away | 17:54 | |
fglock should be writing this in Perl6 instead | |||
autrijus | they can be optimized away only if they are simple values :) | 17:55 | |
fortunately, "overloading the void context" is not yet heard of. | |||
iblech | Yep :) | ||
xinming | autrijus: Could you please tell me when 6.283 might be released? :-) | 17:56 | |
autrijus | xinming: good question | ||
xinming: it'll be released when we have proper support for Rules and Grammers, in addition to the object model. | 17:57 | ||
I'm afraid that's the best answer i have :) | |||
PerlJam | autrijus: On p6l, are you asking if roles become classes for instantiation purposes? | ||
autrijus | PerlJam: yes. | ||
PerlJam: not the previous "anonymous class gets vivified" foo | 17:58 | ||
but just "roles are liskov-equivalent to classes" | |||
"roles are just classes that additionally accepts 'does'" | |||
PerlJam | interesting and strange. | 17:59 | |
autrijus | larry's been thinking interesting and strange thoughts. | 18:00 | |
xinming | I can' think as high as Larry. So, I really don't know what the "roles" do really. just know, It is, really a "class", | 18:05 | |
but can't create object. | 18:07 | ||
mjl69 | roles? | ||
autrijus | xinming: it can create objects if all its methods are defined | 18:09 | |
in that case it's still the same as a class | |||
really, roles are classes with two reuse forms: "is RoleName" and "does RoleName" | |||
while classes only supports "is ClassName" | |||
it seems that's all the difference there is... oh, and roles can be generic (takes type parameters) too. | 18:10 | ||
putter | re pythagoras, www.headmap.org/unlearn/euclid/book1/1.47.htm www.sunsite.ubc.ca/DigitalMathArchi...byrne.html | 18:13 | |
xinming | hmm... If so, I think, Why "roles" exist might be for joining two (or more) "roles" into a class. | 18:14 | |
autrijus | putter: have you seen my pythagoras t-shirt at www.cafepress.com/autrijus/ ? | ||
xinming: yes. | |||
mjl69 | can create objects if all methods defined...like a C++ class with pure virtual methods? | 18:15 | |
putter | autrijus: yes, just did. neat! | ||
www.sunsite.ubc.ca/DigitalMathArchi...kI-47.html too | |||
xinming | autrijus: May I see your photo? :-) I've went your site. most photos aren't clear I think. | 18:16 | |
putter is tempted to create a "How Big Are Things?" T-Shirt www.vendian.org/howbig/ www.vendian.org/howbig/cube/ | |||
mjl69 | autrijus: I like your t-shirt compared to the other pythagoras shirts because it doesn't say what it is. That makes it more cool. | 18:17 | |
fglock | re:metamodel - I can't find the syntax to access an instance attribute - "'undefine' => { _('$.value' => undef) }" doesn't work | 18:18 | |
stevan | fglock: sub _ is probably ignoring the undef | 18:22 | |
I think something like if defined $value | |||
to set that | |||
fglock | I get "cannot call $?SELF from outside of a MetaModel defined Instance method" | 18:23 | |
stevan | hmm | ||
can you nopaste the entire code? | |||
'undefine' => { _('$.value' => undef) } should be 'undefine' => sub { _('$.value' => undef) } | 18:24 | ||
maybe that is it | |||
I made that mistake several times myself | |||
Perl 6 tends to stick with your | |||
s/r$// | |||
fglock | fixed! thanks (i forgot the "sub" :( | 18:25 | |
autrijus | wouldn't it be nice to | ||
package HASH; use overloas '&{}' | |||
sadly that doesn't quite work. | |||
stevan | LOL | ||
autrijus | may be possible with autobox.pm though. | ||
autrijus stops thinking bad ideas | |||
stevan scolds autrijus for even going there :P | 18:26 | ||
mjl69 | is this the channel with the bot that evaluates statements or was it #haskell? | ||
Limbic_Region | ?eval say 'here' | ||
evalbot6 | here bool::true | ||
mjl69 | oooh, I thought it was here. | ||
integral | #haskell has @eval | ||
mjl69 | oh, it's both. | 18:27 | |
autrijus | #haskell also has @plugs | ||
putter | re T-Shirts and objectsm an idea -- date them, eg, 2005. Or "Pugs 2005". "Pugs - The First Year". "Fall 2005". motivates sale closing because you wont be able to get the high-something "Summer 2005" (wow!) versions a month from now. | ||
autrijus | good idea. | ||
mjl69 | I suggested in #ruby-lang they should have one too since Ruby lends itself to that sort of learning/testing. I guess the fear is it opens the bot's system to attack. | 18:28 | |
buy the t-shirt without the date right away. Limited edition. | |||
putter | ;) | 18:29 | |
stevan | autrijus: you could date *and* version them | ||
get your 6.2.9 t-shirts now before 6.2.10 comes out | |||
mjl69 | convert the obfuscated camel code from the back of the perl 5 t-shirt to perl 6... | 18:30 | |
PerlJam | If you date and version them, put a feature list on the back so that either it continues to grow or (if it always takes up the entire back) the font keeps getting smaller :-) | 18:31 | |
putter | re obfuscated, good point. the largest target market is p5 people, so want to hook them... | ||
stevan | ChangeLog t-shirts!!! | ||
putter | lol :) | ||
mjl69 | like concert tour dates | 18:32 | |
PerlJam | exactly | ||
how does cafepress work exactly? Does it cost to update or put up a new entry or just when people buy? | |||
If it only costs when they buy you can automatically update the shift from the repository ;-) | 18:33 | ||
er, s/shift/shirt/ | |||
autrijus | mm changelog t-shirts | 18:45 | |
very crazy | |||
svnbot6 | r6273 | iblech++ | PIL2JS: Remaining .pms ported (PVar, Subs, PVal). Now bugfixing. | 18:46 | |
autrijus | ok. I'll date everything to expire at 1st november | 18:47 | |
18:47
spinclad___ is now known as spinclad
|
|||
autrijus | done. | 18:55 | |
putter | neat. err, just to ensure no misunderstanding, I was thinking of dates on the objects, rather than the webpage... but webpage is nice too. | 19:01 | |
putter ponders what to work on... | 19:03 | ||
nothingmuch: ping? | 19:05 | ||
coral | cafepress lets you put up one t-shirt and sell it for free | 19:12 | |
dunno about zazzle prices | |||
s/one t-shirt/one entry for each type of item/ | |||
putter | sigh. nobody is smoking p6 rules. :( | 19:13 | |
autrijus | coral: s/for each type of item/$& for each store/ | 19:19 | |
coral: and because a person can create +Inf of stores, that's not a severe restirction | |||
gah. past 3am already. | |||
autrijus uploads a brief journal and goes to sleep | 19:20 | ||
fglock | how do I get the class, inside a metamodel object? | ||
autrijus waves & | |||
fglock | good night autrijus | ||
xinming | ?eval { my $t = 3; 'a' => 1 }; | 19:27 | |
evalbot6 | ('a' => 1) | ||
xinming | which value will return in this expression? 3 or 'a' or 1 ? | ||
ooops.I mean the clous* | |||
maybe this sub | |||
?eval sub { my $t = 3; 'a' => 1 }; | |||
evalbot6 | sub {...} | 19:28 | |
xinming | ?eval my $x = sub { my $t = 3; 'a' => 1 }; $x(); | ||
evalbot6 | ('a' => 1) | ||
xinming | anyone here has a clue? | 19:29 | |
?eval my $x = sub { my $t = 3; 'a' => 1 }; $x().key; | 19:30 | ||
evalbot6 | 'a' | ||
xinming | hmm, Maybe It just returns a anonymous hash ref. | ||
iblech | xinming: re. It returns a pair, but pairs can .key, .value, .kv, .pairs, too | 19:40 | |
fglock | re: metamodel - how do I get the class of an instance? | 19:43 | |
xinming | ?eval my $x = sub { my $t = 3; 'a' => 1 }; my $w = { 'b' => 2, $x() }; $w.keys | 19:44 | |
evalbot6 | ('a', 'b') | ||
xinming | ?eval my $x = sub { my $t = 3; {'a' => 1} }; my $w = { 'b' => 2, $x() }; $w.keys | ||
evalbot6 | ('a 1', 'b') | ||
xinming | ?eval my $x = sub { my $t = 3; {'a' => 1} }; my $w = { 'b' => 2, 'hashref' => $x() }; $w.values | 19:45 | |
evalbot6 | (2, (('a' => 1))) | ||
xinming | iblech: thanks. | 19:46 | |
iblech | fglock: Generally, .ref. dunny about Perl5-MetaModel | 19:48 | |
xinming: np | |||
fglock | I'm implementing .ref :) | ||
iblech | oh :) | 19:50 | |
putter | autrijus: re "Day 190 (r6272): Pugs Store opens!", err, no. My suggestion was to have a date _on the shirts/mugs/etc _themselves__. Sorry I was unclear. | 19:54 | |
xinming | ?eval class TMP { has $.tmp = 3; } | 20:02 | |
evalbot6 | Error: unexpected "{" expecting trait, ";" or end of input | ||
xinming | ?eval class TMP { has $.tmp; } | ||
evalbot6 | undef | ||
xinming | ?eval class TMP { has $.tmp; }; my $t .= new TMP; | 20:03 | |
evalbot6 | Error: unexpected ";" expecting letter or digit, ":", term postfix, operator or "," The .= operator needs a type specification. | ||
xinming | ?eval class TMP { has $.tmp; }; my TMP $t .= new; | 20:04 | |
evalbot6 | \TMP.new(); | ||
xinming | ?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; | 20:05 | |
evalbot6 | \1 | ||
xinming | ?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; $t.tmp.say | ||
evalbot6 | 1 bool::true | ||
xinming | ?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp( 1 ); $t.tmp.say | ||
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
xinming | ?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; my $t = $t.tmp; $t.tmp.say | 20:06 | |
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
xinming | ?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; my $y = $t.tmp; $y.say | 20:07 | |
evalbot6 | 1 bool::true | ||
fglock | stevan: ping | 20:08 | |
xinming | ?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; my $y = $t.tmp(); $y.say | ||
evalbot6 | 1 bool::true | ||
xinming | hmm... By the way, Why can't auto-generated accessor method pass a value as a parameter? | 20:09 | |
?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; $t.tmp(2); $t.tmp.say | 20:10 | ||
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
iblech | Because they're declared as method tmp () is rw {...} | 20:16 | |
I.e. they can only be used as lvalues | |||
theorbtw1 | Not quite -- because they take zero parameters, other then the object, and in $t.tmp(2), you're calling it with one. | 20:18 | |
xinming | iblech: In fact, That's why I wonder why the default isn't method tmp( $x ) { if( $x ) { $.tmp = $x }; $x } | ||
theorbtw1 | The rvale isn't a parameter in an lvalue call, for better or for worse. | ||
xinming | I think This might be more often for a writable accessor. | 20:19 | |
theorbtw1 | xinming, because if you want to assign something, you should do something that looks like an assignment. | ||
putter | later & | ||
theorbtw1 | I'm off to bed. | 20:22 | |
svnbot6 | r6274 | fglock++ | * perl5/ Container - added "Scalar" type; tests. | ||
r6274 | fglock++ | .ref() doesn't work yet | |||
xinming | theorbtw1: hmm... thanks, In fact, sometimes, I am thinking in perl 5 for my personal habits. :-) | ||
theorbtw1: good night. | |||
iblech | I'm too. | ||
Night all :) | |||
xinming | night | ||
role X { is Y; }; class Y does X { }; What happens if we do something like this? | 20:27 | ||
fglock | xinming: there should be an error - circular inheritance or such | 20:28 | |
xinming | hmm: so role X { is SOME_CLASS; } will turn SOME_CLASS into a role, right? | ||
fglock | (unless it is a syntax error) | 20:29 | |
xinming | ?? | 20:30 | |
fglock: Could you tell me if I am thinking right. | |||
fglock | xinming - I don't know if it is allowed for a role to inherit from a class | 20:31 | |
xinming | A role is allowed to declare an additional inheritance for its class when that is considered an implementation detail: | ||
This is from Synoposis | |||
role Pet { | 20:32 | ||
is Friend; | |||
} | |||
fglock | ah, ok - but I think the inheritance only applies to the methods in the role. | 20:33 | |
svnbot6 | r6276 | iblech++ | PIL2JS: Stopped PIL2JS from dieing, but more work needed to make it work again (-> tomorrow). | ||
xinming | There are too many perl tricks I think useful in perl 6. :-) | 20:36 | |
s/think/like/ | |||
at least, we don't need to my $self = shift; for every method in a package anymore. | 20:37 | ||
?eval class TMP { has $.tmp is rw; }; my TMP $t .= new; $t.tmp = 1; my $y = $t.tmp; $y.say | 20:45 | ||
evalbot6 | 1 bool::true | ||
xinming | ?eval class TMP { has $:tmp is rw; }; my TMP $t .= new; $t.tmp = 1; my $y = $t.tmp; $y.say | ||
evalbot6 | Error: No compatible subroutine found: "&tmp" | ||
xinming | ?eval class TMP { has $.tmp; }; my TMP $t .= new; $t.tmp = 1; my $y = $t.tmp; $y.say | 20:46 | |
evalbot6 | 1 bool::true | ||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; $t.tmp; | 20:47 | |
evalbot6 | perl 6 bool::true | ||
xinming | it's said that all function call need the parenthesis. So is this wrong for pugs? | 20:48 | |
?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t; | |||
evalbot6 | Error: Wrong number of invocant parameters: 0 actual, 1 expected in "&TMP::tmp" | ||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t(); | ||
evalbot6 | Error: cannot cast from VObject (MkObject {objType = (mkType "TMP"), objAttrs = <ref>, objOpaque = Nothing, objId = 52}) to Pugs.AST.Internals.VCode (VCode) | ||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp( $t ); | ||
evalbot6 | Error: Wrong number of invocant parameters: 0 actual, 1 expected in "&TMP::tmp" | ||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t:; | 20:50 | |
evalbot6 | perl 6 bool::true | ||
xinming | ?eval class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp $t; | 20:51 | |
evalbot6 | Error: Wrong number of invocant parameters: 0 actual, 1 expected in "&TMP::tmp" | ||
xinming | seen autrijus | 20:52 | |
jabbot | xinming: autrijus was seen 1 hours 32 minutes 18 seconds ago | ||
putter | xinming: class TMP { has $.tmp;method tmp { "perl 6".say}; }; my TMP $t .= new; tmp($t:); | 21:05 | |
& | 21:08 | ||
mugwump | autrijus: yes, put the powered by PhD logo there! | 21:59 | |
it is at wellington.pm.org/archive/200506/pe...ide02.html ... the one on the next page is interesting, too | 22:00 | ||
I think the reverse side of a powered by PhD top would have to have a * followed by a little bibliography | 22:01 | ||
including paper names and references, perhaps we can brainstorm some here, stevan ? | 22:02 | ||
mugwump reads the journal entry | 22:04 | ||
svnbot6 | r6277 | fglock++ | * perl5/ - implemented .ref() in Num,Int,Str,Bit,Pair,Scalar | 22:09 | |
r6278 | fglock++ | * perl5/ - new methods .perl, .increment, .decrement | 23:20 | ||
r6278 | fglock++ | partially implemented |