tylercurtis rakudo: sub Good ($time) { say "Good $time #perl6." }; Good time #perl6 00:00
p6eval rakudo 8827d0: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
ash_ rakudo: sub Good ($time) { say "Good $time \#perl6." }; Good time # note the \# 00:02
00:02 mfollett joined
p6eval rakudo 8827d0: OUTPUT«Good 1285889946 #perl6.␤» 00:02
ash_ although 128589946 is not as meaningful as one would hope
tylercurtis std: sub Good ($time) { say "Good {$time.perl} #perl6." }; Good time # perl6
p6eval std 1d6fdf3: OUTPUT«ok 00:02 119m␤»
tylercurtis rakudo: sub Good ($time) { say "Good {$time.perl} #perl6." }; Good time # perl6
p6eval rakudo 8827d0: OUTPUT«Good 1285889998 #perl6.␤» 00:03
tylercurtis rakudo: sub Good ($time) { say "Good $time #perl6." }; Good now # perl6
p6eval rakudo 8827d0: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
tylercurtis rakudo: sub Good ($time) { say "Good $time \#perl6." }; Good now # perl6
p6eval rakudo 8827d0: OUTPUT«Good Instant:2010-09-30T23:40:32.751667Z #perl6.␤»
tylercurtis Interesting. I wonder if that's submitted. 00:04
masonkramer doesn't see the bug
tylercurtis STD parses it but Rakudo doesn't. 00:06
std: sub Good ($time) { say "Good $time #perl6." }; Good time #perl6
p6eval std 1d6fdf3: OUTPUT«ok 00:01 119m␤»
ash_ std: sub Good ($time) { say "Good $time \#perl6." }; Good time
p6eval std 1d6fdf3: OUTPUT«ok 00:01 119m␤»
ash_ hmmm
wonder what's up with that 00:07
masonkramer oh
tylercurtis rakudo: "#foo";
p6eval rakudo 8827d0: ( no output )
tylercurtis rakudo: "$_ #foo";
p6eval rakudo 8827d0: OUTPUT«===SORRY!===␤Confused at line 22, near "\"$_ #foo\";"␤»
00:13 colomon_ joined, colomon left, colomon_ is now known as colomon
masonkramer rakudo: say "#foo"; say "$_ #foo" 00:13
p6eval rakudo 8827d0: OUTPUT«===SORRY!===␤Confused at line 22, near "say \"$_ #f"␤»
masonkramer rakudo: say "#foo" 00:14
p6eval rakudo 8827d0: OUTPUT«#foo␤»
masonkramer rakudo doesn't print the value of the last expression
00:17 stkowski left 00:20 jest left 00:22 mfollett left 00:27 jferrero left 00:28 jest joined, jest left 00:32 mavrc left 00:35 nymacro left 00:48 fod joined 00:54 tylercurtis left 01:01 isBEKaml left 01:04 envi joined 01:17 tylercurtis joined 01:19 mfollett joined 01:25 mfollett left 01:31 satyavvd joined 01:34 bluescreen left, satyavvd_ joined 01:35 satyavvd left, satyavvd_ is now known as satyavvd 01:36 satyavvd left 01:37 molaf__ joined 01:41 molaf_ left, am0c^ joined 01:50 meppl left 01:52 meppl joined 02:03 daemon left 02:05 daemon joined 02:06 TiMBuS joined 02:10 lue left, lue joined 02:11 dominix joined 02:19 mfollett joined 02:20 mfollett left 02:22 Italian_Plumber left
colomon rakudo: role A { has $.b; }; my $c = A.new(:b(10)); say :$c.perl; 02:33
p6eval rakudo 8827d0: OUTPUT«"c" => .new(b => 10)␤»
colomon rakudo: role A { has $.b; }; my $c = A.new(:b(10)); say $c.b;
p6eval rakudo 8827d0: OUTPUT«10␤»
colomon that doesn't seem to be working in my current code. :\ 02:39
oh wait, yes it is. hmmm. 02:41
02:43 leprevost joined
masonkramer oh. now I get tylercurtis's bug =P 02:44
02:44 duff joined 02:48 Italian_Plumber joined 02:50 leprevost left 02:56 justatheory left 02:59 Italian_Plumber left 03:04 Italian_Plumber joined 03:05 LionMadeOfLions left 03:13 LionMadeOfLions joined 03:25 duff is now known as PerlJam 03:28 Italian_Plumber left 03:29 Italian_Plumber joined 03:32 Italian_Plumber left 03:33 Italian_Plumber joined 03:42 meppel joined 03:46 meppl left 03:47 dukeleto joined, Schwern joined 03:54 Italian_Plumber left 03:55 nymacro joined, Italian_Plumber joined 03:56 dominix left 03:59 satyavvd joined 04:04 Italian_Plumber1 joined 04:05 mikehh left, Italian_Plumber left 04:15 PerlJam left 04:20 exodist is now known as Exodist 04:22 ggoebel left 04:25 Italian_Plumber1 left 04:31 xinming_ joined 04:33 xinming left 04:43 am0c^ left 04:51 sftp left 04:56 pythonian4000 is now known as pythonian4000afk 04:59 jql joined 05:23 Guest23195 joined 05:44 masonkramer left, masonkramer joined, ash_ left 05:45 justatheory joined 05:47 justatheory left, tylercurtis left 05:50 grew left
sorear good * #perl6 06:04
(thunderstorms really crimp my hacking time. otoh, they're quite pretty.)
FWIW, I plan to completely ignore TheDamian 06:10
06:12 fod left 06:16 dju left 06:20 am0c^ joined 06:24 grew joined 06:40 Schwern left 06:46 dual left 06:55 am0c^ left 07:07 Mowah joined 07:14 baux joined 07:15 Schwern joined 07:20 am0c^ joined 07:23 araujo left 07:36 icwiener joined, am0c^ left 07:37 am0c^ joined 07:38 kst joined 07:48 wtw joined 07:59 daxim joined 08:06 pythonian4000afk is now known as pythonian4000 08:09 icwiener left
jnthn o/ #perl6 08:17
moritz_ \o 08:18
sorear o/ #jnthn 08:23
08:24 buubot left 08:26 dukeleto left 08:28 buubot joined 08:41 masak joined
masak oh hai, #perl6! 08:41
nymacro good evenin' gov'na 08:42
jnthn lolitsmasak!
masak lol! 08:45
I won't be longing around very stay today.
moritz_ thinks masak is longing for other shores
masak pinin' for the fjords, p'haps. 08:46
moritz_ masak: I hope you don't return as a resting parrot :-)
masak I'll try not to. :) 08:47
I'll try to return as a well-rested parrot instead.
jnthn :-)
masak I'm supposed to release Yapsi tonight, but I don't know what connectivity I will have, so the timeliness of the release is a bit uncertain. 08:48
.oO( Official Perl 6 release delayed! )
masak had I realized this sooner, I might have put together a release guide and asked someone else to do the release...
jnthn: ssh! you'll end up on Slashdot if you keep repeating that :P
nymacro Perl 6: It will come out sometime. So will Duke Nukem Forever. 08:50
08:51 buubot left
moritz_ and The Hurd! 08:51
masak let's not forget about Xanadu and Plan 9. 08:52
also, I hear that fifth-generation computers from Japan have been delayed. they're no longer to be released in the 80s, but... sometime later. 08:53
08:54 buubot joined
flussence :( the hardware curse got me today 08:59
half the morning bus services broke down at the same time... 09:00
nymacro :)
09:00 icwiener joined
flussence blames it on solar radiation 09:01
.oO( even though there's almost none of that visible today )
sorear if you blame the climate in general, I can share 09:03
I was kept away from #perl6 by freak thunderstorms
flussence I think they're headed my way...
sorear Technically, yes. 09:05
However it will take a while for storms to blow from San Diego to the Isle of Man, even if they are going in the right direction. 09:06
masak an interesting short note by Erik Naggum about why "is it finished?" is the wrong question toask: www.xach.com/naggum/articles/199506...um.no.html
flussence heh
jnthn ...wtf...this machine I'm working on at $dayjob is making some...not good noises... 09:08
flussence oh no, not you too!
jnthn My keyboard here failed yesterday!
flussence starts running backups, just in case 09:10
jnthn :-)
I suspect the noise I'm hearing is just a fan on the way out. 09:11
09:12 kjeldahl joined
sorear jnthn: What is OUTER:: in a where{} block? 09:12
jnthn The sub 09:13
in sub foo($x where 42) { }
it'd be foo
(replace 42 with something interesting :-))
Needs to be since we're binding the parameters into the lexpad of foo and conditions can look at already bound ones. 09:14
09:16 icwiener left
jnthn Same for defaults, fwiw. 09:17
sorear What if foo is a multi? 09:19
moritz_ guesses it's just the current candidate, not the full multi
jnthn The multi-ness is all about the symbol installation rather than the sub itself being different
e.g. you make the same thing as for a non-multi and it just gets stuck in a candidate list instead of the lexpad. 09:20
So, what moritz_ said.
09:21 pjcj left, pjcj joined 09:22 mikehh joined
sorear I'm more wondering how something can be run in the sub's lexpad before we've committed to which candidate we're running. 09:22
jnthn ? 09:23
If you're asking that I think your mental model of multis is wrong.
sorear call &foo
&foo resolves to the proto
jnthn Right, which then calls a dispatcher.
masak I also see no problem.
moritz_ and at some point, the where-block is checked 09:24
and the where-block is an ordinary closure
sorear the dispatcher does $sorted-candidates.first({ $capture ~~ $^a.signature })
jnthn Right
masak I guess the optimizer may re-order and complicate things, but then it's the optimizer's mess, and it has to correct for its own lies.
jnthn Taht's an really inefficient implementation, but essentially OK.
sorear moritz_: Normal closures are run AFTER the enclosing sub's ENTER time 09:25
If the multi dispatcher is going to call where blocks while deciding what to call, then things are reversed
jnthn Doing a signature bindability check means you need to get a lexpad made so you can put such things in place.
In Rakudo we re-use the one from the winning candidate for the "real" invocation.
sorear Asides from being written in Perl 6, what's slow about that? 09:27
moritz_ you can be smarter about where to start searching, based on the nominal types 09:28
09:28 am0c joined
sorear Unrelated: How do you plan to handle stuff like dir(), IO::Socket::INET, etc in PortableRakudo? nqp::readdir, nqp::gethostbyname, etc? 09:28
moritz_ yes, that's the plan
09:39 am0c left 09:43 hugme left
masak have a good weekend, everybody! 09:51
I might not re-surface until Monday, in the Netherlands.
09:51 masak left 09:54 timbunce joined 09:55 am0c joined 09:59 jferrero joined
nymacro perlcabal.org is down? 10:06
moritz_ yes, that's a feather1 service 10:07
which said goodbye in a cloud of smoke 10:08
10:08 ruoso left 10:10 oyse joined 10:11 oyse_ joined, oyse left, oyse_ left 10:13 oyse joined, oyse left 10:14 oyse_ joined
mathw o/ 10:14
10:18 tadzik joined
tadzik oh hai 10:20
10:40 mavrc joined 10:43 am0c^ left 10:48 mavrc left 10:49 mavrc joined 10:57 orafu left 10:58 orafu joined
moritz_ back from nom 11:04
11:06 Italian_Plumber joined
jnthn moritz_: Nice nom? 11:08
moritz_ /~/ 11:09
'twas OK
11:10 pythonian4000 is now known as pythonian4000afk
jnthn Same...mine was less good that yesterdays. 11:10
But yesterdays was pancakes... :-)
11:16 wamba joined 11:35 oyse_ left 11:36 oyse joined 11:38 tadzik1 joined 11:40 tadzik left
takadonet morning 11:51
11:52 xabbu42 joined
colomon o/ 11:52
11:53 satyavvd left
jnthn o/ colomon 11:54
colomon good morning! 11:55
11:55 amkrankruleuen joined
moritz_ good localtime() 11:55
rakudo: say ~now.^methods(:local) 11:56
p6eval rakudo 8827d0: OUTPUT«new from-posix to-posix Str perl ACCEPTS Bridge Real Bool Int Rat Num Complex reals isNaN abs exp ln sqrt roots sign floor ceiling truncate round cis unpolar rand sin asin cos acos tan atan sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech
11:56 tadzik1 is now known as tadzik
moritz_ rakudo: say now.WHAT 11:57
p6eval rakudo 8827d0: OUTPUT«Instant()␤»
moritz_ rakudo: say ~Instant.^methods(:local)
p6eval rakudo 8827d0: OUTPUT«new from-posix to-posix Str perl ACCEPTS Bridge Real Bool Int Rat Num Complex reals isNaN abs exp ln sqrt roots sign floor ceiling truncate round cis unpolar rand sin asin cos acos tan atan sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech
moritz_ oh, Instant does Real
colomon rakudo: say Instant ~~ Real 11:58
p6eval rakudo 8827d0: OUTPUT«1␤»
moritz_ rakudo: say Instant.^roles
p6eval rakudo 8827d0: OUTPUT«Real()␤»
moritz_ rakudo: say 'good ' ~ <morning noon afternoon>[time.hour div 8] 11:59
p6eval rakudo 8827d0: OUTPUT«Method 'hour' not found for invocant of class 'Integer'␤ in main program body at line 22:/tmp/ZR4KJnMjwT␤»
moritz_ rakudo: say 'good ' ~ <morning noon afternoon>[DateTime.now.hour div 8]
p6eval rakudo 8827d0: OUTPUT«good noon␤» 12:00
tadzik rakudo: DateTime.now.hour.say
p6eval rakudo 8827d0: OUTPUT«11␤»
12:03 Schwern left
nymacro goo noon moritz_ 12:04
moritz_ wonders why the server clock is not in UTC
rakudo: say DateTime.now 12:05
p6eval rakudo 8827d0: OUTPUT«2010-10-01T11:42:05Z␤»
moritz_ it seems completely off
nymacro it isn't completely off. I'm just from the future. 12:06
moritz_ past, actually :-)
Fri Oct 1 12:06:53 UTC 2010 12:07
since the trailing Z stands for UTC (iirc), it's past
Juerd hates the T in ISO datetimes 12:09
Makes it unreadable
moritz_ 1 Oct 11:47:59 ntpdate[30106]: step time server offset 1385.646993 sec 12:11
flussence huh, I always thought the T was optional...
Juerd It's not; I have a few s/T/ / and s/ /T/ 12:12
nymacro moritz_, it is nearly the 2nd here. So I'm from the future ;) 12:13
moritz_ nymacro: we need those future people; welcome to #perl6 :-)
nymacro it isn't like I have anything better to do; in the future robots do all my work for me 12:15
(PS. invest in SuperRobototronics, it will pay off) 12:18
flussence argh... all this date talk prompted me to check $dayjob's servers and two of them weren't even running ntp. 12:19
oyse Is perlcabal.org down at the moment? I am trying to access the synopsis, but no response from the server 12:20
moritz_ oyse: yes, down
you can read the POD versions on github.com/perl6/specs/ for now 12:21
oyse moritz_: thanks
moritz_: Github parses pod. Nice :) 12:22
12:22 mjk joined
flussence sees a very unpleasant error in the server log 12:22
"time correction of 31535909 secionds exceeds sanity limit (1000)" :( 12:23
moritz_ oh wow
flussence yeah, not exactly 2 minutes off
moritz_ rakudo: say 31535909 / 3600 / 24 12:24
p6eval rakudo 8827d0: OUTPUT«364.998946759259␤»
moritz_ oh, nearly exactly one year
maybe some license expired, and somebody "adjusted" the server clock? :-) 12:26
12:27 cognominal left
colomon loliblogged: justrakudoit.wordpress.com/2010/10/...s-forward/ 12:27
12:31 abra joined
moritz_ yes, // '' should work 12:32
daxim colomon, the blog is too narrow to read the code comfortably
flussence the "lots of small classes in several files" thing bothers me too sometimes. 12:34
daxim heeeeey, java! 12:35
moritz_ sometimes just packs some utility classes into the files of other classes
oyse rakudo: required Dummy; 12:37
p6eval rakudo 8827d0: OUTPUT«Could not find sub &Dummy␤ in main program body at line 22:/tmp/DdRlcvCmPU␤»
oyse rakudo: require Dummy;
p6eval rakudo 8827d0: OUTPUT«Unable to find module 'Dummy' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval//p1/lib/parrot/2.8.0-devel/languages/perl6/lib␤ .)␤ in main program body at line 26␤»
tadzik non-strictness mentioned in S01 is NYI? 12:41
moritz_ correct
12:41 [Coke] left 12:42 plainhao joined
tadzik hmm, I still didn't get my head around this. Role is not to be instantiated, but what is it worth if we're able to .new it anyway? 12:43
moritz_ yes
www.perlmonks.org/?node_id=862830 # another reason why backporting p6 features to p5 is not always as shiny as it looks
12:44 lafille joined
tadzik uhm, I wasn't expecting a boolean answer for that 12:44
12:44 lafille left
moritz_ but what you wrote is correct 12:45
a class that only does that role is autogenerated for you
Juerd I can probably get feather1 back online today, but only with 1 GB RAM 12:46
tadzik mhm
Juerd Better than nothing, I guess. Any strong objections?
(The RAM that was in feather0 was supposed to go into c25, feather1's new host, but it's broken now)
jnthn tadzik: You're not instantiating the role. 12:49
All method calls on roles actually cause a class that composes the role to be magically created.
And the call is forwarded to that class instance.
Which can actually dispatch methods.
12:50 bluescreen joined
tadzik I see 12:50
github.com/perl6/specs/blob/master//S02-bits.pod :( Where is the "I can wait" button? 12:51
12:53 tylercurtis joined, tylercurtis left 12:57 jferrero left
oyse does require support :from<lang> the same way as use does? 13:00
13:10 mjk left
Juerd blazar has a huge file, ~blazar/tmp/bar.txt 13:11
At 81 MB that's a pretty large text file 13:12
I mean 1.1 GB
Contains nothing but nullbytes.
13:14 perlpilot joined
jnthn It may compress well ;-) 13:15
13:15 cognominal joined
perlpilot I got an email from an L Wall this morning. It gave me brief pause while skimming my messages. 13:15
:-) 13:16
moritz_ Juerd: afaict blazar is dead 13:18
he had cancer
13:18 Patterner left
moritz_ (I hope I'm not confusing him with anybody... will see if I find a reference 13:18
13:21 ash__ joined 13:23 araujo joined
perlpilot moritz_: www.perlmonks.org/?node_id=735465 13:23
13:24 perlpilot is now known as PerlJam
Juerd moritz_: Oh :( 13:25
13:29 Psyche^ joined 13:30 Psyche^ is now known as Patterner, colomon left, colomon joined 13:32 PerlJam left, PerlJam joined, ruoso joined 13:34 colomon_ joined, colomon left, colomon_ is now known as colomon, ggoebel joined 13:36 am0c^ joined
mathw \o/ 13:46
13:46 Mowah left 13:51 am0c left 13:58 am0c^ left 14:00 colomon left 14:04 Guest23195 left 14:08 colomon joined, Mowah joined
ash__ *crickets* its quiet today 14:11
mathw it is 14:12
I'm wondering if everybody dissolved in the rain
14:13 colomon left
moritz_ inside 14:13
slavik a girl at wr0k has a red and white umbrella
ash__ it's pretty dry outside here, but i think i am in a different part of the world than some of you folks 14:14
14:14 ash__ is now known as ash_
slavik NYC 14:14
it's been raining off and on for the last couple of days
mathw It's chucking it down here
it took a bit of a break around lunchtime
moritz_ slavik: how very frankonian of her
mathw it merely drizzled
but now it's really raining again
slavik starsmedia.ign.com/stars/image/arti...41-000.jpg
yes 14:15
ash_ glad to see clear skys here
slavik that's what her umbrella looks like ...
I am about to ask for some tvirus
ash_ hurry, barricade the door and find something to hit them with
slavik I am in a NOC ...
ash_ noc ... network operations center? (google may have failed me 14:17
mathw that's what it usually means 14:18
14:18 mikehh left
mathw wonders how the C++ compiler can have forgotten about a macro from one line to the next 14:18
(and no, the one line isn't #undef MACRONAME)
ash_ at least the raptor's haven't figured out how to open the doors yet (google images of NOC reminded me of Jurassic Park)
14:28 am0c^ joined 14:33 sftp joined 14:34 satyavvd joined 14:36 abra left
oyse Are there any Test::More'ish test modules available for Perl 6? 14:36
moritz_ Test.pm contains lots of ideas from Test::More 14:37
and from Test::Exceptions, for that matter
tadzik oyse: modules.perl6.org is actually everything we have. Besides Test of course 14:38
14:38 wtw left
oyse ok. I will take a look at Test.pm 14:39
14:39 xabbu42 left 14:41 meppel left 14:42 meppl joined, daxim left 14:45 colomon joined
ash_ anyone in here familiar with js, or prototype inheritance? 14:51
Juerd Somewhat 14:53
gfldex ash_: i am
Juerd Read "new" as "clone" and everything will make sense ;) 14:54
ash_ lol, i was thinking that too
moritz_ and keeping one "empty" object around from which you clone corresponds to having a class 14:55
gfldex remove that class thing from your head when you think about prototype inheritance 14:57
flussence I'm writing JS right now actually, but I wouldn't mind a distraction
14:57 icwiener joined
moritz_ gfldex: only if it confuses you 14:58
.oO( $dayjob can write php in any language... )
gfldex moritz_: that's the point!
ash_ just kinda toying with the idea, but gist.github.com/606320 is an approach to prototype inheritance in perl6
i have the same example in js, if you have nodejs installed you can run it with node /filename.js, but you'll need 1 function i didn't include to get the multi-inheritance to work right 14:59
its kinda a one-to-one mapping, so it might not be the right approach for perl6, but i just wanted to see how it might work 15:00
flussence looks pretty nice
15:00 mkramer joined
ash_ the question is, what happens if you mix a normal class and a prototyped class? also, should i have to say protoclass B is A.new or should the .new be implied? 15:01
flussence I think that should be implied there 15:02
moritz_ "mix" in what sense?
15:02 colomon left
gfldex ash_: how close do you want it to be with JS? 15:02
ash_ gfldex: i don't care if it matches JS i just want the concept to transfer 15:03
moritz_: "mix" as in a prototype class inheriting from a normal class, or a normal class inheriting from a prototyped class
gfldex then .new is wrong alltogether
ash_ i am not sure i follow 15:05
gfldex var mommy = {baz: function(){ console.log('baz')}}; var child = {}; child.__proto__ = mommy; # that's what new does; mommy.another = function(){console.log('another')); child.another();
in JS a prototype _is_ some other object, not a clone of some other object 15:06
and there is only one object that dont got a prototype, usually called Object
i lied a bit. new creates an empty object, then calles the cunstructor function as a method of that object and then sets the prototype 15:11
in most implementations it sets .constructor to the constructor function so you have something type-like
ash_ got ya, i think i understand, i'll look up __proto__ i don't know what that attribute is
gfldex if you do foo.bar() the runtime will look for ['bar'] in foo, if it doesnt find it it looks in foo.__proto__['bar'], if it doesn't find it it looks in foo.__proto__.__proto__['bar'] ... * 15:13
JS got the most stupid way to have inheritance :)
ash_ hmmm 15:14
and saying var foo = new Foo; sets foo.__proto__ = Foo.prototype?
15:14 cotto left
gfldex it sets foo.prototype.__proto__ = Foo.prototype 15:16
ash_ okay
gfldex ash_: developer.mozilla.org/en/JavaScrip...ject/proto
ash_ i just found that, and i am reading it now 15:17
gfldex ash_: developer.mozilla.org/en/JavaScrip..._Revisited
ash_: don't forget that functions are objects in JS, what is very usefull
ash_ ya, i know, but i don't know how that can translate logically to perl6, unless there is some special way of saying this function-like object is also possibly an object, which is why i used 'protoclass' in that example i wrote up instead of 'class' 15:18
15:18 colomon joined 15:19 Guest23195 joined, am0c^ left
gfldex you have to overload .(), what doesnt work right now 15:19
moritz_ not?
rakudo: class A { method postcircumfix:<( )>($x) { say "OH HAI $x" } }; A.new.('JS') 15:20
p6eval rakudo 8827d0: OUTPUT«OH HAI Capture()<0xfd60708>␤»
ash_ is that a raw capture?
wonder why its not OH HAI JS...
moritz_ rakudo: class A { method postcircumfix:<( )>(\$x) { say "OH HAI $x" } }; A.new.('JS')
p6eval rakudo 8827d0: OUTPUT«OH HAI Capture()<0xfd5e3f0>␤»
moritz_ rakudo: class A { method postcircumfix:<( )>(\$x) { say "OH HAI $x[0]" } }; A.new.('JS')
p6eval rakudo 8827d0: OUTPUT«OH HAI JS␤»
ash_ rakudo: class A { method postcircumfix:<( )>(\$x) { say "OH HAI $x[0]" } }; A.('JS') 15:21
p6eval rakudo 8827d0: OUTPUT«OH HAI JS␤»
moritz_ ash_: I remember it has to do with lazy context, but I don't remember the exact reasons 15:22
gfldex rakudo: class A { method postcircumfix:<( )>(\$x) { say "OH HAI $x[0]" } }; my $a = A.new; $a('o.0');
p6eval rakudo 8827d0: OUTPUT«OH HAI o.0␤»
gfldex there might be a open ticket that needs closing
gfldex goes looking for ticket
moritz_ wonders how far you can get with has $.proto handles *; 15:26
afk 15:27
ash_ okay, but i thought the whole point of prototype-based OO was you had a prototype object that you cloned, so you have your prototype of your object that you clone into an instance, but it requires the prototype to be pretty malleable, and the interesting thing is you can use your sub-objects to make new objects via the same cloning operations. its not all that different than what p6 does already, it just has different semantics for de
15:29 mantovani left
gfldex that's not how JS is doing it 15:30
you have an empty object that is cloned
but why would you want to clone an empty hash?
ash_ well, there are some implied things your getting via Object.prototype 15:31
gfldex nope
you get implied things from Object
and for any var a = {}; you get a.prototype.__proto__ = Object.prototype 15:32
so if you get all the properties from Object that are there or added later at runtime 15:33
15:33 Ross joined, Ross left, Ross joined
gfldex and that's why JS sucks :) 15:33
ash_ okay, well, one sec, lets look at another language that does prototype-based inheritance
lua does prototype-based
in lua, a new object is made from a hash, so: Vector = { } \n function Vector:new(x) ... end; makes a new object you can call new from by doing: Vector:new(0) 15:34
gfldex what does setmetatable(object, { __index = Vector }) do? 15:35
ash_ but really Class:method is syntax sugar for Vector.new(self, argx) so
thats like: my $obj = { ... }; bless $obj, 'Vector'; return $obj; 15:36
15:36 pyrimidine joined
ash_ its the same as JS sorta, if self.x fails it looks in __index.x then in __index.__index.x etc... 15:37
15:37 jaldhar left 15:39 oyse left 15:40 cotto joined 15:42 am0c joined
ash_ you could emulate the whole prototype thing with a couple of hashes and a dispatch function 15:44
gfldex indeed 15:45
ash_ it would be nice to be able to do most of that without having to uses hashes though 15:50
15:52 sjn left 15:53 risou joined 15:54 ruoso left 15:56 Italian_Plumber left 15:58 justatheory joined
ash_ is there a way to tell if something is callable? 15:59
16:00 M_o_C joined
PerlJam ash_: I think if it has a "do" property, it's callable. 16:00
TimToady rakudo: say &print does Callable
p6eval rakudo 8827d0: OUTPUT«Null PMC access in clone()␤ in 'infix:<does>' at line 37␤ in 'infix:<does>' at line 537:CORE.setting␤ in main program body at line 22:/tmp/NXqor71nBI␤»
TimToady oo
rakudo: sub foo {}; say &foo does Callable 16:01
p6eval rakudo 8827d0: OUTPUT«foo␤»
ash_ rakudo: say &print.can('invoke');
p6eval rakudo 8827d0: OUTPUT«␤»
16:01 am0c left
ash_ &print is probably because its in pir? maybe? 16:01
the Null PMC access i mean
either way /submits bug
TimToady rakudo: say &infix:<Xxx> does Callable 16:03
p6eval rakudo 8827d0: OUTPUT«Could not find sub &infix:<Xxx>␤ in main program body at line 22:/tmp/ZJOpTAhpAM␤»
TimToady rakudo: say <a b c> Xxx 3 16:04
p6eval rakudo 8827d0: OUTPUT«aaabbbccc␤»
ash_ rakudo: say ?&infix:<xx>
p6eval rakudo 8827d0: OUTPUT«Bool::True␤»
ash_ isn't X a modifier on xx?
TimToady unless xx is a modifier on X :) 16:05
ash_ hmm
good point
rakudo: say ?&infiix:<X>
p6eval rakudo 8827d0: OUTPUT«Could not find sub &infiix:<X>␤ in main program body at line 22:/tmp/iD8rDYiWbG␤»
ash_ err i duno if that would be infix
hmm wonder what it would be
16:05 synth left
TimToady but yes, meta-ops tend to treat their op as the function that they do HOP on 16:05