Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-01-07

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:00 eric256 actualy, took only minutes to refix, bug hunting is nice that way
00:01 * eric256 now has 65 substr tests failing gracefully instead of having the whole file unparseable
00:01 eric256 hehe
00:01 eric256 :P
00:01 eric256 later guys, off for home
00:01 eric256 left #perl6
00:04 wayland76 lithology++
01:08 ashizawa joined #perl6
01:14 partisan joined #perl6
01:22 orafu joined #perl6
01:33 nihiliad joined #perl6
01:40 dbrock joined #perl6
01:50 galf joined #perl6
02:02 Exodist joined #perl6
02:03 orafu joined #perl6
02:15 K9 joined #perl6
02:16 K9 hello
02:16 K9 where is this channel ill connect with my mIRC
02:16 diakopter ?
02:16 K9 all i could find was this link on my browser.
02:16 K9 what irc network is this
02:16 diakopter :) freenode
02:16 K9 irc.freenode.org ?
02:17 diakopter irc.freenode.net
02:17 ^K9 joined #perl6
02:17 ^K9 good
02:17 ^K9 Hi i hope im at the right place
02:17 ^K9 ive been trying to get this bot to work but I coudlnt', its called Zaslon
02:17 ^K9 anyone here knows how to work with it ?
02:17 * diakopter looks around for carlin
02:18 ^K9 oh carlin lol
02:18 ^K9 ive seen that name in the documenation
02:18 ^K9 looks like a pretty good bot
02:19 diakopter I haven't looked at the code, myself
02:19 diakopter (lazy of me)
02:19 ^K9 hehe
02:19 ^K9 do u think u could help me ?
02:19 diakopter have you built rakudo?
02:19 ^K9 got some pretty general questions...
02:19 ^K9 rakudo ?
02:21 ^K9 just took all the files into a blank mirc and ran the files like he said in the readme.txt
02:21 ^K9 can't seem to make it work tho
02:23 JimmyZ joined #perl6
02:24 diakopter I don't know what you mean by "blank mirc"
02:24 ^K9 mIRC.exe
02:24 diakopter well, I'm afraid I thikn I do
02:24 ^K9 when I run a mIRC.exe in a folder it just installs all the files it needs.
02:24 agentzh joined #perl6
02:25 ^K9 thats what i meant :)
02:25 diakopter zaslon won't function as a bot inside mirc.
02:25 ^K9 o?
02:25 diakopter it runs standalone, afaik.
02:25 ^K9 what do I need to do to make it work ?
02:26 diakopter you need a build of Perl 6 (rakudo)
02:26 ^K9 can I do that on Windows 7 ?
02:26 diakopter http://sourceforge.net/projects/parrotwin32/files/parrot-rakudo%20addon/Parrot-1.9.0-Rakudo-24/setup-parrot-1.9.0-rakudo-24.exe/download
02:27 ^K9 downloading thank you
02:27 diakopter actually, I think you have to install this one first: http://sourceforge.net/projects/parrotwin32/files/parrotwin32%20setup/Parrot-1.9.0/setup-parrot-1.9.0.exe/download
02:28 ^K9 ok
02:29 ^K9 ok so ive installed both of em
02:30 ^K9 only option in start menu is to uninstall
02:35 * ^K9 slaps diakopter around a bit with a large trout
02:35 ^K9 :P
02:37 ^K9 im looking at one of your channel logs
02:37 ^K9 zaslon works perfectly
02:37 diakopter ^K9: it's not a point-n-click program
02:38 diakopter you must launch it from the command line, after configuring it
02:38 diakopter zaslon, I mean.
02:38 ^K9 yes ive seen that on the /bin
02:38 ^K9 and i can handle configuring it
02:38 ^K9 i just don't know how to launch things
02:38 ^K9 like i dont know the basic commands on that perl6 thingy
02:38 diakopter windows Command Prompt
02:39 ^K9 cmd ?
02:39 diakopter yes
02:39 diakopter at this point, I will advise caution
02:39 ^K9 what
02:39 ^K9 what do u mean ?
02:40 diakopter it's easy to destroy things inadvertently :)
02:40 ^K9 ok ill take the risk
02:40 ^K9 im assuming by what you told me earlier that u don't know how to configure the bot right ?
02:41 diakopter I just read the code
02:41 diakopter so, now I do. :)
02:41 ^K9 lol
02:41 diakopter first, you'll need to install proto
02:41 ^K9 i just read that code
02:41 ^K9 im a C# developer
02:41 ^K9 I don't really understand how this linux stuff works tho
02:42 diakopter ah
02:42 diakopter I'm a C# developer also.
02:42 ^K9 how old are you ?
02:42 * diakopter kicks in the universal translator
02:42 diakopter why, how old are you?
02:42 ^K9 ive been looking for a job for ages.
02:42 ^K9 23
02:43 diakopter 29
02:43 ^K9 got a job in the field i assume
02:43 diakopter not doing C# at the moment, but yes
02:43 ^K9 that's just great man
02:43 ^K9 all the best...
02:44 diakopter you've just installed parrot, which is akin to the .NET CLR
02:44 ^K9 akin ?
02:44 diakopter akin, meaning intended to do the same things.
02:44 diakopter the same sorts of things.
02:44 ^K9 oh cool
02:44 diakopter run various languages with high interoperability
02:44 ^K9 but how do i configure the bot first of all
02:45 diakopter you'll need to use another program "proto" to install its dependencies
02:45 ^K9 oh alrighty than
02:45 diakopter but, for that, you'll need Perl 5 :)
02:45 diakopter I think :)
02:45 ^K9 damn
02:45 ^K9 let me ask you a differnt question\
02:46 ^K9 all I want is an IRC bot to fetch posts information from wordpress
02:46 ^K9 do you happen to know one that does that without installing the whole world ?
02:47 diakopter this one looks ok http://www.hawkee.com/snippet/5925/
02:47 diakopter I can't vouch for it, of course.  I'd search google for  "mirc" "rss"
02:48 ^K9 yeah using the rss would be smart...
02:48 diakopter (that's what zaslon does)
02:48 ^K9 REALLY?
02:48 diakopter yes
02:49 ^K9 oh alright
02:49 ^K9 well diakopter
02:49 ^K9 thanks a lot
02:50 diakopter yw
02:50 ^K9 have a great nighjt :)
02:50 astrojp left #perl6
03:15 japhb joined #perl6
03:24 dbrock joined #perl6
03:26 cognominal joined #perl6
03:37 am0c joined #perl6
03:38 ashizawa_ joined #perl6
03:48 eternaleye joined #perl6
04:01 jaldhar joined #perl6
04:35 icey joined #perl6
05:21 orafu joined #perl6
05:22 pugs_svn r29474 | mberends++ | [vill] statementlist() gets through to statement(), small doc updates
06:15 orafu joined #perl6
06:19 gfx joined #perl6
06:32 bbkr joined #perl6
06:43 orafu joined #perl6
06:54 soupdragon joined #perl6
06:55 lmc joined #perl6
07:05 meppl joined #perl6
07:10 Su-Shee joined #perl6
07:11 Su-Shee good morning
07:12 kaare joined #perl6
07:14 saschi Su-Shee: hello
07:14 saschi ^^
07:15 saschi similar sounding nicknames >_<
07:22 agentzh joined #perl6
07:22 fridim_ joined #perl6
07:23 langen joined #perl6
07:32 mberends joined #perl6
07:34 justatheory joined #perl6
07:38 mberends two days ago microsoft finally decided to support SVG http://blogs.msdn.com/ie/archive/2010/01/05/microsoft-joins-w3c-svg-working-group.aspx
07:44 mberends .oO( does that mean they figured out how to "embrace and extend" SVG? )
07:45 Hurley joined #perl6
07:45 Hurley hi
07:45 mberends hi Hurley
07:46 Hurley how can i set on perl 64 the integer as 32bit signed to make a overflow on bitwise for a hash?
07:48 Baggiokwok joined #perl6
07:48 jnthn joined #perl6
07:48 mberends hmm. sounds like a Perl 5 question. Is that what you're using, Hurley ?
07:49 Hurley yes on 64bit
07:49 Hurley version 5.10
07:50 mberends we _use_ Perl 5 here to build Perl 6, but we're not all that expert at this kind of thing. Have you tried other Perl IRC channels?
07:51 iblechbot joined #perl6
07:51 Hurley i try on perl channel
07:51 Hurley thanks
07:51 mberends good luck :)
07:53 rachelBROWN joined #perl6
07:53 sjohnson diakopter: javascript is causing me much grief
07:53 sjohnson var num = 00.00;  and 0.0 will cause completely different results
07:54 sjohnson </rant>
07:54 diakopter sjohnson: oh?
07:54 diakopter what are the different results
07:55 Juerd joined #perl6
07:55 diakopter in V8/Chrome, 00.00 is a syntax error.
07:56 diakopter same in IE
07:57 JohnDoe365 joined #perl6
07:57 diakopter sjohnson: same in safari
07:57 bryan[c1] joined #perl6
07:58 diakopter same in firefox
08:00 diakopter sjohnson: opera accepts it, but it's identical to 0.0
08:02 partisan joined #perl6
08:06 sjohnson diakopter: is it a syntax error in perl?
08:06 sjohnson my argument for why i hate javascript
08:06 sjohnson causing me unbelievable frustration to get something that would take perl 2 minutes to do
08:06 sjohnson is taking forever
08:07 sjohnson can't see declaring something to be 0.0 or 0.00 or 00.00 to cause huge problems for most languages.. though i have learned that javascript is low-level
08:08 sjohnson as opposed to some other languages that can handle this without any problems..
08:10 diakopter I read that as "I don't like it because it's different from the languages to which I'm accustomed"
08:10 bryan[c1] do you guys know a way to increment through websites within a domain?
08:10 diakopter but in perl, 00.00 produces the string "00"
08:11 sjohnson diakopter: how do you add to a var int; variable, something from getElementbyId().value?
08:11 sjohnson the only way i have it working, is to do x = x - -(getelementbyid... etc
08:11 sjohnson += assumes it's a string
08:11 diakopter only if x is already a string
08:12 sjohnson having trouble declaring x as a float
08:12 sjohnson tried var x = new Float();
08:12 diakopter sjohnson: all numbers in javascript are doubles
08:13 diakopter (unless the compiler can infer it's always used as an int, uint, etc)
08:13 sjohnson alright, you are correct that i dont really know it well
08:13 sjohnson though, how about this for a good argument:  how do you do here documents easily
08:14 sjohnson without having to do 'text'+ for every line
08:14 diakopter put a \ at the end of the line you want to wrap inside a string literal
08:14 diakopter var x = "hihi \
08:14 diakopter <new line>
08:14 diakopter hihi";
08:14 sjohnson ... i wish the documents i found on google told me that ... :)
08:15 sjohnson diakopter: plz2help me declare an int
08:15 sjohnson is var inty = 0; the best way?
08:15 diakopter easy; var x = 0
08:15 diakopter (if you're going to be adding to it)
08:16 diakopter if you're going to be multiplying it, init it as 1, of course)
08:16 sjohnson diakopter: alright maybe js isn't so bad :)
08:16 sjohnson just bad documentation on the internet
08:17 sjohnson and i don't think David O'Flannigan is the best writer as far as Javascript bibles go
08:17 sjohnson everytime i look up "how to do basic array stuff"
08:18 sjohnson chapter gives mickey mouse examples
08:18 sjohnson and says "you can find MORE elsewhere in this book, in chapter 8..." etc
08:18 diakopter I agree; "JavaScript: The Definition Guide" is about the worst one I've flipped through at the bookstore.
08:18 diakopter Definitive, I mean
08:31 bbkr joined #perl6
08:32 sjohnson diakopter: he didnt do any better on his Ruby book
08:33 sjohnson he even stated that he wanted the book format to mimic K&R C
08:33 sjohnson and it's a piece of crap compared to K&R C
08:34 Su-Shee I liked "javascript - the good parts" (and a short reference at hand)
08:34 sjohnson Su-Shee: now THAT is a good book
08:34 sjohnson i bought it and work paid for it
08:34 sjohnson and i agree with the "bad parts" section
08:34 sjohnson as the author states that a few things were rushed
08:36 Su-Shee overall, I started to like the books published by manning more than o'reilly's.
08:36 Su-Shee (does one really write "o'reilly's car"?)
08:39 TiMBuS joined #perl6
08:39 langen yes
08:48 yahooooo joined #perl6
08:51 mathw Indeed one does
08:59 Baggiokwok joined #perl6
09:18 Baggiokwok joined #perl6
09:29 frettled diakopter: hee-hee, funny conversation with ^k9 tonight :)
09:29 frettled diakopter: Perl 6 now has market penetration!  \o/
09:29 frettled carlin++
09:32 dakkar joined #perl6
09:42 ihrd joined #perl6
09:47 ihrd left #perl6
09:58 moritz_ good morning
09:58 mathw oh hai moritz_
09:59 frettled lolwerelolcatz
10:00 mathw sleepy ones
10:00 mathw in my case, anyway
10:02 wayland76 and diakopter++ for answering fairly non-P6 questions :)
10:05 szbalint good morning
10:08 frettled wayland76: but I do that all the time, and all I got was this lousy t-shirt!
10:17 Baggiokwok joined #perl6
10:22 Baggiokwok joined #perl6
10:25 hanekomu joined #perl6
10:26 rjh joined #perl6
10:30 Baggiokwok joined #perl6
10:42 thmghtd joined #perl6
10:56 tl joined #perl6
11:01 JohnDoe365 left #perl6
11:02 thmghtd joined #perl6
11:03 wayland76 frettled: Sounds like your t-shirt needs de-lousing then :)
11:03 * moritz_ has asked and answered lots of off-topic questions here and elsewhere, and never got a t-shirt for it :-)
11:07 Baggiokwok joined #perl6
11:08 frettled moritz_: I had to pay for mine ;)
11:08 * wayland76 is tring to figure out whether "lolwerelolcatz" means "We are lolcats" or whether it refers to a werelolcat, an animal that is somewhat like a werewolf, but with a lolcat instead of a wolf
11:14 saschi i'm working topless
11:15 wayland76 I expect to do that later this week.  It should be 38 (Celsius) outside, and maybe more in here where I am
11:16 soupdragon in this cold??
11:16 saschi yep
11:17 wayland76 well, it's warm here in Australia :)
11:20 saschi wayland: i guess, there is kinda summer 'cause of this odd earth's rotation axis >_<
11:33 moritz_ 38 °C > 100 F
11:37 colomon_ joined #perl6
11:53 cls_bsd joined #perl6
12:05 bluescreen joined #perl6
12:07 bluescreen joined #perl6
12:09 frettled Today is a positively balmy -15 °C, light snow, some sunshine.
12:10 frettled (that's 5 °F, BTW)
12:10 frettled And now you guys know why the Nordic Perl Workshop never was in January ;)
12:11 * frettled can imagine the headlines: «Perl development halted - main developers out with cold, flu and broken hips»
12:12 Su-Shee frettled: not all of us are over 60. ;)
12:14 SmokeMachine joined #perl6
12:14 frettled Su-Shee: you'll have to settle for a common cold, then ;)
12:15 frettled Mind you, this is still better than the worst weather in the northern US states.
12:15 frettled or Canada, brrrr.
12:15 * frettled still wants to have a YAPC::Spitsbergen
12:23 wayland76 Su-Shee: You can go in a car adccident for the broken hips, if you prefer :)
12:23 wayland76 'night all :)
12:24 saschi this morning we had -22 deg C
12:24 saschi wayland: good night! ^^
12:25 Su-Shee saschi: where the hell are you?
12:25 saschi Su-Shee: Wolfenbuettel (Lower Saxony)
12:26 Su-Shee _wolfenbuettel_ had -22?!
12:28 saschi Su-Shee: yes, here in the periphery of wolfenbuettel
12:29 Su-Shee .oO(there's something more periphery than wolfenbuettel already is? ;)
12:29 saschi Su-Shee: i'm living near the asse
12:29 saschi Su-Shee: well, yeah, there truly is :D
12:30 saschi Su-Shee: maybe that's why the german one and only ultimate storage place for nuclear waste is nearby ;)
12:31 Su-Shee gee. I would move. ;)
12:31 saschi well :D
12:31 clintongormley joined #perl6
12:33 saschi Su-Shee: i will - in a couple of years
12:34 Su-Shee then it's too late. ;)
12:35 moritz_ saschi: I've been in Wolfenbüttel over Christmas :-)
12:36 saschi Su-Shee: since it's really scary, that, if you are standing on the western hill side of the asse, you've direct line of sight to the headgear of schacht konrad, the other candidate for high radiactive waste >_<
12:36 saschi moritz_: uh, you've family here? ^^
12:37 moritz_ saschi: no, but my girlfriend has
12:37 saschi moritz_: any relations with matthias "the guitarist" lenz?
12:37 saschi moritz_: ah, ok :)
12:37 moritz_ not that I'm aware of :-)
12:38 saschi Su-Shee: i guess, we've app. two decades left :D
12:39 Pzt joined #perl6
12:40 payload joined #perl6
12:41 saschi if nothing will be done (except more MgCl_2 for Carnallit stabilization)
12:46 Baggiokwok joined #perl6
12:47 frederico joined #perl6
12:48 frederico joined #perl6
12:49 frederico joined #perl6
12:49 mikehh joined #perl6
12:55 frederico joined #perl6
12:58 KyleHa joined #perl6
13:00 takadonet morning all
13:00 ruoso joined #perl6
13:22 ihrd joined #perl6
13:28 iblechbot joined #perl6
13:44 ihrd joined #perl6
13:52 Baggiokwok joined #perl6
14:00 mj41 joined #perl6
14:02 takadonet hey mj41
14:04 PerlJam good soon-to-be-cold-and-windy morning from Corpus Christi Texas
14:05 takadonet PerlJam: how cold are you talking about?
14:05 frettled takadonet: probably so cold that the infrastructure isn't designed to handle it :)
14:06 takadonet frettled: Just be glad you are not where I'm right now
14:06 PerlJam I hear it's going to get into the 30s and then < 20 tomorrow.  Not "cold" by some standards, but for a place where winter usually means we have to wear a long sleeve shirt instead of a short sleeve shirt, it's too cold :)
14:06 frettled takadonet: too warm?
14:06 payload joined #perl6
14:06 takadonet frettled: -38 C
14:06 frettled takadonet: too warm.  ;)
14:07 frettled takadonet: but yep, I'm glad.
14:08 frettled takadonet: if it was that cold outside, I'd have to go down to the server room, that one stays at around +20-22 :)
14:32 breinbaas joined #perl6
14:38 Baggiokwok joined #perl6
14:41 eric256 joined #perl6
14:46 eric256 ng doesn't have exit yet?
14:46 eric256 ng: exit
14:46 p6eval ng 3f06c7: sh: ./perl6: No such file or directory␤
14:48 moritz_ ng: exit
14:48 p6eval ng 3f06c7: sh: ./perl6: No such file or directory␤
14:49 jbd joined #perl6
14:49 moritz_ ng: exit
14:49 p6eval ng 3f06c7: Could not find non-existent sub &exit␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
14:52 eric256 yay! got t/spec/S32-str/substr.t to at least run completly, now to fix and unfudge
15:00 ignacio_ joined #perl6
15:11 PacoLinux joined #perl6
15:13 ignacio__ joined #perl6
15:28 rgrau` joined #perl6
15:29 douglashunter joined #perl6
15:35 PerlJam eric256: \o/
15:36 eric256 i think the tests are wrong, they are expecting four arg substr to do an inplace edit
15:36 moritz_ that's the Perl 5 behaviour
15:36 eric256 not according to the docs....
15:37 eric256 oh wait, that part is in the example.....
15:37 moritz_ S32/Str.pod says the return value 'is rw'
15:38 Baggiokwok joined #perl6
15:42 eric256 arg each test is passing $str along and modifying it, so the test depends on the test before it suceeding,/me goes to change it
15:46 Psyche^ joined #perl6
15:49 REPLeffect_ joined #perl6
15:56 ash_ joined #perl6
16:00 justatheory joined #perl6
16:07 uniejo joined #perl6
16:07 nihiliad joined #perl6
16:16 mberends left #perl6
16:25 iblechbot joined #perl6
16:26 colomon_ joined #perl6
16:32 cognominal joined #perl6
16:33 jferrero joined #perl6
16:35 KyleHa joined #perl6
16:48 pmurias joined #perl6
16:59 jferrero joined #perl6
17:23 cdarroch joined #perl6
17:23 * TimToady ponders the semantics of substr($x,3,5) += 2, and then wonders about my Str $x = "10"; $x += 2;
17:24 TimToady rakudo: my Str $x = "10"; $x += 2;
17:24 p6eval rakudo 3867ff: Assignment type check failed; expected Str, but got Num␤in Main (file <unknown>, line <unknown>)␤
17:25 cotto_work joined #perl6
17:27 PerlJam TimToady: lvalue substr does str -> num conversion on just that portion of the string, adds 2 to the number, then does a num -> str conversion and inserts that string in the appropriate place in the original ???
17:29 scottietaz joined #perl6
17:33 TimToady well, it does in Perl 5, I expect
17:34 _jaldhar joined #perl6
17:35 TimToady my $x = '000000'; substr($x,2,2) += 4; print $x,"\n";  # prints 00400
17:35 orafu joined #perl6
17:36 ash_ in perl 5, my $a = "ab 12"; substr($a, 3, 2) += 5; print $a;  printed ab 17, which is what i'd expect it to, but i never thought of using substr like that before
17:36 TimToady lvalue substr is more versatile than 4-arg substr, but I suspect 4-arg substr can be more efficiently implemented
17:39 TimToady so the type of the lvalue is not really Str, but something like Cool>Str (using that as a coercion type notation)
17:39 TimToady presumably >Str defaults to Cool
17:40 TimToady in which case my >Str $x = "10"; $x += 2; would have similar back-to-string semantics
17:40 PerlJam Wasn't audrey or someone looking at using Judy strings in pugs?  Maybe Perl 6 could spec that and expose it to the users so they'd have type Judy  :)
17:40 TimToady we'd need both Punch and Judy
17:44 ash_ why was Object changed to Mu again? i can't remember
17:44 Tene Soviet cows.
17:47 supernovus joined #perl6
17:47 TimToady because people couldn't combine their idea of "object" with their idea of "undef", and were confused when Perl printed out "Object" to mean the most undefined value
17:48 TimToady and Soviet cows
17:48 hejki weird
17:48 hejki i thought it was cause Hitler?
17:48 TimToady wasn't expecting Godwin's Law that soon...
17:49 * PerlJam wasn't expected Godwin's Law at all
17:49 PerlJam s/expected/expecting/
17:49 hejki ok sorry i was too bold with it
17:49 hejki soviet cows made me think of lenin
17:49 hejki and then mussolinis stache
17:49 hejki which brought back adolf
17:50 TimToady that's almost as tenuous as some of my reasoning
17:51 hejki i've noticed that most people fluent with Perl tend to have some weird neuropathic way in logical thinking
17:51 ash_ what is the my >Str $x; semantics, I haven't seen a '>' before used like that
17:51 hejki i recall reading some medical study that linked that with chronic usage of regexp
17:51 PerlJam hejki: that's a community trait--bizarre thinking.
17:51 hejki :P
17:52 hejki i'd call it a 'perk' instead tbh
17:52 huf perl-1?
17:52 PerlJam perl--
17:52 TimToady rakudo: my $name = 'perk'; $name++; say $name
17:52 p6eval rakudo 3867ff: perl␤
17:52 huf coincidence? i'm just asking questions here ;)
17:53 * PerlJam wonders if rakudo still has the proper semantics ...
17:53 TimToady ash_: I've mentioned >Str once or twice on channel in the past as a potential coercive type notation
17:53 PerlJam rakudo: my $n = "foo99.jpg";  $n++; say $n;
17:53 TimToady I've also mentioned Str() for the same thing
17:53 p6eval rakudo 3867ff: fop00.jpg␤
17:54 PerlJam rakudo: my $n = "foo.99.jpg";  $n++; say $n;
17:54 p6eval rakudo 3867ff: fop.99.jpg␤
17:54 PerlJam rakudo: my $n = "9Z.jpg";  $n++; say $n;
17:54 p6eval rakudo 3867ff: 10A.jpg␤
17:54 huf c'mon we want manly jpegs
17:54 ash_ so, instead of failing an assignment to the value it will convert it to a string then try the assignment?
17:54 TimToady or if used as a parameter, constrains the type to be the "outer" type, but coerces to the "inner" type
17:55 ash_ would that work only with Str objects? or could you define some meta/magic/whatever function so your custom objects can do a similar coercion?
17:56 TimToady sub foo (Foo>Bar $x) {} would allow any Foo but coerce to Bar
17:56 TimToady or sub foo(Bar(Foo) $x) {} in the other notation
17:56 TimToady the > seems more mnemonic though
17:56 ash_ So that takes a Foo and turns it into a Bar once the functions called?
17:56 TimToady and we don't have prefix:«>»
17:57 PerlJam TimToady: today was the first time I've seen you mention the > notation that I can recall, and I tend to agree that it seems to work better.
17:57 TimToady that's the idea; we already use this notation for infix:<+> and such
17:57 TimToady s/notation/notion/
17:58 TimToady up till now we've just been poking extra multis into Any (now Cool, conjecturally)
17:59 ash_ Sounds like that would be useful, is it strickly syntactic sugar for sub foo(Bar(Foo) $x) {} or would you need to define a .prefix:«>» () in your class to get the functionality? or are you still thinking about it>
17:59 ash_ s/>/\?/
18:00 TimToady so something like multi infix:<+> (>Num $x, >Num $y) would define both (Num $x, Num $y) and (Cool $x, Cool $y) sigs, the latter coercing to the former
18:00 TimToady we would not have both >Bar and Bar()
18:02 payload joined #perl6
18:03 TimToady well, those aren't the only two syntactic possibilities
18:03 TimToady since the notation is used only in declarations, could even use .Bar and Foo.Bar
18:04 TimToady since .Bar is a normal coercion in normal expressions
18:04 ash_ sub foo(Foo as Bar $a) { ... } # i guess as is taken?
18:04 TimToady (.Num $x, .Num $y) doesn't read so badly either
18:05 TimToady however, people who think they can leave declarators off will not get a good error message
18:05 PerlJam anything without the parens will probably read okay  :)
18:06 TimToady well, I guess .Num $x is also a two-terms-in-a-row error, so maybe it's not so bad
18:07 TimToady that'd mean 'my .Num $x' is short for 'my Cool.Num $x'
18:07 PerlJam Hmm.
18:08 stephenlb joined #perl6
18:08 PerlJam the dot makes me want to ask about the Num method on Cool
18:09 PerlJam That doesn't connect well with coercion like the > does
18:09 TimToady but the Num method *is* a coercion on Cool  :)
18:10 ash_ But is there a Bar method on Foo?
18:10 zamolxes joined #perl6
18:12 TimToady sorry, we're distracted here by a cute little earthquake, felt like about a 3.0
18:14 TimToady ash_: the parser knows if a method name is a known type, and can force it to be a coercion
18:15 bbkr joined #perl6
18:16 ash_ but doesn't the '.' semantic imply a method call?
18:16 PerlJam ash_: yes, and that's what does the coercion.
18:16 PerlJam (from what I can tell)
18:17 TimToady actually, USGS says it was a 4.2 over east of Fremont
18:19 ash_ ah, i guess i am misunderstanding how coercion is occuring, will that do:  my Bar $a; my .Foo $b = $a; and under the hood do $b = $a.Foo;
18:21 TimToady coercions may be specified either by the "from" type or the "to" type.  on the "from" type it looks like a method.  on the "to" type it looks like a call to postcircumfix:<( )>
18:21 TimToady either of these can fall back on the other, I suspect
18:22 TimToady so if there is only one definition or the other, Foo($x) and $x.Foo are equivalent
18:23 ash_ When you do Foo($x) is that like a Foo.new($x)?
18:23 * eric256 starts to doubt that substr should modify a string at all
18:26 PerlJam TimToady: Earlier it looked like  my .X $x; was meant to be an Any->X coercer.  True?
18:28 PerlJam er, I guees the proper example would be something like sub foo (.X $x) { ... }
18:29 TimToady the coercing types now derive from Cool (which derives from Any)
18:29 PerlJam and maybe it was Cool->X, but still.   If either of those is the case, then doesn't that run afoul of the idea that .X is a method call on $_ ?
18:29 Chillance joined #perl6
18:29 TimToady so I think it would be Cool->X
18:29 TimToady not in a declaration
18:30 TimToady but there is potential for user confusion, even if the compiler isn't confused
18:30 TimToady so maybe > is better in that regard
18:30 PerlJam if we've hardwired everyone to think of .foo as the same as $_.foo, (and I think we have) then there'll definitely be user confusion (IMHO)
18:31 TimToady worse for writing HTML though :)
18:34 jferrero joined #perl6
18:35 jferrero joined #perl6
18:36 scottietaz in that case (HTML) you could use the parenthesis though, yes?
18:36 uniejo joined #perl6
18:39 PerlJam scottietaz: we already use > and < all over the place in Perl, so I don't think it'll be too much of an added burden here  :)
18:39 PerlJam besides, I find the parentheses icky  (perhaps that's just my anti-lisp bias showing)
18:40 scottietaz I'm in favor of the > over the .
18:42 ash_ sub foo(Foo as Bar $a) { ... } makes sense to me, Your expecting Foo but its going to function as a Bar
18:42 ash_ but then i guess the Mu/Cool case doesn't make sens, my as Bar $a;
18:42 PerlJam ash_: aye, as far as wordy ops go, that does make sense.
18:43 PerlJam ash_: my * as Bar $a;
18:43 ash_ bbl, i have to go to lunch
18:43 payload joined #perl6
18:46 scottietaz why not, my as Bar $a;
18:46 PerlJam it doesn't read well.
18:47 PerlJam sub foo (as Bar $a) { ... }
18:48 PerlJam sub foo (Any:Bar $a) { ... }  # everyone wants the colon!  :)
18:48 Juerd What are you brainstorming about?
18:49 PerlJam type coercion syntax.
18:49 Juerd sub foo ($a.=Bar) { ... }
18:49 Juerd Can't work, can it :)
18:50 PerlJam Juerd: well, it's more like this:   sub foo (X>Y $x) { ... }   # foo accepts an X or a Y, but if it gets an X, it is coerced into a Y
18:51 Juerd Does that happen a lot?
18:51 scottietaz So can you say, my Any as Bar $a;
18:51 TimToady happens every time you say "2" + "4"
18:52 scottietaz but I think the > syntax is fine
18:52 Juerd Oh, it doesn't automatically just coerce everything?
18:52 TimToady we would like to rely on multidispatch to decide whether coercion is necessary, and remove extra tests on the bare version for speed
18:53 * douglashunter wonders if a type coercion discussion caused the earthquake...
18:54 TimToady likely
18:54 Juerd Can you add a type later on?
18:54 PerlJam we must've crossed some criticla threshhold because we've  talked about it before without an earthquake.
18:54 Juerd If so, I suggest "takes" :)
18:55 Juerd my Str $foo takes Num;  $foo takes Blah;
18:55 hugues23 joined #perl6
18:57 PerlJam That seems more akin to  my Str|Num $foo;
18:58 scottietaz That looks like a type junction
18:58 PerlJam yep
18:58 PerlJam "takes" doesn't connote coercion for me.
18:58 scottietaz exactly what I was about to say regarding the type junction
18:58 Gothmog_ joined #perl6
18:59 scottietaz does that exist btw?
18:59 diakopter rakudo: my $x = "perk"; ++$x for 1..10; say $x
18:59 p6eval rakudo 3867ff: peru␤
18:59 ShaneC joined #perl6
18:59 diakopter rakudo: my $x = "perk"; $x+=10; say $x
18:59 p6eval rakudo 3867ff: 10␤
18:59 Juerd PerlJam: It's much like this Polish restaurant that had a sign "we take euro". But you get change in zloty.
19:00 PerlJam It's funny, but it's a rather small thing.   ">" doesn't connote coercion either but once you learn what it means in that context, it's suggestive of it.   If we were to use "takes", I'd forever be fighting historical baggage from the english language to remember what it does and when it can and can't be used.
19:00 Juerd PerlJam: But how about "eats" then? :D
19:00 TimToady scottietaz: no, not as a storage type declaration, and not really even as a constraint yet
19:01 Juerd sub foo (Bar $a eats Any) { ... }
19:01 Juerd Yum!
19:01 Juerd Bon apetit :)
19:01 TimToady currently you have to use a subset type to get the constraint as a junction
19:01 PerlJam Juerd: (-:
19:01 Juerd my Cat $kitty eats Mouse;
19:01 Juerd Weird.
19:02 TimToady the syntax has to support a default of Cool
19:02 Juerd What does that mean?
19:03 diakopter Cool was the codename for C#/.Net pre-2000
19:03 PerlJam Juerd: sub foo (>X $x) { ... }  # accepts a Cool or an X, coerces the Cool into an X
19:03 PerlJam same as sub foo(Cool>X $x) { ... }
19:03 Juerd What's... a Cool?
19:03 TimToady see S02:1113 and S02:1543
19:03 Juerd TimToady: Will do
19:04 TimToady it's what Any used to do, along with "anyness"
19:05 TimToady but moritz_++ suggested that user-defined types wouldn't want Perl's standard autocoercion semantics by default
19:05 Juerd Wow, I'm confused.
19:05 Juerd Or overwhelmed. Maybe both.
19:08 Juerd And S02 crashed my firefox
19:10 PerlJam ff was overwhelmed too
19:10 Juerd But I haven't crashed
19:12 douglashunter I'm just starting to read the spec, so feel free to ignore.  What does: `sub foo ( Num $bar as Str ) { ... }` do?
19:14 PerlJam douglashunter: nothing, it's a proposed syntax
19:14 PerlJam oh wait, I misread I think.
19:14 douglashunter I mean, is that a possible way to write coercion?  Or is it reserved for something else?
19:14 douglashunter s/reserved/speced as/
19:15 douglashunter Or do I need to go keep reading [grin]
19:16 PerlJam okay, now that I've fixed the weird wrapping on my terminal ...
19:16 douglashunter Oh, I didn't see that was basically proposed in my readback buffer here.
19:18 douglashunter I think I was asking a version of what ash_ asked.
19:18 douglashunter My (limited) understanding of types makes me want to put "as" in a signature to coerce.
19:20 PerlJam douglashunter: currently Perl uses "as Foo" as a possible return type on a subroutine though (which is why I thought I may have misread for a second).
19:20 scottietaz joined #perl6
19:21 PerlJam (see S02)
19:22 douglashunter Maybe I don't understand the terminology, but I thought "as Foo" was a trait, not part of the parameters.  sub foo as Bar {...};  # foo() returns a Bar.
19:22 xenoterracide joined #perl6
19:22 PerlJam douglashunter: no, it sounds like you understand well.
19:23 douglashunter Is it already used in parameters as well?  sub foo (Num $bar as Bar) { ... }; # foo takes a Num in $bar, coerces it to a Bar
19:23 PerlJam douglashunter: no, it's not.
19:24 douglashunter Cool.  That might be a nice way to coerce.
19:25 PerlJam except that  they mean different things.  sub foo as Bar (Blah $x as Baz) { ... }  # would be confusing.
19:26 douglashunter It's pretty clear to me that foo is a subroutine and $x is a Blah, and they respectively become a Bar and a Baz there.
19:27 payload joined #perl6
19:27 douglashunter if it weren't so long, we could write that as `sub foo as Bar (Blah $x becomes Baz) { ... }
19:28 douglashunter maybe that's clearer though.
19:29 douglashunter I can't believe I'm contributing to the earthquake that happened [grin]
19:29 PerlJam Using "as" for both would be confusing because one means "may be a Bar" and the other means "is coerced into a Baz".
19:30 PerlJam though if they were unified to always mean "turns into the type on the RHS", I guess that would be fine.
19:30 douglashunter Ah, sub foo as Bar { ... } allows different return types?
19:30 PerlJam I still like   Foo>bar $x   :)
19:31 PerlJam douglashunter: see S02:1472
19:31 douglashunter I dig that, too, because it makes sense to my *nix redirect semantics.
19:31 douglashunter PerlJam: cool, will do.
19:31 douglashunter But it seems that most of our nifty shorcut syntaxes also have a longer spelled out version.
19:32 douglashunter (Foo>bar $x) possibly spelled as (Foo $x becomes bar) in the parameters?
19:38 douglashunter PerlJam: S02:1472 will require me to bend my mind a bit [grin], thanks.
19:40 dakkar joined #perl6
19:46 pmurias joined #perl6
19:51 rgrau_ joined #perl6
19:51 TimToady I'm not sure that S02:1472 is well thought out wrt "as"
19:52 payload1 joined #perl6
19:54 PerlJam TimToady: well, it does have the same "structure" as what we're talking about for coercions ... except it doesn't have the coercion  :)
19:55 bluescreen joined #perl6
19:56 Exodist joined #perl6
19:58 jonasbn joined #perl6
20:05 ash_ so, on functions using 'as' is loose and using 'of' is enforced?
20:08 TimToady 'as' was meant to imply auto-coecion on the return value, but it might not be worth the mental cost, especially if coercion falls out of type syntax anyway, such as 'of >Num'
20:12 ash_ the last sentence of that in S02 is confusing to me referring to: my sub wanda ($x --> Squid) as Fish { ... } ; That should return the type Squid but inside the function your'll be returning a Fish which is getting coercered into a Squid? (please correct me if I am completely mis-reading that)
20:14 ash_ with the > syntax, you could change that to: my sub wanda ($x --> >Squid) { ... }
20:16 PerlJam ($x -->  Fish>Squid)  you mean
20:17 PerlJam >Squid would mean  Cool>Squid
20:19 ash_ oh, yeah, right i forgot the Fish
20:19 payload joined #perl6
20:26 pmurias joined #perl6
20:29 mberends joined #perl6
20:41 bryan[c1] joined #perl6
20:41 alester joined #perl6
20:44 payload joined #perl6
20:49 ash_ so, my sub wanda ($x --> Fish>Squid) { ... }; &wanda.returns; should give Squid? or Fish?
20:51 payload joined #perl6
20:52 TimToady it would alway give a Squid, but you could return a Fish that would coerce to a Squid
20:52 TimToady *always
20:52 ash_ okay, i get it now
20:53 ash_ so... could you also do say: my sub wanda ($x --> Animal|Fish>Squid) { ... };   and have it return an Animal or Fish that get coerced into a Squid?
20:56 ash_ just trying to think of all of a use of that, it might be nice if you had say a rendering function that could take a Str|HTMLElement and coerce it into say a RenderedOutput object or something
21:12 colomon___ joined #perl6
21:21 bbkr joined #perl6
21:45 jferrero joined #perl6
21:50 lacl joined #perl6
21:52 lacl left #perl6
21:53 astrojp joined #perl6
21:53 astrojp left #perl6
21:59 Hurley joined #perl6
21:59 hugues23 joined #perl6
22:03 renormalist joined #perl6
22:10 mohij joined #perl6
22:14 mohij hey guys. I just found out that in perl6 one can attach roles to instantiated objects this essentially allows to modify the interface of already instantiated objects. This is a feature I missed in all other object oriented languages i know. Now I can only say: Perl6 is SO going to rock :-D Thank you guys.
22:14 PerlJam mohij: cool. Glad you like it.
22:16 PerlJam mohij: btw, you can modify more than just the "interface" of individual, already instantiated objects :)
22:17 Juerd Javascript's prototype based OO lets you add things too.
22:19 patspam joined #perl6
22:25 cognominal joined #perl6
22:31 bbkr joined #perl6
22:38 payload joined #perl6
23:00 cognominal joined #perl6
23:02 eric256 left #perl6
23:21 jddjdd joined #perl6
23:24 cognominal joined #perl6
23:28 ashizawa joined #perl6
23:34 douglashunter_ joined #perl6
23:39 IllvilJa joined #perl6
23:54 dalek book: c5fca57 | chromatic++ | src/builtins.pod:
23:54 dalek book: Minor edits to the builtins section; some author comments.
23:54 dalek book: review: http://github.com/perl6/book/commit/c5fca576ec2645afbdf0d471f858e3b67dd5a001
23:54 mikehh joined #perl6
23:56 orafu joined #perl6

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

Perl 6 | Reference Documentation | Rakudo