Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-10-02

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:05 tokuhiro_ joined #perl6
00:11 leprevost joined #perl6
00:29 Circlepuller joined #perl6
00:42 jerome joined #perl6
00:59 dalek perl6-roast-data: 64a98b7 | coke++ | p (2 files):
00:59 dalek perl6-roast-data: today (automated commit)
00:59 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/64a98b7a1f
00:59 dalek perl6-roast-data: f50d826 | coke++ | / (4 files):
00:59 dalek perl6-roast-data: today (automated commit)
00:59 dalek joined #perl6
01:14 aramisf joined #perl6
01:20 FROGGS_ joined #perl6
01:24 flightrecorder joined #perl6
01:25 [Coke] huh. there were 9 of those, and dalek only showed 2.
01:27 diakopter poor guy got booted
01:28 mjreed joined #perl6
01:36 [Coke] ugh. parrot-nqp used to autoconvert based on HLL mappings. looks like I lost that using nqp
01:36 Targen joined #perl6
01:37 mjreed left #perl6
02:02 isBEKaml joined #perl6
02:06 diakopter is this valid C code:  if (1);
02:07 sorear yes
02:08 diakopter cool
02:08 diakopter I have an opportunity to use it
02:08 sorear that is a valid C statement.  it does nothing.
02:08 sorear you can shorten it to just ;
02:08 diakopter uhm.
02:08 buubot_backup joined #perl6
02:08 diakopter surely you don't think I was asking about the case where 1 is there in particular
02:09 sorear actually I did
02:09 diakopter I would have thought it was pretty clear I was asking about the lack of statement after the condition
02:09 sorear there is a statement after the condition
02:09 sorear ; is legal anywhere C expects a statement
02:10 diakopter I... .... am *surprised* ... you thought I was asking whether 1 was a valid condition.  what kind of moron do you take me for?
02:11 geekosaur huh?\
02:11 sorear I'm just trying to answer the questions without regard to who's asking
02:12 * shachaf took the question the same way.
02:12 diakopter ok. thanks for the info that ; is always a valid statement. I knew it was ok after while () but I wasn't sure about if.
02:13 sorear actually I thought you were asking whether "if (1);", as a whole, was valid
02:14 diakopter yes, but that would be an insane question because it's obviously a no-op
02:14 diakopter I mean, who would ask how to write a no-op?
02:14 sorear I think it's best not to second-guess people's questions.
02:15 diakopter I don't see any "second-guessing" there at all.
02:16 diakopter I see deduction from assumption of sanity and pragmatism
02:17 * shachaf wonders what context makes "if (...);"  useful.
02:18 shachaf Anyway, "sanity" is a pretty vague thing, and figuring out edge cases of C can be tricky enough when you assume that people say what they mean. :-)
02:18 diakopter if (a || b || c || d) { return; } at the end of a void function
02:18 shachaf Does (a || b || c || d) have side effects?
02:18 diakopter nope
02:18 shachaf Then what's the point?
02:19 diakopter I was just curious if I could shorten the { return; } to ;
02:19 PacoAir_ joined #perl6
02:19 colomon http://www.johndcook.com/blog/2012/​10/01/dialing-back-the-cleverness/ # perl 6 disparagement in the comments...
02:19 shachaf You can, but you can also shorten the whole thing to either nothing or "(a || b || c || d)".
02:21 diakopter ah
02:21 diakopter sorry I'm wrong; yes they do have side effects
02:21 diakopter they are each CAS operations
02:21 shachaf OK, then you still don't need the if.
02:22 diakopter if another thread is competing to do the exact same process, the one that fails first can fail fast
02:23 diakopter s/fails first/fails to CAS first/
02:23 diakopter really, only the first one needs checked actually
02:35 macae joined #perl6
02:38 diakopter colomon: do you disagree with the comment?
02:39 colomon diakopter: very definitely
02:39 diakopter can you support your opinion?
02:41 benabik joined #perl6
02:49 orafu joined #perl6
02:59 Pleiades` joined #perl6
03:18 adu joined #perl6
03:48 sivoais joined #perl6
03:59 Tanktalus joined #perl6
04:10 isBEKaml joined #perl6
04:10 jerome joined #perl6
04:31 telex joined #perl6
04:44 fgomez joined #perl6
04:55 cognominal joined #perl6
05:00 PacoAir joined #perl6
05:02 adj13 joined #perl6
05:02 adj13 perl6: say 3
05:03 p6eval rakudo 3d31af, niecza v22-6-g9e5350d: OUTPUT«3␤»
05:03 adj13 rakudo
05:11 salala joined #perl6
05:15 aharoni joined #perl6
05:21 birdwindupbird joined #perl6
05:30 moritz good morning
05:30 sorear good morning moritz.
05:33 isBEKaml moritz: good morning
05:35 moritz \o sorear, isBEKaml
05:40 sivoais joined #perl6
05:44 cognominal joined #perl6
05:46 Kim_Breitwieser joined #perl6
06:08 aloha joined #perl6
06:20 mathw o/
06:21 * mathw was up late launching a bargeful of errors waiting to happen and would now very much like another job for two days of the week
06:24 sjohnson o/
06:24 sorear "another job"?
06:24 mathw well I'd like to swap what I currently do for two days a week for something else
06:25 sorear do you currently have multiple jobs?  would you, after the swap?
06:26 mathw I currently have two part-time jobs which fill the week between them. I very much like one of them (which used to be full-time, and I wish it still was), but the other one causes me continual grief
06:28 sorear ah, I see
06:29 isBEKaml joined #perl6
06:30 mathw ever done a schema migration on a database designed by someone who doesn't think referential integrity is important?
06:31 sjohnson mathw.C++
06:31 isBEKaml|2 joined #perl6
06:31 mathw Wouldn't mind doing some C++
06:31 mathw :)
06:32 isBEKaml|2 left #perl6
06:32 isBEKaml|2 joined #perl6
06:33 isBEKaml|2 left #perl6
06:33 isBEKaml|2 joined #perl6
06:33 isBEKaml|2 left #perl6
06:34 sjohnson mathw: what's the main source of grief?  lack of job satisfaction?  boring tasks?  annoying coworkers?
06:35 mathw it's a very small company, so it basically boils down to one coworker who just doesn't think the same way I do
06:35 mathw almost always takes the shortest path to a solution
06:36 sjohnson i hear ya
06:36 mathw and is very fond of giving me a task then implying it's my fault when I don't manage to include this obscure bit of it that he never told me about
06:36 mathw he's never had to produce proper specs before, because he's never had to communicate them to another programmer
06:36 mathw not that he wants to be a programmer anyway
06:37 mathw the best bit about this job is that I got to learn Dancer and write some serious Perl 5
06:37 sjohnson well, you're not alone
06:37 mathw yeah it's just hard to take because I had an idyllic job with a terrifyingly intelligent colleague who thinks a lot like me (but different enough for us to reinforce each other's weak points) but the company's been having trouble and they couldn't keep me on full time anymore
06:40 sjohnson :[
06:40 mathw so that job's more annoying now because we can never deliver in the time frames they got used to
06:40 mathw becaues we don't have as much time as we did!
06:41 mathw even my productivity-per-day has gone down, because there's a context-switching penalty involved in this
06:41 mathw plus more time (proportionally) spent dealing with user support
06:44 sjohnson sounds like a recipe for woe
06:44 mathw yeppers
06:44 mathw am currently entertaining approaches from a recruiter who contacted me
06:44 sjohnson it is kind of amazing why something so simple would be so hard for managers to understand
06:44 mathw but he hasn't got back to me after passing my CV on to a company yet
06:45 mathw I don't want to leave the good job, but if I have to... well, I have to
06:45 moritz hard choices are hard
06:46 mathw yes
06:46 mathw I've considered freelancing, but I have no idea how to get work or what to really do.
06:50 wtw joined #perl6
06:52 mathw and I'm not sure I ahve the patience for the admin, so I'd rather just get a job :)
06:52 buubot_backup joined #perl6
07:00 atrodo joined #perl6
07:02 grondilu joined #perl6
07:03 grondilu I've recompiled rakudo and now when I try to import a module (previously imported with Panda), I get:
07:03 grondilu ===SORRY!===
07:03 grondilu Missing or wrong version of dependency 'src/gen/CORE.setting'
07:03 nebuchadnezzar joined #perl6
07:04 sorear afaik that's expected
07:05 grondilu do I have to reinstall panda or something?
07:06 sorear you have to tell rakudo to recompile the modules.
07:07 sorear I'm not sure how best to do that, but just using panda to reinstall the modules should be enough...
07:07 sorear alternately, you can delete the precompiled modules
07:07 sorear which should be .pir files in ~/.perl6 or something like that
07:07 sorear but IANA rakudo expert.
07:08 * grondilu tries removing *.pir files
07:10 sorear IANA rakudo user, for that matter, so take everything I say carefully
07:11 grondilu well, now I can run panda at least.  It takes a long time though, since nothing is precompile anymore.
07:14 * grondilu runs "panda install panda"  (which is quite odd)
07:15 mathw :)
07:15 mathw Programmers often deal with absurdities. It's part of the fun.
07:16 grondilu it failed.  It wants an already precompiled JSON::Tiny
07:20 cognominal joined #perl6
07:21 moritz panda has a 'rebootstrap.pl' command
07:21 moritz which you have to run (from its source directory) whenever you install a new rakudo version
07:22 moritz and you want to keep your old modules
07:23 grondilu moritz++:  thanks
07:23 sqirrel joined #perl6
07:24 sorear o/ sqirrel
07:27 aharoni Hallo. How can I check that I have the right version of ICU for building Rakudo? (I'm running Ubuntu.)
07:28 sorear aharoni: I guess you could start the "Configure.pl" script, stop it when it starts building Parrot, then check to see what Parrot's configure thinks about your ICU
07:30 aharoni sorear,  I already ran `perl Configure.pl --gen-parrot --gen-nqp' once, and it cloned everything, so if I run it again, it finishes very quickly and doesn't say anything about what it did or didn't find. Even after I did `make realclean'.
07:30 aharoni Or did you mean that I should run `make' and see what it says about ICU?
07:31 sorear aharoni: maybe try grep has_icu parrot/config_lib.pir
07:32 aharoni set $P0["has_icu"], "0"
07:32 aharoni does "0" mean that I don't have it?
07:32 moritz correct
07:32 moritz --gen-parrot doesn't rebuild if there's a parrot already there
07:33 moritz what you can do is
07:33 moritz rm -rf install/
07:33 moritz and then run  perl Configure.pl --gen-parrot   again
07:35 aharoni aha, "Is ICU installed....................................yes"
07:36 aharoni maybe it's because I installed libicu_dev after running Configure for the first time.
07:36 aharoni But I didn't know that I should delete install/ before re-building. I assumed that `make realclean' would take care of it.
07:37 sorear these days the only "clean" I trust is "git clean"
07:39 Psyche^ joined #perl6
07:40 moritz aharoni: well, 'make realclean' only cleans rakudo's files
07:59 cognominal joined #perl6
08:02 aharoni When I didn't have ICU installed properly, S02-types/version.t tests with Greek letters failed. After installing libicu_dev and re-building, they pass.
08:02 TimToady back to Tokyo from Nikko (along with jnthn & ingy)
08:02 aharoni Should I maybe add a comment about this to S02-types/version.t?
08:03 sorear aharoni: you should modify t/spectest.data and add the NEEDS_ICU marker or however that's spelled to the S02-types/version.t line
08:03 sorear there are a number of test files that Rakudo autoskips if ICU is not available
08:04 * aharoni wonders what other tests it auto-skips.
08:04 moritz grep icu t/spectest.data
08:05 aharoni I would actually love it not to skip Unicode-related tests, given that I care about foreign alphabets a lot.
08:06 fhelmberger joined #perl6
08:06 jnthn afty, #pelr6
08:06 jnthn oops, forgot to type...
08:06 aharoni sorear, moritz, i huess that the marker is `# icu'
08:06 aharoni a comment in the end of the line.
08:06 sorear aharoni: why test something that is known a priori to fail?
08:07 sorear jnthn, aharoni needs to know the history of ICU in Parrot
08:07 sorear also, goof afternood
08:08 aharoni sorear, If you don't care about Unicode and don't want to install ICU, then it's fine to skip it. But without that failure that I had I wouldn't even notice that I don't have ICU installed properly.
08:08 aharoni (Although I would probably notice it after some time.)
08:09 aharoni Is there maybe some make target than runs everything without skipping?
08:10 jnthn History? Parrot used to bundle ICU within it and I spent ages getting the Windows build of it to work and if you had a Parrot you had an ICU, iirc. They they tossed it out of the repo and now some people have ICU and some done.
08:10 jnthn I've no idea how to do it these days.
08:10 jnthn s/done/don't
08:10 aharoni On Ubuntu it's just a matter of installing libicu_dev.
08:10 jnthn Yeah, I'm on Windows.
08:11 aharoni Oh.
08:11 jnthn I don't see ICU as our long-term or even medium-term solution anyways.
08:12 aharoni Anyway, how can I submit a patch that marks these tests as ICU-dependent? http://rakudo.org/how-to-help/ says to ask on IRC :)
08:12 jnthn But yeah, it's needed for doing Unicode stuff on Rakudo today
08:13 jnthn aharoni: Add the # icu markers.
08:13 sorear aharoni: make a patch, then either post it on irc using a pastebin, or via a github pull request, or a github ticket with patch, or whatever else suits you
08:13 jnthn aharoni: Then create a patch and send it to rakudobug@perl.org
08:14 aharoni Oh, GitHub, of course. I just cloned and didn't even look at github.com :)
08:14 aharoni OK.
08:14 sorear note that rakudo has an unusualy (by #perl6 standards) restrictive commitbit policy
08:15 aharoni No problem.
08:15 buubot_backup joined #perl6
08:15 sorear for most other repos we'd give you commit access right now and tell you to fix it yourself
08:15 kresike joined #perl6
08:15 sorear but rakudo does not give commit bits without a signed committer license agreement
08:15 kresike good morning all you happy perl6 people
08:15 sorear hmm, I should do that someday soon
08:15 sorear o/ kresike
08:15 kresike hello sorear o/
08:19 tadzik hello
08:19 jnthn Wow, no Rakudo or NQP commits while I was gone in Nikko
08:19 jnthn o/ tadzik
08:21 sorear o/ tadzik
08:22 tadzik jnthn: do you plan to look at the threads issue?
08:22 tadzik nqp vs parrot-nqp inconsistency
08:23 jnthn tadzik: What threads issue?
08:23 aharoni Mmm... `make spectest' clones from github.com/perl6/roast . Can I tell it to clone from my fork in some nice way?
08:25 moritz aharoni: you can simply clone yourself into t/spec/
08:25 moritz aharoni: then rakudo will just 'git pull'
08:25 moritz aharoni: but of course I can also just give you commit access to perl6/roast, and then you can use the official one :-)
08:25 moritz aharoni: what's your github ID?
08:25 jnthn tadzik: I thought the threads thing in Parrot got backed out?
08:25 tadzik jnthn: https://gist.github.com/3817314
08:25 aharoni moritz, amire80
08:25 tadzik jnthn: backed out by whom
08:26 aharoni moritz, it's very nice of you :)
08:26 jnthn tadzik: I thought I saw a post saying that the threads merge wasn't meant to have happened.
08:26 tadzik huh, don't recall that
08:26 tomaw_ joined #perl6
08:26 tadzik otoh, I'm not on parrot-dev anymore, I think
08:26 aharoni maybe I can just pull from perl6 and push to my fork.
08:26 moritz aharoni: welcome. Have the appropriate amount of fun
08:26 tadzik dukeleto was asking me about blockers recently
08:26 aharoni moritz, thank you.
08:26 jnthn tadzik: Was the lexpad issue fixed?
08:27 jnthn tadzik: nqp, unlike parrot-nqp, does sub lookups lexically, consistently.
08:27 tadzik jnthn: yes, see gist
08:27 tadzik it works in parrot-nqp
08:28 jnthn Even for a custom lexpad?
08:28 tadzik well, I don't know :)
08:28 tadzik it fails in perl6/nqp
08:29 jnthn Hm
08:29 jnthn I'm really not sure from the backtrace, aside from it seems to be trying to construct an exception for some reason
08:29 jnthn I'm not sure why, but the root issue may be that something causes an exception
08:33 dakkar joined #perl6
08:34 sorear tadzik: there was a force push reverting the threads merge.  there was a general message to parrot-dev telling people to recheckout.
08:34 tadzik I'll check out the ML
08:37 * jnthn did that at uni... :)
08:41 FROGGS joined #perl6
08:42 sorear o/ FROGGS
08:44 aharoni Hehe, apparently there is a pull request about the Greek letters in version.t in GitHub already - https://github.com/rakudo/rakudo/pulls .
08:44 cognominal joined #perl6
08:46 flightrecorder joined #perl6
08:48 skids joined #perl6
08:49 FROGGS hi sorear
08:52 lestrrat jnthn: your talk video is up now http://yapcasia.org/2012/talk/show/6​45d66cc-d98a-11e1-af5f-0d4e6aeab6a4
08:52 lestrrat jnthn: do you have your slides up anywhere?
08:52 jnthn lestrrat: No, will fix that now
08:52 jnthn Thanks for the reminder
08:52 lestrrat :)
09:03 jnthn lestrrat: http://jnthn.net/papers/2012-yapcasia-modules.pdf
09:03 diakopter o.o
09:04 lestrrat jnthn: registered! thanks :)
09:07 buubot_backup joined #perl6
09:09 Su-Shee lestrrat: I _just_ read your yapc::asia posting. you made it look like an amazing event i'm very envious about. :)
09:09 Su-Shee hello everyone.
09:10 jnthn lestrrat: Awesome that the video is up so fast, BTW!
09:10 jnthn lestrrat++
09:10 lestrrat If you felt it that way, then I did my job right ;)
09:11 lestrrat jnthn: please thank this guy -> https://twitter.com/941
09:11 lestrrat I'm like the foreign relations / tech / finance guy. He does the rest
09:12 buubot_backup joined #perl6
09:13 lestrrat if you haven't seen me talk about him, please peruse slides 40-42 http://www.slideshare.net/lestr​rat/running-jpa-yapcna-2011/40 :)
09:17 kurahaupo joined #perl6
09:19 jnthn lestrrat: have done so :)
09:19 sorear it's funny.  from what I've seen in the past, I thought lestrrat was generally opposed to the concept of videoing talks, yet yapc::asia has the promptest videos I've seen yet
09:19 lestrrat sorear: huh? what made you think that way?
09:20 TimToady sorear: you sure you aren't confusing lestrrat++ with someone else?
09:20 lestrrat I AM against ustream'ing, if you ask :)
09:21 lestrrat but I don't think I've gone and talked about it much :)
09:21 sorear http://blogs.perl.org/users/yapceuro​pe_2012/2012/02/video-recordings-for​-yapceurope-2012.html#comment-122259
09:22 lestrrat Ah, I must have been thinking ustreaming but typed otherwise, or something.
09:22 sorear what's ustreaming?
09:23 lestrrat people around here likes to http://www.ustream.tv/ their conferences (I don't know about europe or na)
09:23 lestrrat i.e. stream it live
09:23 lestrrat also, we lower the quality of our videos.
09:23 lestrrat on purpose.
09:23 lestrrat that's what I wanted to say in that comment, I think.
09:24 lestrrat since I was asked "I think - without wanting to say anything bad or picky - that video could be even cooler, perhaps with respect to the readability of the slides. "
09:24 lestrrat to which I was like, "well, yeah, I can give you some video, but not the real thing"
09:25 sorear now what I would *really* like in the conferences is some way to make the days longer so that you don't have to schedule interesting talks against each other
09:25 sorear 24 hours is never enough
09:26 lestrrat I'd hate that. the organizers would have to work longer hours ;)
09:26 * sorear cannot speak for yapc::asia specifically but had many painful decisions to make at ::europe
09:26 lestrrat yeah, I purposely put interesting talks back-to-back. otherwise you get one room full, and the other room empty. that's bad for the non-rock-star speakers. demotivates them a lot.
09:27 TimToady at ::asia it largely comes down to whether you understand very rapid 日本語.  :)
09:27 TimToady gets easier to choose if you don't :)
09:27 lestrrat the language barrier is one of the reasons why we are making the videos and slides available so quickly
09:28 lestrrat most JP people probably didn't understand what (exactly) larry was saying at the venue,
09:28 sorear probably for the best I didn't go, then.  my 日本語 listening comprehension skills are basically nonexistant
09:28 lestrrat but they can figure it out if they watch the videos carefully.
09:29 TimToady which is why I picked something that can largely be understood by reading the code on the screen
09:29 TimToady though if they can't see that from the video, it'd be a problem
09:29 sorear lestrrat: what goes into making the videos presentable?  why do na and europe take months?
09:29 lestrrat sorear: Right, but you don't need Japanese or English to understand stuff like this: http://www.youtube.com/watch?v=3C7Ngq6bM4M :)
09:30 lestrrat sorear: beats me. we just have an HD handycam on each room, and just download, cut, and upload. done.
09:30 lestrrat I have no clue why it would take more than a week or two to do the above work.
09:31 sorear lestrrat: is that the reduced quality version?
09:31 lestrrat yep.
09:32 sorear I guess I need new glasses, because I can't see any unusal blurring :D
09:32 sorear or rather, "it seems in focus to me :D"
09:33 lestrrat well let me just put it this way: if we used the original quality video, you would be able to see the scratches on the projector screen. it's full HD.
09:33 lestrrat TimToady: I meant to ask you - since you did live coding, you have no slides, right?
09:33 lestrrat just wanted to make sure.
09:34 sorear well I had better head off to sleep.
09:34 sorear lestrrat++ 941++ # even if I didn't go I consider this a valuable community service
09:34 sorear &
09:34 lestrrat thanks. g'night
09:35 mhasch lestrrat: "live coding" might still have been prepared in advance... :-)
09:35 TimToady lestrrat: in a sense I had 1377 slides
09:35 lestrrat meh :)
09:35 TimToady since it was a vim keystroke file
09:36 lestrrat oh, so you can actually repro the entire step ?
09:36 TimToady but one can see teh before and after on rosettacode.org :)
09:36 TimToady in the Perl 5 and Perl 6 entries for strand sort
09:36 TimToady but yes, I can repro the whole thing
09:37 lestrrat I think a lot of the people there were wondering how you were typing with one hand :) let me know if you feel like posting that keystroke file somewhere
09:37 mathw I like this ocncept
09:38 mathw (sorry, too tired to type properly this morning)
09:38 mathw vim keystroke file as presentation tool. Very cool.
09:40 TimToady the technology has a few rough edges yet
09:40 TimToady you have to be very careful not to use screen-relative commands like H
09:41 mathw I imagine setting it up is quite tedious
09:41 TimToady well, depends on how safe you want it to be
09:42 TimToady every command saves and restores the current position in my file, so if I accidentally or purposefully  move the cursor, it starts up again that the correct spot
09:42 TimToady but that clobbers your position if you do j or k across a short line, so I had to compensate for that too
09:42 TimToady and my popups didn't work quite right
09:43 TimToady not surprising since I hacked that capability in within the hour before the talk :)
09:43 Su-Shee can't you just make it a "filetype" and just disable the keystrokes for this foobar.mysuperpresentation filetype?
09:44 TimToady also, inserts go in all as a single transaction, when you'd want to simulate typing one char at a time sometimes
09:45 TimToady I'm sure there are lots of capabilities within vim that I haven't explored; I was trying to do the simplest thing that would work, and that was a little more complicated than what I used in ::eu, which didn't quite work
09:45 mathw Something tells me that one day there'll be a Perl script which produces files vim can digest from a friendly specification
09:46 Su-Shee I love the idea though. :) I never warmed up with anything "real presentation" like, I usally made everything html..
09:46 mhasch you'd also have to pay a price for more flexibility (shortcuts and elaborations)
09:46 Su-Shee mathw: vim has a perl api, you can just enable it or use vimscript.
09:46 TimToady what the popups did was start a gnome-term with zoom=3 or so, fullscreen
09:46 TimToady I'd hit a return to exit that, and then I was back in vim
09:47 Su-Shee I made a note "look into vim as presentation tool" for me. :)
09:47 * TimToady wasn't trying to use embedded Perl
09:47 mathw Su-Shee: then I'd have to learn vimscript :)
09:47 mathw Which I don't really object to, but it would be more fun to write something in Perl 6 or Haskell
09:48 Su-Shee mathw: http://www.ibm.com/developerworks/lin​ux/library/l-vim-script-1/index.html and there's a part 2, 3, 4 and 5 too.
09:48 TimToady my vim script is all of three lines
09:48 TimToady map <F12> :let feed = readfile(input("vs: ", "x", "file") . '.vs')
09:48 TimToady map <Insert> :call feedkeys((len(feed)?remove(feed,0):''),'t')
09:49 mhasch TheDamian mentioned a little project "vimpoint" back in '08 or so; dont' know whether he pursued it further.
09:49 TimToady map   <Insert>:
09:49 TimToady that's supposed to be a ^V-space
09:50 TimToady oh, I had to write a program to take a keystroke file and split it into separate lines per command
09:51 TimToady I couldn't find any way to get vim to update the screen if I didn't come back to a user prompt on each command
09:51 mathw I will admit to an influence from my colleague, who needed to generate an invoice so wrote an invoice-generating program.
09:53 mhasch TimToady: did ^L not work?
09:53 TimToady didn't seem to
09:53 TimToady I tried lotsa things
09:54 mathw huh
09:54 TimToady in the end I decided doing each command when I type space as a macro gave me more flexibility anyway
09:54 TimToady it certainly gave me the capability of recovering in ::eu when my cursor got off from where it belonged
09:56 mathw which is definitely worthwhile
10:00 aharoni I am very much a newbie, but I suspect that S32-io/IO-Socket-INET.pl creates the file server-ready-flag for testing and doesn't delete it.
10:00 aharoni So `git status' in the spec repo shows it as untracked.
10:05 moritz patches to change that would be appreciated
10:06 daxim joined #perl6
10:12 grondilu joined #perl6
10:13 grondilu Check out this:   perl6 --target=pir -e 'sub infix:<m+>($x, $y) { $x + $y }'
10:13 grondilu ===SORRY!===
10:13 grondilu Serialization Error: could not locate static code ref for closure 'infix:sym<m+>'
10:13 grondilu ?
10:15 grondilu Am I missing something?
10:16 grondilu "perl6 --target=pir -e 'sub m($x, $y) { $x + $y }'"  works just fine.
10:22 grondilu Please do not all anwser in the same time  :/
10:24 grondilu In case you wonder, I wanted to precompile one of my library to make it faster.  But I got the above error.
10:28 cognominal joined #perl6
10:29 TimToady most of the experts are asleep or having Indian food :)
10:29 grondilu ok, I'll wait, then.
10:31 flightrecorder joined #perl6
10:31 FROGGS joined #perl6
10:37 _jaldhar_ joined #perl6
10:46 grondilu r: sub postfix:<%> { $^x / 100 }; say 14% + 1; say 13 % 10;
10:46 p6eval rakudo 3d31af: OUTPUT«1.14␤3␤»
10:46 grondilu cool :)
10:53 FROGGS ya, it is :o)
10:56 mucker joined #perl6
11:05 Su-Shee_ joined #perl6
11:12 flussence re: http://irclog.perlgeek.de/​perl6/2012-10-02#i_6031394 -- I have! :D
11:13 mathw flussence: fun, isn't it!
11:14 flussence worse than that, I had to *fix* it into a proper structure
11:15 mathw I *want* to
11:15 mathw but I can't
11:15 flussence (which is real fun when the entire system you've been given is undocumented...)
11:15 mathw oooh
11:15 mathw at least I've got the author of the system in question here to beat up
11:15 mathw sorry, ask questions of
11:17 sisar joined #perl6
11:20 leont joined #perl6
11:20 SamuraiJack joined #perl6
11:23 aharoni moritz, I tried to fix that remaining test temp file issue: https://github.com/perl6/roast/pull/25
11:36 moritz aharoni: nice. I'll probably won't get around to look at it today, but tomorrow your chances are very good
11:36 aharoni Thank you, moritz.
11:36 moritz (tomorrow is national holliday in .de)
11:40 ingy jnthn: hi
11:40 ingy jnthn: can you pass me my beer please?
11:41 * jnthn does so
11:41 cognominal joined #perl6
11:41 * ingy drinkz
11:42 jnthn grondilu: Problem is that pre-compilation of things with custom operators doesn't work.
11:42 jnthn grondilu: It's already on my "stuff that really needs fixing" list.
11:43 Tanktalus joined #perl6
11:44 gootle joined #perl6
11:56 leprevost joined #perl6
11:56 simcop2387 joined #perl6
11:57 gootle joined #perl6
12:00 flussence I *really* *really* like .?() now. There's a thing I'm trying to do in $dayjob that'd be much easier if there was a short-circuiting -> op
12:02 grondilu jnthn: ok.
12:04 ireekennational joined #perl6
12:05 leont Ah, a maybe operator, nice
12:06 xinming joined #perl6
12:10 FROGGS flussence: what does it do?
12:10 FROGGS .?() I mean
12:13 Timbus r: Any.?this-fails(); say 'alive';
12:13 p6eval rakudo 3d31af: OUTPUT«alive␤»
12:13 daxim http://doc.perl6.org/language/operators#postfix+.%3F
12:14 daxim the point is that you can safely chain method calls
12:14 Timbus kinda
12:15 Timbus r: class A { method foo(Int $a){"got int"} }; say A.?foo('bar');
12:15 p6eval rakudo 3d31af: OUTPUT«Nominal type check failed for parameter '$a'; expected Int but got Str instead␤  in method foo at /tmp/7WDloz6g6k:1␤  in block  at /tmp/7WDloz6g6k:1␤␤»
12:15 Timbus r: class A { multi method foo(Int $a){"got int"} }; say A.?foo('bar');
12:15 p6eval rakudo 3d31af: OUTPUT«Cannot call 'foo'; none of these signatures match:␤:(A : Int $a, Mu *%_)␤␤  in method foo at src/gen/CORE.setting:367␤  in block  at /tmp/DoVzMTjshe:1␤␤»
12:25 jnthn .? is not about bindability, just "is there a method with the right name"
12:32 FROGGS so I can ask the object and it tells me (Bool) that the method exists or does it call the method?
12:32 jnthn Calls it if it exists
12:32 FROGGS daxims answer speaks for the latter
12:32 FROGGS k
12:33 FROGGS what does it do if the method doesnt exist?
12:33 FROGGS is there a $! or something?
12:33 tokuhiro_ joined #perl6
12:34 moritz it returns Nil
12:35 FROGGS thanks
12:35 moritz if you want $! set, you do to   try $obj.?method()   instead
12:44 Tanktalus joined #perl6
12:53 atrodo joined #perl6
12:59 * [Coke] wonders what diakopter's problem is.
12:59 hash_table joined #perl6
13:03 [Coke] (referring to the discussion that occurred after sorear answered his C question)
13:03 PacoAir joined #perl6
13:04 am0c joined #perl6
13:07 [Coke] to clarify: sorear was trying to be helpful, and IMO, diakopter reacted very (too?) defensively.
13:08 [Coke] nqp precedence question: +@args[0].getList()
13:09 [Coke] is the + modifying the result of the getList method?
13:09 flightrecorder joined #perl6
13:09 [Coke] jnthn: does nqp-latest support parrot HLL mappings for pmcs?
13:10 moritz [Coke]: yes, the + binds less tight than method calls
13:10 jnthn [Coke]: CompUnit lets you specify a hll
13:10 [Coke] jnthn: yes, but I'm not seeing args autoconverted.
13:11 jnthn Odd...you have custom PMCs?
13:11 [Coke] quite possible I lost something in the upgrade process so far, just wondering if I should expect that to work (especially for slurpy args getting autoboxed into my list type)
13:11 [Coke] they are classes now.
13:11 jnthn How do you set up the mapping?
13:12 FROGGS joined #perl6
13:12 ireekennational left #perl6
13:12 [Coke] I'm not sure that code survived. I'm just trying to find out if it's expected to work before I try to chase it down.
13:13 [Coke] moritz++ #thanks.
13:13 [Coke] jnthn: I don't see any declarations to try to make that mapping work, no.
13:14 snearch joined #perl6
13:15 [Coke] I suspect I'm going to be better off not relying on the autoconversion working (and therefore having methods available on every object that I put there), and instead move those methods to subs that can work with various types.
13:16 [Coke] (that .getList() for example, is also available on strings to convert them to a list - but not on builtin strings, and not on slurpy @args)
13:17 [Coke] sorry, on TclStrings and TclLists
13:18 leprevost joined #perl6
13:30 cognominal joined #perl6
13:32 GlitchMr joined #perl6
13:58 bluescreen10 joined #perl6
14:04 flightrecorder joined #perl6
14:11 pmichaud good morning, #perl6
14:12 moritz good am, pm
14:12 stopbit joined #perl6
14:12 dalek rakudo/nom: c1ddea8 | pmichaud++ | .gitignore:
14:12 dalek rakudo/nom: Remove '*~' from .gitignore .
14:12 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c1ddea84f4
14:12 sctt joined #perl6
14:16 FROGGS joined #perl6
14:20 jnthn hi, pmichaud
14:23 jaldhar joined #perl6
14:30 kaare__ joined #perl6
14:34 * [Coke] misread that commit hash as my last name.
14:34 [Coke] O_o
14:37 hash_table joined #perl6
14:38 * [Coke] adds more caffeine to be safe.
14:40 Kim_Breitwieser joined #perl6
14:40 mathw \o/
14:41 jaldhar joined #perl6
14:41 * mathw contacts FedEx pls send caffeine stop urgent stop
14:41 * mathw is in need of tea
14:42 jnthn [Coke]: It would be far more worrying if you misread a sha-1 hash as your first name... :)
14:44 jnthn sleep &
14:49 sirrobert joined #perl6
14:50 sctt joined #perl6
14:50 sirrobert r: "a b c 4 e" ~~ /$<num>=(\d+)/; say $<num>; say $num;
14:50 p6eval rakudo 3d31af: OUTPUT«===SORRY!===␤Variable $num is not declared␤at /tmp/OZlTDMIt_b:1␤»
14:50 sirrobert how do I refer to the var after capture?
14:50 * mathw wonders what locale jnthn is in right now
14:50 cognominal joined #perl6
14:51 sirrobert r: say "a b c 4 e" ~~ /$<num>=(\d+)/;
14:51 mathw r: "a b c 4 e" ~~ /$<num>=(\d+)/; say $/<num>;
14:51 p6eval rakudo 3d31af: OUTPUT«「4」␤ num => 「4」␤␤»
14:51 p6eval rakudo 3d31af: OUTPUT«「4」␤␤»
14:51 FROGGS r: "a b c 4 e" ~~ /$<num>=(\d+)/; say $<num>;
14:51 sirrobert mathw: ah, thanks
14:51 p6eval rakudo 3d31af: OUTPUT«「4」␤␤»
14:51 FROGGS ya
14:51 mathw $/ is the default match object
14:51 sirrobert thanks, both
14:51 tokuhiro_ joined #perl6
14:52 mathw I was kind of surprised I remember that correctly actually :)
14:52 mathw I'm not very current on the finer points of matches
14:52 mathw I should write some more Perl 6 :)
14:52 sirrobert ahhh... I see my issue
14:52 sirrobert the repl doesn't keep $/ from one command to the next.
14:53 FROGGS I had no chance to write something for the last weeks ó.ò
14:53 mathw aaah
14:54 flussence r: my $m = "a b c 4 e".match(/$<num>=(\d+)/); say $m<num>;
14:54 p6eval rakudo 3d31af: OUTPUT«「4」␤␤»
14:55 sirrobert flussence: hm!  I didn't know that
14:55 FROGGS feels a little bit like javascript
14:55 sirrobert I guess it's returning a Regex which uses a postcircumfix operator '<>' to access named captures?
14:55 mathw oh yes you can save match objects
14:55 mathw r: my $m = "a b c 4 e".match(/$<num>=(\d+)/); say $m.WHAT;
14:55 p6eval rakudo 3d31af: OUTPUT«Match()␤»
14:57 mathw it's a Match object, which contains the results of a regex match operation, and it implements the necessary roles to let you access named captures in a hash-like way and numbered captures in a list-like way
14:57 sirrobert cool
14:57 thou joined #perl6
14:57 mathw so you can use postfix [] for numbered captures
14:58 sirrobert ahh, that's cool
14:58 mathw and {} and <> and «» for named ones
14:58 sirrobert and the special var $/ stores "last created Regex" ?
14:58 mathw that's the Match object from the last match operation
15:00 mathw the Regex object just has the pattern in it, Match is where the action is once you start doing things
15:04 atrodo joined #perl6
15:04 MayDaniel joined #perl6
15:14 macae joined #perl6
15:20 benabik joined #perl6
15:31 skids joined #perl6
15:35 benabik_ joined #perl6
15:41 benabik_ joined #perl6
15:43 dalek Perlito: 5488b30 | (Flavio S. Glock)++ | / (4 files):
15:43 dalek Perlito: Perlito5 - js - migrate array and hash accessors from "js3" to "js"
15:43 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/5488b303f2
15:51 dalek Perlito: 414f594 | (Flavio S. Glock)++ | README-perlito5-js:
15:51 dalek Perlito: Perlito5 - js3 - README - add milestones
15:51 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/414f594666
15:54 wk joined #perl6
16:01 cognominal joined #perl6
16:03 kresike bye folks
16:21 SamuraiJack joined #perl6
16:29 wk joined #perl6
16:31 macae2 joined #perl6
16:40 kurahaupo joined #perl6
16:41 Chillance joined #perl6
16:44 macae joined #perl6
16:46 rummik- joined #perl6
16:46 _jaldhar joined #perl6
16:48 skids joined #perl6
16:50 bluescreen10 joined #perl6
16:53 aloha joined #perl6
16:57 kurahaupo joined #perl6
17:15 tomaw_ joined #perl6
17:16 diakopter [Coke]: you're right; I do have a problem. I'm trying to get help. <- please don't take as an excuse
17:21 [Coke] hugme: hug diakopter
17:21 * hugme hugs diakopter
17:24 [Coke] diakopter:
17:39 [Coke] whoops. ENOMESSAGE, sorry about that.
17:41 mjreed joined #perl6
17:42 mjreed hello.  What do we have in the way of introspection?  How do I see what methods are defined on an object, what variables are defined, etc?
17:45 [Coke] r: say Int.^methods;
17:45 p6eval rakudo c1ddea: OUTPUT«Int Num Rat FatRat abs Bridge chr sqrt base expmod is-prime floor round ceiling sign conj rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech cotanh acotanh unpolar cis Complex log exp …
17:48 [Coke] I don't know about variable introspections.
17:51 tadzik r: say Int.^attributes
17:51 p6eval rakudo c1ddea: OUTPUT«No such method 'gist' for invocant of type 'BOOTSTRAPATTR'␤  in method gist at src/gen/CORE.setting:4825␤  in sub say at src/gen/CORE.setting:7250␤  in block  at /tmp/c76MFh_Rn8:1␤␤»
17:51 tadzik hehe, to clever
17:51 tadzik r: say DateTime.^attributes
17:51 p6eval rakudo c1ddea: OUTPUT«$!year $!month $!day $!hour $!minute $!second $!timezone &!formatter $!saved-offset␤»
17:52 buubot_backup joined #perl6
17:53 GlitchMr r: say Str.^attributes
17:53 p6eval rakudo c1ddea: OUTPUT«No such method 'gist' for invocant of type 'BOOTSTRAPATTR'␤  in method gist at src/gen/CORE.setting:4825␤  in sub say at src/gen/CORE.setting:7250␤  in block  at /tmp/UA2KNGzukW:1␤␤»
17:53 GlitchMr r: say Set.^attributes
17:53 p6eval rakudo c1ddea: OUTPUT«%!elems␤»
17:57 mjreed Thanks!
18:00 [Coke] should attributes be telling us the priva attributes?
18:04 tadzik there is only one type of attributes :)
18:04 tadzik they can only have public accessors
18:06 leont joined #perl6
18:14 erkan joined #perl6
18:14 erkan joined #perl6
18:19 tokuhiro_ joined #perl6
18:21 kaleem joined #perl6
18:21 _jaldhar joined #perl6
18:24 Targen joined #perl6
18:29 fgomez joined #perl6
18:35 mjreed ok, another dumb question.  Given declaration   'my Foo @foo', what's the best loopless way to initialize it to contain $n instances of Foo.new()?
18:36 GlitchMr mjreed: my Foo @foo = Foo.new xx 8
18:36 mjreed that won't get you 8 refs to the same Foo?  Cool.  Thanks.
18:36 GlitchMr Where 8 is your number of instances
18:36 GlitchMr ...
18:36 GlitchMr oh, perhaps it will
18:36 GlitchMr oh, it doesn'
18:36 GlitchMr t
18:36 GlitchMr It doesn't
18:38 GlitchMr mjreed:
18:38 GlitchMr > rand xx 8
18:38 GlitchMr 0.26045819402589 0.758167870898859 0.671191730109182 0.588028023807915 0.819969979708805 0.181961273527108 0.60098118721211 0.477937755681602
18:38 GlitchMr It's feature :-)
18:38 GlitchMr rn: print join ' ', join xx 8
18:38 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤      'xx' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /home/p…
18:38 p6eval ..rakudo c1ddea: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&xx' called (line 1)␤»
18:38 GlitchMr rn: print join ' ', rand xx 8
18:39 p6eval rakudo c1ddea: OUTPUT«0.599440810809941 0.501246903880627 0.043752178355259 0.387303263970303 0.751670024253219 0.833972400039769 0.432674116824582 0.104679755674702»
18:39 p6eval ..niecza v22-6-g9e5350d: OUTPUT«0.57264244257129837 0.13834876713266073 0.27021880693278222 0.91654168996798879 0.640887339897867 0.84707201963619894 0.87091507942924051 0.020385839985863231»
18:41 mjreed left #perl6
18:42 colomon rn: class Foo { my $counter = 0; has $.index = $counter++; }; my @foo = Foo.new xx 8; say @foo>>.index;
18:42 p6eval rakudo c1ddea, niecza v22-6-g9e5350d: OUTPUT«0 1 2 3 4 5 6 7␤»
18:43 GlitchMr infix:<xx>, expression repetition operator
18:43 GlitchMr I guess it explains the operator
18:44 GlitchMr Foo.new xx 2 is like map { Foo.new }, ^2
18:51 colomon yes
18:53 XphX joined #perl6
19:01 Targen joined #perl6
19:05 aharoni joined #perl6
19:14 nyuszika7h ohai
19:14 tadzik hello nyuszika7h
19:14 leont left #perl6
19:14 nyuszika7h rn: print 'hi'
19:14 p6eval rakudo c1ddea, niecza v22-6-g9e5350d: OUTPUT«hi»
19:18 kst joined #perl6
19:26 benabik joined #perl6
19:30 FROGGS joined #perl6
19:31 flightrecorder joined #perl6
19:33 GlitchMr hi
19:34 GlitchMr rn: say 'hi'
19:34 p6eval rakudo c1ddea, niecza v22-6-g9e5350d: OUTPUT«hi␤»
19:34 sirrobert how can I insert breakpoints in my code for the perl6-debug to catch (rakudo)
19:34 sirrobert ?
19:35 sirrobert I mean, not during runtime
19:38 GlitchMr I guess you cannot... yet
19:40 sirrobert ok, thanks =)
19:45 GlitchMr rn: Exception.new(:message<Hello, world!>).throw
19:45 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared name:â�¤ 'Exception' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /ho…
19:45 p6eval ..rakudo c1ddea: OUTPUT«␤  in block  at /tmp/kho4NU2HNG:1␤␤»
19:45 GlitchMr Uhmmm... how can I throw exceptions properly?
19:45 benabik rn: throw "oops"
19:45 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤      'throw' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /hom…
19:45 p6eval ..rakudo c1ddea: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&throw' called (line 1)␤»
19:45 benabik oops.
19:46 GlitchMr I know I can use die
19:46 GlitchMr But those exception types are to be used, aren't they?
19:47 GlitchMr Oh, I have to extend them.
19:47 GlitchMr ok
19:47 sirrobert dunno =)
19:55 rindolf joined #perl6
19:57 rindolf joined #perl6
19:57 flussence r: X::AdHoc.new(:payload<hai>).throw
19:57 p6eval rakudo c1ddea: OUTPUT«hai␤  in block  at /tmp/oHnBmLfdHd:1␤␤»
19:58 GlitchMr Perl 6 debugger is awesome: https://gist.github.com/3822919
19:58 sirrobert So, I have a hash.  When I try to "say %.hash.perl" the program pins the CPU at 100% (even in the debugger).  How can I inspect it?
19:58 GlitchMr But it looks better in action, with colors
19:59 GlitchMr sirrobert: it's probably recursive hash then
19:59 GlitchMr Currently, Perl 6 freezes on recursive hashes
19:59 sirrobert What's a recursive hash?
19:59 sirrobert a hash with itself as one of the elements?
19:59 sirrobert one of the values?
19:59 GlitchMr > my $a = {}
19:59 GlitchMr ().hash
19:59 GlitchMr > $a<a> = $a
19:59 GlitchMr yes
19:59 sirrobert huh, ok.  I don't *think* I did that, but maybe so =)
20:00 sirrobert thanks, GM
20:00 GlitchMr This hash contains $a<a><a><a><a><a><a><a><a>...
20:00 antigremlin joined #perl6
20:27 aharoni In the documentation of Types at doc.perl6.org, there are many specifications that say something like "multi sub    chr(Int:D ) returns Str:D"
20:28 aharoni What does the <:D> stand for?
20:28 moritz defined
20:28 moritz ie Int:D allows 1, 2 or 3 but not the Int type object
20:29 aharoni I'm not sure that I understand the difference.
20:29 moritz r: sub f(Int $x) { say $x.perl }; f(3)
20:29 p6eval rakudo c1ddea: OUTPUT«3␤»
20:29 moritz r: sub f(Int $x) { say $x.perl }; f(Int)
20:29 p6eval rakudo c1ddea: OUTPUT«Int␤»
20:30 moritz r: sub f(Int:D $x) { say $x.perl }; f(Int)
20:30 p6eval rakudo c1ddea: OUTPUT«Parameter '$x' requires an instance, but a type object was passed␤  in sub f at /tmp/FbDX8HwLgJ:1␤  in block  at /tmp/FbDX8HwLgJ:1␤␤»
20:30 moritz r: sub f(Int:D $x) { say $x.perl }; f(3)
20:30 p6eval rakudo c1ddea: OUTPUT«3␤»
20:30 sirrobert or, if it helps:
20:30 sirrobert r: say defined(Int); say defined(4);
20:30 p6eval rakudo c1ddea: OUTPUT«False␤True␤»
20:31 sirrobert (moritz's was more thorough =)
20:31 aharoni OK, I understand the difference now, but I'm not sure what is f(Int) good for. Can I do anything with that object?
20:31 birdwindupbird joined #perl6
20:31 moritz sure
20:31 moritz you can use it for type checking, for example
20:31 moritz or for creating new instances
20:32 moritz or for introspection
20:32 sirrobert typechecking is the big deal (imho):
20:32 moritz r: say grep Int, 1, 2, 'string', ['arr', 'ay']
20:32 p6eval rakudo c1ddea: OUTPUT«1 2␤»
20:32 moritz there I pass the Int type object to the grep() function
20:33 sorear or for type-friendly semipredicates, Maybe-style
20:33 sirrobert my Int $foo; #do something else#; some_func($foo);
20:33 sirrobert You don't know if $foo is defined or not at runtime, say.
20:33 sirrobert But it does have to be an Int.
20:33 kurahaupo joined #perl6
20:34 aharoni Ah, finally found it in http://perlcabal.org/syn/S12.html .
20:34 aharoni I would expect it to appear in S03 - Operators, but I don't see anything like it there.
20:35 moritz well, actually S06 is about subroutines, and the signatures belong to subroutines
20:35 moritz so I'd expect it in S06, or maybe S02, beause everything is in S02 :-)
20:36 aharoni I couldn't find it in S02 either. Of course, it's possible that I don't understand what to look for.
20:37 moritz indeed, it's only in S12
20:40 sirrobert What's the difference that makes the second one of these hang:
20:40 sirrobert r: my %foo = {}; %foo ,= {a=>1}; say %foo;
20:40 p6eval rakudo c1ddea: OUTPUT«("a" => 1).hash␤»
20:40 sirrobert r: my $foo = {}; $foo ,= {a=>1}; say $foo;
20:40 p6eval rakudo c1ddea: OUTPUT«(timeout)»
20:41 sirrobert r: my $foo = {}; say $foo; $foo ,= {a=>1}; say $foo;
20:41 p6eval rakudo c1ddea: OUTPUT«(timeout)().hash␤»
20:41 sirrobert it's definitely a hash before the freeze
20:43 benabik $foo = $foo, {a => 1} ?
20:43 sirrobert except $foo is initialized as a hash
20:43 sirrobert r: my $foo = {}; $foo ,= $foo, {a=>1};
20:43 p6eval rakudo c1ddea:  ( no output )
20:43 benabik r: say {}, {a =>1}
20:44 p6eval rakudo c1ddea: OUTPUT«().hash("a" => 1).hash␤»
20:44 sirrobert no freeze
20:44 sirrobert say {} ,= {a => 1};
20:44 benabik r: say {{}, {a =>1}}, {b => 2}
20:44 p6eval rakudo c1ddea: OUTPUT«Block.new()("b" => 2).hash␤»
20:44 sirrobert r: say {} ,= {a => 1};
20:44 p6eval rakudo c1ddea: OUTPUT«Cannot assign to a readonly variable or a value␤  in block  at src/gen/CORE.setting:12001␤  in block  at /tmp/JCV68ujC4X:1␤␤»
20:44 sirrobert that makes sense =)
20:44 benabik ().hash("a"=>1).hash ?
20:45 benabik sirrobert: I don't think ,= does what you think it does.
20:45 sorear sirrobert: my $foo = {}; $foo ,= {a => 1} # $foo is now self referential
20:45 sirrobert benabik it does in the first example...
20:45 benabik I think it's creating something recursive.
20:45 sirrobert hmm
20:45 sirrobert why does the first one work?
20:45 sirrobert r: my %foo = {}; %foo ,= {a=>1}; say %foo;
20:45 p6eval rakudo c1ddea: OUTPUT«("a" => 1).hash␤»
20:45 sorear because you're using the % sigil
20:46 benabik r: my $foo = {}; $foo = %{$foo, a => 1}; say $foo;
20:46 p6eval rakudo c1ddea: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name␤at /tmp/vIWEU0UONO:1␤»
20:46 sirrobert so I can't *quite* use a hash stored in $ transparently...
20:46 benabik Bah.
20:46 sirrobert r: my Hash $foo = {}; $foo ,= $foo, {a=>1};
20:46 p6eval rakudo c1ddea: OUTPUT«Type check failed in assignment to '$foo'; expected 'Hash' but got 'Parcel'␤  in block  at src/gen/CORE.setting:12001␤  in block  at /tmp/Ch4GzkH6ZL:1␤␤»
20:47 sirrobert r: my Hash $foo; $foo ,= $foo, {a=>1};
20:47 p6eval rakudo c1ddea: OUTPUT«Type check failed in assignment to '$foo'; expected 'Hash' but got 'Parcel'␤  in block  at src/gen/CORE.setting:12001␤  in block  at /tmp/YuRcfXoaRw:1␤␤»
20:47 sirrobert huh
20:47 sorear sirrobert: don't use ,= ever, it's very wasteful
20:47 sirrobert I can *see* that the difference is $ vs %, but I don't understand why.
20:47 sirrobert sorear: what's a better way to concatenate two hashes?
20:47 sirrobert ,= was suggested
20:48 sirrobert or "merge" two hashes
20:48 sorear can't you use .push for that?
20:49 sorear anyway
20:49 sirrobert I dunno
20:49 sorear $foo ,= {} expands to $foo = $foo, {}
20:49 sorear or rather $foo = ($foo, {})
20:49 sorear $foo may be a hash, but the variable itself doesn't know that
20:49 sorear so after that statement, you are left with $foo being a Parcel pair ($foo, {})
20:49 sirrobert the reason that's a bummer is that means I can't do things like:  %hash<x> = {...};
20:49 [Coke] r: my $foo = {a=>1}; my $bar = {bar =>2}; $foo.push($bar); say $foo.perl;
20:49 p6eval rakudo c1ddea: OUTPUT«Trailing item in Hash.push  in block  at /tmp/qiJedzNkOu:1␤␤{"a" => 1}␤»
20:50 sirrobert then %hash<x> ,= %hash-y
20:50 [Coke] r: my $foo = {a=>1}; my $bar = {bar =>2}; $foo.push($bar.kv); say $foo.perl;
20:50 p6eval rakudo c1ddea: OUTPUT«{"a" => 1, "bar" => 2}␤»
20:50 [Coke] sirrobert: there's a version with push
20:50 sirrobert [Coke]: thanks =)
20:50 sirrobert my other version was a for loop.
20:50 [Coke] de nada
20:51 [Coke] yah, I would ahve used a for loop, too. sorear++
20:57 sirrobert r: my %foo = {a=>1}; my %bar = {b=>2}; say %foo.push: %bar;
20:57 p6eval rakudo c1ddea: OUTPUT«("a" => 1, "b" => 2).hash␤»
20:57 adam7504 joined #perl6
20:57 sirrobert [Coke]: fwiw, the .kv isn't needed.
21:03 [Coke] it was in my example.
21:04 [Coke] look at the scrollback.
21:07 sirrobert yeah, I was saying I re-tried your example... it works without the .kv
21:07 sirrobert in case it was helpful
21:11 colomon sirrobert++
21:16 cognominal joined #perl6
21:31 [Coke] I'm saying I just got an error without the kv.
21:31 [Coke] can you show an example here that doesn't use the colon syntax, uses the $ var, and doesn't get the error?
21:31 [Coke] (you changed both of those from my example: i'm betting it's the %-sigils that let it work.
21:45 hash_table joined #perl6
21:50 rindolf joined #perl6
22:00 benabik joined #perl6
22:04 sorear OT: SHA3 contest closes! http://www.nist.gov/itl/csd/sha-100212.cfm
22:06 rindolf sorear: interesting.
22:06 rindolf sorear: someone once interested me in optimising one of the entries for this competition, but they ended up not wanting my help.
22:36 whiteknight joined #perl6
23:57 benabik joined #perl6

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

Perl 6 | Reference Documentation | Rakudo