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
Set by stevan on 15 August 2005.
svnbot6 r6649 | luqui++ | r471@feather: fibonaci | 2005-08-31 12:10:19 +0200 00:20
r6649 | luqui++ | Create model_theory.pod. I wrote the initial section which addresses
r6649 | luqui++ | the problem.
r6650 | luqui++ | r472@feather: fibonaci | 2005-08-31 12:25:25 +0200
r6650 | luqui++ | Mention union types.
r6651 | luqui++ | r473@feather: fibonaci | 2005-08-31 12:37:04 +0200
r6651 | luqui++ | Minor Edits.
r6652 | luqui++ | r523@feather: fibonaci | 2005-09-02 02:17:26 +0200
r6652 | luqui++ | Implemented "no VERSION" from rgs's new message. Also deleted my model
r6652 | luqui++ | theory writeup -- need to redo it now that I understand the problem more
r6652 | luqui++ | clearly.
luqui woah, karma spam
jabbot luqui: spam has neutral karma
luqui okay good
because I really didn't commit that much...
?eval no 6 00:23
evalbot_6652 pugs: Perls since v6 too modern--this is v6.2.9, stopped at "<eval>" line 1 column 5
geoffb heh 00:31
brentdax karma autrijus 00:40
jabbot brentdax: autrijus has karma of 574
brentdax Heh.
luqui only 574? 00:41
geoffb It appears to get lost on occasion
karma luqui
jabbot geoffb: luqui has karma of 10
geoffb see, that's just wrong
perlbot, karma luqui 00:42
perlbot Karma for luqui: 1
jabbot geoffb: luqui has karma of 10
geoffb perlbot, karma autrijus
perlbot Karma for autrijus: 46
jabbot geoffb: autrijus has karma of 574
geoffb sigh
luqui karma geoffb 00:43
jabbot luqui: geoffb has karma of 5
luqui karma jabbot
jabbot luqui: jabbot has karma of 9
luqui haha
wingofam--
karma wingofam
jabbot luqui: wingofam has neutral karma
geoffb finally converts his cvs repository completely to svn, with a strict policy of svk-only client usage. :-)
luqui trying to bum karma off me then, are you 00:44
well, it works. svk++
geoffb I wondered what you meant.
No, I was just happy and wanted to share. :-) 00:45
luqui I figured :-)
luqui wonders if it is time to start infiltrating #perl 00:48
Supaplex perlbot: karma Supaplex 00:49
perlbot Karma for Supaplex: -3
jabbot Supaplex: Supaplex has neutral karma
Supaplex yay
:-X
Supaplex demands a recount
luqui how did that happen?
Supaplex blame it on q(b).q(u) x 2 00:51
luqui ?eval "foo" 00:57
evalbot_6652 'foo'
stevan luqui: what is the model_theory.pod? 01:00
Supaplex ?eval 0
evalbot_6652 0
luqui it was the first cut of my writeup for solving the expression problem
adding generlizations of roles and classes, called "theories" and "models"
stevan ah
hey,.. any thoughts on how one could speed up C::MM::Pure? 01:01
luqui at the very base, it's a neat idea (and it might be worthwhile contemplating how it will fit into the metamodel)
write another dispatcher
stevan replace C::MM::Pure::Slow?
luqui yeah
there's another one in there
that was reasonably fast... but it was wrong
the algorithm was fundamentally flawed 01:02
I know it's possible to compile the methods into O(n) (n is the number of methods) type check
stevan right and slow is better then wrong and fast
luqui ::Slow is O(nm) (n is the number of methods, m the number of arguments) 01:03
rather, compile it to O(n+m)
(you still have to check that all your arguments match)
but the algorithm for doing that looks a little tricky
stevan it looks like you jump out quick if the number of args is not the same
luqui so I haven't nailed it down yet 01:04
if it's too few, yes
stevan but then you have to do the exhautive searching
are you sorting the list of canidates at all?
luqui that's what the other dispatcher did 01:05
stevan ok
is that where it went wrong?
luqui not really
stevan ok
so that idea may be salvagable
luqui you can sort specific to general
stevan my other thought,.. and this may be not worth it
luqui but you still have to check all of them to get ambiguities :-( 01:06
yes?
stevan is to use the stringification you have going on to do fast matching
it would only help specific matches
luqui I wondered about going for a caching technique
stevan so I am not sure it would really be a gain
luqui caching would be a huge gain
stevan did you read yuval's old proposal?
luqui but you can't do it for subtypes, etc. 01:07
but most of the time you aren't doing subtypes
stevan I know CLOS uses some kinds of caching for the generic methods
luqui yuval's proposal about what?
stevan MMD
luqui basically turning every method into a multi?
stevan nut quite 01:08
svn.openfoundry.org/pugs/docs/notes/mmd.kwid
luqui oh, the heuristic ordering
01:08 Lopo_ is now known as Lopo
stevan yes 01:08
he has short name and long names
if it doesnt match the short,.. forget about the long
but this is in the general dispatcher 01:09
luqui you could certainly do that kind of matching
note that subtype needs to have a base type
stevan while I know that @Larry.pick does not want MMD for all
luqui get_base(Subtype base cond) = get_base(base)
or something like that 01:10
stevan I think one some level this is an implementation detail
luqui methods are exactly single-invocant multimethods
the semantics are the same
stevan yes
luqui but for some reason, the syntax differs a little
but I never learned how
stevan one thing I found is that you get argument checking for free with multi-method
luqui stevan, 'splain 01:11
stevan multi-methods have to type check
luqui you mean compile-time?
stevan if multi-methods are implemnted like you did,.. which is all enclosed inside a single element
code element
then you end up with 2 layers of dispatch in the metamodel 01:12
1) the short name,... finding the method in the class hierarchy
and then 2) is the invocant and args matching
this is done by C::MM::Pure
at least right now it is if you use the multi_sub() constructor I hacked
luqui not sure I follow. I probably know what you're saying, I just can't determine that you're saying it. 01:13
stevan :)
ok 01:14
the SMD dispatch mechanism
and more specifically the subroutine parameter checking
ideally that is done at compile time
but since it is not required,... you can't always do that
luqui well, smd not done at compile time
stevan I am talking purely about subs now 01:15
luqui okay
stevan so ,.. there must exist code to check the args
and check the types of args
luqui oh right
stevan this includes determining subtype relationships, etc etc etc
luqui so if every sub is a multi, the multi mechanism is checking the args anyway
stevan yes
exactly
for free :)
luqui cool
stevan because it is just how MMD works
now,.. if we do some optimizations for MMD with only one variant 01:16
we can probably avoid any performance penalty
luqui I imagine so
such an optimization would forbid adding new variants later 01:17
stevan It also simplifys the meta/class/instance-method distinctions
and possibly simplifying the dispatcher in the metamodel
luqui always a good sign
stevan yes,.. simple == good
luqui I've always found that the semantics that cause the implementation to be simpler end up being more correct 01:18
stevan beautiful design is almost always good design
and simple is almost always beautiful
luqui let me explain the "theory" concept to you, so you can see if it already "beautifully" fits into the metamodel 01:19
stevan ok
shoot
luqui are you familiar with type classes in haskell?
stevan uhm... enough I think 01:20
I have algorithms right here if I need to refer :)
luqui a theory is kinda like that, and kinda like a role
but it's more general than both
so a role is a contract that says "if you implement these methods for me, I'll implement these methods for you"
so is a type class
stevan k 01:21
luqui a theory is a contract that says "if you implement these multimethods for me, I'll implement these multimethods for you"
stevan hmm
luqui it can act on multiple types at a time
luqui is trying to think of an example 01:22
stevan ok,.. lemme just ask a question
so Role is added to one class
but Theory is added to many
luqui this is where theory is more like type class than role 01:23
you "instantiate" a theory (using a "model") that tells it which methods to define
stevan basically any types/classes which it's multi-methods can "service"
luqui uh, kinda
so a theory doesn't itself define a type
stevan is starting to think CLOS style generic-methods are a really good idea 01:24
luqui instead, it defines more a constraint
stevan yes, I think I get it
luqui what are CLOS generic methods
stevan :)
in CLOS instances have slots and superclasses
but no methods
(remember classes are just instances of standard-class) 01:25
luqui righto
stevan the methods are defined by generic functions
luqui multimethods :-)
stevan a generic function is basically a multimethod
yes
I used to think it was interesting,.. but I liked the idea of neat little packages with methods in them 01:26
luqui well, you also run into that bit about accessors
stevan but now I am seeing the power of being able to define a new variant of the generic function anywhere
Larry suggested on p6l at one point in a metamodel discussion about accessors probably just being roles 01:27
but roles that were generated on the fly by the metamodel
luqui wait -- each accessor is a role? 01:28
stevan this way we can get role-style conflict resolution
not each accessor... all accessors in a class
luqui okay good
stevan class Foo { has $.bar; has @.bar; has %.bar; }
luqui i mused about having each method be a separate role, so that you could express nicely "I just need an object that has this method"
stevan that is problematic
it you make it a role 01:29
luqui so then you're forced to define your own bar()
stevan then the three bar() accessors conflict and the Role conflict catcher will force you to disambiguate
yes
:)
I am planning on applying it to MM2.0 once I have roles in place
luqui somehow I think that that's not really appropriate though 01:30
stevan why?
luqui roles have a strong conceptual importance
stevan uhm
how does that take away from it?
luqui (I didn't used to think this; if you look at my very early perl 6 OO proposals you'll see something very different)
stevan honestly I think Roles are becoming a catch-all for "things we are not sure about" 01:31
luqui I don't think they should be
stevan "its just a role" is heard to often for my taste :)
I agree
but it seems that they are getting muddled
luqui A role specifies conformance to an interface
stevan only partially 01:32
luqui and that interface can have some algebraic properties that can't be specified in code
and that last statement is the important one
stevan explain more please
luqui for instance, it does not suffice to implement a < operator to do the Ordered role
stevan and remember,.. I was either high or sleeping through most of math class :P
so go easy on me 01:33
why not?
luqui that operator needs to be transitive and antisymetric (so if a < b and b < c, a must be < c)
also, if a < b, then b must not be < a
and for instance, IO::All implements a < operator
stevan yes, but IO::All is insanity
luqui but that doesn't mean that IO::All is ordered, because it doesn't satisfy those properties 01:34
buu Fun though
stevan right,.. but that is easy to determine since IO::All would not implement Ordered
luqui well, you can see some other things that aren't insanity
stevan, exactly
stevan but only the operator Ordered asked for
stevan wonders if luqui has read all the original trait papers yet 01:35
luqui and that's why roles must not be spuriously made as parts of implementations
no
"all the accessors in a class" is not a concept, and it may not make any sense at all without the methods to support them
stevan why?
luqui that means that whoever has those accessors does that role 01:36
so roles could certainly be used as an implementation detail to get the disambiguation behavior
but logically, it isn't a role
oh, two statements back, s/does that role/can do that role/ 01:37
stevan it would be an anon-role
luqui sure, but why even talk about that then?
it shouldn't be exposed to the language 01:38
stevan it wont :)
luqui oh, then I've been preaching to an empty audience
stevan it will be part of the class builing process
no I hear you
your concern is valid
the Role that would be generated would essentially be specific to that class only 01:39
I am thinking it would either be totally anon.. and so not show up in does()
or it would be the same name as the class itself
luqui so it's probably best to abstract the disambiguation code so you can use it outside of roles
stevan and so then does() would also respond to the classname
well... here is the thing
I know that ~~ is supposed to do does() 01:40
if the role is composed with the accessors as well as the regular methods
and applied,.. then we have a valid does() which represents that specific class
s/does()/Role/ 01:41
luqui right. that's a bit from the model theory thing I was thinking
every model comes with a valid theory
(but not vice-versa)
so in plain perl 6-speak, every class comes with a valid role
it's the interface of things that behave exactly like that class :-)
basically, I don't want Foo ever to refer to a class 01:42
instead, it always refers to a role, so that you can implement mock types for that class
stevan :)
so this makes sense
to build this Role
luqui yeah, I think so
stevan :) 01:43
luqui dinner &
stevan is very pleased with bookpool.com right now 01:52
TAPL should be here tomorrow :)
stevan & 01:57
luqui fg 02:13
infiltration sucessful! 02:17
buu hahaha 02:30
luqui why buu, why?
the infiltration has turned into a perl6-dissing session 02:34
darn
this is why I'm not a social engineer
buu luqui: That tends to happen with great frequency 03:51
You should have heard the conversations after I learned about $^X 03:52
luqui heh, yeah 03:54
people don't seem to understand that these features are to make your life easier in limited circumstances, and aren't meant for daily use
or maybe daily use, but not minutely use
and I don't know what all that consistency crap was 03:55
but I can see the reason for the backlash
people fear change :-)
it's going to be difficult to sneak those line-noisy looking features into people's brains without them noticing
Supaplex :) 03:56
geoffb Anyone happen to remember the URI for harrorth's darcs repo? 04:00
Supaplex I know it started with a / 04:21
luqui Supaplex, :-p 04:32
it probably says in harrorth, right? 04:33
svnbot6 r6653 | luqui++ | r2977@jabberwock: fibonaci | 2005-09-01 22:34:16 +0000 04:40
r6653 | luqui++ | No, deleted model_theory.pod, for real.
putter geoffb: a quick thought: Prelude.pm is basically a ordered(?) bag of several chunks of code, mostly independent ones. why not add a marker between them, compile separately, and link? 04:45
&
luqui I think it's more like a set 04:55
and I think the reason we don't is because most of us don't have trouble compiling it
but for those of you who do, that ain't a bad idea 04:56
geoffb There are actually a couple big things that hurt small memory compiling: 04:59
1) Sheer size of PCP Haskell output
2) compile and link still done in single pass mode
I believe 2) is fixable with makefile changes, but it has not risen to the top of my tuits, because it's not enough of a savings to make PCP possible for me. 05:00
oh, and luqui: I think harrorth somewhere does link to the repo, but I wasn't finding it in first 5 or so places I looked. 05:01
05:26 davidra is now known as jp-autark2
svnbot6 r6654 | luqui++ | r528@feather: fibonaci | 2005-09-02 08:07:39 +0200 06:10
r6654 | luqui++ | Added a test for lexically bound subs.
dduncan fyi, I have finally released on CPAN my updates from the last 2 months, and the newest versions of all the Rosetta-related distros are once again compatible with each other 06:14
coming up next ... a set of "Perl Best Practices" inspired changes
brentdax Kontent 0.02 was 4.6 kilo-lines--think that's the msot Perl 6 anyone's written yet? 06:32
(code *and* docs.)
geoffb brentdax, how much just code? 06:55
brentdax I'm not sure--is there a tool I can use to filter the POD out? 06:56
geoffb Hmmm . . . I know there are for P5, I'm not sure about P6
But you can always do it by hand, since POD is line and block oriented . . . 06:57
Just run through the file, printing based on the state of a flip-flop (controlled by lines beginning with =head, =pod, =for, =cut, and so on) 06:58
brentdax They aren't all that different as far as POD vs. not-POD is concerned--I'm using `perldoc` to view them, after all.
geoffb fair enough. 06:59
geoffb really hates pod, so doesn't know the toolset extensively
brentdax Why the hate? 07:00
geoffb It is a horrid syntactic mess. It's almost the worst possible implementation of a "free text" markup language. 07:02
I am *very* happy that Perl 6 will support KWID out of the box
It may not be perfect, but it beats the pants off POD 07:03
brentdax Looks like 2928 non-POD lines.
Granted, that still includes comments, empty lines, single-brace lines, and so on, but... 07:04
geoffb Hmmm, so far I think my largest single Perl 6 file is 571 lines
brentdax This is across ~30 files. 07:05
Suppose I shouldn't really be surprised it takes so long to parse and run.
geoffb Wow, Prelude.pm is only 511 lines . . . so we both have that one beat. :-) 07:06
nodnod
There's a significant pause before my script actually launches . . . .
brentdax Give me a minute and I'll see how long it takes to -c this beast. 07:07
29 seconds, looks like. 07:08
(24s user, .053s system)
geoffb yeehaw
brentdax And it runs even slower--to render some of the larger help pages I wrote, I actually had to bump Apache's timeout settings. 07:09
(They default to five minutes; I had stuff that was taking six minutes and change to render.)
geoffb oh my 07:10
So far my graphics code is pretty slow, but not quite that slow. :-)
brentdax In outline, I had code that would recursively look up pages in a database via DBI, extract the attributes, create a few objects, call a few methods, generate a big tree by parsing a markup language with an amazingly primitive regex-based parser, recurse down the tree to generate HTML, and finally spit the HTML out. The parser did a ton of string twiddling--I never did any formal profiling,... 07:13
...but when I had tracing code in that part of the process always seemed to take the longest--and the renderer did lots of concatenation.
geoffb yowza
brentdax I expect a big win if I redesign things to output the HTML as I go rather than building it up into a big string. 07:14
But, like quite a few other things, that can wait. 07:16
autrijus greetings 07:30
brentdax: you there?
geoffb g'day, autrijus
autrijus yo geoffb
07:31 jp-autark2 is now known as jp-autark
autrijus ooh, Kontent 0.02 07:31
wouldn't work on 6.2.9? 07:32
that probably means we need to release soonish
again syncing with parrot's monthly release
geoffb How long until parrot's release? A week? 07:34
autrijus any day now 07:35
another 3 days, if the past months is of any indication
geoffb Is Chip in the US? It's a holiday weekend here 07:36
autrijus yeah
dduncan Its also a holiday weekend in Canada ... or BC anyway
oh, and greetings
geoffb greetings, dduncan 07:37
dduncan ditto
this all said, I'm about to go to bed ... as mentioned earlier, I just put my last 2 months of updates on CPAN ... with more to follow any day ... 07:38
the very next releases are special because they mark the first time ever I will use perltidy
gaal greets everyone (night dduncan!) 07:39
dduncan greets you also
A suggestion ... one of the Perl Best Practice things is that indents are done with spaces (4 per indent level) rather than tabs ... 07:54
in a casual search of Pugs, it seems a lot of it is this way, but some chunks aren't
the other week I already converted the Perl 6 locale-keyedtext to spaces, but other areas remain 07:55
this might be something worth doing before the next release
unless there are any objections, I will see to doing this
... over the weekend 07:56
autrijus I personally use spaces over tabs 08:01
if you do so, be sure to add a note in lib/pugs/hack.pod
luqui ?eval sub foo($x) { $x + 1 } sub bar(&foo) { foo(2) } bar({$^x + 2}) 08:02
evalbot_6652 *** cannot cast from VRef <Sub> to Pugs.AST.Internals.VCode (VCode) at -e line 11, column 5-122
autrijus luqui: got a test for that?
luqui well, it didn't do what actually went wrong
I just checked in a test for what actually went wrong 08:03
(I was screwing with my pugs, which is what evalbot_6652 uses, so maybe it's my code)
autrijus indeed as it worksforme
locally
I'll bbiab
luqui autrijus, by "worksforme", you mean it doesn't die 08:04
it doesn't do what it should
which is return 4
?eval sub foo($x) { $x + 1 } sub bar(&foo) { foo(2) } bar({$^x + 2}) 08:06
evalbot_6652 3
luqui ?eval 0 !! 0 08:22
evalbot_6652 bool::true
luqui ?eval 0 !! 0 !! 0
evalbot_6652 bool::false
luqui uh, where'd that operator come from?
dduncan comment added to hack.pod 08:23
oh, and that's a smart thing, having evalbot say what revision its running ... I don't remember it doing that a month ago 08:24
autrijus luqui: !! is apparently "nor" 08:27
svnbot6 r6655 | Darren_Duncan++ | In lib/pugs/hack.pod, added asuggestion under 'Editing' to follow Damian's 'Perl Best Practices' where applicable, such as doing all indenting with spaces 08:29
luqui autrijus, is there a spec for that?
lhooq all indenting with spaces? 08:30
luqui I agree with that, considering that the *best* way to do indentation is hard to do
(use tabs up to the code indent level, and use spaces after that for alignment) 08:31
?eval 0 nor 0
evalbot_6652 bool::true
luqui can't find a spec for nor 08:36
and seems only to recall vague musings on the subject
dduncan any decent text editor will allow you to continue typing the tab key to do indents, but will indent a run of spaces instead 08:38
so its actually no more work than using tabs 08:39
s/indent/insert/
second copy only
luqui uh, I don't think so
you're referring to what I said was the best way? 08:40
dduncan yes
it is said that spaces are the best way to indent
luqui I haven't found a text editor that will tab up until I want it not to tab, and then space afte rthat
well, with spaces, if somebody likes it two spaces while you like it four spaces
that person is hosed
dduncan everybody has preferences, but 4 spaces is the happy middle ground ... sayeth the book 08:42
luqui yeah, I agree 08:43
again, with the proviso that you can't do it the best way :-) 08:44
dduncan it's also said that one can run perltidy or some other utility automatically on checkout/checkin so that a person always sees their favorite way, but all repository code is consistent
luqui which lets everybody have his cake
yuck
dduncan I'm not going to that trouble though, I'll just adapt to the best way
luqui that kills custom formatting
one of the main reasons Larry does not make whitespace significant
dduncan if the utility is customizable, it can be set for whatever custom formatting you want
luqui no no no, I mean local custom formatting 08:45
*just this function* needs to be indented weirdly because it will help you understand it
dduncan its not a matter of the compiler caring, its a matter of all humans being able to see the same thing when they look at a document
luqui yeah, so let me finish my sentence :-)
one of the main reasons Larry does not make whitespace significant
is so that you can indent customly when you need to to increase clarity 08:46
even if that indentation is not "by the book"
luqui sleep & 08:47
dduncan well, you don't have to use the utilities; I don't
as for the book, its only a suggestion that is backed up with reasons ... there are always exceptions ... 08:48
the main important thing is that a project is consistent with itself
a quick glance I made the other day suggested that over three-quarters of pugs was indented with spaces, and 4 per indent level 08:49
my suggestion was partly to alter the other part to be consistent with the majority
fyi, I have always used tabs to indent, but using spaces instead is one thing I am changing about my work habits, for the greater good 08:50
wilx Tabs are evil.
dduncan and so, there are no objections to removing all the tabs? 08:51
luqui not in particular, no
dduncan so then, I'll get to it this weekend
dduncan now lay down to sleep 08:52
09:07 Aragone is now known as Arathorn
autrijus amazing! my newly purchased 80gb laptop HD just died _again_ 10:23
I'm seriously contemplating ataraid for the laptop :-/
autrijus goes off to buy a replacement and hope restore will not take too long this time
luqui :-(
autrijus what's wrong with my laptop
maybe it's because I put it upside down to run overnight without air condition 10:24
maybe it's because I constantly drop water into it
maybe it's that I hold it on my left hand and bumps into stuff all the time
mmm the possibilities
luqui maybe you need a waterproof, water-suspended laptop 10:25
autrijus that sounds like a good idea 10:26
obra autrijus: I sort of wonder if you'd do better with a mini laptop and a heads up display 10:28
clkao grins at autrijus
obra: he tried 10:29
autrijus obra: too bad for my eyes
it's easy to get tired coding on a HMD 10:30
clkao you need brain mount display
autrijus right, I need implants
obra hm. 10:31
I really want a convertable tablet. 10:32
acme the lenovo tablet looks nice 10:43
obra the X41? 10:52
acme what does has $:pool mean? 10:57
luqui the current class has a private member variable called $:pool
(the : means it's private)
acme aha
luqui though we seem to be leaning toward damian's idea that the private : should be spelled _ these days 10:58
Juerd Rehi!
The neat thing about _ is that it *isn't* special, right?
luqui no, but it is
Juerd Then I'm against
luqui we're just taking convention and enforcing it just a little bit 10:59
Juerd In almost every snippet of code, I find a good use for prefixed _s
luqui Juerd, is it always the same use?
Juerd No
OTOH, this is probably only for methods and properties?
luqui attributes, yes 11:00
Juerd Oh, right, attributes in Perl 6 :)
Properties is Perl 5 lingo
luqui it is?
Juerd (Attributes is too, but that's what is now traits - right?)
Yeah
luqui never heard of that one
luqui heard of attributes, though
Juerd I investigated that thoroughly to name Attribute::Property
Which introduces an attribute called Property :)
Concensus in Perl 5 is to call object attributes "properties", like they are called in at least visual basic 11:01
luqui how very confusing :-)
most .net languages call them so
Juerd People using the word "attributes" for this often aren't aware of the OTHER THING called so :)
Generally, "attributes" for object attributes is found mostly in pre-5.6 documentation 11:02
luqui should really get at least a little sleep before school tomorrow 11:05
luqui &
Juerd Sleep well 11:15
svnbot6 r6656 | scook0++ | * More Parser Haddock docs 11:33
xinming ?eval [+]@[1,2,3] 11:57
evalbot_6652 Error: unexpected "@" expecting "\171", "<<", ".", ":", "(", block construct, "::", term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
xinming ?eval [+] @[1,2,3]
evalbot_6652 Error: unexpected "@" expecting block construct, ":", "::", term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
xinming ?eval my $ref = [1,2,3]; [+]$ref; 11:59
?eval my $ref = [1,2,3]; [+]@$ref;
?eval [+](@[1,2,3])
evalbot_6652 [1, 2, 3]
6
Error: unexpected "[" expecting program
xinming seen autrijus 12:30
jabbot xinming: autrijus was seen 1 hours 59 minutes 38 seconds ago
stevan :) 12:42
TAPL is on it's way here
stevan loves the internet :) 12:43
GeJ stevan: grabbing ebooks on P2P networks is baaaaaaad, you know? :) 12:48
oh you mean, online shops?
sorry... my bad
stevan GeJ: not a big p2p fan anyway 12:49
but yes, I mean bookpool.com in particular
GeJ hum, didn't know this one... 12:51
stevan GeJ: it's a nice one,.. they have good deals on tech books
GeJ I just ordered a few books from Martin Fowler on amazon, the prices seems more or less the same. But I'll keep it in my bookmarks. 12:53
stevan they are sometimes a few dollars less than amazon
but they tend to have good sales,. and the selection is huge
GeJ I'll have a look and see about world-wide deliveries... 12:54
stevan hmm, that they might not do
GeJ I'm going to move to the middle of nowhere next year, and I need to be able to feed my shelves with new books 12:55
svnbot6 r6657 | Stevan++ | Perl6::MetaModel 2.0 - 13:38
r6657 | Stevan++ | * added a 10,000 ft. view updated for MM 2.0
r6657 | Stevan++ | * moved Syn 12.5 over from MM 1.0 to here
fglock stevan: ping 13:39
stevan fglock: pong 14:05
fglock stevan: I worked a bit on 'Type' yesterday 14:08
I'm still not sure what a Type is 14:09
(Class | Sub | Code)
stevan fglock: I am not sure about Type either 14:10
svnbot6 r6658 | iblech++ | * pugs::hack: Extremely minor cosmetic fixes. 14:15
r6658 | iblech++ | * t/statements/for_with_only_one_item.t: Expanded tests based on p6l feedback,
r6658 | iblech++ | Juerd++, see www.nntp.perl.org/group/perl.perl6....age/22971.
r6658 | iblech++ | * Removed t/operators/binding.t and added t/operators/binding/scalars.t (former
r6658 | iblech++ | binding.t), t/operators/binding/arrays.t (39 tests), and
r6658 | iblech++ | t/operators/binding/hashes.t (30 tests).
r6658 | iblech++ | * PIL2JS: Prelude::JS::Array, Prelude::JS::Hash: Binding of not yet existing
r6658 | iblech++ | array/hash elements should autovivify (i.e., @array[$out_of_bounds_index] :=
r6658 | iblech++ | ..., %hash<not_existing_key> := ... should work). With these fixes, PIL2JS
r6658 | iblech++ | passes binding/scalars.t 28/28, arrays.t 36/39, and hashes.t 30/30. :)
r6659 | iblech++ | * Usual svn props. 14:33
r6659 | iblech++ | * New t/var/assigning_refs.t: Tests for @array = $arrayref, @array =
r6659 | iblech++ | ($arrayref,), @array = ($arrayref), etc. (and the same for hashes).
r6659 | iblech++ | Juerd++, see www.nntp.perl.org/group/perl.perl6....age/22959.
cognominal ?eval say @p == 0 14:38
evalbot_6652 Error: Undeclared variable: "@p"
cognominal ?eval my @p; say @p == 0
evalbot_6652 1 bool::true
cognominal ?eval my @p; say +@p == 0 14:39
evalbot_6652 1 bool::true
ycheng help: "$a = <>;" in pugs ? 14:41
14:44 typester is now known as typeout
PerlJam ycheng: $a = =<>; 14:44
ycheng: unary = is an iterator. Iterating over the empty string will act like the diamond operator in perl5 14:45
ycheng PerlJam: it works, but still hard to understand. 14:53
Khisanth the fish op :) 14:56
PerlJam ycheng: what's hard to understand exactly? 14:57
ycheng: If you have a file handle in $fh, then =$fh will read a "record" from that file handle (where "record" is typically a line) 14:59
ycheng PerlJam: oh
PerlJam: I thought it will be something like $fh.read() or something
PerlJam: why $a = = ""; doesn't work, if <> means an empty string ? 15:00
Khisanth =<> is probably the <> operator at work 15:02
which I am not quite sure what it is but you can do for =</etc/passwd> -> $foo { say $foo } :) 15:04
which actually looks extremely weird right now
15:12 typeout is now known as typester
fglock putter: ping 16:58
svnbot6 r6660 | fglock++ | * perl5/Code - implemented 'returns'+Type 18:04
r6661 | fglock++ | * perl5/Code - implemented subtypes 18:28
r6661 | fglock++ | $Int=Perl6::Type->new(...); MyType=Perl6::Type(..., supertype=>$Int);
fglock hi putter 19:49
putter fglock: pong
oh, hi fglock
fglock putter: I see both p6_new_sub_from_pil_macro() and p6_new() create Subs - is it possible to move it to a single place (more maintainable) 19:51
putter looks... 19:52
fglock wait...
I see the purpose is a bit different - maybe it's ok 19:54
I'm adding some features to Code.pm - I'm trying to find out how to move them into PIL-Run 19:55
btw - what does 'crude_repl' means?
19:55 typester is now known as sleepster
putter ok... (not a great name... p6_new_sub_from_pil_macro means p6_new_sub_from_pil "and its a" _macro) it looks like the only real overlap is the last 5 lines. the rest is either play with pil code, or a p5 code string that when evaled does what p6_new does... 20:00
fglock I'm trying to add optional arguments to p6_new('Sub', ... ) 20:02
like ?$a
putter so there are 3 copies of sub creation. create a p5 code string which does it (used in pil compilation), do it now (p6_new), and do it now after figuring out what's needed from pil (the aforementioned 5 lines).
re crude_repl, read-eval-print-loop (wikipedia), and... well, crude is self explanatory, though increasingly non-applicable ;) 20:03
fglock there is a weird problem with my zip() signature
(1,2,3) Y (4,5,6) works
but (1,2,3).zip(4,5,6) doesn't - it gets 3 integers instead of a list 20:04
and (1,2,3) Y (4,5,6) Y (7,8,9) doesn't work either
putter hmm... have you looked at what's different about the PIL? and the generated p5? 20:05
putter goes to look...
fglock (1,2,3).zip((4,5,6)) works 20:07
putter re "but (1,2,3).zip(4,5,6) doesn't - it gets 3 integers instead of a list", you mean the 4,5,6? 20:10
fglock yes 20:11
putter all arguments are being passed a normal p5 "list" of arguments. 20:13
to the mm, too, no?
s/passed a/passed as a/
we can certainly switch to Lists... looking... 20:14
fglock it I use a @x signature, it should make an Array, right? 20:15
I just noticed there is no signature, because MM1 methods aren't objects :( 20:17
putter yeah, I was wondering about that # mm1 methods
fglock MULTI SUB Array::zip ($x0,$@1) { $x0->zip($x1) }; should work, right? 20:18
putter p6 subs declared *@x should get slurped arguments. @x is more of a type declaration than a request for different behavior
fglock I mean @x1
trying... 20:19
putter no, that should be :zip ($x0,*@x1) { $x0->zip(@x1) } or zip(\@x1) if you want to pass a ref.
p6 objects, regardless of type, become scalars of the same name. slurpies become arrays/hashes of the same name. 20:20
"become" meaning "that's what they are called in the (p5) interior of the primitive" 20:21
fglock cool - it works now!
(1,2,3).Array::zip(4,5,6)
putter :)
fglock defined as: MULTI SUB Array::zip ($x0,*@x1) { $x0->zip( p6_from_a( @x1 ) ) };
putter ahh, yes. :) 20:22
fglock++
;)
fglock (1,2,3).zip(@a) works too - everything is fine 20:23
putter what's the state of methods and classes? or is that all mm2?
fglock I've been talking to stevan about unifying Code.pm and MM2 - but he thinks it is too early 20:24
putter I believe there is now enough (kludged) info in the pil to start generating classes and methods... 20:25
ah, ok. well, whenever you guys are ready, or would like to exercise something.
fglock no problem - you can use MM1 20:26
putter ?
has classes/methods?
fglock MM2 is a cleaner implementation, but the API should not change much
sure - all Perl6::Value and Perl6::Container are based in MM1 classes and methods 20:27
there are only a few things missing
putter neat. so... what does class C{has $.x; method m(){$.x}} look like in mm api?
fglock like anonymous classes, but there are workarounds
putter I can then bang on EvalX until it emits it... 20:28
hmm, oh, wait, no I cant. 20:29
pilrun still doesnt do any control flow. we're only using Sub in the context of primitives. you cant compile a sub.
fglock class C{is=>['Perl6::Object'],instance=>{attrs=>['$.x'],methods=>{'m'=>sub{_('$.x')}}} 20:30
add or take curlies
putter hmm...
fglock a Sub is an object - you can store it in a p5 scalar and use it later 20:31
you can store the subs in a hash for lookup
putter ok, let's see how many silly things I can say today. of course we can compile subs. we have a p6 prelude. doh.
fglock local subs are tricky, but we can add that later
putter ok, I'll try to get the bare bones of pilrun class compiling in. 20:32
fglock :)
wait - I'll commit zip() 20:33
done
putter np. svn seems to have been pretty good at dealing, even when we were editing the same file at the same time.
?eval my %h=(a=>11,b=>12); class C{has $.a; has $.b;} C.new(*%h) 20:34
evalbot_6652 Error: Must only use named arguments to new() constructor
putter ?eval my %h=(a=>11,b=>12); class C{has $.a; has $.b;} C.new(%h.pairs)
evalbot_6652 Error: Must only use named arguments to new() constructor
putter ?eval my %h=(a=>11,b=>12); class C{has $.a; has $.b;} %h.pairs
evalbot_6652 (\('a', 11), \('b', 12))
putter Is that a bug? # the C.new(%h.pairs) not working? 20:35
It's rather putting a crimp in my p6-based pil parsing 20:36
svnbot6 r6662 | fglock++ | * PIL-Run - fixed zip() 20:38
fglock I think that's because %h.pairs is an Array, and the signature doesn't permit Array -> List of Scalar
or List of Any 20:39
putter ?eval my %h=(a=>11,b=>12); class C{has $.a; has $.b;} C.new(*(%h.pairs)) 20:41
evalbot_6652 Error: Must only use named arguments to new() constructor
putter ? 20:42
re mm class, will everything be ok if methods are added incrementally? $existing_class->{'methods'}{'m2'} = sub ... 20:44
fglock yes, but you have to check the API for how to do it, I haven't used it like that - see the t/ directory for good examples 20:46
putter great. thanks. 20:48
svnbot6 r6663 | putter++ | Perl/Compiler/PIL/Node_pm_gen.pl: a bit of progress. 20:56
fglock (1,2,3) Y (4,5,6) now returns '1' - but it calls (1,2,3).zip(4,5,6) which returns the correct answer ???
svnbot6 r6664 | fglock++ | * PIL-Run - added debugging code to zip() - commented out 21:02
PerlJam returns 1? 21:08
sounds like it's in a boolean context
fglock 2 ^.. 4 returns '1' too - the problem must be somewhere else
it used to work
yup - all PrimP6 subs are failing 21:09
but PrimP5 works fine 21:10
putter: in the last lines of p6_new_sub_from_pil_macro() - a Sub object is created but it is not stored anywhere 21:13
putter correct, it's returned. or would be - I suspect p6_new_sub_from_pil_macro is never currently called without $want_macro set. 21:17
fglock ok - my mistake :) 21:18
putter np. :) at all. 21:20
putter 's theory of maximum collective rate of progress - folks familiar with component x should strive to keep questions about, and limitation of, x, out of peoples' way. 21:21
If that means you get less done yourself, well, as long as the folks you are helping are good productive people, its still a net win. 21:22
fglock re PrimP6 subs failing - I may have done something wrong, but I don't know what it was 21:31
putter looking... 21:33
fglock bb later - I will read the logs 21:38
putter -3 stopped working between -r6659 and -r6660 21:45
svnbot6 r6665 | putter++ | Perl6-Value/lib/Perl6/Code.pm: unbreak r6660. Scalar variable used to hold the return value of an array returning function. The variable is also passed to self->returns->match(), so further tweaking may be required. 22:02