Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-09-13

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 M_o_C joined #perl6
00:05 alester joined #perl6
00:13 ihrd joined #perl6
00:22 jdv79 left #perl6
00:26 payload joined #perl6
00:41 cotto joined #perl6
00:43 JimmyZ joined #perl6
00:43 JimmyZ rakudo: my Int = 'a';
00:43 JimmyZ rakudo: my Int $foo = 'a';
00:44 p6eval rakudo 446d49:  ( no output )
00:44 p6eval rakudo 446d49: OUTPUT«Assignment type check failed; expected Int, but got Str␤in Main (/tmp/5lDzGPNkby:2)␤»
00:47 JimmyZ rakudo: try{ my Int $foo = 'a'; }
00:47 p6eval rakudo 446d49:  ( no output )
00:48 JimmyZ rakudo: try{ my Int $foo = 'a'; CATCH { warn "Ops: $! " } }
00:48 p6eval rakudo 446d49:  ( no output )
01:03 Guest44537 joined #perl6
01:08 meppl joined #perl6
01:29 rdice joined #perl6
01:30 KatrinaTheLamia joined #perl6
01:35 sri_kraih joined #perl6
01:49 sri_kraih_ joined #perl6
02:01 jaldhar joined #perl6
02:10 c9s_ joined #perl6
02:12 patspam joined #perl6
02:33 mdxi joined #perl6
02:37 mdxi i love serendipity. couple days ago i'm out thrifting and stumble on "Introduction to Tagmemic Analysis", Cook, 1969. Being an addict for all things word-and-language, I grab it (besides, it's $2)
02:38 mdxi get home, do some googling to learn what's up before actually reading. 3 minutes later i'm reading a PDF form Allison form YAPC::EU 2002 adn looking at Perl6's given/when statement.
02:38 mdxi s/form/from/g
02:42 __ash__ i have a bool on cobol from the 70's i found in a thrift store
02:43 __ash__ and another book on computers from the 70's from a business perspective, it lists computers you can go rent for like $1300 an hour and how many  (or few) instructions they can process a second, etc.
02:43 __ash__ its very amusing considering the state things are in these days
02:48 diakopter pmichaud: maybe you know; does a viv Action:: ever get invoked but then backtracked away? or are the ast nodes certain by the time viv gets them?
02:51 snarkyboojum joined #perl6
02:56 __ash__ okay, this is probably a dumb question, but in bash how do you redirect stderr to stdout? or how would i do perl6 --trace=5 somefile.pl | grep 'somefunction'
02:58 mdxi stuff 2>&1 | otherstuff
02:59 __ash__ thanks, i really should know that by now, i knew it was something like that but didn't know exactly
03:02 jaldhar joined #perl6
03:05 agentzh joined #perl6
03:09 zamolxes_ joined #perl6
03:20 drbean joined #perl6
03:21 asciiville joined #perl6
03:28 jauaor joined #perl6
03:31 frew_ joined #perl6
03:31 drbean__ joined #perl6
03:34 tak11 joined #perl6
03:37 mepplock joined #perl6
03:40 colomon rakudo: for (1, 2, 3) Z (5, 3, 4) -> $a, $b { say "$a $b"; }
03:40 p6eval rakudo 446d49: OUTPUT«1 5␤2 3␤3 4␤»
03:41 cotto joined #perl6
03:43 __ash__ colomon, hows the trig stuff going? still looking into that?
03:44 colomon __ash__: Absolutely still looking into it.  Checked in a bunch more stuff today.
03:45 __ash__ are you done with the failing Num tests? didn't you get to the complex ones?
03:45 colomon I haven't worked out how to get Complex to work correctly, but I got sucked into fixing the Num functions.
03:45 colomon All the hyperbolic ones were broken, as well as several of the normal ones.
03:46 colomon I think my next step is going to be to whip up a code generator to generate trig tests, as there's just too much repetition and ugliness otherwise.
03:47 colomon After that, the inverse trig functions need to be tackled.  At least a few of those are broken as well.
03:47 __ash__ whats wrong with the complex numbers?
03:48 colomon They're calling the Parrot complex number versions of the functions rather than the Rakudo versions.
03:48 colomon Of course, most of the Rakudo versions aren't actually implemented yet, either.
03:49 colomon The other thing to do is fix the $base argument to be an enum, as per the spec.  That's another thing to tackle once the test generator is up and running.
03:50 colomon I'll probably be tinkering on it for at least another week.  :)
03:50 __ash__ rakudo: say (1 + 0i).PARROT;
03:50 p6eval rakudo 446d49: OUTPUT«Complex␤»
03:50 Entonian joined #perl6
03:50 __ash__ rakudo: say (1 + 0i).perl;
03:50 p6eval rakudo 446d49: OUTPUT«1+0i␤»
03:51 __ash__ would be nice if it was called ParrotComplex or something to tell the difference
03:51 colomon It says Complex, but it's still calling the Parrot version.  I've tested that pretty exhaustively.
03:52 colomon Yeah, I guess I don't know if the problem is that it's really complex (parrot version) but it says Complex, or that it calls complex.sin when it should call Complex.sin.
03:53 colomon rakudo: class Complex is also { multi method tan() { say "Hello!"; }; }; say (1 + 1i).tan;
03:53 p6eval rakudo 446d49: OUTPUT«0.271753+1.08392i␤»
03:54 colomon See?
03:54 __ash__ rakudo: say &(1 + 1i).tan.signature
03:54 p6eval rakudo 446d49: OUTPUT«Use of contextualizer & not implemented. at line 2, near ".tan.signa"␤in Main (src/gen_setting.pm:3043)␤»
03:54 __ash__ rakudo: say &((1 + 1i).tan).signature;
03:55 p6eval rakudo 446d49:  ( no output )
03:55 alester joined #perl6
03:55 __ash__ rakudo: say &(5.tan).signature;
03:55 p6eval rakudo 446d49: OUTPUT«Use of contextualizer & not implemented. at line 2, near ".signature"␤in Main (src/gen_setting.pm:3043)␤»
03:56 colomon Anyway, need to get bed now.  Busy day ahead tomorrow.  Let me know if you come up with anything brilliant on the Complex problem.  :)
03:56 __ash__ i'll probably mess around with it some, at least maybe for identifing which complex your actually using (if you could easily tell the difference between a parrot complex and a perl complex it would be easier)
03:57 __ash__ rakudo: say (1 + 1i).WHAT
03:57 p6eval rakudo 446d49: OUTPUT«Complex()␤»
03:57 __ash__ rakudo: say ((1 + 1i) + 1).WHAT;
03:57 p6eval rakudo 446d49: OUTPUT«Complex()␤»
04:01 s1n is there any sort of specification for NQP? that is, how much is and is not supported?
04:12 JimmyZ s1n: http://docs.parrot.org/parrot/latest/html/ PCT
04:12 lambdabot Title: Parrot 1.5.0 - Home
04:13 dukeleto joined #perl6
04:13 JimmyZ s1n: http://docs.parrot.org/parrot/latest/​html/docs/book/pct/ch05_nqp.pod.html
04:13 lambdabot Title: Parrot - Grammar Actions, http://tinyurl.com/phluqx
04:17 s1n JimmyZ: thanks, this isn't so much what i want though, i'm curious how much or little of perl6 NQP (and PGE) are of perl6... there's no language spec that i know of, just wanted to know if anyone has documented the differences
04:18 JimmyZ s1n: take a look at rakudo. I think.
04:18 s1n JimmyZ: yes, but that's only seeing 1 example, which may or may not use everything available
04:20 JimmyZ NQP is written by PM, and it is mainly for rakudo.
04:20 s1n JimmyZ: yes, i am aware of that
04:21 patspam joined #perl6
04:24 JimmyZ s1n: I think you should read the source code, for more.
04:25 s1n JimmyZ: naw, i'll just ask pmichaud when i see him next weekend
04:26 JimmyZ s1n: :)
04:27 frew_ joined #perl6
04:30 s1n phenny: tell pmichaud i'm looking for specifics on nqp; hit me up if you have any info for me
04:30 phenny s1n: I'll pass that on when pmichaud is around.
04:51 payload joined #perl6
05:48 REPLeffect joined #perl6
06:10 agentzh joined #perl6
06:25 synth joined #perl6
06:36 Lorn joined #perl6
06:40 orafu joined #perl6
07:01 cotto joined #perl6
07:12 dukeleto joined #perl6
07:12 alester joined #perl6
07:19 petdance joined #perl6
07:26 mikehh rakudo (0f1edeb) builds on parrot r41247 - make test PASS / make spectest (up to 28222) FAIL - Ubuntu 9.04 amd64
07:26 mikehh rakudo - t/spec/S12-introspection/walk.rakudo FAILs and t/spec/S03-operators/arith.rakudo - TODO passed:   120, 131-132
07:27 mikehh Note - t/spec/S03-operators/arith.rakudo - TODO passed:   131 only on i386
07:28 mikehh and also no more Segmentation faults here
07:40 Tene joined #perl6
07:43 rfordinal joined #perl6
07:55 cotto joined #perl6
07:55 pugs_svn r28223 | fglock++ | mp6 - Javascript stub
07:56 Su-Shee joined #perl6
07:56 Su-Shee good morning. :)
07:56 Matt-W Good morning
07:56 KatrinaTheLamia good morning
07:58 KatrinaTheLamia btw... something was mentioned a _long_ time ago about jhiard(sp?) offering shell accounts to some people... I could check my logs about it (which would take quite some time BTW), or I can ask again here.
07:58 mberends KatrinaTheLamia: email juerd@juerd.nl
08:02 KatrinaTheLamia mberends, thank you kindly ^.^
08:16 KatrinaTheLamia and the email has been sent... awaiting my rejection letter style reply ^.^
09:34 M_o_C joined #perl6
09:52 sharada joined #perl6
09:55 pmurias joined #perl6
09:57 pmurias KatrinaTheLamia: feather accounts are given to all people interested
09:58 pmurias KatrinaTheLamia: they are intended for Perl6 related activities only
10:46 Whiteknight joined #perl6
10:53 pmurias_ joined #perl6
11:11 molaf joined #perl6
11:18 cono joined #perl6
11:23 Guest44537 joined #perl6
11:45 jferrero joined #perl6
12:22 digitalise joined #perl6
12:26 jauaor left #perl6
12:33 alexn_org joined #perl6
12:43 diakopter anyone around read japanese?
12:45 diakopter nm; google translate is my friend
12:50 Su-Shee left #perl6
12:51 Eevee_ joined #perl6
12:56 diakopter rakudo: say »ö«
12:56 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near " \x{bb}\x{f6}\x{ab}"␤in Main (src/gen_setting.pm:2565)␤»
12:56 diakopter rakudo: say '»ö«'
12:56 p6eval rakudo 446d49: OUTPUT«»ö«␤»
12:57 icwiener joined #perl6
12:57 diakopter pmurias: hi
12:59 carlin rakudo: say «ö»
12:59 p6eval rakudo 446d49: OUTPUT«ö␤»
13:02 diakopter heh
13:20 carlin How do you make a rule case-insensitive?
13:26 agentzh joined #perl6
13:28 payload joined #perl6
13:42 carlin rakudo: if * ~~ /foo/ { };
13:42 p6eval rakudo 446d49: OUTPUT«Object must be created by a class.␤in regex PGE::Grammar::_block54 (/tmp/W6W5tsaYUS:1)␤called from Main (/tmp/W6W5tsaYUS:2)␤»
13:48 pmurias diakopter: hi
14:09 nihiliad joined #perl6
14:13 Juerd carlin: With :i
14:14 Juerd rakudo: say("foObAr" ~~ /:i oba/)
14:14 p6eval rakudo 446d49: OUTPUT«ObA␤»
14:15 Juerd carlin: :i is short for :ignorecase and is documented in Synopsis 5, http://perlcabal.org/syn/S05.html
14:15 lambdabot Title: S05
14:18 carlin Juerd: right, but how do I do that with a rule {} block?
14:18 Juerd rule quux { :i xyzzy }
14:21 carlin Argh, I thought I had tried that
14:21 carlin but it works so I guess not. Thanks Juerd++
14:33 davidfetter joined #perl6
14:34 zamolxes joined #perl6
14:37 davidfetter left #perl6
14:46 Psyche^ joined #perl6
14:46 SmokeMachine joined #perl6
14:50 jan__ joined #perl6
14:50 nihiliad joined #perl6
15:00 JimmyZ joined #perl6
15:05 c1sung joined #perl6
15:22 Jedai joined #perl6
15:24 pugs_svn r28224 | jimmy++ | [Spec/S03-operators.pod]fixed POD format.
15:45 molaf joined #perl6
15:48 abra joined #perl6
16:00 __ash__ joined #perl6
16:24 frew_ joined #perl6
16:31 tylerni7 joined #perl6
16:33 cotto joined #perl6
16:39 zloyrusskiy joined #perl6
16:48 abra joined #perl6
16:55 nbrown joined #perl6
16:57 araujo joined #perl6
17:02 abra joined #perl6
17:03 moritz_ re
17:03 lambdabot moritz_: You have 2 new messages. '/msg lambdabot @messages' to read them.
17:03 moritz_ @massages
17:03 lambdabot mncharity said 5m 15d 17h 18m 15s ago: re p6 project advertising, it might be worth doing a "state of p6", high-visibility general posting to the p5 community at some point. a tiny sample of
17:03 lambdabot comments on #moose suggests even active p5 developers don't quite realize how shoestring the effort is.
17:03 lambdabot wayland76 said 3m 22d 12h 52m 5s ago: Can eternaleye have a commit bit for the Specs so he can work on S22 please?
17:05 moritz_ @tell wayland76 you can hand out commit bits yourself at <http://commitbit.pugscode.or​g/admin/project/Pugs/people>
17:05 lambdabot Consider it noted.
17:05 moritz_ I hope somebody else gave eternaleye a commit bit in the mean time?
17:06 __ash__ moritz_ do you know an easy way to tell if the class an object is, is the parrot version or the perl version?
17:06 __ash__
17:07 moritz_ __ash__: don't know - if .PARROT doesn't reveal that information, I don't think so
17:07 pugs_svn r28225 | moritz++ | [t/spec] delete die-arg-preservation.t which is simply wrong
17:07 pugs_svn r28226 | moritz++ | [t/spec] get rid of S06-operator-overloading/method.t
17:07 pugs_svn r28226 |
17:07 pugs_svn r28226 | I deleted half of the tests because they were wrong, the others went into
17:08 pugs_svn r28226 | sub.t
17:08 pugs_svn r28227 | moritz++ | [t/spec/TODO] more spec changes as TODOs
17:08 __ash__ rakudo: class Complex is also { multi method tan() { say "Hello!"; }; }; say (1 + 1i).tan;
17:08 p6eval rakudo 446d49: OUTPUT«0.271753+1.08392i␤»
17:08 pugs_svn r28228 | moritz++ | [t/spec] tests for Rat and Complex literals
17:08 pugs_svn r28229 | moritz++ | update test according to r28201
17:08 pugs_svn r28230 | moritz++ | [t/spec] forbid lists and ranges as Range end points (as per r28171)
17:08 pugs_svn r28231 | moritz++ | [t/spec] initial tests for :my, :our, :state, :constant in regexen
17:13 __ash__ this is mainly related to complex numbers is why i ask, its hard to figure out if your dealing with the perl complex or the parrot complex for tests
17:13 abra joined #perl6
17:15 moritz_ I don't understand the interaction between parrot's Complex and rakudo's Complex at all.
17:15 __ash__ how do you get a method signature? isn't it like &method.signature?
17:16 __ash__ rakudo: sub a { }; say &a.siganture;
17:16 p6eval rakudo 446d49: OUTPUT«Method 'siganture' not found for invocant of class 'Perl6Sub'␤»
17:16 __ash__ helps spelling it correctly...
17:16 __ash__ rakudo: sub a { }; say &a.signature;
17:16 p6eval rakudo 446d49: OUTPUT«Signature()<0xb6895e28>␤»
17:17 __ash__ rakudo: say &((1 + 1i).tan).signature;
17:17 p6eval rakudo 446d49: OUTPUT«Use of contextualizer & not implemented. at line 2, near ".signature"␤in Main (src/gen_setting.pm:3043)␤»
17:18 moritz_ .signature.perl
17:18 __ash__ rakudo: say &((1 + 1i).tan).signature.perl;
17:19 p6eval rakudo 446d49: OUTPUT«Use of contextualizer & not implemented. at line 2, near ".signature"␤in Main (src/gen_setting.pm:3043)␤»
17:19 tak11 joined #perl6
17:21 justatheory joined #perl6
17:23 Juerd rakudo: say (1, 5).sum
17:23 p6eval rakudo 446d49: OUTPUT«Method 'sum' not found for invocant of class 'List'␤»
17:23 Juerd Oh.
17:23 moritz_ use [+] instead
17:24 Juerd I know it exists, but I wanted a close translation of some original code :)
17:25 __ash__ rakudo: say [+] 1, 2, 3, 4;
17:25 p6eval rakudo 446d49: OUTPUT«10␤»
17:26 mberends rakudo: ([+](1,5)).say
17:26 p6eval rakudo 446d49: OUTPUT«6␤»
17:27 Juerd mberends: I think say [+] 1, 5; is clearer.
17:27 * Juerd is not a big fan of parens.
17:27 * __ash__ flashbacks to lisp (+ 1 5)
17:28 * sharada prefer (+ 1 5) to (+ 1, 5)
17:28 * moritz_ prefers 1 + 5
17:32 __ash__ (format t "Num: ~D~%" (+ 1 5)) ;; if memory serves
17:35 moritz_ @clear messages
17:35 lambdabot Messages cleared.
17:35 Juerd Hm, rakudo doesn't like my huge regex
17:35 Juerd Uses lots and lots of memory
17:35 arnsholt __ash__: The CLHS agrees with you
17:35 arnsholt ~a would probably work as well
17:35 __ash__ yeah but its an int, so might as well call it that
17:36 arnsholt True, true
17:36 Juerd http://feather.perl6.nl/~juerd/big_regex.p5.txt
17:36 Juerd http://feather.perl6.nl/~juerd/big_regex.p6.txt
17:36 Juerd Too big? :)
17:36 arnsholt Juerd: Hilfe!
17:36 __ash__ Juerd, you just broke my brain
17:36 Juerd arnsholt: Ich spreche kein Deutsch! :)
17:37 arnsholt Me neither =)
17:37 Juerd Parrot VM: PANIC: Out of mem!
17:37 Juerd Aw :(
17:38 rewt joined #perl6
17:42 pugs_svn r28232 | moritz++ | [S05] since \# is forbidden, s/unescaped/unquoted/
17:42 synth joined #perl6
17:42 pugs_svn r28233 | moritz++ | [S03] ^4 cannot mean 0..3 and 0..^4 at the same time, because they are not the same
17:51 __ash__ http://gist.github.com/186256 is one of my favorite obfuscated C programs
17:51 lambdabot Title: gist: 186256 - GitHub
17:52 moritz_ ;-)
17:54 arnsholt Now that is cool
17:55 Zloyrusskiy joined #perl6
17:55 __ash__ it compiles too, you need ncurses for it to work though
18:19 kidd_ joined #perl6
18:29 Matt-W moritz_: Good blog post
18:31 moritz_ Matt-W: thanks
18:32 moritz_ I just think that it's a point theoretical/pointless for the outsiders (aka not-yet-perl-6-hackers)
18:33 __ash__ is there a way in perl6 to return code? I imagine macro's would be the way to do it, but what i mean is more like, if you know ruby, say their attr_accessor :attr syntax
18:34 moritz_ macros can return ASTs, but are NYI
18:34 moritz_ you can return closures
18:34 moritz_ I guess attr_accessor is something like has $.public_attr?
18:35 Matt-W I just looked it up, it seems to be a method for creating accessor methods automatically
18:35 Matt-W so yes, it's rather like has $.attr is rw;
18:37 moritz_ __ash__: there'll surely be ways to add methods to classes via the meta class
18:37 moritz_ but I don't think it's specced in detail yet
18:37 __ash__ got yeea
18:38 __ash__ http://yehudakatz.com/2009/06/04/the-i​mportance-of-executable-class-bodies/ has example of what exactly i am referring to more or less
18:38 lambdabot Title: The Importance of Executable Class Bodies « Katz Got Your Tongue?, http://tinyurl.com/q66yjz
18:39 __ash__ I imagine some of that can be done with macro's but then there are some things that seem like it would need a bit more than macros to implement
18:43 __ash__ like the lazy example at the bottom of that post, which maybe there is a whole different way of doing that sort of thing in perl6 but thats more or less what i am referring to
18:44 moritz_ $yourClass.^add_method($some_closure)
18:44 moritz_ not yet specced as such
18:45 __ash__ ah, okay, cool
18:45 moritz_ the standard meta class really needs specs
18:45 moritz_ rakudo and smop both implement it paritially
18:46 __ash__ is there a spec out there for it yet?
18:47 moritz_ no
18:47 moritz_ unless you write one ;-)
18:47 __ash__ lol
18:47 __ash__ i'd be willing it give my opinion on it, but writing the whole thing is probably beyond my capabilities
18:48 moritz_ a partial one would be great already
18:49 __ash__ i have to say ruby and smalltalk have influenced my opinion on OO meta programming quite a bit, i have yet to find an OO language that rivals ruby for meta programming capabilities, but perl6 looks more like the kind of language i like all things considered, i like all the other features it has that aren't OO because OO isn't 'the one true way'
18:49 moritz_ (and I mean it, really. No super-wizard skills required for the intial version - others will refine it as needed)
18:50 Matt-W The OO/lazy functional hybrid approach seems to work very well
18:51 __ash__ i can write up my ideas if you want and send them to you moritz_
18:52 moritz_ that would be great
18:53 __ash__ i think it kind of speaks for functional programming that in all the implementations i have seen they can never stay 'purely functional' and be a productive language, but many of the ideas from them have made there way into non-functional languages
18:53 moritz_ or maybe even to p6l, because others have interest in that too
18:53 arnsholt Is there anyone that uses OS X for Rakudo development?
18:54 __ash__ arnsholt: i do
18:54 __ash__ 10.6.1
18:54 moritz_ masak does, too
18:54 __ash__ arnsholt: need me to test something OS specific?
18:55 arnsholt When I run make test/spectest, there seems to be a lot of tests that are marked as dubious (Test returned status 0 (wstat 10, 0xa)\nafter all the subtests completed successfully)
18:55 arnsholt Is this a sign of something not quite right with my setup, or just a normal thing?
18:55 moritz_ arnsholt: could you please updated to latest parrot and try again?
18:56 moritz_ I had these problems too, but they seem mostly gone now with parrot r41252
18:56 arnsholt 'k. I'll do that and report back
18:56 meppl joined #perl6
18:58 __ash__ mine still does that on some tests with the newest parrot, i haven't really looked into what it is exactl
18:58 __ash__ y
18:59 pugs_svn r28234 | fglock++ | mp6 - Javascript update
18:59 finanalyst joined #perl6
19:00 finanalyst @seen moritz_
19:00 lambdabot moritz_ is in #perl6. I last heard moritz_ speak 3m 55s ago.
19:00 finanalyst moritz_: ping
19:00 moritz_ finanalyst: pong
19:03 finanalyst hi moritz. Just saw your change to S03 on ranges. I dont think 'exclusively' is sufficiently clear.
19:03 finanalyst possibly 'upto but not including its argument'
19:04 finanalyst and add an example using a fractional :by
19:04 finanalyst am i being clear?
19:04 moritz_ finanalyst: yes - feel free to change that
19:04 finanalyst ok. will try
19:04 moritz_ great!
19:05 mberends perl6 -v
19:05 finanalyst Specs still in pugs?
19:05 moritz_ yes
19:18 finanalyst mortiz_: applogies, but what it is the correct way to commit an update?
19:19 moritz_ finanalyst: are you familiar with svn?
19:19 finanalyst i use a GUI called rapidsvn
19:20 finanalyst i have downloaded just the directory with the specs and I got a commit bit a long time ago from Audrey
19:20 moritz_ then you need to change the file
19:21 finanalyst changed the file
19:21 moritz_ then you need to commit it
19:21 finanalyst that's all?
19:21 moritz_ that's all
19:21 finanalyst no need to do a diff?
19:22 moritz_ you can do that for sanity checking
19:23 moritz_ but the diff that's sent to the p6l list ist generated automatically for you
19:24 moritz_ finanalyst: and if you do mess something up, it can be easily reverted
19:24 finanalyst now i cant remember my password
19:24 finanalyst it was a long time ago
19:25 moritz_ I can re-send your password
19:25 moritz_ is richard@\w+.ru correct?
19:25 finanalyst please. yes
19:26 finanalyst thanx
19:29 pugs_svn r28235 | finanalyst++ | clarifying ^4 in a range and including a fractional example
19:29 finanalyst moritz_: finally remembered it
19:30 __ash__ does perl6 have a 'method_missing' like functionality right now?
19:30 moritz_ what's that?
19:30 __ash__ in ruby on an object if you call a method that doesn't exist it calls that function (which is actually whats throwing the MethodMissingException
19:30 __ash__ )
19:31 moritz_ ah, like AUTOLOAD in Perl 5
19:31 moritz_ grep the specs for CANDO, iirc it provides a similar mechanism
19:34 moritz_ finanalyst: note that ^$number :by didn't used to be specced
19:34 moritz_ the case where it made a difference before was smart-matching
19:34 moritz_ 3.5 ~~ ^4 # true
19:34 moritz_ 3.5 ~~ 0..3 # false
19:34 __ash__ okay, got ya moritz_ thanks
19:35 finanalyst moritz_: i assumed it was intended
19:36 finanalyst as otherwise how would 0 ..^ 4 be different from ^4?
19:36 finanalyst just the smart match?
19:36 moritz_ good point
19:38 finanalyst daren duncan has just emailed me on the same topic
19:39 moritz_ if adverbs work on prefix operators, I see no point in not having them work on prefix:<^>
19:39 finanalyst nevertheless, if what I suggested is a no-no, then it's probable others like me will jump to the same conclusion
19:40 moritz_ let's see if others complain ;-)
19:41 __ash__ is there currently a spec for a method thats called when a role is included into a class?
19:41 finanalyst daren has just taken back his objection :)
19:42 moritz_ __ash__: afaict it's a bit more complicated...
19:42 moritz_ __ash__: there's of course the multi 'does' which is called for 'class A does B { ... }'
19:42 finanalyst __ash__: interesting question, but why would you want one
19:42 molaf joined #perl6
19:43 moritz_ __ash__: second there must a be a method on the meta class to (tentatively) add a role (let's say A.^compose(B))
19:43 moritz_ __ash__: and then there's a method that's called when the class composition is finished
19:43 moritz_ the reason is that a role may never conflict with itself
19:44 moritz_ if you have role D { }; role B does D { }; role C does D { }; class A does C does B { }, the methods from D don't conflict
19:45 moritz_ so composition is not performed immediately when calling .^compose, but later when the class construction is finished
19:45 __ash__ finanalyst: lots of reasons if you want an example of how a similiar functionality is useful in ruby look at the DataMapper library
19:46 __ash__ yeah, it would be better to have a function you can call when the class is finished being constructed
19:46 moritz_ put it into your metaclass spec ;-)
19:47 __ash__ in the DataMapper ruby library they effectively have a role called Resource that lets them turn any object into a persistable object without screwing up inheritence (so you don't have to inherit from some table class or w/e)
19:47 __ash__ i am, i am trying to think of the kinds of things i'd include in it, i am outline what i consider useful meta features right now
19:47 __ash__ then i'll try to flush out the ideas a bit more
19:48 finanalyst Does ruby have both roles and classes (or the equivalents) - sorry, but i have never used ruby
19:48 __ash__ finanalyst yeah it does
19:48 moritz_ it certainly help to have people with different backgrounds working on that
19:50 __ash__ say you had a big project and wanted a few random bits of data to be persistent, thats where you could define a simple role to include in a few objects and have them behind the scene's know how to persist themselves based off the role rather than the more traditional approach of inheriting from some DB table object, which you see a lot of
19:50 __ash__ that is a great example of how/why roles are useful
19:52 reqamst joined #perl6
19:52 __ash__ http://datamapper.org/doku.php?id=getting_​started_with_datamapper#define_your_models is an example of the ruby way of doing that, its simple and readable, the property function returns a constructor to object accessors that know how to make themselves into database table columns, then you can add your Object#save anywhere and it knows how to save its state
19:52 lambdabot Title: getting_started_with_datamapper [DataMapper], http://tinyurl.com/pbpmqa
19:53 __ash__ thats a lot of fancy metaprogramming but in the end it makes things really easy to work with and gives you clean ways of defining what you need in your class
19:54 finanalyst i misunderstood the aim of the question. i wasnt asking why roles are a good idea, but why there would need to be a method called when composing a role into a class, in other words why would a progammer want to have access to such a method.
19:56 moritz_ finanalyst: for all sorts of things. For example role composition, as I mentioned to __ash__ earlier
19:56 __ash__ okay, here's a simple example, say you have a function in a base class A with a method foo
19:56 moritz_ finanalyst: role composition is delayed up to the point where the class is fully composed to avoid roles confliciting with itself
19:56 moritz_ so the thing that composes roles must have a callback
20:02 __ash__ datamapper uses the included method to keep track of all of the objects that are supposed to be persistable too, so every time something includes Resource it adds that to another object to keep track of that
20:02 __ash__ it also has an inherited method so if a class that includes a resource is inherited it can keep track of that too so you can do STI (single table inheritence, a db thing)
20:04 __ash__ so you have Person, which includes Resource, so it knows to make a table called person, then you have Worker < Person, so worker is a child of Person, this shouldn't be a new database table, it should be STI
20:05 __ash__ there are at least 2 useful meta callbacks in that, 1 called when the role is added to a class, 1 that is called when a class is inherited into another class
20:05 arnsholt __ash__/moritz_: I get 14 dubious (returned 0 after all tests successful) with latest parrot
20:06 moritz_ hrmpf. 14 is far too much, but better than the about 50 that I was getting with older parrots
20:07 __ash__ something is exiting with a bad status
20:08 finanalyst left #perl6
20:09 moritz_ if anybody has new findings in that matter, please comment on https://trac.parrot.org/parrot/ticket/998
20:13 __ash__ moritz_ i have noticed that sometimes rakudo gets bus errors and segfaults as the program is finishing, everything runs but i still get the errors
20:14 moritz_ __ash__: yes, there are two classes of such problems. One is the so-called "inferior run-loop problem" when eval()s die under certain circumstances and are caught later on. The other one is quite new and we don't know yet what's the problem
20:20 mberends moritz_, with r41199 perl6 -v segfaulted at exit on Ubuntu x86. r41253 is ok...
20:20 Confield left #perl6
20:22 Confield joined #perl6
20:23 zamolxes joined #perl6
20:35 frettled You guys are just great, you provide me with blogging material each and every week.  :D
20:45 __ash__ frettled what your blog?
20:45 frettled __ash__: howcaniexplainthis.blogspot.com
20:47 abra joined #perl6
20:48 __ash__ have any comments on meta classes?
20:49 frettled nopes, I haven't taken the time to wrap my head around them
20:49 moritz_ src/classes/ClassHOW.pir might be worth a read
20:49 KatrinaTheLamia joined #perl6
20:51 __ash__ k, well if you have any ideas let me know, i am taking up moritz_ challenge of writing a preliminary meta-magic spec
20:52 moritz_ __ash__++
20:52 frettled __ash__: will do, but I don't think it's likely to happen soon, busy times for me :(
20:52 __ash__ no worries
20:54 frettled but definitely __ash__++ :D
20:55 __ash__ isn't there something about doing somehthing related to generics in perl6? like with roles?
20:55 moritz_ there are parameterized roles
20:55 __ash__ class A does Role[Something] {} ?
20:55 moritz_ yes
20:55 moritz_ (defined in S14, and implemented in Rakudo already)
20:55 __ash__ kk, just checking
20:56 frettled parametrized roles are cool braintwisters.
20:56 moritz_ which actually is a signature
20:56 moritz_ and you can do multi dispatch on multiple parameterized roles
20:57 mhymn joined #perl6
20:57 moritz_ rakudo: role A[Int $x { where $x < 12 }] { method size { 'small' } }; role A[Int $x] { method size { "$x is large" } }; class B does A[3] { }; B.new.size
20:57 p6eval rakudo 446d49: OUTPUT«Unable to parse 'generic role'; couldn't find final ']' at line 2, near "{ where $x"␤in Main (src/gen_setting.pm:3469)␤»
20:58 moritz_ rakudo: role A[Int $x where { $x < 12 }] { method size { 'small' } }; role A[Int $x] { method size { "$x is large" } }; class B does A[3] { }; say B.new.size
20:58 p6eval rakudo 446d49: OUTPUT«Potential internal error: bindability check may have done more than just binding.␤small␤»
21:00 jferrero joined #perl6
21:00 moritz_ rakudo: say (4/6).perl
21:00 p6eval rakudo 446d49: OUTPUT«2/3␤»
21:02 __ash__ how do attributes work in inheritence?
21:02 moritz_ they don't
21:02 moritz_ attributes are private to the current class
21:02 moritz_ only accessors are inherited (being normal methods)
21:03 __ash__ hmmm so no way for their to be 'cross class' variables?
21:03 __ash__ like a variable thats inherited into its children
21:03 moritz_ well, if you declare an attribute as 'has $.attrib is rw' it's as though the variables was inherited
21:04 moritz_ but it's really just the accessors that are inherited
21:05 mikehh rakudo (0f1edeb) builds on parrot r41254 - make test PASS / make spectest (up to 28235) FAIL (1 test) - Ubuntu 9.04 amd64
21:05 mikehh rakudo - t/spec/S12-introspection/walk.rakudo FAILs and t/spec/S03-operators/arith.rakudo - TODO passed:   120, 131-132
21:05 mikehh rakudo - no Segmentation faults reported in make spectest
21:05 pugs_svn r28236 | moritz++ | [evalbot] build parrot and rakudo with ccache and --optimize
21:05 __ash__ but if Workers has our $.total is rw that is incremented when its makes a new worker, and you subclass it and make a new instance of a subclass, would it effect Workers?
21:05 __ash__ s/Workers/Workers total/
21:06 moritz_ no
21:06 moritz_ I got you wrong
21:06 moritz_ you mean things like class attributes, no?
21:07 __ash__ okay, understandable
21:07 moritz_ class Worker { our $total = 0; ... }
21:07 moritz_ submethod BUILD { $total++ }
21:14 moritz_ and then 'method total() is rw { $total} ' to achieve inheritance of $total (NYI in Rakudo)
21:15 arnsholt Hmm. Running spectest on my Mac returns a lot of funky errors
21:15 arnsholt Or, some at least
21:16 __ash__ arnsholt: what errors?
21:16 arnsholt Two Parrot backtraces, a malloc error (free of an unallocated pointer) and a bus error
21:16 arnsholt And a bucketload of dubiouses
21:17 moritz_ with which exit status? 11?
21:18 arnsholt Looks like most of them return 10
21:22 __ash__ mine always exits with a Bus Error
21:23 arnsholt I'm not quite at the end yet
21:36 krzys joined #perl6
21:37 krzys ?
21:55 arnsholt Right. 134 failed test scripts, one of which (t/spec/S12-introspection/walk.rakudo) actually failed any tests (4)
21:58 arnsholt Which command does prove run to execute a single test script?
21:59 moritz_ first 't/spec/fudge --keep-exit-code rakudo $filename' or so, then ./perl6 $fudged_filename
22:00 KatrinaTheLamia joined #perl6
22:03 arnsholt Right. Looks like the bad return values are from bus errors (like __ash__ said)
22:04 moritz_ dammit. And they just went away on amd64.
22:05 arnsholt Are Rakudo/Parrot built with or without debugging symbols?
22:05 moritz_ with, per default (I think)
22:05 moritz_ at least gdb gives you stack traces
22:06 arnsholt I think you get those without symbols as wel
22:06 arnsholt +l
22:08 arnsholt From build/gen_parrot.pl and Configure.pl it doesn't look like it builds with debugging symbols
22:08 arnsholt But that's not really important I suppose
22:08 arnsholt I'll get that stacktrace first
22:09 arnsholt Right. This is annoying
22:10 arnsholt When I tried it in gdb it exited normally
22:10 * moritz_ exits normally to bed
22:10 arnsholt And same when I tried it outside of gdb, this time
22:10 moritz_ ttfn folks
22:10 * arnsholt is confused
22:12 arnsholt Hmm. Looks like this error is somewhat transient
22:14 arnsholt Going from the fact that I got a warning about trying to free something that wasn't allocated, I suppose it's possible this is related
22:28 omega joined #perl6
22:29 Confield joined #perl6
22:30 yahooooo joined #perl6
22:30 p6eval joined #perl6
22:33 arnsholt joined #perl6
22:34 awwaiid joined #perl6
22:34 jaldhar joined #perl6
22:35 nbrown joined #perl6
22:36 pnu joined #perl6
22:37 rhr joined #perl6
22:37 Eevee joined #perl6
22:37 synth joined #perl6
22:38 arthur-_ joined #perl6
22:41 Entonian joined #perl6
22:59 snarkyboojum joined #perl6
23:06 Whiteknight joined #perl6
23:06 snarkyboojum_ joined #perl6
23:13 nbrown_ joined #perl6
23:15 nbrown_ joined #perl6
23:23 sm^^^ joined #perl6
23:30 jrtayloriv joined #perl6
23:35 Entonian joined #perl6
23:54 nbrown joined #perl6

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

Perl 6 | Reference Documentation | Rakudo