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.
gantrixx buu, what don't you hope? 00:10
It would have been nice to have @array.push($arg) and @array.pop() methods 00:12
Khisanth those exists too ... 00:15
gantrixx they do? Well then I'll try to use them once I get this working
can you have two classes defined in one module?
Khisanth ?eval my @a; @a.push("gantrixx"); @a
hmm where did the bot go?
gantrixx: that will depend on which syntax you use for declaring the class, should be able to if you are using the one with the block 00:16
gantrixx I'm getting an "Undeclared variable: "$?SELF" error
I used the block style 00:17
Khisanth class Foo { method foo { say $?SELF; } } my $foo = Foo.new; $foo.foo; seems to work ok 00:18
gantrixx what is "say" 00:19
and what is $?SELF
?
Khisanth the same $?SELF you are using :) 00:22
say is print but with the newline automatically added
gantrixx it's like $self in perl5? 00:23
it's the reference to the object that you are?
Khisanth hmm seems so 00:24
gantrixx interesting, if I put say $?SELF; in there it complains and says "Undeclared variable: $?SELF" 00:25
putter & 00:27
Khisanth hrm 00:28
gantrixx is it different if I'm using Pugs?
Khisanth SELF seems undocumented 00:29
< using pugs
gantrixx it says "Undeclared $?SELF"
Khisanth use the paste site and paste your code?
ahh 00:30
$?SELF # The current instance as scalar variable
need a perl6doc perlvar :) 00:31
pasteling "gantrixx" at 24.251.41.77 pasted "Undeclared variable $?SELF" (24 lines, 455B) at sial.org/pbot/12605
gantrixx sial.org/pbot/12605
The funny thing is that I was getting this error before I ever had the say $?SELF; statement in there. 00:33
As you can see, I've commented everything else out just to test the say $?SELF
Khisanth actually I wouldn't expect that to work
gantrixx you wouldn't expect say $?SELF to work in pugs? 00:34
geoffb appears hazily for a moment . . . 00:35
Khisanth gantrixx: not where you have it
geoffb Limbic was looking for me earlier, but he's not here now -- anybody happen to know what he needed?
Khisanth gantrixx: the $?SELF should only work inside a method 00:36
geoffb fades away again . . . 00:40
gantrixx Can I define the new method?
Khisanth the constructor? yup :) 00:43
luqui does anybody know how to trigger a perl6 warning from haskell 00:52
gantrixx under what circumstances would I get the "No compatible subroutine found: "&subname" " error? 00:54
I've got 3 methods defined in a class and I get this error
but it's clearly defined
luqui you have to call methods as method 00:55
methods
can you snip me the relevant code?
gantrixx I can paste it into the bot
luqui yep
pasteling "gantrixx" at 24.251.41.77 pasted "Undeclared variable $?SELF" (49 lines, 806B) at sial.org/pbot/12606 00:57
gantrixx sorry if I pasted more then relevant
*** No compatible subroutine found: "&display" 00:58
luqui where is the error happening?
oh
gantrixx is the error from $deck.display()
luqui hmm 00:59
Khisanth your new does not seem to return anything
luqui that would be a problem
gantrixx what am I supposed to return $?SELF?
luqui I think you mean "submethod BUILD"
not "method new()" 01:00
Khisanth and if return values work like they do in p5 then your new is returning the value of the last push
gantrixx let me read about submethod then
luqui his "new" is an initializer, not a constructor, so it should be BUILD
and BUILD need not return anything
a submethod is a method that only gets called when the invocant is *exactly* the class in which it was defined 01:01
it's mostly used for initializers and destructors
gantrixx OK, I think I understand this one 01:04
but is BUILD an inherent method to all objects like DESTROY?
luqui yeah 01:05
gantrixx is it something that the constructor (new) calls?
luqui by default, yes
in perl 6, it should be unnecessary most of the time to write your own new
gantrixx so basically, I just want to change the new method to submethod BUILD right?
luqui righto
gantrixx OK, cool, then I can define a class called Card::Shoe and it won't inherit the submethods? 01:06
luqui yeah
why would you want that?
gantrixx because a show is built differnt than a deck
Khisanth Shoe! 01:07
gantrixx It's a blackjack term
luqui OOishly, though, you should probably make a common base class for the two of them
BUILD is called like constructors from C++
all the BUILDs in the heirarchy are called 01:08
it still makes me wonder how those are actually submethods, then...
gantrixx Well a shoe is just multiple decks
luqui so it's probably best to do it by delegation
gantrixx so they still have all the same methods of a deck such as shuffle, cut, and deal, they are just built differently
luqui yeah, you basically just thread the methods over multiple decks, right? 01:09
method Shoe::shuffle() { @.decks>>.shuffle }
gantrixx Well the idea was to have a group of Card classes Card::Card, Card::Deck, Card::Shoe 01:10
luqui that makes sense. I'm just saying that Card::Shoe should probably aggregate a couple Card::Decks
but design how you will
there are many WTDI
gantrixx WTDI? 01:11
luqui way(s) to do it
from TIMTOWTDI
gantrixx oh, sorry not up on all the geekronisms 01:12
luqui you don't come from a perl 5 background do you?
gantrixx yes, I do
luqui huh...
let me take this foot out of my mouth here, and, ahhh, that's better 01:13
gantrixx you've lost me. what foot in your mouth?
...I guess it doesn't matter, but I appreciate your help. And my appologies for the "geek" comment. I meant it as a term of admiration 01:14
luqui I know
geek isn't a negative word for miles outside of this town
gantrixx it's a hood thing, only a geek can call another a geek without ending up in a gangland brawl 01:15
wazup my geek
keepin' it real? 01:16
luqui hehe
dudley heh, my daughter drew a picture of me at school and she drew me wearing a shirt that said "geek" across the front 01:19
her teacher got all serious and showed my wife, thinking my daughter was being mean
then my wife had to explain that I really did have a shirt like that...
gantrixx how old is the daughter? 01:20
dudley she's 8 now, this was at least a year ago 01:21
gantrixx where can I find all these methods that come with arrays? 01:23
this Auodads book is lacking a lot
is there an @array.length() function? 01:28
luqui it's called "elems"
because of the confusion between length of string and length of array 01:29
gantrixx where is it that you learn all this?
luqui the string version is called "chars"
Apocalypses, Exegeses, and (especially) Synopses
and being aroung perl6-language long enough to know what parts of those are outdated
in other words, it's hard to learn from docs at the moment
gantrixx Well, I'm mostly relying on the Auodads book (which should eventually become a Camel with a Parrot on it's back). 01:30
Someone should aggregate all the Apocolypses and Exegeses into one reference document
(no, I'm not volunteering) 01:31
luqui we'll do that once we feel like it's stopped changing
or at least reasonably slowed down
I'm trying to get my hand in to write a chapter of the camel 6
(which I guess would be the camel 4)
what's the auodads book? 01:32
gantrixx I call it Auodads, it's the Perl6 and Parrot Essentials
It has a pic of an Auodad on the front
luqui ahh, that one
2nd ed?
gantrixx so like they call it "the Camel Book", I call it "the Auodads Book" 01:33
yes, 2nd edition
luqui well, we're trying to keep the Synopses no more than six months out-of-date :-)
so you can kinda rely on those
gantrixx I wish they were searchable 01:34
luqui you can check them out with svn and then grep 01:35
svn.perl.org/perl6/doc 01:36
gantrixx what comes between 13 and 29?
are they missing?
luqui for now 01:37
they correspond to chapters of the camel
and 14-28 really aren't that important to the primary design of the language
we'll be filling in a couple of those, but not many 01:38
gantrixx I think the learning curve on Perl6 is pretty significant 01:42
It's pretty much like learning a new language
luqui do you have any ideas on how to make it softer
oh yeah, that
you can't expect it to be like Perl 5 01:43
gantrixx not really
luqui except when you can...
QtPlatypus gantrixx: Its more like perl5 then it isn't IMHO.
putter Drats. r6371 went out without a descriptive log entry (a click-o).
gantrixx well I've programmed in Perl5 and I'm finding it very painful to get a simple script done 01:44
luqui well you're using the OO features
putter r6371: pugsbugs/attribute_of_return_value.t: Created. Calling accessors on the return value of a sub doesn't work. Eg, class C { has $.a; } sub f() { C.new() } f().a
luqui which, admittedly, weren't there physically in perl 5
gantrixx for the amount of effort I'm putting in, I could probably learn Python or Ruby....this is what I'm worried about with the Perl5 to Perl6 transition
luqui just culturally
gantrixx, how so? what have you struggled with?
plus, yeah, you probably could learn Python or Ruby. But Perl 6 is better than those :-p 01:45
gantrixx right now I'm looking for the random number function,
luqui oh, it's "rand"
but it's probably unimplemented :-(
gantrixx a second ago I was looking for the $#array function
luqui oh, you use that?
we're trying to phase that out. just use @array in numeric context 01:46
gantrixx makes sense
It's just that I would hate to see Perl slip off it's dominance 01:48
dudley gantrixx: Perl 6 is really a moving target right now. You're not only trying to learn the language, but also how much is actually implemented, how much of what is implemented works the way it's supposed to, etc. And the language spec itself is mutating every day.
svnbot6 r6371 | putter++ | pugsbugs/attribute_of_return_value.t
gantrixx ther is a lot of Python advocacy these days (i.e www.linuxradio.org) 01:49
I understand dudley
I hope I don't sound like chicken little
putter gantrixx: re combining AES into a single searchable document... agreed. I tried to get one into Perl6::Bible when I was getting started with p6, but it "didn't take". I just use one of my own. Though I find as I get to know the assorted AES, which individually have different characteristics, grepping them separately has become more useful. 01:50
dudley gantrixx: I hear a lot of that around here ;)
gantrixx do most of the developers on Perl6 have full time jobs and do Perl6 on the side? or are they students or what? 01:51
putter On the IRC a while back I consed up (with help) a google search which hit the bible and mailing lists. Perhaps that's a concept worth dusting off and linking from the wiki.
luqui is a student 01:52
dudley is a student, works full time, and is a new father. 01:53
so Pugs gets considerably less time than I would like :)
putter ruby and python are both nice languages. in some respects nicer than perl. I look forward to having compilers and runtimes for both written in p6, so we can "use ruby;". 01:54
I started on the ruby runtime, but decided to wait for the metamodel merge and oo cleanup, so it could actually be tested during development. 01:55
tewk /tewk just became a student again reciently, ruby seems like a good mix of perl and smalltalk.
putter all three have significant limitations. but only p6, technically and socially, has the potential to do a superset. and blends. 01:57
tewk so what is the word on th oo cleanup, is leo done? I heard it was waiting for chip's approval. 01:59
gantrixx gantrixx is a 40+ hr/week contract engineer and aspiring retiree
putter but yes, it's rather hard to get started. I keep hoping folks trying to get started will start using the wiki as a collective resource to ease the process. But hasnt happened yet. Maybe folks get two free beginners questions on #perl6, and then they are strongly encouraged to add the questions and answers to a GettingStartedFAQ on the wiki. 02:00
gantrixx where is the wiki? 02:01
putter tewk: pugs side oo. metamodel merge, and pil2 runtime. parrot... I'm not sure what the status of the leo-ctx5 branch merge is. But that only holds up the pugs PIR backend. 02:02
pugs.kwiki.org
tewk putter: I'd like to help so all start with my two free questions and put your answers on the wiki 02:05
putter tewk: unfortunately one thing ruby didn't pick up from smalltalk is the culture of self-hosting code. for a language which is exceptional for metaprogramming, there has been strikingly little community interest or effort at supporting it. Eg, it took years to create the equivalent of Tie::Array::Simple (or whatever its called) base classes for creating Array/Hash/etc-like objects. And it was still a mess the last time I looked. 02:06
tewk++ ! :)
luqui hey putter, you know haskell? 02:07
more importantly, do you know pugs internals very well?
for a very loose definition of "very" 02:08
putter not really. some corners more than others.
luqui where should I put a utility function like warn :: String -> Eval () 02:09
Pugs.Internals? 02:10
putter tewk: feel free to mash FrequentlyAskedQuestions. its quite crufty. please let me know if you have any questions or if I can be of assistance.
luqui I'm going with that one 02:12
putter luqui: yes, that sounds plausible.
hmm... or not... putter tries to remember the files scope of Eval... 02:13
luqui I'm going to stick it in Eval, since that's where I'm using it, and I'll let autrijus move it if he wants :-) 02:14
putter sounds good. 02:15
gantrixx: rand() actually is implemented. the quick way to find out if primitive foo is implemented is to grep for foo in src/Pugs/Prim.hs and src/perl6/Prelude.pm (and perhaps src/perl6/Parser.hs if its something which seems likely to benifit from special parser treatment). 02:19
Oh, though the first thing to do is just try whatever p5 does. 02:20
jql sniffs at :x($horizontal)
luqui huh, there's already a Pugs.Compile.warn 02:22
weird, my grep didn't see it
gantrixx sorry, I'm back putter and thanks 02:25
yes, I just wrote a small program to see if it was implemented
putter tewk: I've added a link to www.kwiki.org/?KwikiFormattingRules on the top page of the wiki. 02:29
gantrixx: np :)
tewk putter: What does the pil2 runtime consist of, What does new improvements are there in version 2
putter gantrixx: you know you can just say ./pugs and get an interactive read-eval-print-loop?
tewk putter: I'm familiar with wiki 02:30
putter addid from the usual -e ./pugs -e 'say rand'
tewk pil is Perl itermediate Language ? 02:34
luqui something like that
though there is dispute about the word "language" 02:35
putter tewk: my understanding is the current PIL was basically a "roughing it out", bootstrap, first draft. so this second draft is expected to be cleaner. and will be/is being used by several backends. the new haskell backend will emphasize correctness. becoming a running spec for p6. the current state of affairs is a bit flakey.
luqui PIL is just PIL :-)
gantrixx is there a @array.splice($start, $stop) function? 02:37
luqui ?eval my @a = (1,2,3,4); say @a.splice(0,1); say @a 02:38
where is evalbot?
well, try that in a -e 02:39
the short answer is "yes"
but it's @array.splice($start, $length)
gantrixx the wiki didn't return anything from the search on it 02:40
svnbot6 r6372 | luqui++ | r225@feather: fibonaci | 2005-08-20 04:36:27 +0200
r6372 | luqui++ | Added a runWarn function for runtime warnings, and added "Odd number
r6372 | luqui++ | of elements in hash constructor" to the hash() builtin (only -- not {}).
luqui then ot'
then it's probably not there
you don't seem to understand our poor state of documentation
gantrixx I do understand
luqui do you want to add it to the wiki? 02:41
that'd be great
gantrixx It just makes me feel like an idiot to be bothing you all with these silly questions
luqui it's okay, I clearly have nothing better to do
still, don't be afraid to use pugs -e
gantrixx autrijus asked me to help by writing some examples, so I am, but it's a real learning curve
luqui try learning haskell some time :-) 02:42
gantrixx hassel?
luqui haskell, the language pugs is implemented in
gantrixx df -f /dev/brain shows 99% full
putter PIL is basically a "kernel language" for p6. Hmm... I dont see a good reference webpage describing what a kernel language is. Anyone...?
luqui I figured. It was just an expression; I don't want you to learn haskell 02:43
I just wanted to contrast the learning curves :-)
gantrixx ...and highly fragmented
putter ?eval 42 02:46
tewk putter: I'm writting a page about general architecture right now. 02:47
Where is PIL2 in svn?
luqui evalbot6 isn't even present
tewk where does it, live did it die?
So what does autrijus think of the wiki does he prefer it over docs in svn? or the other way around? 02:48
putter tewk: neat! src/PIL/ I think (anyone: yes?) there is a good article in autrijus's journal at... 02:50
use.perl.org/~autrijus/journal/25964
luqui autrijus likes svn 02:51
so I expect svn docs are the way to go
tewk Yeah that what I thought.
so wher is a kwid format document
luqui docs/01Overview.kwid ? 02:52
putter tewk: do you have a committer bit yet?
tewk Hmm, I'm not sure? 02:53
putter is there anyone on now who has committer invitation ability?
tewk I talked to autrijus along time ago, and he might have given me one? I'll try to commit some docs in a little while and see what happens. 02:54
putter (this is rather the quiet time each day of 24hr world-wide pugs development;)
ok
tewk So what is YAML used for in pugs. 02:55
jql can't burn the candle from both ends forever
tewk I'm in MDT. But I often stay up till midnight(my wife works in an E.R. till midnight). I often get up early, 3-4am so I catch the other half of the world:) 02:58
putter autrijus, iblech, etal: it looks like f().foo , where f() is a sub returning a non-native object, currently doesnt work. for both accessors and methods. Eg, class C {method me(){42}} sub f(){C.new} f().me 02:59
YAML is used for the build config file, a dump format for (Json actually) PIL, and ...? 03:00
tewk Ok so pugs uses it to dump PIL cool. 03:01
Json?
putter http::/www.json.org/ redhanded.hobix.com/inspect/yamlIsJson.html 03:04
tewk So is src/PIL the old PIL or the new PIL2? I heard PIL2 will resemble scheme.
putter semantically (well, a superset of), rather than syntactically. though an s-expression dumper for PIL is on the collective todo list. 03:05
tewk putter: so is pugs.kwiki.org your baby, would you mind if I stole some of the content and moved it to svn. A glossary in svn would be helpfull. 03:08
putter tewk: who me? looks over sholder. not my baby. ;) go for it. 03:09
dudley tewk: src/PIL is PIL2 03:10
tewk dudley: so is the old PIL somewhere else or has it been gutted. 03:11
scook0 tewk: the old PIL is sitting around in various parts of src/Pugs 03:12
putter tewk: might want to leave a (svn) link behind so folks surfing but not yet using pugs can easily find it. 03:13
dudley src/Pugs/Compile.hs is a lot of it, I think.
look for the data types starting with P
putter ;)
dudley PStmt, PPos, PNoop, etc..
tewk scook0: Thats what I thought, thanks for all the confirmations, maybe my attempt to document will be close to the truth. 03:16
I figure if I document I'll know my way around enought to start hacking. 03:17
scook0 tewk: that's more or less what I've been doing with my Haddock stuff 03:20
(not that I've made any actual code changes yet)
putter End of day. I believe the f().foo bug is the last obsticle to getting Rul and rules development unstuck. fingers crossed.
dudley scook0: I've been meaning to ask you about the #ifdef HADDOCK stuff 03:21
putter Good night all. &
scook0 dudley: what did you want to know?
do you know what Haddock is?
dudley does that just change some of the types as they appear to haddock?
scook0 it depends
Haddock isn't as sophisticated as GHC 03:22
dudley Only vaguely. It's documentation annotation in the source, right?
scook0 dudley: right
so some Haskell extensions that GHC accepts will trip up Haddock
the easiest way around that is just to #ifndef them out
but this means that the affected types and functions don't show up in the documentation 03:23
dudley That's pretty much what I was thinking. Thanks.
scook0 so in some places we've put in replacements that have a similar meaning, but don't confuse haddock
the Haddock docs are quite useful when you're browsing around the Pugs source 03:24
dudley That's what it looked like to me, but I know better than to think that I understand what's going on with Haskell. :)
scook0 dudley: :) 03:25
dudley Are the Haddock docs online somewhere?
scook0 dudley: there's a link off pugscode.org somewhere
dudley Haddock doesn't build out of the box on my machine, and I lack the tuits to make it work.
nothingmuch.woobling.org/pugs_test_...s/haddock/ 03:26
for anyone reading the logs, wondering where the Haddock is :) 03:27
scook0 dudley: out of curiosity, what are you running?
dudley Mac OS 10.4 03:28
using darwinports
scook0 actually, speaking of OSX, does anyone know a way to get Haskell syntax-highlighting in XCode? 03:30
(or something else I can use in the mac-labs at uni) 03:31
dudley SubEthaEdit has a Haskell mode
or, of course, Emacs :) 03:32
gantrixx ok, another stupid question 03:33
is there a min function?
there is, sorry I figured it out 03:34
scook0 dudley: oh, I didn't realise until now that SubEtha was free for non-commercial use 03:36
I shall give it a try next week
dudley Yeah, but it's got this annoying watermark that shows up after a few minutes of inactivity.
Otherwise a nice editor, though. 03:37
OSX needs a good open-source cocoa editor. Maybe I'll write one when Pugs gets an ObjC backend :) 03:39
luqui starts the wthi project 03:54
scook0 luqui: wthi? 03:57
luqui what the heck is
it's a sort of perldoc search
scook0 ooh, tasty
luqui wthi '[>>+<<]' # brings up the entries for [] reduce, binary hyper, and infix + 03:58
scook0 didn't somebody already start writing p6explain? 03:59
luqui oh, let me look
that's what it was called
ahh, a different approach from mine 04:00
hmmm...
maybe that's a good approach
p6explain maps syntax into vocabulary, and then you can go look up the vocabulary
hmmm 04:09
I wonder if it is worth starting a feature-oriented documentation project
a one-page document about hyper operators, separate from a page about metareduction, separate from a page about multimethods, etc.
gantrixx If I want to pass in an initialization arguement to the &.new method, does that automatically get passed to the &.BUILD method? 04:44
can someone answer a question for me about the BUILD method in objects 04:48
?
For example if I have class Card::Shoe is Card::Decke{ yada yada } it appears as if the BUILD submethod of Card::Deck gets called and then the BUILD submethod of Card::Deck 04:50
scook0 gantrixx: S12 says that bless calls BUILDALL, which calls all the BUILDs in least-to-most-derived order 05:06
also, I believe it says that the default &new passes all its named arguments to &bless, which passes them to both &CREATE and &BUILD 05:08
(unless something has changed to make that out-of-date)
QtPlatypus luqui: Sounds good. 05:10
gantrixx wow, I'm confused
YOu can have more than one BUILD in a class? 05:11
I just wanted Card::Shoe to inherit everything except the BUILD method from Card::Deck
I thought using submethod BUILD in Card::Shoe overwrites the BUILD in the object from which it inherits 05:12
luqui nope 05:14
BUILD is just a constructor, and it's probably best not to think of it any differently
what I would do is to make an init() function that BUILD calls 05:15
*init() method
and then override that
class Card::Deck { submethod BUILD() { ./init } method init { initialize deck } } 05:16
class Card::Shoe { is Card::Deck; method init { initialize shoe } }
gantrixx I'm confused then, I thought submethod was teh thing that did the overwriting 05:17
luqui gantrixx, have you used C++?
arcady submethod just means that it's part of a class, but not inheritable like a method is
gantrixx no
luqui Java? 05:18
arcady at least as far as I understand it
gantrixx the example in the Auodad book is contrary to your explaination
or perhaps I'm not reading it correctly
luqui thinks he has the 2nd ed.
luqui goes to look 05:19
gantrixx When you say class Frogstar::B is Frogstar::A { stuff} it means that Frogstar::B inherits from Frogstar::B right?
scook0 (B inherits from A)
gantrixx and in that example the smash method is overwrittin in B with submethod smash 05:20
luqui only has 1st ed
can you paste? 05:21
gantrixx oh, wait, no, I think you are right
but this doesn't seem to be what is happening with my classes 05:22
luqui paste? 05:23
OO stuff is hard to talk about
gantrixx umm OK, but let me get it back into shape for pasting 05:24
pasteling "gantrixx" at 24.251.41.77 pasted "Calls both BUILD methods" (52 lines, 1.2K) at sial.org/pbot/12609 05:28
luqui so when you call Card::Shoe.new, which BUILD do you think will be called? 05:29
gantrixx I was hoping it would call only the BUILD from Card::Shoe
but perhaps the BUILD methods can't be overwritten
luqui well, that's not really what's going on 05:30
gantrixx so the new calls the BUILDALL which calls the BUILD from the parent as well as the child
luqui BUILDALL from the call to new() is calling *both* BUILDs explicitly
yeah
gantrixx why?
luqui because objects often need local initialization 05:31
gantrixx you can't overwrite the BUILD methods?
luqui if you derive from a class that initializes a file handle
you don't want your BUILD to override its BUILD
because then you would keep it from opening its handle
same with DESTROY
gantrixx ok, well I think I can hack this to work the way I wanted to 05:32
arcady where does a parent class's BUILD get its arguments from, by the way?
gantrixx that's a good question
luqui the same place as all other BUILDs
the argument list
(which I think is a little bit... wrong) 05:33
arcady yeah, especially for multiple inheritance
gantrixx what if the BUILD in the parent does have arguements but the BUILD in the child does?
luqui arcady, the situation isn't as bad as you'd think, since all parameters to constructors must be named
arcady oh
didn't know that
luqui but it's still pretty limited compared to what you'd like to do
arcady but it makes sense and does sort of solve the problem 05:34
still, not necessarily what I'd want
luqui gantrixx, all arguments are named, so the ones that aren't in the argument list are simply ignored
gantrixx, there's some OO design stuff in your program going on that is making your job harder than it should be 05:35
gantrixx please enlighten me 05:36
luqui well, you're accessing member variables from the child class, which is a no-no
(I'm not even sure if it works in pugs)
you probably want a common abstract base class for these two things
and make them both siblings 05:37
like Card::Dealer (or something)
put all common implementation in there
gantrixx OK, guys, I'm an EE I'm not formally trained on all this computer stuff
Well Card::Shoe is just a specialized Card::Deck
luqui then class Card::Deck { is Card::Dealer; ... } class Card::Shoe { is Card::Dealer; ... }
gantrixx I understand what you are saying 05:38
luqui gantrixx, how is it specialized?
as in, how is it different?
gantrixx A shoe is just multiple decks
they do that to make it harder for card counters
luqui right
so how does this make you think that multiple decks is a kind of single deck? 05:39
gantrixx so only the initialization is different
arcady why do you even need two separate classes?
luqui (I was thinking that too)
gantrixx well, I could do it with on class
arcady make number of decks an optional parameter with 1 being the default 05:40
gantrixx I suppose a Card::Deck is a Card::Shoe of just 52 cards
yes, that is what I'm thinking
luqui Card::Deck is a subtype of Card::Shoe
but don't use subtypes, because they're inappropriate here
gantrixx I was also trying to keep it so that it was easily readable 05:41
but it's still easily readable this way too
luqui bbiab 05:42
gantrixx bbiab? 05:44
luqui .e .ack .n . .it
gantrixx what does this error mean? 05:52
*** Can't use positionals in default new constructor
QtPlatypus gantrixx: It means that the defalut consturctors must take named arguments. 05:54
gantrixx oh, I get it, and I understand why 05:55
QtPlatypus You can rewrite your constructor to take named arguments, or you can just make a nondefault constructure using positionals. 05:57
gantrixx where can I read more about this? 05:58
just do it like.... 05:59
class Card::Shoe ($numdecks) { has @.sequence; yada yada }
?
like a subroutine? 06:00
luqui huh?
oh
(didn't see that ($numdecks) there)
no, you have to write
class Card::Shoe { sub new ($arg1, $arg2) { various stuff that the default new does that I don't know } } 06:01
in other words, right now, you should use positionals
I mean nameds
QtPlatypus method mynew (::Class $class: {# Your arguements go here #}) { ... }
luqui QtPlatypus, more important, though, is what goes where you wrote ... 06:02
QtPlatypus luqui: sub new will not work.
luqui QtPlatypus, hmmm, right, because it's a class method, not a sub
luqui goes to change the error message that gantrixx cites 06:03
how about *** Must use named parameters to new() 06:04
gantrixx ok, I'll give it a go
is the loop syntax still 06:21
svnbot6 r6373 | luqui++ | r232@feather: fibonaci | 2005-08-20 08:09:57 +0200
r6373 | luqui++ | Changed error message to be more descriptive. gantrixx++
gantrixx loop ( $i = 1; $i >= $max; $i++ ) { stuff }
?
QtPlatypus gantrixx: Thats a c style for loop. 06:22
gantrixx OK, so what is the new Perl6 style
luqui that is correct, it's just not idiomatic
for 1..$max -> $i { stuff }
gantrixx what did you call me?
:) 06:23
luqui hehe
gantrixx just kidding
luqui ?say "eval is back!"
gantrixx is there a better way?
luqui ?eval say "eval is back!"
evalbotzy eval is back! bool::true
gantrixx because this way doesn't seem to work
luqui gantrixx, what do you mean?
?eval for 1..10 -> $i { say $i } 06:24
evalbotzy 1 2 3 4 5 6 7 8 9 10 undef
gantrixx it keeps saying that $i is undeclared
luqui oh, you mean in the loop () form?
gantrixx yes
luqui loop (my $i = 1; $i <= $max; $i++ ) { stuff } 06:25
gantrixx I tried that too
luqui ?eval loop (my $i = 1; $i <= 10; $i++) { say $i }
evalbotzy Error: No compatible subroutine found: "&my"
luqui ohhh, that's right
my is still broken
?eval my $i; loop ($i = 1; $i <= 10; $i++) { say $i }
evalbotzy 1 2 3 4 5 6 7 8 9 10 undef
gantrixx well I'm trying it the loop 1..$.max -> $i { stuff } way 06:26
now it's complaining about unexpected {
I just can't win
luqui s/loop/for/ 06:27
gantrixx but sometimes I've see this when it is missing a ;
ok, it works now
luqui which one did you do? 06:28
gantrixx this is a good speed test for the interpreter.....shuffling a 6 deck shoe
for 1..$.max { stuff }
luqui prepare to be disappointed :-)
cool, that's the way the perl gods intended it
gantrixx wow, this is slow
QtPlatypus gantrixx: Its not speed optimized yet. 06:31
luqui PIL2 should help with that
QtPlatypus nods "And hopefully make alot of stuff easy to write" 06:32
gantrixx Well, it's not that slow 06:34
It's reasonable
xinming anyone here knows chinese? I wish to know the translation of the word delegation. 07:05
hmm, I looked up the word in the directionary. But I want to know if that's what it means. 07:06
Khisanth autrijus probably knows :) 07:16
xinming Khisanth: He might be busy working with pugs. :-) 07:19
Khisanth or sleeping! 07:20
xinming seen autrijus 07:22
jabbot xinming: autrijus was seen 13 hours 23 minutes 9 seconds ago
xinming BTW which editor are you using to handle the perl 6 code? 07:23
Khisanth uses vim in gnome terminal 07:31
luqui in the pugs repository there is a vim syntax file for perl 6 07:34
which makes editing it so much nicer
xinming ?eval my @ary; my $aryref := @ary; 07:49
evalbotzy []
xinming hmm, by the way, is := the same as = here? 07:50
nothingmuch good morning 09:32
castaway mornin 09:35
nothingmuch for some reason I have all sorts of crap music on my comp all of a sudden 09:48
arcady it's a virus!
a crap-music-downloading virus
spread by the RIAA
nothingmuch oh, I get it 09:49
this is some friend's music dir
I went through it, after copying it
and I didn't really think it was something
appearantly itunes gobbled it up when I installed the new comp
there's christmas songs, and some of the soundtrack to Top Gun 09:51
and, uh, all sorts of really weird stuff
ods15 nothingmuch: umm, what's your ip... 10:09
i mean, why is it pasta.woobling.org
nothingmuch pasta.woobling.org... why?
because that's my domain
ods15 i just noticed, you aren't grey
nothingmuch and that's what my reverse pointer is
ods15 what isp do you use?
nothingmuch bezeq
but i have a business account
ods15 you asked them to reverse dns to that?
nothingmuch yes
ods15 oh.. doesn't that cost much more money?
how much upload do you have 10:10
nothingmuch 278kbit
1.5m down
ods15 wow neat.. how...
nothingmuch again: business account
it's more $, but it's worth it
ods15 i mean, isn't the buissness account for buisnesses only?
whats the price
nothingmuch social engineering =)
ods15 oh bah, that 10:11
nothingmuch around 300 nis altogether a month
maybe slightly less
ods15 heh that's quite a bit
including bezeq adsl?
nothingmuch yes it is, but the difference is astounding
yes, and no... it's cable
that's the combination of carrier+ISP
ods15 ok, so including cable? heh
well, it almost 2 times as much.. iirc i pay 120 altogether... 10:12
nothingmuch yup
ods15 almost 3 times*
nothingmuch the advantages:
dhcp instead of those fucking dialers (that's for bezeq regardless of business or not)
ods15 so, damn, an extra 200 shekels for more upload and a reverse dns? yes, more upload is ERY good, but not THAT good..
nothingmuch bit torrent *FLIES*
i don't feel load of webserver or mailserver 10:13
ods15 i usually get BT at 50-70k...
nothingmuch my server isn't likely to be spammy
ods15: do you give back a good ratio?
i tended to get around 20-30 when I was on 96k
ods15 my ratio is usually 0.001
nothingmuch that's evil
ods15 heh i love it
nothingmuch seriously man, that's evil 10:14
upload more
my ratio is between .8 and 3
for big files too
ods15 if my isp didn't suck so bad i would
nothingmuch use a traffic shaper and leave it in the background
ods15 but generally i'm evil with my upload
nothingmuch what kind of files do you download, btw? 70k is amazing if you don't upload
ods15 you mean, the kind where you can still download 100% while uploading?
movies mostly, in rare occassions programs 10:15
but i mostly dl at 120kb/sec from xdcc, tv shows
that's my real specialty..
anyway, the cables in my house suck SO bad, that believe me, no matter wtf traffic shaper i use, there's no way on earth i'll get fast download when uploading 10:16
seriously, i've tried all kinds of traffic shapers
and they helped, a little, but seriously marginally
basically it goes, if don't upload, i can dl at 120k (when my max should be 190!! i _NEVER_ get that from those xdcc's! only from sites, and even THATS rare), if i upload at 5k, i can dl at 60k, if i upload at 9k, and i'm lucky, i can dl at 5k... 10:17
which is why i ALWAYS limit my bt to 2k
sometimes i'm like 'wtf, why is bt barely dling at 2k
then i realize i forgot to limit it and its uploading at 7k 10:18
thats how much my connection sucks
adsl in general in israel sucks, mine just sucks more, cause of wiring in the building
(my sister worked at tech support adsl, they can actually check if the connection from them to my adsl is ok, she checked, it's suck ass) 10:19
nothingmuch: i know that reverse dns is new, cause i have seen you grey before... 10:22
when did you get it, only like a week ago or something
nothingmuch yes it is
sorry, i was away
ods15 i color all israelis grey, and i noticed all of a sudden you weren't anymore... 10:23
i thought you just weren't resolving for a bit and then it stayed, so i whoised :)
nothingmuch i switched from nv to bezeq intl about 2 weeks ago 10:24
nv sucked real bad (connection was always dropping)
ods15 nv?
nothingmuch netvision
ods15 oh
nothingmuch then a few days after I got connected i setup the rev ptr
ods15 well, i'm not sure whats the status on isps is anymore
about 2 years ago, the status was 012 > 013 > internet zahav > netvision> bezeqint 10:25
i use 012, and i think i'm worse off than when i was with bezeqint back then, which was REALLY bad, so i dunno
012 was very good when i just switched to them, a huge improovement from bezeqint... 10:26
nothingmuch right now I have decent pings, good throughput, and a reliable connection 10:32
so I'm happ[y
i hear that 012 ~~ bezeqing > nv > internet zahav > 013
ods15 wow 013 sinked then i guess.. it was just about same as 012 then, i.e., best 10:36
and bezeqint took its place :P
but anyway, all of it doesnt matter in my case cause my wiring simply sucks :( i should switch to cable or something, but it took me a YEAR to convince my dad to switch to 012 instead of ebzeqint (he works at bezeq), i doubt it'll be possible at all for me to convince him to switch to cable... 10:37
castaway slaps ods15 for misusing BT.. 10:40
ods15 i told you, i wouldnt be evil if my upload didnt suck
castaway then dont download ?
ods15 i used to be non-evil, but evantually i realized it just wasnt practical
castaway ours sucks too, we just leave it running a week 10:41
theorbtwo Ours sucks differently, though.
castaway shhh thats not the point!
theorbtwo We can't drop much below 1 no matter what we do, because our downstream is often slower then our upstream on BT.
On non-BT it sucks much less. 10:42
castaway you're not helping ,)
theorbtwo If it doesn't improve drasticly at the new place, I'll try shaping, QOS, and the like.
I suspect our provider sucks on BT on purpose, and our router is old and slow and not helping matters. 10:43
...but we'll likely change routers at the new place anyway.
castaway doesnt think the router is the/a problem
nothingmuch is very happy with meta-box as router
it does mail, web, etc
and also wonderful traffic shaping 10:44
castaway sighs
nothingmuch btw - for all of you music downloaders - musicbrainz's clients were updated
please use them, they are good for you and good for other people who use them too
theorbtwo Our router does web and routing only. 10:45
castaway wtf is that?
nothingmuch castaway: you calculate an accoustic checksum for the song
from then on it's like freedb
only higher quality entries
theorbtwo Eh?
castaway umm, oh
I dont think I care ;)
theorbtwo I thought it was a P2P music sharing ap. 10:46
nothingmuch and it doesn't need the original CD, which you, uh, obviously lost, and that's why you were downloading off the internet to begin with ;-)
castaway it should ,)
nothingmuch it should what?
castaway require the CD ,)
nothingmuch ah
but it doesn't 10:47
theorbtwo "SendQ exceeded"? First time I've seen that one... 10:49
ods15 13:43:43 * nothingmuch is very happy with meta-box as router - btw, i use ipcop 10:52
nothingmuch hmm... i guess NAT was enough for me 10:57
svnbot6 r6374 | scook0++ | * Misc. Haddock for Parser.hs
nothingmuch what other advantages does ipcop have?
ods15 nothingmuch: well, i dunno, it's just overall nice, there's no special advantage 11:14
has all the regular services, you can set it to update dyndns, traffic graphs, etc.
nothingmuch ods15: is it just a wrapper for iptables? because "if it ain't broke, don't fix it" is my system administration motto
hmm... graphs might be nice, but unnecessary 11:15
ods15 ?
nothingmuch dyndns is useless - i've got a static IP
ods15 on occassion i use traffic graphs for connection "debugging"
TheMaaaa does anybody know when iblech will be back from holiday again?
ods15 well its obviously useful for me
what do you mean by wrapper to iptables? 11:16
nothingmuch iptables is the linux fw, right?
ods15 fw? 11:17
nothingmuch firewall
if ipcop is a userland firewall, it may be different
but I doubt it
ods15 i know nothing of internet management on linux :/
nothingmuch and my iptables is also configured to a working state, so I'd rather not touch
ods15 i use ifconfig a tiny bit, route a little, and mostly dhclient...
nothingmuch this is at another level 11:18
ods15 anyway, i dunno, it's possibly a userland firewall, it has logs and everything
nothingmuch route is somewhat related
but basically it's the set of tables that every packet goes through
ods15 anyway, its obviously much more than a firewall, its an entire router...
tbh i dont get whats the point of having a firewall in your router to begin with 11:19
nothingmuch thinks he'll pass.. things have been working and I don't have the time to break them and fix them again
a firewall and a router is the same thing
ods15 heh i didnt suggest you use ipcop...
nothingmuch it's just that "firewall" is usually used to describe a router with one route and complicated rules 11:20
ods15 im saying that what i use and kind of asking if its any good
nothingmuch and a "router" is usually used to describe a firewall with no complicated rules, but elaborate transformations and dispatches
let me answer the question "if it's any good" by asking you a question: "does it make your life easier?"
ods15 i thought a router is a internet <-> nat thing, where as a firewall is just prtoection from malicious asshats
nothingmuch both control what happens to packets coming in on an interface, and have multiple interfaces to move packets in and out of 11:21
functionally any capable firewall OR router can get the job done well
ods15 nothingmuch: umm, i cant not have a router, thats like asking if having arms makes my life easier...
the only thing that annoys me about my router is that the web interface is FUCK SLOW 11:22
nothingmuch high end hardware might be suited for a specific purpose for performance reasons, but anything "serious" should be able to do both tasks moderately well
ods15 well over 4 seconds to open each page, even 20 seconds on occassion
but i;ve been told thats only cause slow hardware 11:23
i run it on 75mhz
and guy with 200mhz says it runs totally smooth for him
nothingmuch that should be enough
my box is ~1.8ghz =)
ods15 the ROUTER? 11:24
nothingmuch yes
but it does other jobs too:
mail (imap, pop, smtp, spam filtering, all that)
ods15 well, actually, you own a macintosh laptop, you might as well be a millionare :P
nothingmuch (including running mutt on my 32,000 message inbox)
castaway (hmm, P90, but no web interface needed for iptables ;)
nothingmuch mail for ~10 other users 11:25
ods15 i run exim on this box, not on the router
10 other users? you admin for other ppl?
nothingmuch webserver, with dynamic apps (gallery, squirrelmail, occasional experimentation)
ods15 just random ppl from net using your box as inbox?
nothingmuch 10 other users - friends with mail accounts on my box
ods15 ah, what i said
nothingmuch it's also DNS, DHCP, and all that mess
ods15 dont be so proud of 32,000 msgs :P
nothingmuch i'm not proud... my story is: at 1000 i was like "if I don't clean this up quick it's going to be too late" 11:26
ods15 385M .kde/MyDocs/Mail
nothingmuch tsk tsk
du is still working
ods15 dns/dhcp etc. my router does too
you probably use maildirs
i use mboxes, that whole dir is ~15 files 11:27
nothingmuch the reason I don't delete is that then threads become orphanned in mutt
yes i do
now i'm looking into a solution that knows how to remember that a certain thread is boring, and then I should be able to zap about 25,000 messages
ods15 anyway, hmm
what was i saying
oh, i run all services on this box 11:28
nothingmuch the router box also runs mldonkey, which is heavy
ods15 Hostname: linux15 - OS: Linux 2.6.6/i686 - CPU: AMD Athlon(tm) XP 2500+ (1837.634 MHz) - Processes: 121 - Uptime: 12d 19h 24m - Load Average: 0.17 - Memory Usage: 330.12MB/503.42MB (65.58%) - Disk Usage: 47.28GB/327.13GB (14.45%) - External Traffic (eth0): 520.06MB In/2616.78MB Out
its not totally awesom,but its good enough
hehe, yeah i run mldonkey here too
anyway whats annoying me now is that i lost my webspace :( 11:29
i had some uber good webspace for quite a long while, and a whileago it disappeared and still hasn't returned :( 11:30
nothingmuch the reason I have my own box and business acct and all that - i got tired of the longevity (or lack thereof) of webspace, mail addresses, etc
ods15 longevity? 11:31
my webspace was pretty damn reliable
castaway has her email address 10 yrs now
nothingmuch mail addresses tend to live for about 2-3 years tops
webspace tends to live about 1 year
castaway they do?
nothingmuch unless you have an account somewhere serious
ods15 but of the man users on it, i was one of the few that wasnt paying for it
nothingmuch which either costs money 11:32
ods15 mine was VERY serious, i knew the admin personally
nothingmuch or is there because you work there
or if you have a friend who admins one of those
castaway ah, well cheap/free ones dont count
you get what you pay for ;)
nothingmuch castaway: true... and if i'm going to pay i might as well have it my way
castaway yup
ods15 the problem is that now he's disappeared, and wont answer mails (he's busy, he answered a few old mails to other ppl that mailed him), and my account is still missing
nothingmuch ods15: maybe he hates you 11:33
ods15 they did a switch from one pc to another or something, and since then my account hasnt returned
possible
anyway, i'm not begging mplayer fokes to gimme mplayerhq.hu/~ods15/ :)
nothingmuch: so, umm, you run your own webspace? 11:34
nothingmuch yep
ods15 even with 300kbps up, that aint enough, atleast not for my needs
castaway (the email account is actually a dialin, but I never do.. so email is costing me 12 euro/month ,)
nothingmuch my needs are modest
ods15 i put up pics, movies, programs, etc.
nothingmuch i put up text 11:35
castaway text++
ods15 yeah that would be the difference...
nothingmuch and s3cr3t-linkz-fuh-friendz
and a modest webgallery
ods15 i guess i can use kmenc15.sf.net/ , but i hate sf.net
nothingmuch sf.net for your personal needs?
isn't that a violation of the agreement?
ods15 yeah, not a good idea
castaway collaborative websites ;) 11:36
ods15 heh i dont remember it
besides who cares :P
nothingmuch well, it's not very nice to take the bw and space they give you for a project and misuse it
this being opensource most people are poor
and sf.net is doing a service for the poor people
so don't make them poor
ods15 i dont use that much bw anyway, i think my project is near dead :P
nothingmuch yes, but other projects need the disk and bandwidth 11:37
ods15 and yes, its painfully obvious that sf.net are broke. the m$ ads are a good hint...
castaway thinks they should charge a mini amount per project/yr
nothingmuch castaway: the problem is the added beurocracy
ods15 castaway: that would prevent A LOT of projects going there 11:38
castaway other projects that do such cope ,)
ods15 even if i wanted to, i couldnt pay, i have no credit card
castaway ods15 if you cant afford, say, $1 a month or year...
nothingmuch castaway: part of the mission statement is to preserve as much data as possible
castaway ods15: also, a lot of them are not worth it anyway ;)
ods15 someone tried to give me a donation a fe months ago, and i coulldnt accept it!!
nothingmuch castaway: in israel it's hard to get an int'l credit card before your 22 years old or so
castaway why would you need a credit card to accept it? 11:39
nothingmuch again, i have one due to social engineering
what would you do, send a cheque?
ods15 because no other transactions are allowed with israels
nothingmuch: i think thats my biggest problem
i have zero social engineering
nothingmuch ods15: practice... it costs you nothing to lose
castaway shrugs .. it would obviously have to be worked out per country/possibility etc 11:40
nothingmuch castaway: you'd be surprised how hard it is to shop on ebay when you're in israel
castaway I dont think I would..
xinming multi sub is_even (Int $value:) { 11:42
$value % 2 == 1;
}
5.is_even
how can this work please?
multi sub isn't a keyword to define a "method" :-S
nothingmuch again with the multis... WHY DON"T THEY CONSOLIDATED IT ALREADY?!
sorry
i'd say 'class Int is extended { method is_even ($value:){ $value % 2 } }' 11:43
oh wait, is Int a role or a class this week?
scook0 the way things are going, I don't think Perl 6 will come out with /any/ classes :) 11:44
just a bazillion roles
castaway (or come out at all :)
scook0 castaway: ooh, that was low :)
ods15 nothingmuch: ugh, '$value & 1' !!
castaway just realistic
ods15 not % 2 ...
nothingmuch ods15: no... that's only for 'int'
ods15 ah bah 11:45
nothingmuch for something pretending to be an Int & 1 is not necessarily consistent
it might not be repreented as bits at all
ods15 well his original was only int :)
nothingmuch no, it wasn't
Int is a boxed type, that is a class
'int' is N bits representing a number
ods15 oh, right, perl6 ugliness, nm :)
nothingmuch ods15: please don't judge
ods15 ok ok 11:46
nothingmuch ods15: if you have nothing to contribute don't call it uglyness
boxed vs unboxed types have their merits
and just because C doesn't have boxed types doesn't mean that's the best way to go
ods15 btw nothingmuch, you probably know better than i do, are there any fun/interesting event in israel like that august penguin?
that was the first time i've ever been in such a thing
nothingmuch august penguin was boring =(
YAPC::Israel is more fun 11:47
ods15 where when
nothingmuch google google
probably mid feb
ods15 doing so, shush
nothingmuch probably in hertzelia interdisciplinary center
ods15 any other event though?
nothingmuch not that I know of 11:48
ods15 oh, umm, perl only?
nothingmuch yes, YAPC is Yet Another Perl Conference
ods15 hmm, 17th feb 2005 11:49
thats past
nothingmuch 2006
ods15 2006 is 404
nothingmuch wait for szabgab to update it 11:50
ods15 sigh
nothingmuch you can come to the Israel.pm meetings, they're either boring or very very fun
ods15 oh well, seems expensive too
when are they
nothingmuch early bird is cheap
ods15 i could use ANY kind of meeting
90 nis i saw?
nothingmuch they are monthly
yes, that's cheap
YAPC::NA is $85 11:51
OSCON is $700+
90 NIS is dirt cheap
ods15 i preffer august penguin's price
which was 30 nis, or actually free for me
nothingmuch august penguin is appearantly better subsidized... it's in direct ratio to the number/size of sponsorships
inverse ratio, that is
ods15 hehe
nothingmuch except for OSCON which isn't nonprofit 11:52
ods15 whAT oscon 11:53
whats
nothingmuch oreilly's open source conference
a spinoff from TPC (the perl conference)
ods15 oh that
svnbot6 r6375 | scook0++ | * Haddocks for use/no/require in Parser.hs 12:22
dudley Is a Pad in PIL2 analogous to a typeglob in Perl 5? 12:38
Or does a Pad store multiple names? 12:40
nothingmuch dudley: uh, sort of
it says "this new lexical symbol pops into existence"
scook0 and be careful not to confuse the Pad data-constructor with the Pad type 12:41
dudley oh, crap.
scook0 there's lots of that sort of punnery in Pugs
dudley Well, does every symbol in a Pad have the same Name, with different Sigils? 12:42
or is there one symbol per Pad? 12:43
nothingmuch dudley: that's an implimentation detail
the sigil is part of the name
scook0 dudley: hold up
nothingmuch as I see it the simplest implementation is: keep a stack of symbols
and keep a stack of scope frames
scook0 tell me what file you're looking at right now
nothingmuch scopes refer to the last element in the linked list stack 12:44
dudley scook0: The one in my brain.
nothingmuch as you create new symbols you push new pad items to the stack
as you enter a scope you record the symbol stack head in the scope stack
lookup traverses the symbol stack, starting from scope stack element #x where x is the number of OUTER::'s encountered in the name
when you leave a scope you pop the symbol stack until you find the the head of the scope stack, and then you pop one element from the scope stack 12:45
but that is inefficient
the scope stack may be a stack of hashes
where each pad is a hash
and each Pad node creates a new key in the hash 12:46
that's also a simple mapping, but not as "functional" ;-)
dudley :)
nothingmuch that's probably what the perl5 runtime should do
btw - scope enter does not necessarily mean dynamic scope 12:47
the scope stack maintained by that is the dynamic scope one (CALLER::) 12:48
but for lexical, each scope has a ref to it's parent scope
iblech Hi :)
oooh PIL2 discussion :)
nothingmuch hola iblech, you were sought after earlier
dudley Not so much discussion as instruction :)
iblech nothingmuch: pads as stack of hashes -- this is exactly what PIL2JS does
iblech backlogs 12:49
dudley nothingmuch is learnin' me some stuff
nothingmuch iblech: pads are stack frames
whether they are stack elements or regions of the stack, it doesn't matter =)
iblech yep 12:50
nothingmuch anyone who has a song named "Bitch Niggaz" is obviously an idiot... *sigh* 12:51
what does that even mean? 12:52
dudley scook0: I'm mostly looking at src/PIL/Container.hs and src/PIL/Pad.hs
nothingmuch: I kind of like that song :)
nothingmuch dudley: it could be a good song, but the title is stupid
and I infer the person who came up with a title is also stupid 12:53
dudley I didn't say it was a _good_ song :)
nothingmuch dudley: i don't know the song, and 'good' is subjective
OTOH i do know the title, and stupid is objective because I am the center of the universe
dudley but yes, the title is quite stupid
nothingmuch so there
scook0 nothingmuch: you're the centre of the universe? 12:54
crap
nothingmuch it came up as a possible tag for a Grateful Dead song... no clue how =)
scook0 I thought that was me...
nothingmuch scook0: you too
dudley heh
nothingmuch it just depends on your POV
from my POV things are organized in a radial fashion, around me
hence I am the center of the universe
scook0 nothingmuch: deep... 12:55
nothingmuch because I have no grasp of the end of the universe, it might aswell be round, with me at the center
regardless, that song title is stupid because I said so =) 12:56
scook0 iblech: I was looking at ruleUseJSANModule in Parser.hs earlier 12:58
trying to refactor it into ruleUsePackage and friends
I've stopped for now because it was getting complicated 12:59
iblech The problem is that ruleUseJSANModule doesn't do anything at compile-time
in contrast to the regular uses
Therefore I created an own rule for it 13:00
scook0 I see 13:01
nothingmuch anybody want to shove me in the right direcction WRT fixing my smoke report?
it's failing the parrot rule stuff
scook0 iblech: but I see no real reason for them to be separate 13:03
nothingmuch eep, wtf is Test::Code all about
scook0 (other than the fact that merging them would require work and refactoring)
nothingmuch might as well copy your .pm file to the t/ dir and make sure the files are identical 13:04
iblech scook0: Well, you'd need lots of if and cases
scook0 iblech: yeah, that was the 'getting complicated' part
iblech :)
scook0 well, I'll try changing both of them in small steps until they resemble each other more closely 13:05
then merging should be easier
iblech scook0++
pdcawley_: t/unspecced/cont.t passes 11/13 on PIL2JS :) Working on the two remaining tests 13:06
scook0 iblech: it wouldn't make sense to 'no' a JSAN package, would it? 13:11
iblech Right, IIRC JSAN doesn't support that
scook0 I shall make it an error then 13:14
iblech Yep 13:17
scook0 (bah, compiling takes WAY too long...I need more RAM) 13:22
integral iblech++ # cont.t
xinming hmm, I've read the example in example/vmmethods/ . 13:24
iblech pdcawley_: Now 12/13 :) 13:28
xinming In my understanding. In keyword multi will define a function which will dynamic append to a specified class? 13:30
anyone here would tell me if I am right or wrong?
scook0 xinming: I don't think that's right 13:34
'multi' means you can have more than one sub/method/whatever with the same name
QtPlatypus As long as they have diffrent signatures. 13:35
scook0 then, when you call it at run-time, it will pick the most appropriate version, based on the types of the arguments
xinming seen autrijus 13:37
jabbot xinming: autrijus was seen 19 hours 37 minutes 51 seconds ago
iblech integral: 14/14 :) 13:39
svnbot6 r6376 | iblech++ | * Usual svn props. 13:48
r6376 | iblech++ | * PIL2JS: &?CALLER_CONTINUATION.
r6376 | iblech++ | * t/unspecced/cont.t: Added some type annotations and a new test.
r6376 | iblech++ | PIL2JS passes 14/14 with 6 unexpected succeedings. :)
r6376 | iblech++ | * PIL, PIL2JS.js: PIL2JS.cps2normal now works correctly with functions
r6376 | iblech++ | which reach the end of the program (this can happen, for example, with
r6376 | iblech++ | continuations :)). Previously, the program flow was restarted after the
r6376 | iblech++ | call to PIL2JS.cps2normal, resulting in certain regions running twice.
r6376 | iblech++ | * PIL, PIL::PVar, PIL::Subs: sub foo { {return}() } didn't compile, because
r6376 | iblech++ | PIL2JS only kept track of the current subtype, not of all subs it's
r6376 | iblech++ | currently in. Fixed.
r6376 | iblech++ | * PIL2JS: PIL, PIL2JS.js, README: Context objects are now unboxed -- boxing was
r6376 | iblech++ | never needed. Should give a small speedup.
ods15 why does svnbot6 keep flooding the channel? 13:51
nothingmuch ods15: because it's useful info 13:53
ods15 i cant make head or tails of it
iblech must have huge karma by now
nothingmuch ods15: than read more carefully
iblech ods15: svnbot6 relays new commits to the repository
jhorwitz karma iblech 13:54
ods15 whats the r6376 mean
jabbot jhorwitz: iblech has karma of 337
iblech revision 6376
jhorwitz karma autrijus
jabbot jhorwitz: autrijus has karma of 574
iblech rREVISIONNUMBER | committername++ | description as given by the committer
ods15 hmm, what has higher precedence in perl5, space or operators? 13:55
func $bla > 10
is it
func($bla > 10)
or
func($bla)> 10
?
nothingmuch ods15: that depends on when and how func was defined
ods15 in this case, func is 'scalar' 13:56
nothingmuch it still depends 13:57
;-)
wolverian I don't think a space has much precedence in perl5 at all
svnbot6 r6377 | scook0++ | Phase 1 of my 'use'-parser refactoring: 14:00
r6377 | scook0++ | * Unified the 'lang' parser for JSAN & Perl packages
r6377 | scook0++ | * JSAN & Perl paths now use similar code to parse the package name
scook0 well, I'm off to get some sleep--later all
integral it depends on the type of operator, unary named ops have different prec to list named ops 14:05
ods15: so in the case of `scalar $a < 5` according to perlop, named unary ops are one prec level above <
ods15 hmm 14:08
nothingmuch ods15: do you know perl? 14:11
ods15 i've done a few scripts..
nothingmuch ods15: then why not learn it seriously?
it's a pretty nice language... perhaps not as nice as <xyz>, but CPAN makes up for that
ods15 i like perl for it's intended usage, string manipulation
xyz? (was that a generic word?..) 14:12
nothingmuch that is it's superficially intended usage
but the language has progressed from 1987, you know
replace xyz with whatever you think is better than perl
ods15 yeah so i figured
i do like perl, but i dont like what perl6 is trying to do with it 14:13
nothingmuch why not?
ods15 i heard something about unicode operators?
nothingmuch heh
there's always ascii equivelents
the unicode ones just look pretty
theorbtwo We allow users to define whatever unicode operators they like.
As for operators that are defined by the language, we limit ourselves to latin-1, and there's always a way to write it using pure ASCII if you prefer. 14:14
ods15 '\233' is not pretty :/
theorbtwo Who said anything about \233?
nothingmuch ods15: you don't need it to be \233
ods15: i think you are really trying hard to ignore the big points of perl 6
theorbtwo You can write @array Ā„ @array2, if you want.
nothingmuch and instead you're nitpicking about small details that don't really make a difference
ods15 anyway, you took a complicated language, and made it more complicated 14:15
theorbtwo You can also write @array Y @array2, or zip(@array;@array2).
nothingmuch no, perl 6 is more simple
because it's more consistent
castaway looks at nothingmuch ,)
nothingmuch and perl is also simple, it's just wide
theorbtwo Perl 6 is more complicated to define, and more simple to use, we hope.
ods15 nothingmuch: so far i see added features, not reduced
iblech nothingmuch: I'm about to un-warnock "Serializing code" -- I still don't get what you mean by "kind of value", could you elaborate please? :)
theorbtwo Yep, ods15. If you want a sparse language that has a simple defintion, you know where to find brainfuck.
ods15 i see perl6 falling down same trap as C++ 14:16
nothingmuch ods15: if you really knew perl 5 for more than just scripts, and really studied the synopsis you would see a kind of all-encompassing consistency
theorbtwo iblech, for one, look forward to being able to write if (-1 < $x < 1) {...}.
nothingmuch C++ is ugly because it has symptomatic solutions for problems
iblech: one sec
theorbtwo Anyway, I was planning to implement Hail and Ride, not do this...
nothingmuch ods15: please study the synopses carefully before passing judgement 14:17
ods15 nothingmuch: yeah i'm generally trying not to pass judgement because i know very little/nothing about it 14:18
QtPlatypus ods15: What trap is that?
theorbtwo s/iblech/I/
nothingmuch with all due respect it's appearant that you don't really know what you're talking about, since most of your criticism has too little facts, too much prejudice
iblech nothingmuch: Sorry, just got informed I have to go to $work now, will be back in ~~6h (but I'll backlog, of course)
Later all :)
wolverian theorbtwo, the set operators are not latin1 (although it's not exactly a core feature)
nothingmuch iblech: ciao!
QtPlatypus fully expects that I will be able to write with a subset of Perl 6, without having to learn the entire langauge.
ods15 QtPlatypus: over complicated 14:19
castaway hopes so too
theorbtwo wolverian, last I heard, the set operators were just an example... has that changed?
castaway -p You can skip most of Perl6's new features if you like (iirc)
wolverian theorbtwo, they're being used for types not as well. Int (+) Str
s,not,now,
theorbtwo QtPlatypus, I certianly expect you can, and I plan to avoid Junctions for the most part.
ods15 17:18:10 <nothingmuch> with all due respect it's appearant that you don't really know what you're talking about, since most of your criticism has too little facts, too much prejudice - that's pretty true
i'm generally an asshat 14:20
nothingmuch iblechbot: what I meant by "types of data" is not the value type (Int, Str, etc), but the nature of the data (global variables, closure owned pad snapshots, etc)
ods15: is that a good thing?
ods15 anyway, i believe in "small is beautiful"...
theorbtwo Oh... but that still has an ASCII alternative, right -- like you just wrote it?
ods15 nope
wolverian theorbtwo, yes.
theorbtwo Good.
wolverian ods15, do you like Ruby?
ods15 wolverian: never tried it
castaway (non-ascii operators - too futuristic.. )
wolverian ods15, you might like it. it's pretty simplistic.
nothingmuch iblech: the issue is - what happens to data in the environment that compiled code relies on? is it serialized too? is it symbolically stored, to be looked up on the other side?
ods15 tbh not sure what it is, guessing a programming language...
wolverian ods15, www.ruby-lang.org 14:21
nothingmuch ods15: small is beautiful applies to lots of perl 6 *code*
there are some really amazing patterns captured in perl 6 (the language), which allow you to write code so elegant you want to nopaste it immediately
wolverian ods15, while perl's syntax is not beautiful, its nature is. :)
(what nothingmuch said.) 14:22
ods15 hehe i don't care about "beautiful" syntax :)
wolverian that's good.
nothingmuch hyperoperators, reductions, gather/take, lazy lists, functional aspects, post-object-oriented - these are all tools that let you simplify the way your intention is written in code
ods15 hehe 14:23
nothingmuch ods15: take gather/take as an example
ods15 hmm
nothingmuch: ok, it's just not my style, it's not necessarily bad
i like control 14:24
nothingmuch my @filenames = gather { for =$input_handle { take $_ if looks_like_a_file($_) } };
castaway sound like you're stuck in the mud ods15 ..
how many languages do you program in?
ods15 while writing a perl6 program, i'll most likely have absoloutely no idea whats going on 'under the hood', which i hate
castaway its almost basic like again nm ,) (ie sounds like english)
nothingmuch in perl 5 this looks like: my @filenames; while (<$input_handle>){ push @filenames, $_ if looks_like_a_file($_) }
ods15 castaway: define 'program in'
nothingmuch except that gather/take is lazy
QtPlatypus ods15: And you think you have that with perl 5?
castaway regularly use, as opposed to 'did one script in 5 yrs ago' 14:25
Qt he doesnt know either much
nothingmuch in C, i don't want to know what you have to allocate in there
ods15 i've hacked in C, perl, python, bash, VB, BASIC, PASCAL and probably quite a few other hideous langs
QtPlatypus: nope, not with perl5 either
castaway a few scripts in perl hardly counts
nothingmuch ods15: why not try a beautiful one for change? Scheme, perhaps?
castaway LISP!
ods15 nothingmuch: heh lisp you mean? 14:26
i've tried that too, yes
nothingmuch ods15: scheme is a beautiful dialect for a beautiful languagre
QtPlatypus loves scheme "I just hate the implemations"
ods15 QtPlatypus: but perl5 was ok, its intent was string manipulation (and more), and it did it beautifully
nothingmuch then why didn't you grok the goodness of map/filter and so forth a while ago? Are you sure you "got" lisp?
castaway perl*1*s intent was string manip.. perl5s wasnt
wolverian ods15, if you hate not knowing what's going on under the hood, you're stuck with assembly 14:27
ods15 nothingmuch: no i didn't get into much.. hardly at all actually
i just saw the hideous () :)
wolverian: and C
nothingmuch ods15: see, that is superficial judgement
castaway hideous what?
nothingmuch the parens mean nothing
lisp can be written with just indentation
ods15 nothingmuch: yes i know
nothingmuch or using a graphical tree
wolverian ods15, right. why is it so important to you, though, to know what's going on under the hood?
ods15 i never got into it much
castaway oh, parens in LISP :) 14:28
ods15 wolverian: control... when you dont know what youre doing, you start making hacks
nothingmuch ods15: so why did you let the parens stop you? it's a shame that you're missing out on so much due to such a small barrier
ods15 "hey, this just happenned to work. i have no idea why, but it works. oh well, i'll just use it"
wolverian ods15, you know what *you're* doing. you don't need to know what exactly the compiler is doing for you to get it done.
ods15 nothingmuch: i dunno, just never bothered, i guess i could look into it..
wolverian ods15, as long as the program makes algorithmic sense the implementation doesn't matter.
nothingmuch ods15: bullshit. cargo cult programming has nothing to do with highlevel programming
QtPlatypus I've often heard that as an argument by hard core Cers against Garbage collectiors.
wolverian ods15, right. you can do that in ASM and C as well. high level does not mean you can't learn algorithms. 14:29
ods15 wolverian: when things get more complicated you're not sure how the "language" will cooperate with your things 14:30
nothingmuch ods15: look, this discussion is fruitless. I do not appreciate being called a cargo cult programmer just because I do perl
ods15 nothingmuch: whats a cargo cult programmer?
nothingmuch i appreciate minimalism and essence in programming
wolverian ods15, but things aren't more complicated. it's often simpler to state an algorithm in a high-level language than to write its implementation in C.
ods15 (i didnt call you that...)
nothingmuch and I believe, with my experience, that C is just as prone to that (even more, perhaps) than a high level language
castaway if you read up on the docs and such you'd know what the language was doing
nothingmuch because understanding just how much control someone has is not something a newbie gets instantly
ods15 i care not about newbies 14:31
nothingmuch oldbies do not copy-paste blindly, and i'm offended that you implied we do
dudley a cargo cult programmer is someone who codes using idioms she doesn't understand because she's seen someone else do it.
ods15 nothingmuch: i implied?i must be misunderstanding me :(
QtPlatypus ods15: What do you like programing in? 14:32
ods15 QtPlatypus: C is my favorite, then perl, then C++, and then VB. seriously.
nothingmuch you said: "hey, this just happenned to work. i have no idea why, but it works. oh well, i'll just use it"
ods15 nothingmuch: yeah, i'm quoting random j. hacker
QtPlatypus ods15: What is the problem space of most of your programing? 14:33
ods15 not you or anyone here...
nothingmuch a language is good in the hands of an experienced programmer
ods15 QtPlatypus: ? what do you mean
nothingmuch a language designed for idiots could come with an IDE with no copy-paste function
castaway those sort of things are not language specific..
nothingmuch if you are looking for a language that makes sure the programmer behaves you've got python and java, and they're good for what they do
QtPlatypus ods15: What type of problems do you write programs to solve?
theorbtwo Someone who codes like an idiot will do it in whatever language.
nothingmuch but they also suffer from cargo cult madness
my dad's colleague has some students help him with his protein-folding code... they copy paste all the time 14:34
ods15 QtPlatypus: ah.. well, multimedia sometimes, mathematical stuff sometimes, stuff just for my convinience (ie some task i do often..)
nothingmuch and then he can't make folding deadlines, because the code is too bugyg
theorbtwo It seems like your primary problem with perl is that you code perl like you don't know what perl's really doing.
That's not perl's fault, it's yours.
nothingmuch they use java, which was supposed to keep the stupid error factor down
but it doesn't 14:35
theorbtwo Nobody will deny that there exist bad perl programmers. Perl's philosiphy has always been to give you plenty of rope.
nothingmuch they get buggy code, but no buffer overruns, at the cost of 30% the performance it could have been
theorbtwo It's up to you if you perfer to hang yourself, or make a net.
ods15 lol i like that :P
nothingmuch ods15: C also gives you plenty of rope
QtPlatypus I mean Matts Script archive vs CPAN and all that.
theorbtwo Good then. Get an account at perlmonks, and start programming well. Then come back, and we'll tell you how perl6 can let you program better. 14:36
Khisanth heh there is a page on shooting one's own foot in various languages :) 14:37
theorbtwo What do you like least about programming, in whatever langauge?
ods15 i think perl6 is a different language for a different purpose.. you guys said it's built to work with big projects and such?
nothingmuch ods15: let's refine the argument: a good language is one that lets the programmer get the best output from their intention, right?
Khisanth ods15: only superficially
theorbtwo ods: Perl6 should work for you, no matter what size your project is. 14:38
castaway perl5 is already
theorbtwo That has very little to do with what you program in, and more with how you program.
ods15 nothingmuch: no, a good language for me, is one that's fun to program in and in the end result makes my life better :)
nothingmuch in that sense C is good, when "best" is constrained to performance or memory use
fun to program in is a value of "best"
theorbtwo I think perl6 will be fun to program in.
QtPlatypus ods15: I've found perl 6 hell of alot more fun.
nothingmuch life better is a part of 'intention"
ods15 17:37:31 <theorbtwo> What do you like least about programming, in whatever langauge? - i'm not sure...
nothingmuch in this sense, perl is good when you want it done in a short time, and you would like lots of code reuse, and performance isn't that much of an issue 14:39
QtPlatypus loves that he can say [~] @array. Rather then join '',@array for example. "I practally creamed my pants the first few times I did that"
ods15 ni i like preformance too
nothingmuch ods15: you can get performance in perl for the parts that matter by using Inline::C, for example 14:40
ods15 this is in perl6 or 5?
nothingmuch ods15: perl 6
let me explain what it does:
ods15 figured, no compiler in perl5 :)
nothingmuch compiler?
castaway perl5 has Inline::C too
nothingmuch oh.
not inline::c, reduce
castaway so eh?
nothingmuch inline::C is perl 5 only, so far
and perl 5 does have a compiler 14:41
theorbtwo (With the stress on /so far/, I expect.)
nothingmuch anyway, let me explain QtPlatypus's example
ods15 this is extremely funny, we've evolved from the days of c with inline asm into perl with inline c :P
castaway Perl has inline more-or-less everything
nothingmuch ods15: C is good for certain things, that's what Inline::C gives you!
theorbtwo ods: You can also use Inline::ASM if you like, but I wouldn't recommend it.
nothingmuch you're really not listening
castaway (or Inline::Java, if you're crazy ,)
ods15 umm, i'm trying to... go on, i'll be quiet and listen..? 14:42
QtPlatypus (Don't we have an Inline::Perl6 now as well?)
Khisanth there is even Inline::Java
ods15 Khisanth: pay attention :P
nothingmuch ods15: look, C is good for certain things: performance, memory restriction, etc
castaway (restriction.... ;)
nothingmuch perl is good when you want to worry less, and get more done in less time
ods15 nothingmuch: i mentioned that part of is fun 14:43
nothingmuch if you can't afford to use perl for 2% of your project, since it's too (big|slow), then you can use Inline::C for just that bit
ods15: fun is subjective
Khisanth ods15: erm perhaps you are just bad at expressing yourself but after reading the scrollback you off being quite trollish...
ods15 for me that is
nothingmuch: that i admit would be really really good
nothingmuch ods15: s/would/is/; 14:44
castaway well do it then ,)
ods15 i'm being serious - mplayer written in perl, with serious bits being in C/asm would be very very good
castaway so what are you waiting for? ;)
nothingmuch ods15: look at the bunch of C extensions on CPAN
QtPlatypus And if worse comes to worse. Perl is great for prototyleing your algorthems in and then when you have got your algrythms down pat back porting into C.
nothingmuch Digest::MD5 and Crypt::Blowfish will be too slow in perl 14:45
but much more convenient in perl
castaway baeh ;)
nothingmuch so they are C/Perl - convenient and fast
there are countless examples
ods15 anyway, regarding the fun thing, for me, comftable, is NOT fun.. if it's too easy, it's not fun. if i write in perl, i can get my goal done usually pretty damn fast, but if i write in c, i can spend some effort in it, and if bored, i can sit back and really thing about whats going on in my program behind the scenes.. i find this fun..
but again, subjective :) 14:46
nothingmuch ods15: do you code for a living? or just as a hobby?
ods15 nothingmuch: i'm in army, i have no living
nothingmuch ods15: that's the fine line then
Khisanth ... bugs = fun eh? guess I am not the only one that enjoys debugging :)
nothingmuch when you code for $$$ time is an important factor
castaway most people think the coding should be fairly easy, and the fun/tough bit is figuring out the division into modules, subs, classes, and the algorithms etc 14:47
nothingmuch and you want to get it out the door as fast as possible, in the best shape it could be
ods15 Khisanth: not bugs at all
effort is fun
castaway he means do you get paid to code?
nothingmuch and you want to make sure that when you have to fix it, it would be painful
and time is always at war with the other priorities
ods15 nothingmuch: painless you mean?
nothingmuch and the better the language, the less tradeoffs you have to make 14:48
yes, painless
ods15 hehe
yeah you lost me there :P
funny thing, in army, i DID program in perl! hehe
nothingmuch the army is not like the market
ods15 i've only made one program there and its all perl...
but i used perl cause it was more suited... it had to do with http and string manipulation... so, c, no good 14:49
nothingmuch i'll reiterate - the value of the language is the quality of the output, measured by programmer burnout, performance, code size, maintainability, clarity, and so forth, divided by the time it takes to get the output
QtPlatypus ods15: Do you think that the shift to Perl 6 will harm this ability? 14:50
nothingmuch ods15: apache is written in C, and perl iis written in C
those are perhaps the best tools out there to deal with http and strings
please tell me why they aren't written in perl?
ods15 nothingmuch: to this day i dont understand the http spec.. :)
so i used ready made stuff 14:51
nothingmuch ods15: that's why library authors grok spes for you
see also LWP
ods15 and c is horrible for strings, i think we all agree
wolverian perldoc LWP :)
ods15 wolverian: thats what i used there..
wolverian that's good.
nothingmuch ods15: do you agree with my function to compute the value of a language?
wolverian reinventing the wheel might be fun, but it's not productive. 14:52
ods15 nothingmuch: almost, yes
castaway but, ods15, you were using stuff that you dont know how it works!
nothingmuch and do you understand why in your circumstances time is not a factor, and do you see why this is perhaps the reason you value C more than high level things?
Khisanth nothingmuch: the military(at least the US one) tends to waste a lot of money ...
nothingmuch Khisanth: IDF does that too
ods15: now, do you also see why Perl 6 helps increase that value?
maintainability is high due to good solutions for normal problems 14:53
programmer burnout is low, because lots of things are easy and quick
code size is low, because the language is dense
ods15 nothingmuch: one thing i wish to add about your equation, it is correct when your goal is JUST, to get something DONE
Khisanth either that or they are really using some of the money or some secret stuff but I am not paranoid enough for that :)
nothingmuch ods15: no!!! THAT IS SOOO NOT MY POINT!!!
castaway one generally needs to get it done, and working well without bugs
ods15 ?
nothingmuch it applies when you need to have a sustained rate of productivity over time 14:54
maintainability has nothing to do with "just getting it done"
because it's a factor that is calculated in lieu of the understanding that it's never done
ods15 nothingmuch: i was reffering to the equation about the quality of a language
nothingmuch yes
that is the quality of the language 14:55
Khisanth hrm .. nothingmuch, C IS high level :)
high level asm!
nothingmuch productivity is the the cost of the programmer * the value of the language
castaway not relative to Perl.. ,)
nothingmuch and over time it's cheaper to use perl for most things like web applications, short lived data munging scripts, general do-hicky programs, support tools, rapidly changing code than it is to use C 14:56
ods15 that's true...
nothingmuch however, it's cheaper to use C to develop a database application, because if you write it in perl it'll be too slow, and no one will buy it, hence it's very expensive (investment - income)
that is my point
and it was my point when I stated that perl 6 is a good language
since perl 6 is better than perl 5 in almost all the measurable or seemingly measurable aspects of what is the value of a language 14:57
and off the top of my head I can't think of why it's worse
the only thing about it is that:
a. it's not ready yet
b. people seem to think it's ugly
c. there's more to learn
but to counter c, once you know 40% of perl 6, the curve flattens 14:58
castaway I think c doesnt really count..
nothingmuch in perl 5 this only happens around 80%
ods15 hmm
castaway theres a lot to learn in perl5, but lots of people dont know/need to know all of it
QtPlatypus b, is purely subjective.
nothingmuch perl has many more special cases
QtPlatypus: that's why it's also moot
ods15 heh 14:59
nothingmuch ods15: are we at an understanding?
because if so, i'd like to drop this
ods15 yes..
do you mind showing me some kind example perl6 code?
nothingmuch with the conclusion that every language is good at whatever it is that it's good at 15:00
ods15 something complete, non trivial, but not too big
nothingmuch svn.openfoundry.org/pugs/examples/
svn.openfoundry.org/pugs/t/
svn.openfoundry.org/pugs/ext
ods15 hmm 15:01
print "5x5 matrix in one line: " unless @*ARGS; 15:02
my $matrix = @*ARGS[0] || =<>;
nothingmuch where is that from?
ods15 matrix.p6
nothingmuch okay, what about it? 15:03
do you know what that line does?
it means that $matrix is the string value that is either the first argument if it's there, or a line of STDIN
so little code, saying so much
helping the program be more usable 15:04
ods15 but i couldnt understand it
nothingmuch i could
ods15 whats the = before =<> for?
nothingmuch that means lazy
ods15 (whats @* ?)
nothingmuch @ is array
* is global
the global array named ARGS
ods15 ah
nothingmuch indexed to offset 0
|| is short circuiting on value 15:05
if @*ARGS[0] is undefined or false, then evaluate the right side
ods15 yeah i got that part.. heh 15:06
heh i didnt get why the print is only when there's args... 15:07
and i see an obvious change from perl5, no more $arr[0] ...
which i really did kinda hate about perl5
nothingmuch ods15: the reasons for that are quite beautiful actually 15:08
but the usage is bad
that's why it's going away
ods15 $matrix .= chomp;
nothingmuch see? isn't perl 6 better already?
.= means mutating method call
ods15 this obviously behaves differently than perl5... could you explain?
nothingmuch chomp is a method called on strings
that removes end of line if there is one tacked on the end of the string
$matrix = chomp($matrix);
that's the equivelenet perl 5 snippet 15:09
ods15 heh, thats a pretty damn big change for '.='.. couldnt they pick a different operator?
nothingmuch ods15: see? superficial differences again
no, they couldn't, because the rest of the world uses '.' for method calls
and everyone hated perl for using '->'
so we switched to '.'
ods15 ok, but it's certainely confusing regarding perl5...
nothingmuch it's nicer, shorter, and more readable
ods15: it takes 3 minutes to learn
ods15 hmm
.= means.. 15:10
nothingmuch ~ is now the string concatenator
ods15 $bla = $bla.chomp
?
nothingmuch $obj .= method
$obj = $obj.method
yes
but it's possibly more efficient
ods15 ah, ok, thats sense making
nothingmuch for example @array.=sort could be in place, since it's not returning anything
ods15 neat
btw, regarding compiled binaries... libpugs.so ?.. 15:11
nothingmuch not yet
ods15 i mean, is that how it all works?
nothingmuch let me find you a link
pugscode.org/images/simple-compilation.png
autrijus ods15: we can have libpugs.a
nothingmuch hola autrijus
autrijus but GHC's .so support is not really there 15:12
so until that improves, no .so for now
yo nothingmuch
ods15: but it doesn't matter that much; the reference runtime is just that, a reference
ods15: the real action is likely to happen at the Perl5, Javascript and Parrot runtimes.
ods15 btw, if perl is supposed to be an "industrial" language, you really should've disallowed 'method params' altogether :/
autrijus which all has their own .so
nothingmuch method params?
autrijus what are method params again? 15:13
ods15 not method(params)
space as a function call
autrijus juxtaposition as function call?
nothingmuch how do you say MMD?
ods15 mmd?
nothingmuch why should it be $fh.close or close($fh) and not both
multimethod dispatch
autrijus nothingmuch: er, no, ods15 means
close $fh;
ods15: what should juxtaposition mean then? 15:14
ods15 ?
as far as i can tell i'm talking about a purely cosmetic thing
nothingmuch ods15: perl 6 lets you optimize for readability
autrijus ("juxtaposition" means you put a verb and an argument together separated by only space)
nothingmuch if it makes more sense to you to close a file handle, you write 'close $fh'
if you think 'filehandle, be closed', you say $fh.close
it really depends on what color your train of thought is at the moment 15:15
ods15 nothingmuch: i was actually talking about, the ()
sort @arr sort(@arr)
that cosmetic thing
nothingmuch ah
i forget the new rules in perl 6
autrijus I don't know... OCaml, Fortran, Visual Basic etc
even Haskell
theorbtwo The question, I think, is why can you say $fh.print("Your mother"), but not $fh.print "Your mother" 15:16
ods15 but re-thinking, i guess i can see some actually nice "uses" for thiss
especially in heavily nested calls
theorbtwo There is a reason, but I don't remember what it is.
autrijus theorbtwo: $obj.print + 3;
nothingmuch ods15: that really doesn't matter
that's just syntax
you can replace the grammer for perl 6 within a perl 6 program 15:17
autrijus theorbtwo: method calls doesn't have the arity/listop kinding
theorbtwo: so they need parens to parse
nothingmuch ods15: not that I'd bother reading your code if you do
ods15 nothingmuch: well the whole idea was to sanitize the perl5 syntax
nothingmuch ods15: but also to introduce new levels of flexibility 15:18
theorbtwo Ah, right.
nothingmuch you can ammend to the syntax
autrijus ponders doing a "The Least Insane" web comic strip
nothingmuch you can create macros
if they help, then they help
and that's good
nothingmuch quotes spiderman: "With great power comes great responsibility"
since I like to think that I'm not an irresponsible idiot, i tend to prefer power
ods15 nothingmuch: that was spiderman's uncle!
nothingmuch yeah, that was ambiguous 15:19
autrijus with great power comes electric shock
Khisanth autrijus: where will you find time to do a comic strip? :p
ods15 hehe
nothingmuch i meant i was quoting spiderman the comic, not the character
ods15 ah
autrijus Khisanth: I don't
Khisanth :)
ods15 btw is there ANY kind of ambiguity in perl6/undefined behavior?
theorbtwo (Uncle Owen)++
castaway autrijus++
nothingmuch ods15: far less than perl 5 15:20
autrijus I'm still working on this $job thing and trying to get Catalyst+SQLite3 happy with each other
Khisanth ods15: of course :)
theorbtwo ods: There's plenty, but when we find it we try to define it.
nothingmuch autrijus: what do you need? i do it all the time
ods15 nothingmuch: heh i wasn't aware perl5 had any
Khisanth since it's not fully specced yet :p
castaway darn jobs..
ods15 Khisanth: heh. i consider it C's greatest weakness
autrijus nothingmuch: which scaffolding do you use nowadays?
nothingmuch autrijus: i also had crap with it
Khisanth perl5 has at least a couple as well
autrijus nothingmuch: the main problem is the schema changes every day
nothingmuch autrijus: i started with the helper, and then grew my own
autrijus: /msg ?
ods15 if (0) if (1) a = 1; else a = 2;
autrijus nothingmuch: #catalyst
castaway thats hardly the softwares fault, autrijus ;)
theorbtwo ods: That's not legal in perl (5 or 6), so it's not ambigious. 15:21
ods15 but atleast it gives a compiler warning :P
autrijus castaway: no, but it contributes to my lack of time on pugs :)
nothingmuch ods15: compiler error
ods15 theorbtwo: i said, i consider it C's ngreatest weakness
castaway I can imagine ;(
ods15 C's!
theorbtwo Oh, right.
castaway (changing specs)--
theorbtwo Sorry.
ods15 hehe
nothingmuch afk & 15:22
ods15 oh, nothingmuch, i just remembered what was the other thing i "hated" about perl6... no official implementation :(
Khisanth I consider C's greatest weakness to be the number of yaks you end up shaving in the course of writing a program :)
nothingmuch (not really, just other channel)
ods15 bye
nothingmuch ods15: we're working on it
what i mean is: mention my name to get my attention
ods15 nothingmuch: umm, you're working on the opposite?
castaway ods15: thats just a matter of time, in theory
ods15 castaway: i find portability problems only get worse with time, not better :( 15:23
the second you have 2 implementations, you might as well have a million
castaway eh?
one will be plenty
ods15 castaway: there was never a perl standard, and it was the most consistent language on earth
nothingmuch ods15: we're working on an implementation
ods15 because it had only one implementation 15:24
nothingmuch that will bootstrap *the* implementation
in the future there will be one perl 6
ods15 nothingmuch: no, thats not what i mean..
nothingmuch compiling to NPIL
ods15 heh
nothingmuch PIL will the run on different runtimes
castaway theres a P6 standard?
Khisanth there are also good reasons for multiple implementations ...
nothingmuch i doubt there will be several perl 6's because it's designed to fulfill the deployment needs project forks usually get around to
ods15 Khisanth: they are rare
Khisanth though it would probably fail for the same reason Communism fails :)
good but only if you take away human behavior/emotions/desires :) 15:25
ods15 oh, i still didnt understand, whats =<> ? 15:29
Khisanth you know what <> does in perl5? 15:33
ods15: svn.openfoundry.org/pugs/docs/quickref/ 15:35
that should be useful for getting started
15:58 Maddingue__ is now known as Maddingue
putter nothingmuch: ping? 16:26
xinming hmm, by the way, Is there any problem with irc.freenode.net? 16:43
why will I have to connect over times to get in here?
QtPlatypus You keep getting an "SendQ exceeded" error. 16:44
xinming ??? 16:48
QtPlatypus Thats what it says in your quit
Khisanth * xinming has quit (SendQ exceeded)
which client are you using? 16:49
xinming xchat
Khisanth in any large channels?
xinming I might considering erc instead. :-)
Khisanth anyway /set away_track off 16:50
xinming Do you mean I opened too many channel a time?
Khisanth no 16:51
nothingmuch putpong
ugh
putter: pong
ods15: how's your perl 6 learning coming along? 16:52
Khisanth xinming: but the away tracking can cause the problem with SendQ 16:53
ods15 umm, i just read one script :P 16:54
i moved on to the next bored thing
i'm not interested in becoming perl6 programmer, atleast not in forseeable future, you can count on it :) 16:55
xinming Khisanth: hmm, do you mean I need to check the "enable away tracking" or not ? 16:56
Khisanth: default It is unchecked.
Khisanth then there shouldn't be anything else that would cause that by default 16:57
if you have any scripts loaded then it's anybody's guess what is causing it
xinming ods15: hmm, Larry says, you will use perl 6 as perl 5. :-) 16:58
ods15 heh in the forseeable future, there is no perl6... 16:59
xinming Khisanth: hmm, I really don't know, This happened today. really trouble some, And I can open google here today.
can't open google 17:00
autrijus xinming: might be that great firewall of yours :-/ 17:01
xinming ods15: don't you believe that after pugs covers most of the perl 6 "specification", Perl 6 will be out in at most a year. 17:04
ods15 no i don't 17:05
it'll be used by few
cause of the name
xinming autrijus: hmm, Don't know, M$ Home seems not to be able to reach either.
ods15 it's like the corel draw fokes working on a linux version, and then m$ bought corel draw (or something like that?) and kicked the linux team off, and now they are still working on it, but nobody knows who they are cause they dont carry the name 17:06
xinming ods15: you mean some people don't like pugs, because pugs isn't developed by Larry ? T_T
ods15 xinming: i thought pugs was the perl6 bug tracking system :/ 17:07
xinming ods15: hmm, well, You might suggest autrijus to rename pugs to perl pugs. :-) 17:08
nothingmuch wrestling is soo stupid, even when it'
ods15 who
nothingmuch s stupid by definition
ods15 nothingmuch: that reminds me linus's quote about sco :P
"There are literally several levels of SCO being wrong. And even if we were to live in that alternate universe where SCO would be right, they'd still be wrong." 17:09
theorbtwo nothingmuch, I know a /very/ intelegent wrestling coatch.
autrijus ods15: anointment comes if and when it's time. before that, it might be a good thing if people doesn't mistake pugs as the production version of perl6.
nothingmuch theorbtwo: not real wrestling, sorry
tv wrestling, as enterntainment, not as a sport
theorbtwo Right. 17:10
autrijus lest they have unrealistic expectations.
theorbtwo That WWE junk.
nothingmuch yup
there's this one show, which I'm waiting to be over at the moment
every time they fall I have to wait for the announcers to tell me who i shurt
because it looks so symmetrical
ods15 hey, maybe all you can help... what would be a good name for a library that does all sorts of audio/video.. umm, that's the word i'm looking for... 17:11
it does scaling, cropping, etc. etc.
autrijus videomagick ;) 17:12
nothingmuch ods15: are you wrapping the mplayer filters in a lib?
ods15 has to start with 'libav'.. we thought of libavfilter, but 'lavf' is already taken by libavformat
autrijus libavmagick
ods15 nothingmuch: we're thinking of making a new one from scratch cause mplayer's filter layer sucks so much
xinming It seems that the Great Firewall is doing something really stupid... or the main routers are down currently. 17:13
ods15 lead developer likes 'libavmunge' :P
autrijus libavmunge
ooh.
ods15 ....
autrijus sick minds, etc.
ods15 lol
how the hell did you come up with that word :P 17:14
xinming caibird.3322.org/Screenshot.png
nothingmuch what word?
ods15 munge
btw how's perl6's gui
xinming autrijus: open that pic. and see the time on the left column...
ods15 (if at all?)
nothingmuch ods15: which GUI?
autrijus ods15: parrot has sdl and javascript has dhtml 17:15
ods15 nothingmuch: can i make a gui with it
autrijus so we're doing fine, thank you :)
nothingmuch in theory wxhaskell might be gluable
xinming really a pain to wait for your talks.
autrijus bbiab.
nothingmuch perl 5 has tcl/tk, gtk, qt, wx, win32::gui, cocoa, x11 libs
uh, can't remember what else
ods15 and they all suck :P
actually, not sure if they suck 17:16
nothingmuch yes, cocoa stinks
qt is worthless
gtk2 is shyte
wolverian gtk2 is lovely.
(although the documentation sucks.)
(I mean the perl bindings.)
ods15 hehe
nothingmuch wolverian: shutup, we're listening to ods15
wolverian oh, sorry. ;)
ods15 i use Qt btw
(and KDE..)
wolverian ods15, since you can directly use perl5 modules from perl6, your question is pretty much answered.
ods15 wolverian: i was wondering if there's anything builtin 17:17
nothingmuch ods15: there's nothing builtin for perl 5 either
why should there be anything builtin?
wolverian ods15, no. perl is a language, not a gui toolkit.
(although it can work as one when you install the appropriate modules. that's the brilliance of CPAN!) 17:18
xinming autrijus: I might be wrong, I haven't noticed the time is "hours:minute" :-)
ok, anyone here can answer my question I asked this afternooon? 17:20
Is the keyword multi used for append the sub routine to the spcified "class" dynamicly? 17:21
arcady xinming probably not 17:22
xinming I read the example in examples/vmmethods/, I can understand the example, But I don't know the "internal" for correctly.
arcady since with multi there is not necessarily a "the class"
there might be multiple classes
xinming arcady: So, with multi, you can make the subroutine as "method" to any class, right? 17:24
arcady yes, you can 17:25
Khisanth wolverian: the C documentation for gtk2 isn't much better
arcady but you can also make a method of two classes at the same time
like multi infix:<+>
xinming just like, `class C { }; multi sub haha{ "haha".say }; "a".haha; 3.haha; C.new.haha;` 17:26
amazing feature.
arcady no, not like that
multi haha(C $foo) 17:27
wolverian Khisanth, right. wx has pretty nice docs, I think.
Khisanth wolverian: not by much ...
well it has More :)
wolverian xinming, multi just means that there can be multiple versions of that method or sub, and the dispatcher chooses the right one at runtime based on the parameter types 17:28
xinming wolverian: so, you can declare the multi sub without parameter? 17:30
wolverian xinming, you mean: 'multi foo () { ... }'? yes. then it will only be called when you do foo(), without arguments. 17:31
xinming s/can/can't/
wolverian xinming, yes, you can. as above. :) 17:32
xinming wolverian: Ok, So, multi can do something "cross" the class. just like multi sub ( MyClass $self: ) { };, This function will dynamic append to MyClass as a method. 17:34
wolverian: This is my understanding of keyword of multi after reading the examples. :-)
wolverian: But now, It's more clearly to me.
wolverian: thanks. ;-) 17:35
wolverian xinming, right.
I don't think 'multi' has anything to do with the 'add as method' bit. that's the ':' in the signature.
xinming wolverian xinming, multi just means that there can be multiple versions of that method or sub, and the dispatcher chooses the right one at runtime based on the parameter types 17:36
wolverian: This one gives me the answer. :-) 17:37
wolverian good. :)
some people think that this behaviour should be the default. 17:38
xinming Lvalue subroutines, what does lvalue mean here? "long"?
nothingmuch xinming: left 17:39
from this: (left = right)
an lvalue is something you can assign to
and an rvalue is something you can put in an assignable lvalue 17:40
xinming wolverian: I think multi is just used for some people who is work "harder" whom will handle all the function himself. and signature or the compiler.
wolverian xinming, I didn't quite get what you mean there. 17:41
xinming wolverian: hmm, Just like, in C++, there is "multi sub"-like feature, which is much like float add( float, float); and int add( int, int); In Synopsis, Larry wrote that perl 6 program can be compiled into byte codes. So, the "signature" is need for optimize. 17:44
Khisanth overloaded method names ... 17:46
xinming Khisanth: ...
Sorry for my poor English... :-)
wolverian xinming, right, but it's useful for more things besides that. 17:51
xinming wolverian: In perl 6, it is. 17:55
?eval my $lval; sub get { return $lval }; sub set ( $v ) { $lval = $v }; set 100; my $t = get; $t.say; 17:58
evalbotzy 100 bool::true
xinming hmm, what's the differences between with is rw, and without 'is rw' ?
?eval my $lval; sub get() is rw { return $lval }; sub set ( $v ) is rw { $lval = $v }; set 100; my $t = get; $t.say; 18:00
evalbotzy 100 bool::true
Khisanth a rw sub? 18:03
xinming Khisanth: yeap, don't know their differences, rw is specified that this is a lvalue sub, But In fact, without rw, It is also a lvalue sub. 18:07
Khisanth eval my $lval; sub get() is rw { return $lval }; sub set ( $v ) { $lval = $v }; set 100; set() = 100; 18:09
oops
?eval my $lval; sub get() is rw { return $lval }; sub set ( $v ) { $lval = $v }; set 100; set() = 100;
evalbotzy Error: No compatible subroutine found: "&set"
Khisanth ?eval my $lval; sub get() is rw { return $lval }; sub set ( $v ) is rw { $lval = $v }; set 100; set() = 100;
evalbotzy Error: No compatible subroutine found: "&set"
Khisanth grr
?eval my $lval; sub get() is rw { return $lval }; sub set ( $v ) is rw { $lval = $v }; set() = 100;
evalbotzy Error: No compatible subroutine found: "&set"
xinming ?eval my $lval; sub get() is rw { return $lval }; sub set () is rw { $lval }; set = 300; my $t = get; $t.say; 18:15
evalbotzy 300 bool::true
xinming Khisanth: :-)
?eval my $var = "key_value"; (key => $var) = "value" 18:23
evalbotzy ('key' => \'value')
xinming ?eval my $var = "key_value"; (a => $var, b => $var ) = "value" 18:24
evalbotzy (('a' => \'value'), ('b' => \'value'))
xinming ?eval my $var = "key_value"; ( => $var, => $var ) = "value" 18:30
evalbotzy Error: unexpected ">" expecting term
xinming ?eval my $var = "key_value"; ( => $var ) = "value" 18:32
evalbotzy Error: unexpected ">" expecting term
xinming ?eval my @ary = ( 1, 2, 3 ); my $b ::= @ary[1]; $b = 100; "{@ary}".say; 18:42
evalbotzy 1 2 3 bool::true 18:43
xinming hmm, anyone here would explain this for me? 18:48
autrijus my @ary = ( 1, 2, 3 ); my $b := @ary[1]; $b = 100; @ary 18:54
?eval my @ary = ( 1, 2, 3 ); my $b := @ary[1]; $b = 100; @ary
evalbotzy [1, 100, 3]
autrijus xinming: the ::= happens at compile time
xinming: then the assignment overwrite whatever that was in @ary 18:55
so the previous @ary[1] was gone
that's all
xinming autrijus: that's why I feel confusing to me. 18:56
$b here in fact, It get the "location" of the @ary[1], 18:57
autrijus yes.
xinming hmm, not in fact, in my opinion. :-)
autrijus but that location is no longer associated with @ary after the assignment
fglock_ hi
autrijus when you assign into @ary, you discard all cells associated with it
hi fglock_
xinming: then you replace it with a new set of scalar container: (1,2,3) 18:58
xinming autrijus: Oh, Ok, thanks. hmm, It seems that compile time binding is useless. :-S
autrijus not really.
watch:
fglock_ a friend of mine is going to china in ten days - how is the weather (Shanghai)
xinming except for some "constant" values.
autrijus ?eval my @ary; @ary[1] = 10; my $b ::= @ary[1]; $b = 100; @ary
evalbotzy [undef, 100]
xinming fglock_: Sorry, I am living in a place a bit far from ShangHai. :-S 19:00
autrijus same here
you'd be better checking the various weather service sites
sorry :-/
xinming fglock_: I will check it for you. for me I might be better to understand Chinese than you do. 19:01
8꜈ 21ę—„ 8꜈ 22ę—„ 8꜈ 23ę—„ 19:02
jabbot xinming: 8꜈ 21ę—„ 8꜈ 22ę—„ 8꜈ 23ę—„ę˜ÆꘟꜟäŗŒ
xinming 22Ā°C 24Ā°C 23Ā°C 19:03
This is the lowest temperature.
28Ā°C 28Ā°C 28Ā°C
highest
fglock_ xinming - thanks
nothingmuch wants to see china... It looks so pretty in pictures. Mongolia too
i had a friend whose brother went there, and ever since I saw his photographs I've had it in the back of my mind 19:04
xinming weather.yahoo.com/forecast/chxx0116.html 19:05
fglock_: weather.yahoo.com/forecast/chxx0116.html
fglock_: The weather report I ever pasted is from a Chinese "site" serves doing the weather report. 19:06
fglock_: I don't know which is more correct. ;-) 19:07
wolverian heh, why is feather's MOTD in hebrew or something like that? :)
xinming autrijus: could you please give me an example for using compile time binding? It seems that compile time binding is useless except doing a constant variable binding.
integral wolverian: it's upside down :) 19:08
nothingmuch wolverian: that's not unicode
or hebrew
wolverian oh, haha.
where does it come from?
autrijus xinming: sure. 19:12
xinming: this:
sub f ($x) { $x + 1 }
is a compile time binding :)
our &f ::= sub ($x) { $x + 1 }
is what it is
to the compiler 19:13
wolverian oh, ::= is not aliasing at all?
autrijus wolverian: it's compile time :=
it's roughly equivalent to BEGIN { := }
wolverian right - but I don't understand why the $b ::= @a[1]; $b = 100; doesn't carry over to @a when with := it does 19:14
autrijus wolverian: BEGIN happens before the my() assignment.
my @a = (1,2,3); -- desugared to
wolverian ohh.
autrijus my @a; @a = (1,2,3);
wolverian: you can witness the same situation with perl5.
try it sometimes :)
wolverian right, but perl5 doesn't have ::= :) 19:15
autrijus it does have use :)
my $a = 1; use constant A => $a;
this, for example, won't work.
fglock_ if I have a multisub with Int argument, can I call 10.mysub() ?
autrijus fglock_: yes, that's what multisub is.
wolverian autrijus, good point.
autrijus, does that have to be a multi? 19:16
autrijus wolverian: no, any sub would do, last I heard.
wolverian ?eval sub square (Int $x:) { $x**2 } $x.square
evalbotzy Error: Undeclared variable: "$x"
wolverian er, duh.
?eval sub square (Int $x:) { $x**2 } 3.square
evalbotzy 9
wolverian right. then I understand 'multi' correctly and didn't lie to xinming. hooray. 19:17
xinming autrijus: then... ::= this is the beauty for the compiler. :-) 19:18
wolverian: :-)
autrijus xinming: think about it this way; using ::= the code will only be run once 19:19
during compilation
xinming Now, I think I understand what pugs really do in rough... :-)
autrijus using := means the code will need to be run every time on the vm
sometimes there's a large difference.
esp. when you are in a inner loop
xinming ?eval sub x2 ( Str $x: ) { $x**2 }; sub x2 ( Int $x: ) { $x**2 }; "3".x2; 3.x2; 19:23
evalbotzy 9
xinming ?eval sub x2 ( Str $x: ) { $x**2 }; sub x2 ( Int $x: ) { $x**2 }; "3".x2;
evalbotzy 9
xinming ?eval sub x2 ( Str $x: ) { $x**2 }; sub x2 ( Int $x: ) { $x**2 }; 3.x2;
evalbotzy 9
xinming hmm... I still wonder... What will multi do... :-S 19:24
autrijus easy
ods15 whats that ':'
xinming this example, multi isn't needed...
Khisanth ?eval sub x2 ( Str $x: ) { $x**2 }; sub x2 ( Int $x: ) { $x**2 }; "foo".x2;
evalbotzy 0
xinming ods15: just like, in perl 5, you have to write. sub { my $obj = shift; ... };
ods15 ? 19:25
xinming ods15: in perl 6, you just need to write sub ( $obj: ) { ... }
Khisanth of course raising a string to a power doesn't make sense
ods15 whats tha got to do with the ':' then
ah
?eval sub square (Int $x:) { $x**2 } "3".square
evalbotzy 9
ods15 ?eval sub square (Int $x:) { $x**2 } "3".square()
autrijus actually you can drop the : here, as that's implicit
evalbotzy 9
ods15 autrijus: only needed if you have multiple params? 19:26
autrijus ?eval sub x2 (Int $x) { 'int called' }; sub x2 (Str $x) { 'str called' }; 3.x2
evalbotzy 'int called'
autrijus ?eval sub x2 (Str $x) { 'str called' }; sub x2 (Int $x) { 'int called' }; 3.x2
evalbotzy 'int called'
xinming ?eval sub x2 (Int $x) { 'int called' }; sub x2 (Str $x) { 'str called' }; "3".x2
evalbotzy 'str called'
ods15 ?eval sub x2 (Str $x) { 'str called' }; sub x2 (Int $x) { 'int called' }; "3".x2
evalbotzy 'str called'
ods15 bleh beat me to it
autrijus mm, pugs is being too smart.
ods15 best match? 19:27
kinda like overloading..
autrijus yeah. that shouldn't happen.
it's a bug ;)
ods15 damn
autrijus if you had written
multi x2 ...
instead of
sub x2 ...
coral ?eval sub x2 (Int $x) { 'int called' }; sub x2 (Str $x) { 'str called' }; "3".x2
evalbotzy 'str called'
autrijus then that behaviour is exactly what should happen
nothingmuch *cough*
autrijus but not 'sub' -- sub is supposed to be single.
nothingmuch: ;) 19:28
xinming autrijus: so, what does multi really do, It seems that "sub" handles all...
autrijus: ... :-)
ods15 ambiguous
autrijus xinming: the fact that 'sub' handles all is a pugs bug ;)
nothingmuch ods15: did you find the 'sub'/'multi sub' distinction confusing?
autrijus and a new one at that.
ods15 nothingmuch: dunno, i haven't even seen it yet
coral ?eval multi x2 (Int $x) { ... }, (Str $x) { ... };
evalbotzy Error: unexpected "," expecting ";", statements or end of input
coral just curious
ods15 ok night 19:29
xinming ods15: learning perl 6 is a kind of fun... ;-)
ods15: night.
autrijus: hmm, I will write these test in the "near" future. at least, I have to understand perl 6 "well". :-)
coral if i follow what just went by multi allows what sub is demonstrating that it supports right now -- argument-based multple path support
nothingmuch coral: multi xs ((Int (+) Str) $x) { }
coral that combines the two into a single { }? 19:30
multi seems like a switch statement only with sub instead of case
neat to see that it works! pugs++ 19:31
nothingmuch coral: no, that's just saying the type that is Int and Str
fglock_ autrijus: what kind of object a "Type" is? is it a function that takes an object and returns true or false?
xinming coral: in my humble opinion, I agree with you...
nothingmuch coral: i hope not
MMD dispatch order is, IMHO, orthogonal to definition order 19:32
that way you have an aspect of usefulness - you can amend to other people's code
you just define the special cases very carefulyy
coral i hadn't considered the ordering implied by switch
nothingmuch and you can work around, optimize, extend, fix and otherwise resolve bad code
but the way it looks i am going to be wrong
coral just noting that it's a very clean syntax for defining lots of "this argument" means "this code block"
nothingmuch and i'm sad
boohoo
coral the order is decided by the arguments, afaict 19:33
autrijus fglock_: it provides that method.
nothingmuch coral: you know haskell, right?
coral nope. i'll stop then.
wolverian hmm, can we make multi a listop like ods15 showed? :)
nothingmuch coral: you should
ods15 ?
leave alone, lemme go sleep
ods15 crashes into keyboard
dkj fzg
xinming hmm, after autrijus said the "smart bug" of pugs. I wonder, how will larry think of this...
I mean, If multi is really needed... 19:34
nothingmuch ods15: it's called /quit, and people type it when they really mean "i went to bed"
if they don't, then they're lying
and it's OK to keep them around
wolverian (or /away)
nothingmuch uh, oops
/away is when you're faking it, and you really stick around a few minutes longer, closing windows 19:35
wolverian I don't close my IRC client.
even when I sleep. 19:36
xinming nothingmuch: well, some people don't want his(her) computer go sleep... so will keep all night long. :-)
nothingmuch wolverian: that means you're always there
unless you coincidentially went a away
but we can never trust you fully
it's like autrijus
autrijus xinming: ok, I fixed the multi/sub bug
wolverian hehe. :) 19:37
autrijus tests very much welcome :)
nothingmuch 03:05 - <autrijus> Journal up, bed &
05:42 - <autrijus> r8715
autrijus xinming: certain people want all 'sub' to be 'multi'
xinming: a prominient certain people made that case very well, but currently @Larry and me are still not convinced
nothingmuch 05:42 - <autrijus> PIL compiles to JVM now
autrijus (that certain people is nothingmuch here) 19:38
wolverian autrijus, why are you not convinced?
(I haven't read contrary opinions, or don't remember them. a URL is fine too)
(or title to a p6l thread :)
nothingmuch wolverian: every time i brought it up it was eitehr warnocked or taken in another direction 19:39
but "MML Dispatch" [sic] (yes, with the typo)
that'
s a good read
wolverian right. thanks.
nothingmuch and docs/notes/blh has some stuff
xinming autrijus: hmm, I also wonders why, :-)
autrijus wolverian: oh, mostly because I rarely redefine subs purposefully, but mostly accidentally
wolverian autrijus, ah, okay.
autrijus and I'd like compiler to catch that by default.
nothingmuch and modules/Class-Events has code which I think should be the way MMD should look like
wolverian does 'multi' in a class mean 'multi method' or 'multi sub'? 19:40
(is there a difference?
)
autrijus there is a difference, multisub doesn't get inherited
and I think the answer is multisub currently
it makes sense
since multi are designed to exist transparent to class boundaries
so copy/pasting them around should ignore the class context around them
wolverian good point. 19:41
nothingmuch or alternatively - since all methods are just multisubs too, whose implicit first MMD argument is an object whose type is the current class... yadda yadda yadda
nothingmuch tries to enumerate all the kinds of subs in his head 19:42
and the ways they are dispatched
nothingmuch feels slightly nautious
naucious ?
autrijus nauseous
autrijus applies an unicorn horn on nothingmuch
nothingmuch what does a unicorn horn do? 19:43
and isn't application of sharp things to heads a fatal error?
wolverian nauseated.
nothingmuch neo-seating 19:44
autrijus nothingmuch: it's from the game that you dare not start playing :)
wolverian (nauseous would mean you make others around you ill.)
nothingmuch www.cenqua.com/pairon/
ah
fglock_ is there a public interface to Types - like 1.isa('Int') but for types? $list.isa('Lazy') ?
nothingmuch fglock_: every class is a type 19:45
so, uh, yes
wolverian fglock_, and you don't need to quote defined types
autrijus fglock_: also the string form is not specced to be supported
1.isa(Int) is the only specced form
nothingmuch is afraid of being shot by TSa
wolverian autrijus, does 1.isa('foo') check 1.isa(Str)?
autrijus wolverian: no, it's either an error or it does a runtime lookup on ::foo. 19:46
pugs implements the latter; it's apocryphal.
xinming autrijus: the default multi key word is equal to "multi sub" right? 19:47
nothingmuch xinming: yes
xinming nothingmuch: so multi method override the default "multi" behavior... (In my humble ... )
nothingmuch uh, i have no clue, what the semantics of those are 19:48
there are just too many clashing metaphors, IMHO
sub foo { }; # in the current package
multi sub foo { }; # regardless of package, based on argument types only
multi method foo { }; # in the current class, allows functional programming like pattern matching on types, values, etc 19:49
submethod {}; # an uninherited method, should be a trait or attribute of methods, IMHO
wolverian autrijus, does Larry want it to be ::('foo')?
nothingmuch multi submethod {}; # is it a multi method that is uninheritable?
fglock_ but Lazy is a subtype - not a Class - so it's not seen by 'isa' (or is it?) 19:50
nothingmuch did I forget anything?
fglock_: Lazy is either a class or a role... i suspect it's a role
fglock_ roles aren't seen by isa 19:51
nothingmuch how is multi sub found, btw?
autrijus wolverian: no.
fglock_ but 'does' is
nothingmuch really accross anything?
who beats who? package Moose { multi sub foo ... }; package Dog { sub foo ...; foo($thing) };
what's the point of multi subs when you have mutlimethods? or rather, what's the difference? 19:52
except the calling style?
fglock_ in this case Lazy would be a trait - but i think i've read it was a subtype
autrijus nothingmuch: er wow, one thing at a time
nothingmuch: in your example $thing won't ever see the moose foo
it's not even in scope!
nothingmuch autrijus: so i must import all multi subs I care about?
in that sense, why aren't they just subs with pattern matching? 19:53
why aren't the multimethods in the classes of the values involved?
(which is something completely different)
autrijus nothingmuch: multi subs are just subs with pattern matching.
it's specced like that.
nothingmuch so non multi subs are multi subs with the restriction of a unique short name?
or can they not contain any pattern matching at all 19:54
?
autrijus nonmulti subs can only be defined at one place.
that's that.
sure they can pattern match
but if it fails it fails.
doesn't retry.
hence, much better compile time errors.
nothingmuch so in a sense it's the same thing
just that the compiler approaches definitions in a different way 19:55
autrijus yes.
nothingmuch have i said the "why isn't it a pragma" line today?
autrijus also runtime override of multi is easier.
s/override/augmentation/
no, you havn't, but you can say that, and I'll answer that you can make s/sub/multi/ a pragma as you well please. 19:56
nothingmuch no
module Moose; sub foo {} ;
that is uploaded to cpan
module Dog; use Moose qw/foo/;
use multi qw/i_know_what_i'm_doing/;
sub foo () { };
autrijus surely it can do a runtime rebind. 19:57
or even compile time ones at that.
nothingmuch but what is the difference?
i still fail to understand why there is any technical distinction
it's a pedantic one at best
autrijus it is. 19:58
which is good.
think back to "use overload".
xinming ...
nothingmuch what about it? 19:59
xinming never saw any good point except to remember new keyword
autrijus xinming: oh ok. you know the concept of overload? 20:00
nothingmuch: multi is designed to replace overload
xinming autrijus: hmm, I think I know...
nothingmuch autrijus: and just that?
30% of a feature to replace a hack?
autrijus nothingmuch: also replace the visitor pattern.
xinming float add( float, float ); int add( int, int )...
autrijus xinming: right, exactly
xinming: in perl5, you can use "use overload" to overload some operators 20:01
but only those
and you can't extend the list
nothingmuch autrijus: explain that please
autrijus multi is designed so you can overload any operator or function that is marked to be overloadable.
and to mark a function to be overloadable, you define it with "multi" first.
end of explanation :)
nothingmuch no, the visitor pattern thing
fglock_ thinks a subtype can be created using a role that overrides .isa - but it looks like a hack 20:02
nothingmuch autrijus: but saying 'multi sub' just adds a flag to the definition of said sub
right?
and that flag is just a hint to the compiler saying "don't reject more definitions" 20:03
xinming well, Maybe larry found that in perl 5, many aspects are too simple... so that try to make a more complex one... :-)
nothingmuch and the compiler can then infer from the lack of this flag that the user is errorneously redefining something (which is an error i got once or twice in my life =()
svnbot6 r6378 | autrijus++ | * xinming pointed out that "sub foo" was silently treated
r6378 | autrijus++ | as "multi foo" -- i.e. later "sub" did not override the
r6378 | autrijus++ | earlier scope's "multi" or "sub". Fixed.
autrijus nothingmuch: you know what visitor pattern is? 20:04
nothingmuch autrijus: nope
autrijus ok.
www.ccs.neu.edu/research/demeter/pa...node9.html
nothingmuch do you remember these links by heart?
autrijus no I googled it
nothingmuch: the visitor pattern is designed to solve the OO problem where foolish people wrote
if ($o->isa("Foo") { 20:05
er
sub visit_tree_sum (Tree $o) { given $o { when Leaf { .val } when Branch { visit_tree_sum(.left) + visit_tree_sum(.right } } } 20:06
very ugly
nothingmuch aha
the visitor takes &infix:<+> and applies it?
autrijus exactly. 20:07
nothingmuch how does MMD get rid of that?
by pattern matching Leaf and Branch?
autrijus multi sum (Branch $_) { sum(.left) + sum(.right) }
multi sub (Leaf $_) { .val }
nothingmuch yes, I see
autrijus s/sub/sum/ 20:08
nothingmuch okay, but that's not really replacing visitors, that's a different approach
the way it's compiled is sort of like the visitor approach
but it's more scalable
since it's defined outwardly, and not inwardly
this is inheritable
autrijus now think when you want to visit two objects.
nothingmuch uh, s/inheritable/extendable/;
autrijus mmd becomes clearly superior.
nothingmuch right 20:09
autrijus and perl5's overload.pm totally fails.
since it's biased inherently to the left.
nothingmuch and why do we want this not to be the default again? 20:10
xinming autrijus: multi sub () { ... }; will this just define a anonymous multi sub?
autrijus xinming: I'm not sure you can have an anonymous multi
I don't quite know what it means even
theorbtwo Because it means you can't give messages about illegal use of subs at compile-time, because somebody might make it legal between then and when it's run.
autrijus not only 'might', it's more like you expect people to. 20:11
so you can warn, but not die fatally
fglock_ $x = multi sub () {...} | multi sub () {...}
:)
nothingmuch autrijus: multi foo (...) { }; multi foo (...) {}; my $anon = \&foo;
autrijus nothingmuch: er sure
nothingmuch: it's not anonymous though.
it's a reference to a named thing.
nothingmuch if the symbols go out of the scope it's anonymized, right? 20:12
ooh
autrijus sure but it's beside the point :)
nothingmuch my &foo = multi sub (...) { }
my &foo = multi sub (...) {};
wtf happenned therE?
autrijus syntax error.
nothingmuch how do you do it then? 20:13
autrijus like I said, I'm not sure multi can be used to anonymous sub syntax.
nothingmuch my multi sub foo (...) { }?
autrijus that works.
nothingmuch so how do you generate mutli subs
and assign them to globs?
you *need* to do that
autrijus why, easily
the first multi clause creates a MultiSub object 20:14
the next ones call its add_variant method or something.
nothingmuch ah
su my &foo = sub ( ) { };
&foo.is_multi = 1;
&foo.add_variant(sub () { });
?
autrijus er you need a promotion
or a rebless
nothingmuch phooey that, they are the same =)D 20:15
autrijus since it's different class underneath
but generally yes ;)
nothingmuch okay, so i win
you only think you win
fglock_ (maybe a trait?)
nothingmuch fglock_: i'd argue yes
there's no real functional diff
they both do parameter pattern matching
xinming just watching your conversation, I learnt a lot. :-) 20:16
nothingmuch xinming: me too =)
autrijus anyway, yes you can do all that at runtime
nothingmuch really wants to do it to broken code at compile time
autrijus but then the compiler won't catch your errors :) 20:17
timtowtdi.
nothingmuch what errors?
autrijus accidental redefinition; static typechecks; inlining
nothingmuch the latter two - please explain
the first one i don't care about 20:18
it has never happenned to me in perl 5 land
unless i really ment it
meant
then you just say 'no warnings'
fglock_ static typechecks means the compiler already knows which sub to call
nothingmuch fglock_: i know
i don't know what compile time appending of multi flag has to do with it 20:19
it should simply change the compiler's mind regarding what's going on
and static binding is a link time optimization anyway
fglock_ the problem would be runtime binding, I think - that can be slow 20:20
nothingmuch runtime binding is slow
autrijus ok. when you import two subs from diff. pkg the the same user space
with the same name
if both are sub, the compiler can stop you right there
nothingmuch autrijus: that's not the same as 'use Moose qw/foo/; multi foo () { }'
that indeed looks like an error 20:21
unless you resolve the conflict by saying 'multiize these two in this lexical scope'
autrijus I'm not sure of that. hm 20:22
nothingmuch or you say 'both are multi of the same sub' 20:23
autrijus oh also. you said both does pattern match
nothingmuch that's the choices i'd like to have
either: conflict
autrijus that is partially true
nothingmuch multi just for here
multi everywhere
which will require recompilation of other code
autrijus multis need to sort
their dispatcher need to do multistep narrowing
with layers of invocants
nonmultis doesn't have the layers 20:24
nothingmuch and again, IMHO it's only sane if dispatch order is orthogonal to definition order
the fact that they don't have them is an optimization, is it not?
autrijus it's just one layer, always flattened, and just checked for false/true, not constraints
er, as opposed to what?
nothingmuch well, as I see it SMD is functionally a subset of MMD
autrijus I understand your position very well :) 20:25
nothingmuch by simply not making use of the multiness of MMD you get the same behavior
hence there is no distinction
you can also tell the compiler that 'if i added more multis, that was a mistake'
and it can compile more efficiently or make up better errors with that knowlege'
autrijus well you just outlined the distinction yourself. 20:26
nothingmuch that's not a distinction, that as optimization and a compiler hint =)
autrijus it's all lambda calculus -- I mean turing machine underneath
_everything_ is either a compiler flag or a runtime hack. 20:27
nothingmuch no
there's a conceptual difference
let me demonstrate:
multi sub foo (); # no other definitions
use optimize :closed(Everything);
is 'multi' a no-op in this specific case?
i argue that it is 20:28
autrijus I argue not.
nothingmuch then please enlighten me
autrijus unless of course you put them both in the single toplevel program.
then sure.
if you however put the two lines in two files.
nothingmuch okay
autrijus separate compilation kicks in
nothingmuch then again we agree
it's a matter of *when* resolving happens
but it's still the same resolution
for both single and multi
autrijus er no.
if you write 20:29
multi sub foo () {}
in a file
and let compiler generate code for it
it needs to be different from
sub foo () {}
for obvious reasons.
nothingmuch but the compiled 'sub foo {}' can be transformed at link time WRT to it's consumer
into something that is exactly the same as 'multi sub foo () {}', right/
autrijus really. how? 20:30
whole-program analysis?
solving the eval halting problem?
nothingmuch by saying 'use Moose :asMulti<foo>' or something like that
no
autrijus drop all special case hints please ;)
nothingmuch these are more than special case hints
autrijus you can of course emulate any behaviour with anything else.
but in absense of hints, they are different things and generates different object code. 20:31
nothingmuch i really don't see *why*, not *that* subs are not just a subset of multis
post object code too
why it isn't that their user can determine what they are
and they simply provide a default
autrijus you can force sub to become multisub by a slow non-compiler-protected rebinding. 20:32
nothingmuch that's not what I want
because I see no reason that the compiler can't be told to rebind
in a fast compiler protected way
and in a lexically scoped or global way
autrijus you mean the linker 20:33
nothingmuch they are the same to me
since the compiler compiles based on what the linker linked
after the compiler compiled the code that caused the link
autrijus alright. technically I think you are right; it is feasible. practically though, I have not seen anyone do that.
nothingmuch i would see me do it 20:34
autrijus probably because smd-turned-mmd is not considered a popular use case.
nothingmuch i'd see me fix Class::DBI::AsForm that way
i'd implement Class::Events that way
autrijus so, because of this practical (in)consideration, there is a conceptual difference.
but yes, if you take that away, then transmeta CPU is as good as intel CPU, or something like that.
nothingmuch beh 20:35
autrijus (no, seriously; it's similar)
nothingmuch i still don't understand this:
a feature intended to protect newbies limits the technical capabilities of the language
in a language that isn't java
xinming nothingmuch: me either... :-)
autrijus er look 20:36
04:32 < autrijus> you can force sub to become multisub by a slow non-compiler-protected rebinding.
04:32 < nothingmuch> that's not what I want
I'd argue no technical capabilities per se is being violated :)
nothingmuch i argue the compiler should be implemented that way
and then on top of that the newbie guard can be added
autrijus and it will be even efficient, if you do help implementing the compiler that way.
but in either case the capability is there. 20:37
xinming But, IMHO, multi is a thing a bit like syntax highlighting... It is not needed to a computer... But really useful to a human... :-)
nothingmuch xinming: it's necessary to fix broken 3rd party code which you get as encapsulated byte code
autrijus xinming: yes... but consider if you said
sub close ($x) { say "I'm closed! $x" }
and discovered that you can't call close($IN) 20:38
because it's an IO and there is a (sub close (IO $x) {...}) by default
that will likely become inconvenient very quickly.
so @Larry ruled that you can override a multi with a same-named sub
nothingmuch autrijus: but you didn't import IO qw/close/;
autrijus and the default builtin functions are all multis 20:39
nothingmuch so it's always $IN.close;D
autrijus and you can safely override any of them with your subs.
nothingmuch close: $in;
or if it is imported, you get a compilation error that you can turn off
or you can say 'my sub close ($x) { say "I'm closed! $x" };
and close($IN) will go that anyway
since lexical wins
autrijus nothingmuch: right, but that violates principle of least surprise 20:40
nothingmuch 23:39 < nothingmuch> or if it is imported, you get a compilation error that you can turn off <-- not surprising
btw, what is 'close'? 20:41
autrijus by turning it off, you mean the compiler do the mutilate thing
nothingmuch class IO { method close () { } } ?
autrijus nothingmuch: er it's a multisub defined in IO and Socket?
global multisub at that
nothingmuch so you have to import it, right?
or it's in Prelude?
imported for you?
autrijus it's prelude.
yeah
nothingmuch wtf?
global multisub? as opposed to?
autrijus package-scoped 20:42
it's &*close
nothingmuch uh, i'm confused again
but now it's cleared
r
autrijus cool. and as much as I'd like to chat, I've been neglecting $work, and it's 4:43am
so I'm afraid I need to go off irc :) 20:43
nothingmuch how do you say $IO.close?
is there also a method close?
ciao
class IO { method close () { close $?SELF } }; # stupid
autrijus surely $IO.close dispatches to &*close.variants(IO) 20:44
it doesn't need a method there.
nothingmuch class IO { method close () }; package Prelude; multi sub *close (IO $obj) { $obj.close }; multi sub *close (Socket $obj) { $obj.close }
why? it's a sub, not a method
why is that distinction going away?
autrijus multisubs in scope gets the dispatch when no method is found.
xinming autrijus: hmm, If this consumes you so much time, I'd really suggest you to finish "pugs" first. As These "feature" can be discussed in the future. :-)
nothingmuch ick! 20:45
autrijus nothingmuch: that's what the visitor pattern is for!
nothingmuch i'd much rather have methods being treated as global multisubs when they're unambiguously resolved at compile time
autrijus I sympathize. 20:46
but perl6 is not that sort of language
please send S06 diffs to p6l :)
nothingmuch phooeey
this is such a huge mess
autrijus (as in, I'd really like to do static method binding)
nothingmuch i want to try that absynthe thing the examiner chick is into
autrijus xinming: right, I'll try that ;) 20:47
but before that I need to go back to $work before I fall unconscious.
autrijus waves &
nothingmuch ciao
wtf is eigen btw? 20:48
btw, are rules normal methods that are just compiled to a different target language (usually PGE?) 20:52
xinming ?eval sub x2 (Str $x) { 'str called'.say }; sub x2 (Int $x) { 'int called'.say }; 3.x2
evalbotzy int called bool::true
xinming hmm, it seems that the bug still exist. 20:53
nothingmuch ?eval sub x2 (Str $x) { 'str called' }; sub x2 (Int $x) { 'int called' }; 3.x2
evalbotzy 'int called'
nothingmuch ?eval sub x2 (Str $x) { 'str called' }; sub x2 (Int $x) { 'int called' }; "3".x2
evalbotzy 'int called'
nothingmuch ?eval say "moose"
evalbotzy moose bool::true
xinming ?eval say "evalbotzy is stupid." 20:54
evalbotzy evalbotzy is stupid. bool::true
xinming :-)
nothingmuch ?eval say "is evalbotzy stupid?"
evalbotzy is evalbotzy stupid? bool::true
nothingmuch that's more like it =)
you know what's also nice?
?eval "xinming++ " x 3 20:55
evalbotzy 'xinming++ xinming++ xinming++ '
nothingmuch jabbot: karma xinming
jabbot nothingmuch: xinming has neutral karma
nothingmuch uh, yeah, sure
xinming jabbot: karma evalbotzy
jabbot xinming: evalbotzy has neutral karma 20:56
nothingmuch macro Ī» "->" 20:58
xinming I'd think if perl 6 "rule" syntax could be written as a normal "sub" which will use print or say such kind of things to a string to compose a "rule"
nothingmuch xinming: i'd think of it like parsec treats it's monadic actions 20:59
xinming hmm, Maybe just the humble opinion of mine. :-)
nothingmuch sub moose is rule (@input_tokens is delayed) { ... }
sub <a-z> is rule (@input_tokens is delayed){ atomic { die unless shift @input_tokens eq any("a" .. "z") } } 21:00
or somesuch 21:01
xinming I skiped the grammar and rule section while I reading the synopsis. :-) everytime.
lamer0 will perl 6's threads be cpu scalable?
xinming lamer0: I think This should be a function of parrot. 21:02
nothingmuch lamer0: define that
and generally "if it's a good thing, we hope so"
lamer0 such as, you create two threads, they get split evenly between two cpus 21:03
or between two cores, or evenly on a hyperthreaded cpu
nothingmuch lamer0: that's for the OS to decide, and for parrot to make portable
lamer0 right now for example python, it uses internal threads, it does not get split evenly and just ends up bouncing back and forth
nothingmuch ouch, that sucks
lamer0 well, I wrote this quick floating point benchmark program in C and python, with C posix threads the two threads get split evenly between two cpus.. python on the other hand just bounces around 21:04
xinming nothingmuch: $a + $b, <+> here is infix, <!-- comments here --> <\<!-- --\>> is circumfix, so what are the prefix and postfix?
nothingmuch lamer0: are you sure that it isn't just how python is compiled for your platform?
xinming: prefix is like multi sub &prefix:<~> ($thing --> Str) { } 21:05
postfix is like sub &postfix:<++>, as in '$a++'
unary postfix and unary prefix that is
the first is ~ as in ~50 yields "50"
xinming nothingmuch: so, the postfix is at the ass part... the infix in at the front, right? 21:06
nothingmuch yes
pre is before, post is after
post mortum - the thing after death
pre-calculated - calculated in advance 21:07
latin
but borrowed into english
xinming nothingmuch: hmm, and prefix will takes 2 arguments always, others only one, right? 21:08
nothingmuch prefix takes one argument
listfix takes N arguments
lamer0 how far a long is parrot anyway?
xinming oops,
s/prefix/infix/
nothingmuch and a unicode named sub like 'sub x ($obj, $obj)' takes two
yes, infix takes two, and is between them
lamer0: uh, it depends 21:09
lamer0 is it useable at all? for personal use?
nothingmuch i would say 30% of completeness, 80% of functionality
yes it is, but it's not stable enough (the API)
Dan uses it at work
xinming nothingmuch: 30% of completeness, 80% of functionality is also the progress of perl 6. :-) 21:10
nothingmuch xinming: i'd say 15% completeness, no more 21:11
xinming: there's still lots of stuff to do WRT to compilation semantics
which we are only exploring in our heads right now
xinming what does WRT mean please?
Ok, I know, WRT = write. 21:12
nothingmuch "With Respect To"
sorry =)
xinming nothingmuch: hmm, I really don't understand... I've read the synopsis, and found, It seems cover most of the normal syntax of perl 6. 21:14
nothingmuch xinming: yes, that part is pretty far along
but the actual semantics are very complicated
xinming nothingmuch: maybe I am too eye-narrow...
nothingmuch in that there are many details
this isn't specced but:
compilation of code is chunked into units
each unit pretends it's compiled in another process 21:15
they have no knowlege of each other
a piece of code that consumes other code gets access to the compiled version
and it's compiled structure is linked against that
this process covers a hell of a lot of decisions that need to be made 21:16
which no one has really thought about yet
uh, correction
which no one has really thought about until the hackathon
at least to my knowlege
xinming nothingmuch: hm, do you mean, the specification is almost "finished", But the problem is the parser or "compiler". It's far more complex than we can think?
nothingmuch no 21:17
the specificationc overs just one side of the language:
definition
it is very lacking in another, IMHO broader side: behavior
xinming ...
hmm, You mean, It doesn't covers all the situation that other programmers might hold. or try. 21:18
?eval "sorry for my poor English... nothingmuch.".say
evalbotzy sorry for my poor English... nothingmuch. bool::true
nothingmuch xinming: english is not a prerequisite =)
xinming: not only that... the synopses are indeed ambiguous in some places 21:19
but more than that - the way the perl 6 system
that is:
the compiler
the runtime
the language
the libraries
how they behave
how they integrate
those aspects are not tightly woven enough
they are easy to gues
s
but not yet completely designed 21:20
and some parts are completely unimplemented
xinming nothingmuch: Hmm, Now I know, I think I can understand. 21:21
hmm, what part the pugs plays? 21:22
runtime?
nothingmuch xinming: currently it's about 15% of a compiler 21:23
and a runtime
and libraries
the libraries are written in perl 6 and haskell
soon it should be 25% of compiler
xinming nothingmuch: Ok, If we just need a parser like perl 5 does, no need compile it into binary or such, just need to learn the "language" itself...
nothingmuch perl5 is more than a parser: 21:24
it's a parser
with a weighted tokenizer
that compiles to in memory op tree
and a peephole optimizer which fixes that op tree into something more efficient
and a VM which walks the op tree and executes it
xinming hmm, In fact, What I want, is just wishing pugs finished all the perl 6 language definition, and libraries will be out soon... IMHO It won't be long as @Larry wrote the language spcification. ;-) 21:27
Khisanth but the language specification is not yet written :)
nothingmuch xinming: but the language isn't 100% finished
look at the argument we just had today:
we still don't know exactly how MMD works
xinming Khisanth: hmm, well, I believe that Synopsis is reaching the truth... 21:28
nothingmuch xinming: i'd say no more than 50% there
though it seems more
xinming ...
autrijus 99% of statistics is useless anyway. 21:29
xinming I'd say @Larry is mutable...
autrijus the remaining 1% is rounding error
nothingmuch @Larry has a mute button?
xinming autrijus 99% of statistics is useless anyway. what does this mean please? 21:30
autrijus xinming: it means that the 50%, 20% etc figure is not useful without a measurement
and really it's very hard to quantify things. 21:31
for example, I can say we have six milestones and we only reached one. 21:32
does that makes pugs 13% there?
surely not; it's arbitary, and the other milestones have been progressing simultaneously
xinming autrijus: Nope... the bigger one and the smaller one. 21:33
autrijus so the numbers are more like confidence ratings
autrijus goes back to $work :)
xinming autrijus: good job. ;-)
autrijus thank-you :) 21:34
&
nothingmuch dev.perl.org/perl6/status.html <-- eep. 2001?
obra nothingmuch: patches welcome. to [email@hidden.address] 21:35
nothingmuch obra: no thanks
svnbot6 r6379 | autrijus++ | * PIL1's poem: "Tin?\195?\186viel, Tin?\195?\186viel!" 21:54
xinming autrijus: the "sub/multi" bug still not fixed. 21:55
?eval sub x2 (Str $x) { 'str called'.say }; sub x2 (Int $x) { 'int called'.say }; 3.x2
evalbotzy int called bool::true
Khisanth that looks correct ... 21:56
xinming Khisanth: No, In fact, this example should raise a error. 21:57
xinming is not so sure about this. 21:58
autrijus ?eval sub x2 (Int $x) { 'int called' } sub x2 (Str $x) { 'str called' } 3.x2
evalbotzy 'str called'
autrijus *shrug* I think it's fixed.
xinming :-)
autrijus it should have raised an error, yes, but we don't have a compiler yet, so it can't easily do that :)
meanwhile, having the latter x2 override the earlier x2 is implemented. 21:59
compare:
?eval multi x2 (Int $x) { 'int called' } multi x2 (Str $x) { 'str called' } 3.x2
evalbotzy 'int called'
autrijus see the difference?
Khisanth ah you mean it's acting as a multi sub even when not declared as one?
autrijus Khisanth: it was. not anymore
hey iblech! 22:00
xinming autrijus: hmm, I see the difference.
hi iblech
iblech Hi :) 22:01
nothingmuch: re serializing code -- can I find your answer in the backlog? 22:02
nothingmuch iblech: yes. 3 minutes or so after you left
autrijus iblech: does pil2js solve sudoku?
iblech nothingmuch: Thanks, /me looks
autrijus (examples/continuation/nondet_sudoku.p6) 22:03
iblech tets
iblech tests
autrijus pdcawley: cross yer fingers :)
iblech Compile error -- invalid Pugs.PIL1.PIL_Expr
autrijus take away the do block 22:04
I actually 22:05
just removed the 'do'
on line 55
xinming hmm, In my understanding of perl 6, It seems that perl 6 is doing something which describe the language it self. Just spcifying the rule sets of the language... So, You might even write a "perl 6" language which can parse "basic" source, am I right?
autrijus and it compiles. committing 22:06
iblech autrijus: &choose accesses &give_up -- but this doesn't work as &choose is in pilGlob, far away from pilMain
Converting to subrefs now
theorbtwo xinming: There's syntax, and there's semantics.
autrijus ah, the old lifting problem
yeah
theorbtwo Changing the syntax of perl6 is /very/ easy. 22:07
The hard(er) bit is where there is semantic differences between the languages.
autrijus and you can always solve them by emulation
xinming theorbtwo: hmm, In fact, I mean, you can override the operators...
autrijus but sometimes emulation is so slow it isn't practical anymore
theorbtwo Exactly... in one direction.
iblech autrijus: &uniq is not yet implemented in PIL2JS 22:08
theorbtwo The hard bit is passing things from perl6-world that don't have any real equivelent in basic-world.
What does a continuation look like from a language that doesn't have funtion pointers?
autrijus it would look like a toplevel function.
or a label that you can jump to. 22:09
theorbtwo Perhaps not the best of examples.
autrijus :)
you can ask "what does a compiler look like from the game of life?"
"how do you write &eval with gliders?"
svnbot6 r6380 | chromatic++ | Untabified source code. 22:10
r6380 | chromatic++ | Don't add empty descriptions in Test::Builder::Test report() methods.
r6380 | chromatic++ | Don't use non-existent $.really_passed in Test::Builder::Test::TODO.
r6380 | chromatic++ | Added test_pass() and test_fail() to Test::Builder::Tester.
r6380 | chromatic++ | Added get_test_number() to Test::Builder (but may change name later).
r6381 | autrijus++ | * remove spurious 'do' from sudoku solver.
r6382 | iblech++ | * t/statements/loop.t: Minor fix.
r6382 | iblech++ | * PIL2JS:
r6382 | iblech++ | * PIL::Subs, PIL::Params:
r6382 | iblech++ | Refactored PIL::PSub to be a subclass of PIL::PCode.
r6382 | iblech++ | This will makes adding support for coroutines much simpler.
r6382 | iblech++ | * Prelude::JS::ControlFlow:
r6382 | iblech++ | * Fixed &next, &last, &redo (was a two-char fix...).
r6382 | iblech++ | * Added &statement_control:<postwhile> and postuntil.
autrijus and the answer would be rendell.server.org.uk/gol/tm.htm
theorbtwo At some point all turing-machine equivelent langauges are equivelent, yes... but if everything looks like a turing machine, then you might as well be programming in brainfuck. 22:12
autrijus right. and nowadays, most self-respecting languages can communicate with the vanilla C semantics of function calls and primitive types 22:13
but as all Inline::* users (and authors!) know, that's simply too painful. 22:14
putter hi all. 22:15
autrijus thus, the interest in virtual machines. ;)
hi putter.
theorbtwo I'm not sure I follow that leap, autrijus?
putter nothingmuch: re smoking rules, when I ran it on my own machine it just worked, so I dont have any "what might be wrong" suggestions. Sorry.
nothingmuch crapxor 22:16
autrijus theorbtwo: oh ok. the C semantics maps into an ideal machine, but that ideal machine doesn't do enough interesting things
now that the "interesting" level is rised
but just how interesting is interesting enough, is an interesting question.
theorbtwo Wouldn't an interesting ABI spec on a real machine be able to do the same sorts of interesting things? 22:17
autrijus why, sure, except for the reprogrammable bit
putter ?eval class C { has $.v } my $c = C.new; sub f(){ $c } f().v
evalbotzy Error: No compatible subroutine found: "&v"
autrijus ?eval class C { has $.v } my $c = C.new; sub f() returns C { $c } f().v 22:18
evalbotzy \undef
autrijus putter: bad inferencing at work. known problem
and tested for, iirc.
putter ooooohh. but a workaround! happy, happy, joy, joy, joy. autrijus++
autrijus++
autrijus :)
theorbtwo: if Java Chips can microassemble themselves when a new Java spec is out 22:21
svnbot6 r6383 | autrijus++ | * make crude_repl run on platform that doesn't have `cat`.
autrijus I think they will fare much better :)
in that regard, our Parrot Chip is much more adaptable 22:22
but the technical difficulty at mass production is a problem.
autrijus is reminded of the "clone dconway to run perl6 for you" sayings way back 22:23
obra autrijus: cloning?
autrijus obra: and mind transfer, yeah
theorbtwo Obra: It'd be easier to get a Damien Conway whenever you want to execute perl then to make a perl6 evaluator on a computer. 22:24
iblech BTW, rt.openfoundry.org/Foundry/Project/.../pugs/log/ is still at r6317. Known? 22:34
autrijus iblech: nope. thanks, fixed. 22:39
svnbot6 r6384 | putter++ | Beginning of a JavaScript front-end.
r6384 | putter++ | modules/JavaScript-FrontEnd/Grammar.pm: a grammar derived from the ECMA-262 spec. It is untested. And is unrunnable on current PGE.
iblech autrijus: Thanks much :)
putter: JavaScript front-end? /me looks
autrijus mm compiling javascript to javascript. 22:40
but narcissus project did that
putter js to p5? js to haskell? ;) 22:42
autrijus that'd be too useful ;)
putter iblech: the only thing there now is an unrunnable and untested grammar. next step would be a runtime. 22:43
hmm, pugs head just now failed to build with an error of 22:45
/usr/bin/perl -Iinc util/drift.pl src/Pugs/PIL1.hs-drift > src/Pugs/PIL1.hs
runhugs: Error occurred
ERROR - Unable to open file "/home/net1/perl6/pugsxpl2/util/../../DrIFT/src/DrIFT.hs"
autrijus mea culpa
nothingmuch ciao! 22:46
putter bye.
autrijus fixed.
see ya
putter danke
autrijus bitte schƶn
svnbot6 r6385 | autrijus++ | * unbreak the build. remember to check in PIL1.hs after modifying 22:48
r6385 | autrijus++ | PIL1.hs-drift -- even just adding a poem
putter nothingmuch: actually, one note on smoke. you are failing, rather than skipping, the t/rules/from_perl6/rules/*.t. Johnathan's smoke is skipping them, but failing t/rules/rules.t. curious. dont know what it means.
nothingmuch *shrug*
i'll look at it when i have some spare time, and my brain is functional
putter pines for a working public smoke of p6 rules... :-( 22:49
thanks. L)
err, :) even
nothingmuch perhaps if parrot were also pining towards a good goal (like fjords) it would just work 22:50
putter lol 22:51
fglock___ iblech: what kind of structure a "type" is in PIL2JS runtime? I'm studying how to implement types in Perl5 runtime 22:53
pasteling "putter" at 66.30.119.55 pasted "pugs head compile warning" (13 lines, 933B) at sial.org/pbot/12623 22:54
fglock___ (I mean, a subtype)
iblech fglock___: Ah. There is none :)
putter Compiling Pugs.Embed.Perl5 is currently unhappy. 22:55
iblech fglock___: Much of the OO stuff needs -CPIL2
fglock___: And, as there is no -CPIL2 yet, very little OO things work -- in fact, only method declarations work 22:56
autrijus putter: that warning was always like that. 22:57
nothingmuch iblech: read mail 22:59
fglock___ If I define 'multi sub grep(List x:,...){...}' globally, will $list.can(grep) work?
nothingmuch fglock___ =~ s/_*$//; 23:00
fglock___ :)
that's my beard
iblech fglock___: I don't think so -- the class isn't modified in any way, I think. 23:01
fglock___ so 'can' will be mostly useless, with most routines being defined in Prelude? 23:02
putter autrijus: really? oh, ok, thanks.
fglock___ (unless they are defined in a class, and then exported)
iblech Why do they need to be exported? 23:03
fglock___ ok, right 23:04
iblech method grep (@array: ...) {...} -- then both @foo.grep and grep @foo will work
autrijus waves again... &
iblech bye autrijus :)
fglock___ If it is defined in Prelude, does it have to be: method Array::grep (... in order to be a method? (and be can()'ed) 23:06
iblech I think method grep (Array $self: ...) (or method grep (@self: ...)) is sufficient 23:07
But probably explicitly writing Array::grep doesn't hurt
fglock___ method grep ( Array|List @a: ... 23:10
iblech Right.
(BTW, this is how PIL2JS handles methods like .pairs currently: method pairs (Hash|Array|Pair $self:) {...}) 23:11
putter ?eval do{my $r = 13; $r } 23:21
evalbotzy Error: Undeclared variable: "$r"
putter huh?!? 23:22
iblech ?eval do { 1; my $r = 13; $r } 23:24
evalbotzy \13
iblech Ah, maybe because of the special treatment of do STMT
putter thanks! :)
?eval (sub() returns Int {12}()) # so dont need this 23:25
evalbotzy Error: unexpected "r" expecting block
netstar_ Does anyone have any idea when Perl 6 will be ready?
xinming netstar_: What do you mean for "perl 6" exactly? :-)
netstar_ perl6 even 23:26
iblech and what do you mean by "ready" exactly? :)
xinming netstar_: If you mean the whole perl 6... As nothingmuch ever told me. It is now only 15% completed.
iblech There exist many working Perl 6 modules today 23:27
xinming netstar_: If you mean only the language "grammar" and you wish to try to program in perl 6, Then pugs is for you.
netstar_: It covers many aspects of perl 6 "specification".
netstar_ cool
xinming BTW, if something I said wrong. Please told me. 23:28
putter iblech: shall I create a t/pugsbug? 23:29
(re do{})
iblech please do :)
putter ok
iblech BTW, I got coro almost working in PIL2JS :) 23:30
But need to sleep soon
putter soo... the combination of macros and Prelude and broken type inference still has me stuck (vis trying to get Rul working and rules unstuck)
iblech :( 23:31
putter what are all the ways to say something has a type? cant do return value on an anon sub. macro expanding "do{1; my Rul $r = ...; $r}" doesnt help. "foo(...)" where foo is returns Rul, even if foo is defined in- or post-Prelude, doesnt help. other ideas? 23:32
iblech a Rul $r 23:33
but "a" is not yet implemented yet
putter ;)
xinming how do slurp in perl 6? hmm, I mean if there is already a interal function handle this. 23:34
iblech slurp "filename"
putter wonders if it would have been easier to implement macro quote:foo, that this attempted hook to Prelude. weary sigh. 23:35
iblech slurp $filehandle works too, IIRC
putter s/that/than/
xinming what it will return? a file handle?
or a Str
iblech Str 23:37
xinming iblech: thanks.
iblech (slurp works in Pugs, BTW)
putter iblech: any last give-type-type-inferencer-a-hand thoughts? 23:39
iblech putter: No, sorry :(
putter ok. my thanks. :/
svnbot6 r6386 | iblech++ | PIL2JS: coro almost working. 23:41
iblech Need to sleep now, night all :)
putter 'night iblech. thanks again. 23:44
night all & 23:48