Camelia, the Perl 6 bug

IRC log for #perl6, 2006-12-19

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 Psyche^ is now known as Patterner
00:04 Debolaz Speaking of parrot, is there anywhere I can find the discussion/rationale behind a register based approach?
00:05 luqui Debolaz, I don't remember where the doc is; but the surface reason is that we have tons of register based research to draw on; the deeper reason is that stack-based VMs do not like ILP very much
00:06 luqui and there is probably an even deeper reason that I don't know about
00:06 luqui ?eval class List is also { method shuffle() { $.pick($.elems)) } }
00:06 evalbot_r14926 Error: ␤Unexpected ")"␤expecting ":", term postfix, operator or "}"
00:06 luqui ?eval class List is also { method shuffle() { $.pick($.elems) } }   [1..5].shuffle
00:06 evalbot_r14926 [3, 4, 1, 2, 5]
00:07 luqui ?eval class List is also { method shuffle() { $.pick($.elems) } }   <w 0 0 t>.shuffle
00:07 evalbot_r14926 ["0", "t", "w", "0"]
00:07 wolverian whoa. luqui++
00:07 jrockway Debolaz: the reasoning was that optimizations for register-machines are well-known
00:07 jrockway since every *real* machine is register-based, and there are pretty good optimizing compilers for them
00:07 jrockway almost every, i mean
00:08 jrockway (further reasoning is documented somewhere on the parrot website, btw)
00:10 Ovid There's a List class separate from Array?  Which inherits from the other?
00:10 Ovid (I'm feeling very slow right now)
00:10 luqui I left perl about the time the debate was going on
00:10 luqui my angle was: List is the value type for Array
00:10 wolverian luqui, should that be @.pick?
00:10 luqui wolverian, possibly, yes
00:10 jrockway ?macro circumfix:</* */> is parsed /.*?/ { '' } /* foo bar */ 1;
00:10 lambdabot Unknown command, try @list
00:10 jrockway ?eval macro circumfix:</* */> is parsed /.*?/ { '' } /* foo bar */ 1;
00:10 evalbot_r14926 Error: ␤Unexpected "/.*?/"␤expecting trait or block
00:10 luqui luqui, an Array is a reference to a variable containing a List
00:11 wolverian reference? what's that? ;)
00:11 luqui but on these issues I seldom get my way :-), so it's probably something else
00:11 Debolaz jrockway: But those real machines are register based because that's much more practical to implement in hardware aren't they? In many software cases, especially when allowing unlimited registers, it seems somewhat inefficient (Sort of like an obfuscated stack) to use registers. That being said, I'm not expert on the sbuject.
00:11 jrockway Debolaz: right, but that's where the research efforts have been made
00:11 jrockway there'a *a lot* of literature on register-based machines
00:11 jrockway even if they're "not as good"
00:11 luqui Debolaz, also, stack machines don't like ILP; they cause mispredicts too much
00:11 luqui er, cache misses
00:12 py1hon doesn't code for stack machines tend to be bigger too as it's littered with pushes and pops?
00:12 luqui yeah, but whatever.
00:12 py1hon and i'd think stack based machines would be harder to do jit compiling on, not that i know
00:12 Debolaz I just feel that perhaps chosing a register based machine because more optimizations are known for it is sort of like chosing fortran over perl based on it being many possible optimizations in the context of fortran.. ie, it doesn't really counterargue using a stack machine in itself.
00:12 jnthn If you are interpreting the code and have no JIT available and you have a stack, you gotta maintain the stack pointer. = slow
00:13 luqui jnthn, yeah, that's the ilp thing; all your instructions are dependent on the stack pointer.
00:13 jnthn And yeah, JIT on a stack is stack => register mapping, whereas JIT with register is essentially just register minimisation.
00:13 jnthn Which if you have lots of registers and a Parrot sub doesn't use many, may be a no-op.
00:14 jrockway although my machine doesn't have a register that can store pmcs :)
00:14 luqui jrockway, really?  they're just pointers...
00:14 jnthn A Parrot register doesn't really, just a pointer to one. :-)
00:15 jnthn Your hardware stores pointers just fine.
00:15 Ovid For shuffle, can't you just extend Array with the sig (*@list) and use it with both lists and arrays? (Or am I being totally naive again?)
00:16 py1hon arrays can't do o(1) insertions and deletions in the middle...
00:17 Ovid Wait, I meant (*@list is copy).  That's assuming that slurpy arrays don't default to 'is copy'
00:18 jrockway ah :)
00:18 luqui Ovid, I'm not sure
00:18 luqui I implemented it as a method
00:18 luqui so...
00:18 Ovid Well, Larry suggested it might be that way, but who knows?
00:19 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   <w 0 0 t>.shuffle
00:19 evalbot_r14926 ["0", "t", "w", "0"]
00:19 luqui hmm.
00:19 luqui ?eval <w 0 0 t>
00:19 evalbot_r14926 ("w", "0", "0", "t")
00:19 luqui why is it returning a ref
00:19 Ovid ?eval <w 0 0 t>
00:19 luqui ?eval <f o o b a r>.pick(6)
00:19 evalbot_r14926 ("w", "0", "0", "t")
00:19 evalbot_r14926 ("b", "r", "o", "a", "o", "f")
00:19 jrockway ref?
00:19 luqui the square brackets
00:20 Ovid ?eval <w 0 0 t>.pick(3)
00:20 evalbot_r14926 ("0", "0", "t")
00:20 Ovid ?eval <w 0 0 t>.pick(5)
00:20 evalbot_r14926 ("0", "w", "0", "t")
00:20 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   @{<w 0 0 t>.shuffle}
00:20 evalbot_r14926 Error: ␤Unexpected "{<"␤expecting "@" or "::"
00:20 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   list <w 0 0 t>.shuffle
00:20 evalbot_r14926 ["0", "t", "0", "w"]
00:21 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   *<w 0 0 t>.shuffle
00:21 evalbot_r14926 Error: Odd number of elements found where hash expected: VNum Infinity
00:21 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   *(<w 0 0 t>.shuffle)
00:21 evalbot_r14926 Error: Cannot cast from VNum Infinity to Pugs.AST.Internals.VCode (VCode)
00:21 luqui oh
00:21 luqui * doesn't do that anymore
00:22 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   =<w 0 0 t>.shuffle
00:22 Ovid Why should "<w o o t>.pick(5)" only return 4 elements?  That's silently discarding the information that I'm trying to pick too many elements.
00:22 evalbot_r14926 Error: Can't modify constant item: VUndef
00:22 luqui Ovid, you want it to die?
00:23 Ovid I always want things to die when they're a serious error doing something they shouldn't do.
00:23 Debolaz Also, what is the adventage with a junction over a list that would be difficult to achieve using lists?
00:23 audreyt luqui: the obvious solution is the correct one: @()
00:23 luqui ?eval class List is also { method shuffle() { @.pick($.elems) } }   @(<w 0 0 t>.shuffle)
00:23 evalbot_r14926 ["0", "w", "t", "0"]
00:23 luqui hmm..
00:23 luqui apparently not
00:23 audreyt why not?
00:24 Ovid Of course, that might just be the "strong typing" pseudo-bigot coming out!
00:24 audreyt arglist flattening is |<< btw
00:24 audreyt ?eval class List is also { method shuffle() { @.pick($.elems) } } |<< <w 0 0 t>.shuffle
00:24 evalbot_r14926 (["0", "t", "0", "w"],)
00:24 audreyt but that doesn't quite work here
00:24 audreyt have to be inside a function call
00:25 luqui what is |<< ?
00:25 audreyt ?eval class List is also { method shuffle() { @.pick($.elems) } }   <w 0 0 t>.shuffle
00:25 evalbot_r14926 ["w", "t", "0", "0"]
00:25 audreyt ?eval class List is also { method shuffle() { @.pick($.elems) } }  | <w 0 0 t>.shuffle
00:25 evalbot_r14926 ["0", "t", "w", "0"]
00:25 audreyt ?eval class List is also { method shuffle() { @.pick($.elems) } }  sort | <w 0 0 t>.shuffle
00:25 evalbot_r14926 ("0", "0", "t", "w")
00:25 Ovid In other words, if there's a serious debate about what a non-sensical method call should return, I want it to die a quick and painful death.
00:25 audreyt luqui: prefix | is the new *
00:25 Ovid Of course, that might be the rum talking.
00:25 audreyt S03/Argument Llist Interpolation
00:25 luqui Ovid, I'm never sure about TimToady, but he might disagree with you
00:26 luqui Ovid, you're not too good with haskell, are you?
00:26 luqui (ha, speaking like I am! :-p)
00:26 audreyt you are quite good :)
00:26 * audreyt goes making Really Important phone call. bbiab &
00:27 Ovid I went through a Haskell tutorial  a long time ago and I remember precisely squat (aside from the fact that i can recognize guards when I see them)
00:27 luqui Ovid, it might be a good exercise to make it die when you try to pick too many elements
00:27 audreyt Ovid: http://web.archive.org/web/20060327034​654/www.cs.nott.ac.uk/~gmh/preview.pdf
00:27 lambdabot http://tinyurl.com/y94rfc
00:27 * audreyt ponders the ethics of linking into now-404'ed preview pdf of a book
00:28 luqui Ovid, src/Pugs/Prim/List.hs line 70 if you're interested
00:28 Ovid Audrey:  thanks!
00:28 audreyt but that's the best material I've found so far
00:28 audreyt and I will buy the book once it comes out, so I guess that's ok :)
00:30 Ovid Audrey:  no worries. I won't tell anyone and this will just be between us :)
00:30 luqui and me, now
00:30 Ovid Shh!
00:31 Ovid I just noticed that you linked to something that is from the University of the city I just moved to (and am now moving away from).  Cool!
00:32 * TimToady is never quite sure about TimToady either...
00:32 * luqui knew that, he just didn't say
00:33 Ovid luqui:  there's absolutely no point in making it try to pick from more elements than the list has, so anyone trying to do that is arguably trying to do something wrong.
00:33 audreyt this certainty thing is certainly overrated...
00:33 Ovid left perl6
00:33 luqui oh, the old hit-and-run argument approach :-)
00:33 jrockway heh, i printed a paper copy of that book a few weeks ago ( i think )
00:34 Ovid joined perl6
00:34 Ovid Oops.
00:34 Ovid Just lost my chat log, too :(
00:34 audreyt there's always irc.pugscode.org
00:35 * Debolaz checks out the book.
00:35 TimToady ?eval <a b c>.pick(*)
00:35 evalbot_r14926 Error: pick not defined: VList [VStr "a",VStr "b",VStr "c"]
00:35 TimToady looks like the implementation is not yet complete...
00:36 luqui ah
00:36 luqui I wonder what the internals of * look like
00:36 Ovid Thanks, Audrey.
00:36 TimToady matched by Whatever in the sig
00:36 Debolaz The biggest obstacle to learning haskell for me so far has been the tutorials going out of their way to just saying things the way they are but instead try to make up every imaginable analogy for it.
00:36 TimToady other than that, doesn't have much internals...
00:37 luqui looks like it is represented by VNum Infinity
00:37 jrockway i just read through one of audreyt's talks on haskell
00:37 TimToady that's a hack
00:37 jrockway very accessible and entertaining
00:37 TimToady arbitrarily large is very different from infinity
00:38 Debolaz jrockway: Url?
00:38 * luqui goes to perpetuate the hack in his implementation of pick
00:38 TimToady and * is really only "arbitrarily dwim" with a slight bias toward largeness.
00:39 TimToady or smallness, in the case of *..0
00:39 Ovid jrockway:  which intro?  I read one and was terribly confused, so it must be a different one (this being from a  guy who went from OO to Prolog but doesn't quite grok the lambda calculus)
00:39 jrockway let me look around for it
00:39 jrockway http://feather.perl6.nl/~audreyt/osdc/haskell.xul
00:40 Ovid Tjat
00:40 Ovid That's the the one I read.  I guess I'd have to hear the accompanying talk.
00:41 jrockway just type them into ghci and follow along
00:41 jrockway and then read the book
00:41 jrockway then you'll be the next audreyt, perhaps :)
00:42 Ovid I'll give that a shot.  The fact is, I confess I'm just not as quick as the rest of you.  I'm just persistent :)
00:42 jrockway hehe
00:42 jrockway some of the examples need let in front of them, i think
00:43 TimToady I am often persistent briefly.
00:43 jrockway let double = (*) 2 instead of "double = (*) 2" as per the slides
00:43 Ovid TimToady:  don't say that.  I'll stop believing your honesty!
00:47 Ovid So anyone willing to make a prediction about a timeline for Perl 6 alpha built in PGE?
00:47 jrockway people are willing to predict, but i bet you're tired of the answer ;)
00:48 Ovid (Warning:  a O'Reilly blog post might follow that if there aren't enough caveats)
00:48 * luqui is certain that people don't want to hear my answer...
00:48 Ovid Well, I've predicated "2007", but likely in the first half.
00:49 jrockway christmas 2007?
00:49 svnbot6 r14927 | luqui++ | Implemented @list.pick(*).
00:49 jrockway ?eval (1,2,3).pick(*)
00:49 evalbot_r14926 Error: pick not defined: VList [VInt 1,VInt 2,VInt 3]
00:49 luqui jrockway, be patient! :-)
00:49 Ovid :P
00:49 jrockway *whir of evalbot self-compiling itself*
00:51 luqui ?eval [1..31].[5..*]
00:51 evalbot_r14926 ()
00:51 luqui hmm
00:52 luqui ?eval (1..31).[5..*]
00:52 evalbot_r14926 (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)
00:52 luqui that seems, wrong
00:52 luqui the former, that is
00:52 jrockway ?eval [1..31]
00:52 evalbot_r14926 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]
00:52 jrockway ?eval [1..31].WHAT
00:52 evalbot_r14926 ::Array
00:52 Ovid Agreed.  References should resolve themselves.
00:53 TimToady there are no references. :)
00:53 Ovid We'll call them "spoons".
00:53 jrockway what's the difference between [...] and (...) ?
00:53 jrockway sporks
00:53 TimToady Arrays are mutable
00:53 luqui I'm afraid of touching that bug though.
00:53 TimToady but that shouldn't matter for this
00:53 luqui I've been there before
00:54 TimToady ?eval [1..31][-1]
00:54 evalbot_r14926 \31
00:54 luqui was it the dot?
00:54 luqui ?eval [1..31][5..*]
00:54 evalbot_r14926 ()
00:54 TimToady ?eval [1..31].[-1]
00:54 py1hon array references wrap around?
00:54 evalbot_r14926 \31
00:54 TimToady subscripts wrap around
00:54 jrockway py1hon: as per perl5, right?
00:54 TimToady yes
00:54 luqui py1hon, but not as in modular arithmetic
00:55 luqui just negative numbers
00:55 luqui ?eval [1..31][42]
00:55 evalbot_r14927 \undef
00:55 jrockway ok :)
00:55 py1hon jrockway, i'm a c monkey =/
00:55 jrockway ?eval (1,2,3).pick(*)
00:55 evalbot_r14927 (1, 2, 3)
00:55 TimToady however, once we get range objects, they may behave more toward
00:55 jrockway py1hon: learn perl :)
00:55 Ovid ?eval item [1 .. 31][-1]
00:55 py1hon i did a long time ago, then forgot it all ;p
00:56 evalbot_r14927 31
00:56 jrockway i only program in C for the mental exercise
00:56 jrockway using tools like valgrind has a certain satisfaction
00:56 py1hon i do tons of sockets programming for work...
00:56 py1hon valgrind is so awesome
00:56 jrockway well, even better is a language that doesn't let you leak memory :)
00:56 jrockway not as fun though
00:56 luqui I program in C++ for games (and I'm ashamed), haskell for mathematical inquiries, and perl for everything else
00:56 Ovid ?eval (1..23).pick(*)
00:56 evalbot_r14927 (11, 20, 7, 9, 1, 4, 22, 16, 18, 17, 8, 23, 14, 15, 6, 10, 12, 3, 2, 5, 19, 13, 21)
00:56 sili memory leaks are good thing. it keeps certain people employed
00:57 jrockway sadly kde's C++ base seems to lead to unstable apps
00:57 Ovid Yeah, but they can never forget the pain!
00:57 jrockway whereas gnome's python base (now) is quite solid
00:57 sili what doesn't kill you...
00:57 * luqui is amused at the fact that .pick(*) is the same number of characters as .shuffle\
00:57 sili makes you study liberal arts
00:57 py1hon lol
00:57 py1hon or pure math?
00:57 Ovid ... leaves you in a half-dead, unreaped state.
00:57 luqui py1hon, hey!
00:58 py1hon mmm graph theory :)
00:58 luqui I was almost killed by my math final today
00:58 luqui that was the hardest test I have ever taken (but I did well ;-)
00:58 py1hon i didn't finish my take home math final because i was finishing my project that i put off till the last minute =/
00:58 Ovid Hey, I don't want to hear about Python.  lambda is fundamentally borked and is going to stay that way :(
00:58 py1hon graduate course, too
00:59 luqui Ovid, how come
00:59 TimToady ?eval ('a'..'c').pick:*
00:59 luqui my python-fu is weak
00:59 evalbot_r14927 Error: ␤Unexpected ":*"␤expecting term postfix or operator
00:59 TimToady ?eval ('a'..'c').pick: *
00:59 evalbot_r14927 ("c", "b", "a")
00:59 TimToady heh. hoist by my own petard
00:59 luqui :-)
00:59 sili python does function-level scoping like javascript/ruby, right? that's really ick.
01:00 Ovid basically, lambda only allows a single statement (unless it's changed recently)
01:00 jrockway python never excited me really
01:00 * luqui dislikes function-level scoping too
01:00 jrockway no better than perl, but really really ugly syntax
01:00 luqui jrockway, you say python's syntax is ugly?
01:00 sili luqui: it's just... dumb. there's no argument for it aside from the fact you can omit my()-like constructs
01:00 Ovid http://www.artima.com/weblog​s/viewpost.jsp?thread=147358
01:01 lambdabot Title: Language Design Is Not Just Solving Puzzles
01:01 jrockway __init__.[__whoa__].[__unde​rscores_arent_that_cool__] '''''''comment'''''''
01:01 jrockway :)
01:01 luqui jrockway, wow, you're the first person to call python ugly when comparing to perl
01:01 luqui that I've heard
01:01 jrockway perl's not beautiful, but it's concise
01:02 jrockway easy to type, easy to edit, easy to read
01:02 jrockway not so easy to parse
01:02 luqui I think python looks cleaner, but then again I think italian sounds poetic.
01:02 luqui it doesn't really matter, because I don't know either language
01:02 Ovid Though now that I google for it, it appears that some folks seriously disagree with me:  http://ivory.idyll.org/blog​/nov-06/i-just-dont-get-it
01:02 lambdabot Title: Daily Life in an Ivory Basement : /nov-06/i-just-dont-get-it
01:02 jrockway if you want really ugly, look at PHP
01:03 jrockway no postfix control statements, everything requires parens, etc.
01:03 TimToady someone really needs to write a refactoring PHP-to-Perl6 translator...
01:03 jrockway that would be potenitally easy
01:04 jrockway php is just a simple bison grammar
01:04 jrockway T_FUNCTIONNAME etc.
01:04 jrockway it's slightly insane
01:04 jrockway i found a bug the other day, but i couldn't bring myself to send them a patch :/
01:04 luqui I think the "refactoring" makes it a little tougher :-)
01:04 jrockway yeah
01:04 jrockway how to make dumb php smart
01:04 TimToady "here's the namespaces you should have used, dolt!"
01:05 jrockway who needs namespaces when you have 8 different ways to split a string?
01:05 sili pretty soon someone's going to write a language that supports anything you could ever want in a language, then it's just a matter of giving it a syntax
01:05 sili cough cough.
01:05 jrockway php is a great language to learn for one thing
01:05 luqui Ovid, hmm, the double colon seems slightly analogous to :: in haskell, but not very much so
01:05 jrockway it's every combination of poor design, all combined into one language
01:05 sili php isn't great for anything. take that back right now!
01:06 jrockway fine, i take that back
01:06 jrockway it's interesting to see why php is popular
01:06 jrockway mostly, people feel smart when they do things the compiler should do for them
01:07 jrockway like differentiate between when to use split and preg_split
01:07 Ovid Because it's so easy to get up and running with PHP.  That's not something which should be ignored.
01:07 jrockway a smart language would say, "hey, this regex is just a string" and DWIM
01:07 TimToady er, unlike P5, which botches that...
01:08 jrockway p5 is included with every sane OS in the default install
01:08 jrockway what could be easier?
01:08 jrockway catalyst is hard to install (i'm told), but so are the PHP frameworks
01:08 jrockway and they're not worth the effort IMHO
01:08 TimToady I think "sane OS" indicates the null set.
01:08 jrockway non-insane then?
01:09 luqui wow.. it's amazing how much I disagree with guido.
01:09 luqui thanks for the article Ovq
01:09 luqui er, Ovid
01:09 sili but he's our benevloent dictator for life!
01:09 sili how dare you!
01:09 Ovid :)
01:13 TimToady I hope I'm just benevolent dictator till I can Get It Right...
01:13 luqui you mean for life?
01:13 lyokato joined perl6
01:13 luqui hmm.. actually longer than that
01:13 TimToady Life pluse 182 years...
01:13 TimToady *plus
01:13 jrockway btw TimToady, have you read this? http://steve.yegge.googlepage​s.com/ancient-languages-perl
01:13 lambdabot Title: Stevey&#39;s Home Page - Ancient Languages: PerlÂ
01:14 jrockway pretty hilarious
01:14 TimToady sure
01:14 TimToady it's a nice rant
01:18 polettix I don't fully get this in van Rossum's article: "This is also the reason why Python will never have continuations, and even why I'm uninterested in optimizing tail recursion.". Why this opposition to tail recursion *optimisation*? It should be benevolent with the caring programmer and not-malevolent with the uncaring one
01:19 jrockway i learned the other day that elisp of all languages doesn't support tail recursion
01:20 jrockway pretty insane IMHO
01:20 luqui polettix, tail recursion optimization has some trade-offs, and it is good for programming styles that make good use of it.  python's "one true style" does not.
01:20 jrockway what are some of the tradeoffs?
01:21 polettix luqui: does this mean that enhancing tail recursion would bash those not using it?
01:21 Ovid Because tail recursion is something that many programmers don't quite 'get'.  Guido's point seems to be that he wants a language that most programmers can understand.   However, most programmers 20 years ago wouldn't have understood Python, so I don't follow his logic.
01:21 jrockway PHP is a language that everyone can understand
01:21 polettix ah, so it's for a readability issue
01:21 Ovid Of course, I could easily be misunderstading Guid
01:21 jrockway i personally would prefer a langauge that *I* can understand :)
01:22 Ovid ... misunderstading Guido, so that's not an objection.
01:22 luqui polettix, that is my impression.  I'm not heavily enough in implementation-land to defend it though.
01:22 Ovid Ah!  I misspelled it again!
01:22 Ovid "misunderestimating!
01:22 luqui "misunderstandimating"
01:22 polettix it seems some time that I don't update perl6 - when did it jump on new GHC 6.6?
01:23 jrockway before the latest release release, i think
01:24 Ovid I note that TimToady i largely silent on this topic, but given the politics of the situation, I guess that's understandable :)
01:25 TimToady Guido is not willing to give up indentation, and I'm not willing to give up list flattening.  :)
01:25 * allbery_b discovered perl and python at the same time.  he stuck with perl. :)
01:25 allbery_b (after playing with both for a while)
01:26 jrockway i looked at python when i wanted a "real" object system, but python didn't satisfy
01:26 jrockway i would have been happy with perl6 = perl5 + java classes (+MI)
01:26 TimToady people keep talking about Python like it's the true successor to Lisp, but I don't buy it.
01:26 py1hon if it was, it'd have macros :)
01:27 Tene I think  lisp variant allowing indentation to be used in place of ()s would be interesting.
01:27 py1hon and oo based on multimethods
01:27 Tene entertaining, at least.
01:27 jrockway that would be hard
01:27 py1hon Tene, in practice that's what happens, when you write lisp you let your editor indent and mostly ignore the parentheses
01:28 jrockway how would you handle cond, for example
01:28 lyokato joined perl6
01:29 Ovid Tene:  I thought about that based on http://billhails.net/Book/, but I need tuits!
01:29 lambdabot Title: Exploring Programming Language Architecture in Perl (cover art by the author)
01:30 jrockway something like: (let ((a 10)) (cond ((< a 10) t)((> a 10) t)((= a 10) nil)))
01:30 jrockway would it be let \n \t a 10 \n \t \t cond \n \t \t \t ... ?
01:31 Ovid I would have called that language "Cor" (massive bonus points to anyone who knows why)
01:32 jrockway google from "cor python lisp" returns some possibilities
01:32 Ovid Nope.
01:33 jrockway oh. :(
01:33 Ovid The original Ovid wrote love poems to "Corinna".  No one knows if she existed or if she was a literary device.
01:34 TimToady well, hey, the two are not mutually exclusive.  :)
01:34 Ovid There's some speculation that she might be the woman he was forced into marrying for his first marriage (an arranged marriage).
01:34 seano joined perl6
01:35 luqui TimToady, I don't understand the paragraph beginning with "It is allowed to specify" in your recent change
01:35 Ovid So it might be the case that Ovid wrote many of his love poems to a woman he was forced to marry, but had the bad grace to actually fall in love with.
01:35 Aankhen`` joined perl6
01:37 TimToady luqui: the following example doesn't clarify it?
01:37 luqui not really
01:37 luqui so you're talking about a sub taking a capture, and then continuing to bind?
01:37 luqui but doesn't the capture eat up everything?
01:37 TimToady no, it's a lookahead.  :)
01:38 luqui so there is backtracking?
01:38 TimToady no, just snapshotting
01:38 luqui sub foo (|$cap, $n) { say $n };     foo(3,4,5,6);  # ?
01:38 luqui is it 6?
01:38 mako132_ joined perl6
01:39 TimToady no it'd be 3
01:39 TimToady except there are too many args
01:39 luqui sub foo (|$cap) {...}    foo(3,4,5,6)  # legal?
01:39 Aankhen`` joined perl6
01:39 TimToady certainly
01:40 TimToady $cap is \(3,4,5,6)
01:40 luqui so the comma isn't so much a comma as an en-passant capturer?
01:40 Aankhen`` joined perl6
01:40 TimToady which comma?
01:40 luqui after |$cap
01:40 luqui (|$cap) and (|$cap, $n) are very different
01:40 TimToady I originally didn't have one.  Someone else put it in.
01:41 * luqui looks it over again
01:41 TimToady But it really doesn't matter, if |$cap is "zero width".
01:41 luqui but in my first example, foo(3,4,5,6) is illegal?
01:42 TimToady no compatible routine found...
01:42 luqui one last test:
01:42 luqui sub foo (|$cap, $a, $b, $c) {...}   foo(1,2,3)
01:42 luqui $a is 1, $b is 2, $c is 3, $cap is \(1,2,3) ?
01:42 TimToady that's the intent.
01:43 luqui okay
01:43 luqui yeah, the comma is what is bugging me
01:43 luqui but I kind of grok the reasoning
01:43 luqui it's more like a processing queue than a specification list
01:43 TimToady I originally specced it (|$cap $a, $b, $c)
01:43 luqui or something
01:43 luqui why the change?
01:43 TimToady someone thought it was a typo
01:44 luqui oh, you were serious about someone else changing it
01:44 TimToady and I thought maybe it didn't matter.
01:44 TimToady but it could influence mmd
01:45 * luqui wants to hash out the consequences of a processing-queue model
01:45 TimToady either that, or you have to write the most generic form as (|$cap, *) or some such
01:45 * luqui wants also to go home now
01:45 luqui back in an hourish probably
01:45 TimToady and pragmatically, I figured if people thought it was a typo once, they'd do it over and over.
01:46 luqui uh huh
01:46 luqui neither is really obvious
01:46 luqui one for syntax, one for semantics
01:46 * luqui &
01:47 Ovid OK, It's almost 2 in the morning here.  I have to run.  Bye folks.  (And read the Peter Green's translations of Ovid's works. He's brilliant)
01:47 TimToady decommuting &
01:49 Aankhen`` joined perl6
01:51 Aankhen`` joined perl6
02:00 mr_ank joined perl6
02:01 Azure-BOT joined perl6
02:17 Debolaz What's the proper way to call a subroutine referenced in $foo?
02:17 Debolaz $foo($bar)?
02:17 * Debolaz recalls eval
02:18 Debolaz eval my $foo = -> $x { say $x }; $foo(42);
02:18 Debolaz ?eval my $foo = -> $x { say $x }; $foo(42);
02:18 evalbot_r14927 OUTPUT[42␤] Bool::True
02:18 Debolaz :o
02:22 amf joined perl6
02:28 Psyche^ joined perl6
02:28 Psyche^ is now known as Patterner
02:37 awwaiid joined perl6
02:42 nipra joined perl6
02:47 luqui joined perl6
02:56 TreyHarris ?eval my $foo = -> $x { say $x }; $foo.(42)
02:56 evalbot_r14927 OUTPUT[42␤] Bool::True
02:56 TreyHarris that syntax works too.
03:54 bsb joined perl6
03:54 ssig33 joined perl6
04:16 ingy hola
04:18 luqui hola ingy
04:33 dduncan joined perl6
05:14 mjk joined perl6
05:23 Eidolos_ is now known as Eidolos
05:33 nipra joined perl6
06:15 BooK_ joined perl6
06:28 jdv79 is now known as capo
06:36 seano joined perl6
06:43 capo is now known as jdv79
06:55 xinming joined perl6
07:09 devogon joined perl6
07:28 justatheory joined perl6
07:39 ofer1 joined perl6
08:00 iblechbot joined perl6
08:19 rahikkala joined perl6
08:33 svnbot6 r14928 | lwall++ | change call to callsame/callwith/nextsame/nextwith
09:45 falseep joined perl6
10:02 luqui joined perl6
10:11 elmex joined perl6
10:23 dduncan left perl6
10:54 ruoso joined perl6
10:56 buetow joined perl6
11:08 Nei am I still here? test test
11:08 jrockway ?eval Nei.exists
11:08 evalbot_r14928 Error: No compatible subroutine found: "&Nei"
11:09 Nei dang!
11:09 Nei thought so
11:09 jrockway declare yourself, human :)
11:10 luqui ?eval 'Nei'.exists
11:10 evalbot_r14928 Error: No compatible subroutine found: "&exists"
11:10 luqui aww
11:10 Nei ^^
11:11 luqui ?eval 1 < 5< 7
11:11 evalbot_r14928 Bool::True
11:11 luqui ?eval sub postfix:<!> ($x) { [*] 1..$x }   9!
11:12 evalbot_r14928 362880
11:13 luqui ?eval class List is also { method stupid() { ([+] @.elems) % 2 == 0 } }    [1,4,5,7,3]
11:13 evalbot_r14928 [1, 4, 5, 7, 3]
11:13 luqui ?eval class List is also { method stupid() { ([+] @.elems) % 2 == 0 } }    [1,4,5,7,3].stupid
11:13 evalbot_r14928 Bool::False
11:13 luqui ?eval class List is also { method stupid() { ([+] @.elems) % 2 == 0 } }    [1,4,5,7,2].stupid
11:13 evalbot_r14928 Bool::False
11:15 Nei perl6 will make it easy to provide a mirc script like irc scripting glue
11:55 avar why does make test always compile something even though I've just done "make" and haven't svn up-ed
12:00 chris2 joined perl6
12:02 elmex joined perl6
12:10 avar joined perl6
12:13 Psyche^ joined perl6
12:21 Psyche^ is now known as Patterner
12:40 mako132_ joined perl6
12:50 xinming_ joined perl6
12:59 xinming joined perl6
13:22 buetow joined perl6
13:26 weinig|bbl is now known as weinig_
13:26 weinig_ is now known as weinig
13:48 kanru joined perl6
13:52 weinig is now known as weinig|bbiab
13:53 gnuvince joined perl6
13:54 gnuvince joined perl6
14:11 weinig|bbiab is now known as weinig
14:36 iblechbot joined perl6
14:42 weinig is now known as weinig|bbl
14:46 rahikkala left perl6
14:46 chris2 joined perl6
15:03 c6rbon joined perl6
15:04 bonesss joined perl6
15:05 mdiep_ joined perl6
15:07 azazello joined perl6
15:13 awwaiid joined perl6
15:28 mdiep joined perl6
15:33 buetow joined perl6
15:52 hexmode joined perl6
16:00 marmic joined perl6
16:32 penk joined perl6
16:33 ruoso joined perl6
16:36 penk joined perl6
17:08 lisppaste3 joined perl6
17:10 kanru joined perl6
17:24 svnbot6 r14929 | wolverian++ |  r32@pupu:  wolverian | 2006-12-19 19:24:00 +0200
17:24 svnbot6 r14929 | wolverian++ |  update the hq9+ example
17:25 wolverian augh, can I make --verbatim the default somehow?
17:42 weinig|bbl is now known as weinig
18:03 coumbes joined perl6
18:07 TSa joined perl6
18:15 buetow joined perl6
18:31 ozo joined perl6
18:34 nothingmuch Coleoid: i know the problem
18:34 nothingmuch just back from a 4 day hike
18:35 nothingmuch will take care of it soon
18:46 drrho joined perl6
18:50 justatheory joined perl6
18:51 weinig is now known as weinig|bbl
18:52 justatheory joined perl6
18:55 justatheory joined perl6
19:05 prism joined perl6
19:13 prism joined perl6
19:18 autark joined perl6
19:19 prism joined perl6
19:21 larsen_ joined perl6
20:17 cookys joined perl6
20:39 Aankhen`` joined perl6
21:04 chris2 joined perl6
21:07 weinig|bbl is now known as weinig
21:09 ozo joined perl6
21:12 Ovid joined perl6
21:13 Ovid ?eval my @result; <a b c c d> ==> map { $_ xx 2 } ==> @result; @result.perl.say;
21:13 evalbot_r14929 Error: ␤Unexpected " map"
21:14 Ovid I gather that feed operators are not yet implemented?  
21:15 Ovid When they are, will the following be legal syntax?  <a b c c d> ==> map { $_ xx 2 } ==> my @result;
21:16 Ovid Or wait, looks like I would do:  my @result = < a b c c d > ==> map { $_ xx 2 };
21:19 jrockway Ovid: i think the synopsis says ==> @result
21:19 jrockway @result <== map { .. } <== @input
21:19 Ovid Looking at it now:
21:19 Ovid    @oddsquares =
21:19 Ovid            (@nums ==> grep { $_ % 2 } ==> sort ==> map { $_**2 });
21:19 jrockway so feed operators return the end of the pipeline
21:19 jrockway makes sense
21:19 Ovid Needs parens, but it's still not implemented.  Looks like the t/operators/feed.t is all :todo tests.
21:20 jrockway am i allowed to refer to list and scalar context in perl6, or is that gone?
21:20 sili still there
21:21 jrockway so what do the feeds return in scalar context (without parens) ?
21:21 jrockway ?eval  (1,2,3) ==> my @output
21:21 evalbot_r14929 Error: ␤Unexpected " my"
21:22 jrockway ?eval @in1 ==> map {} <== @in2 # :)
21:22 evalbot_r14929 Error: ␤Unexpected " map"
21:23 jrockway that should be fun :)
21:24 prism joined perl6
21:25 Ovid Hmm, I wrote a program to split the 99 problems into separate Perl 6 test files.  I wonder if those would be OK to commit?
21:27 Ovid I imagine they might slow down the test suite even more.
21:31 jrockway are they really tests?
21:31 jrockway maybe put them in examples?
21:31 Ovid Ah, that makes sense.  I am writing them as .t files, but examples/ would be much better.
21:34 jrockway however, having them as tests seems like a beginning of a good idea to me
21:35 jrockway really you should give each example a test suite
21:35 jrockway to make sure the example works, and the perl6 implementation can run it and get correct results
21:35 jrockway i think that would be pretty awesome
21:35 jrockway 99 working programs with good test coverage
21:36 Ovid Each problem has been split into it's on .t file (and it turns out that there are only 84 problems, go figure) and I'm slowly working through them.  I just don't know if t/ is really a good place to put them since they *are* examples.
21:37 Ovid Still, they are also tests.
21:37 jrockway what is the output of your .t files?
21:37 allbery_b new section?
21:37 jrockway i only briefly looked at the problems, but they're things like "get the last element of a list"
21:37 allbery_b perhaps rigging the test harness so you can toggle its inclusion?
21:38 Ovid They are standard Perl 6 tests using the 'Test' module.
21:38 jrockway (easy in perl, harder in lisp :)
21:38 Ovid Oh, some of the problems get *much* harder.  There are other beginner ones like 'packing elements in a list into sublists and stuff'.
21:39 Ovid Of course, I don't think I'll be tackling the sudoku solver right away :)  (problem 97)
21:40 Ovid And I'm not even remotely able to write an Ada identifier syntax checker!
21:41 Ovid Oh, wait.  It actually turns out to be easy.  Never mind :)
21:44 Ovid Junctions are broken in Pugs?
21:44 Ovid Wow.  They're horribly broken!
21:46 Ovid ?eval use Test; plan 1; is 'b', any('a' .. 'h'), 'junctions should work';
21:46 evalbot_r14929 Error: *** Unsafe function 'use' called under safe mode␤    at -e line 16, column 7-138
21:46 Ovid :(
21:47 Debolaz :~(
21:58 Ovid ?eval sub a (Str $g, Str $e) { my $t := $g eq $e; $t ~~ s:P5:g/#/\\#/;say('whee!',$t) } a('b', any('a'..'h'));
21:58 evalbot_r14929 OUTPUT[whee!1␤whee!␤whee!␤whee!​␤whee!␤whee!␤whee!␤whee!␤] (Bool::True)
21:59 Ovid Yeah, that looks like a bug to me.
22:00 Ovid Ah, it's calling a() once every every item in the any() junction.
22:08 amf left perl6
22:13 Ovid OK, gotta run. Night all.
22:28 silug joined perl6
22:29 gnuvince joined perl6
22:36 jrockway ?eval 'b' == any('a', 'b', 'c')
22:36 evalbot_r14929 (Bool::True)
22:36 jrockway ?eval 'b' == any('a'..'z')
22:36 evalbot_r14929 (Bool::True)
22:36 jrockway that's horribly broken?
22:37 jrockway ?eval sub a(Str b){ b == 'a' } a(any('a'..'c'))
22:37 evalbot_r14929 Error: ␤Unexpected "Str"␤expecting "\\", ":", "*", parameter name or ")"
22:37 gnuvince joined perl6
22:37 jrockway ?eval sub a(Str b){ b == 'a' }; a(any('a'..'c'))
22:37 evalbot_r14929 Error: ␤Unexpected "Str"␤expecting "\\", ":", "*", parameter name or ")"
22:38 sili joined perl6
22:38 jrockway ?eval sub a (Str b){ b == 'a' }; a(any('a'..'c'));
22:38 evalbot_r14929 Error: ␤Unexpected "Str"␤expecting "\\", ":", "*", parameter name or ")"
22:38 jrockway jrockway-- # :(
22:39 sili left perl6
22:39 dduncan joined perl6
22:58 dmq joined perl6
22:59 dmq seen audreyt?
23:06 allbery_b ?seen audreyt
23:06 lambdabot audreyt is in #ghc, #haskell and #perl6. I last heard audreyt speak 22h 31m 53s ago.
23:09 Psyche^ joined perl6
23:09 weinig joined perl6
23:14 Aankhen`` joined perl6
23:25 Psyche^ is now known as Patterner
23:27 Aankhen`` joined perl6
23:32 Aankhen`` joined perl6
23:35 Aankhen`` joined perl6
23:45 sonorous joined perl6
23:49 Aankhen`` joined perl6
23:52 Aankhen`` joined perl6
23:53 luqui joined perl6
23:54 xpika joined perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs