»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by sorear on 4 February 2011. |
|||
00:05
tokuhiro_ joined
00:09
atrodo left
00:11
leprevost joined
00:16
supernovus left
00:28
jerome left
00:29
Circlepuller joined
00:30
Circlepuller_ left
00:42
jerome joined
00:43
Targen left
|
|||
dalek | rl6-roast-data: 64a98b7 | coke++ | p (2 files): today (automated commit) |
00:59 | |
perl6-roast-data: f50d826 | coke++ | / (4 files): | |||
perl6-roast-data: today (automated commit) | |||
00:59
dalek left,
dalek joined,
ChanServ sets mode: +v dalek
01:02
tokuhiro_ left
01:07
aramisf left
01:11
japhb_ left
01:14
aramisf joined
01:15
aramisf is now known as Guest20650
01:20
FROGGS_ joined
01:22
flightrecorder left
01:24
FROGGS left,
flightrecorder joined
|
|||
[Coke] | huh. there were 9 of those, and dalek only showed 2. | 01:25 | |
diakopter | poor guy got booted | 01:27 | |
01:28
mjreed joined
01:33
macae left
|
|||
[Coke] | ugh. parrot-nqp used to autoconvert based on HLL mappings. looks like I lost that using nqp | 01:36 | |
01:36
Targen joined
01:37
mjreed left
02:02
isBEKaml joined
02:04
buubot_backup left
|
|||
diakopter | is this valid C code: if (1); | 02:06 | |
sorear | yes | 02:07 | |
diakopter | cool | 02:08 | |
I have an opportunity to use it | |||
sorear | that is a valid C statement. it does nothing. | ||
you can shorten it to just ; | |||
diakopter | uhm. | ||
02:08
buubot_backup joined
|
|||
diakopter | surely you don't think I was asking about the case where 1 is there in particular | 02:08 | |
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 | ||
sorear | there is a statement after the condition | ||
; is legal anywhere C expects a statement | |||
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:10 | |
geekosaur | huh?\ | 02:11 | |
sorear | I'm just trying to answer the questions without regard to who's asking | ||
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
buubot_backup left
|
|||
sorear | actually I thought you were asking whether "if (1);", as a whole, was valid | 02:13 | |
diakopter | yes, but that would be an insane question because it's obviously a no-op | 02:14 | |
I mean, who would ask how to write a no-op? | |||
sorear | I think it's best not to second-guess people's questions. | ||
diakopter | I don't see any "second-guessing" there at all. | 02:15 | |
I see deduction from assumption of sanity and pragmatism | 02:16 | ||
shachaf wonders what context makes "if (...);" useful. | 02:17 | ||
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 | ||
shachaf | Does (a || b || c || d) have side effects? | ||
diakopter | nope | ||
shachaf | Then what's the point? | ||
diakopter | I was just curious if I could shorten the { return; } to ; | 02:19 | |
02:19
PacoAir left,
PacoAir_ joined
|
|||
colomon | www.johndcook.com/blog/2012/10/01/d...leverness/ # 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)". | ||
diakopter | ah | 02:21 | |
sorry I'm wrong; yes they do have side effects | |||
they are each CAS operations | |||
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 | ||
s/fails first/fails to CAS first/ | 02:23 | ||
really, only the first one needs checked actually | |||
02:35
macae joined
02:37
benabik left
|
|||
diakopter | colomon: do you disagree with the comment? | 02:38 | |
colomon | diakopter: very definitely | 02:39 | |
diakopter | can you support your opinion? | ||
02:41
benabik joined
02:46
orafu left
02:49
orafu joined
02:59
Pleiades` joined
03:18
adu joined
03:44
sivoais left
03:46
Tanktalus left
03:48
sivoais joined
03:49
isBEKaml left
03:56
jerome left
03:58
macae left
03:59
Tanktalus joined
04:10
isBEKaml joined,
jerome joined
04:25
telex left
04:27
bro_grammer left
04:30
leprevost left
04:31
telex joined
04:36
fgomez left
04:42
skids left
04:44
fgomez joined
04:49
cognominal left
04:55
cognominal joined
04:56
_jaldhar_ left
05:00
PacoAir joined,
PacoAir_ left
05:02
adj13 joined
|
|||
adj13 | perl6: say 3 | 05:03 | |
p6eval | rakudo 3d31af, niecza v22-6-g9e5350d: OUTPUT«3» | ||
adj13 | rakudo | ||
05:06
thou left
05:07
adu left
05:11
salala joined,
adj13 left
05:13
salala left
05:15
aharoni joined
05:20
tomaw left
05:21
birdwindupbird joined
05:25
cognominal left
|
|||
moritz | good morning | 05:30 | |
sorear | good morning moritz. | ||
05:31
Chillance left
|
|||
isBEKaml | moritz: good morning | 05:33 | |
moritz | \o sorear, isBEKaml | 05:35 | |
05:39
sivoais left
05:40
sivoais joined
05:44
cognominal joined
05:46
Kim_Breitwieser joined
05:51
isBEKaml left
05:53
aloha left
06:08
aloha joined
06:20
flightrecorder left
|
|||
mathw | o/ | 06:20 | |
06:20
FROGGS_ left
|
|||
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:21 | ||
sjohnson | o/ | 06:24 | |
sorear | "another job"? | ||
mathw | well I'd like to swap what I currently do for two days a week for something else | ||
sorear | do you currently have multiple jobs? would you, after the swap? | 06:25 | |
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:26 | |
sorear | ah, I see | 06:28 | |
06:29
isBEKaml joined
|
|||
mathw | ever done a schema migration on a database designed by someone who doesn't think referential integrity is important? | 06:30 | |
sjohnson | mathw.C++ | 06:31 | |
06:31
isBEKaml|2 joined
|
|||
mathw | Wouldn't mind doing some C++ | 06:31 | |
:) | |||
06:32
isBEKaml|2 left,
isBEKaml|2 joined
06:33
isBEKaml|2 left,
isBEKaml|2 joined,
isBEKaml|2 left
06:34
isBEKaml left
|
|||
sjohnson | mathw: what's the main source of grief? lack of job satisfaction? boring tasks? annoying coworkers? | 06:34 | |
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 | |
almost always takes the shortest path to a solution | |||
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 | ||
he's never had to produce proper specs before, because he's never had to communicate them to another programmer | |||
not that he wants to be a programmer anyway | |||
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 | ||
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 | ||
sjohnson | :[ | 06:40 | |
mathw | so that job's more annoying now because we can never deliver in the time frames they got used to | ||
becaues we don't have as much time as we did! | |||
even my productivity-per-day has gone down, because there's a context-switching penalty involved in this | 06:41 | ||
plus more time (proportionally) spent dealing with user support | |||
sjohnson | sounds like a recipe for woe | 06:44 | |
mathw | yeppers | ||
am currently entertaining approaches from a recruiter who contacted me | |||
sjohnson | it is kind of amazing why something so simple would be so hard for managers to understand | ||
mathw | but he hasn't got back to me after passing my CV on to a company yet | ||
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 | ||
mathw | yes | 06:46 | |
I've considered freelancing, but I have no idea how to get work or what to really do. | |||
06:50
wtw joined
|
|||
mathw | and I'm not sure I ahve the patience for the admin, so I'd rather just get a job :) | 06:52 | |
06:52
buubot_backup joined
06:56
buubot_backup left
07:00
atrodo joined
07:02
grondilu joined
|
|||
grondilu | I've recompiled rakudo and now when I try to import a module (previously imported with Panda), I get: | 07:03 | |
===SORRY!=== | |||
Missing or wrong version of dependency 'src/gen/CORE.setting' | |||
07:03
nebuchadnezzar joined
|
|||
sorear | afaik that's expected | 07:04 | |
grondilu | do I have to reinstall panda or something? | 07:05 | |
07:06
atrodo left
|
|||
sorear | you have to tell rakudo to recompile the modules. | 07:06 | |
I'm not sure how best to do that, but just using panda to reinstall the modules should be enough... | 07:07 | ||
alternately, you can delete the precompiled modules | |||
which should be .pir files in ~/.perl6 or something like that | |||
but IANA rakudo expert. | |||
grondilu tries removing *.pir files | 07:08 | ||
sorear | IANA rakudo user, for that matter, so take everything I say carefully | 07:10 | |
grondilu | well, now I can run panda at least. It takes a long time though, since nothing is precompile anymore. | 07:11 | |
07:12
cognominal left
|
|||
grondilu runs "panda install panda" (which is quite odd) | 07:14 | ||
mathw | :) | 07:15 | |
Programmers often deal with absurdities. It's part of the fun. | |||
grondilu | it failed. It wants an already precompiled JSON::Tiny | 07:16 | |
07:20
cognominal joined
|
|||
moritz | panda has a 'rebootstrap.pl' command | 07:21 | |
which you have to run (from its source directory) whenever you install a new rakudo version | |||
and you want to keep your old modules | 07:22 | ||
grondilu | moritz++: thanks | 07:23 | |
07:23
sqirrel joined
|
|||
sorear | o/ sqirrel | 07:24 | |
aharoni | Hallo. How can I check that I have the right version of ICU for building Rakudo? (I'm running Ubuntu.) | 07:27 | |
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:28 | |
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 | |
Or did you mean that I should run `make' and see what it says about ICU? | |||
sorear | aharoni: maybe try grep has_icu parrot/config_lib.pir | 07:31 | |
aharoni | set $P0["has_icu"], "0" | 07:32 | |
does "0" mean that I don't have it? | |||
moritz | correct | ||
--gen-parrot doesn't rebuild if there's a parrot already there | |||
what you can do is | 07:33 | ||
rm -rf install/ | |||
and then run perl Configure.pl --gen-parrot again | |||
aharoni | aha, "Is ICU installed....................................yes" | 07:35 | |
maybe it's because I installed libicu_dev after running Configure for the first time. | 07:36 | ||
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
Patterner left
|
|||
sorear | these days the only "clean" I trust is "git clean" | 07:37 | |
07:39
Psyche^ joined,
Psyche^ is now known as Patterner
|
|||
moritz | aharoni: well, 'make realclean' only cleans rakudo's files | 07:40 | |
07:53
cognominal left
07:59
grondilu left,
cognominal joined
|
|||
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) | ||
aharoni | Should I maybe add a comment about this to S02-types/version.t? | ||
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 | |
there are a number of test files that Rakudo autoskips if ICU is not available | |||
aharoni wonders what other tests it auto-skips. | 08:04 | ||
moritz | grep icu t/spectest.data | ||
aharoni | I would actually love it not to skip Unicode-related tests, given that I care about foreign alphabets a lot. | 08:05 | |
08:06
fhelmberger joined
|
|||
jnthn | afty, #pelr6 | 08:06 | |
oops, forgot to type... | |||
aharoni | sorear, moritz, i huess that the marker is `# icu' | ||
a comment in the end of the line. | |||
sorear | aharoni: why test something that is known a priori to fail? | ||
jnthn, aharoni needs to know the history of ICU in Parrot | 08:07 | ||
also, goof afternood | |||
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 | |
(Although I would probably notice it after some time.) | |||
Is there maybe some make target than runs everything without skipping? | 08:09 | ||
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 | |
I've no idea how to do it these days. | |||
s/done/don't | |||
aharoni | On Ubuntu it's just a matter of installing libicu_dev. | ||
jnthn | Yeah, I'm on Windows. | ||
aharoni | Oh. | 08:11 | |
jnthn | I don't see ICU as our long-term or even medium-term solution anyways. | ||
aharoni | Anyway, how can I submit a patch that marks these tests as ICU-dependent? 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 | ||
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 | ||
jnthn | aharoni: Then create a patch and send it to [email@hidden.address] | ||
aharoni | Oh, GitHub, of course. I just cloned and didn't even look at github.com :) | 08:14 | |
OK. | |||
sorear | note that rakudo has an unusualy (by #perl6 standards) restrictive commitbit policy | ||
aharoni | No problem. | 08:15 | |
08:15
buubot_backup joined
|
|||
sorear | for most other repos we'd give you commit access right now and tell you to fix it yourself | 08:15 | |
08:15
kresike joined
|
|||
sorear | but rakudo does not give commit bits without a signed committer license agreement | 08:15 | |
kresike | good morning all you happy perl6 people | ||
sorear | hmm, I should do that someday soon | ||
o/ kresike | |||
kresike | hello sorear o/ | ||
tadzik | hello | 08:19 | |
jnthn | Wow, no Rakudo or NQP commits while I was gone in Nikko | ||
o/ tadzik | |||
sorear | o/ tadzik | 08:21 | |
tadzik | jnthn: do you plan to look at the threads issue? | 08:22 | |
08:22
Kim_Breitwieser left
|
|||
tadzik | nqp vs parrot-nqp inconsistency | 08:22 | |
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? | ||
moritz | aharoni: you can simply clone yourself into t/spec/ | 08:25 | |
aharoni: then rakudo will just 'git pull' | |||
aharoni: but of course I can also just give you commit access to perl6/roast, and then you can use the official one :-) | |||
aharoni: what's your github ID? | |||
jnthn | tadzik: I thought the threads thing in Parrot got backed out? | ||
tadzik | jnthn: gist.github.com/3817314 | ||
aharoni | moritz, amire80 | ||
tadzik | jnthn: backed out by whom | 08:26 | |
aharoni | moritz, it's very nice of you :) | ||
jnthn | tadzik: I thought I saw a post saying that the threads merge wasn't meant to have happened. | ||
tadzik | huh, don't recall that | ||
08:26
tomaw_ joined
|
|||
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. | ||
moritz | aharoni: welcome. Have the appropriate amount of fun | ||
tadzik | dukeleto was asking me about blockers recently | ||
aharoni | moritz, thank you. | ||
jnthn | tadzik: Was the lexpad issue fixed? | ||
tadzik: nqp, unlike parrot-nqp, does sub lookups lexically, consistently. | 08:27 | ||
tadzik | jnthn: yes, see gist | ||
it works in parrot-nqp | |||
jnthn | Even for a custom lexpad? | 08:28 | |
tadzik | well, I don't know :) | ||
it fails in perl6/nqp | |||
jnthn | Hm | 08:29 | |
I'm really not sure from the backtrace, aside from it seems to be trying to construct an exception for some reason | |||
I'm not sure why, but the root issue may be that something causes an exception | |||
08:32
kurahaupo left
08:33
dakkar joined
|
|||
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:35 | |
jnthn did that at uni... :) | 08:37 | ||
08:41
FROGGS joined
08:42
cognominal left
|
|||
sorear | o/ FROGGS | 08:42 | |
aharoni | Hehe, apparently there is a pull request about the Greek letters in version.t in GitHub already - github.com/rakudo/rakudo/pulls . | 08:44 | |
08:44
cognominal joined
08:46
flightrecorder joined
08:48
skids joined
08:49
buubot_backup left
|
|||
FROGGS | hi sorear | 08:49 | |
lestrrat | jnthn: your talk video is up now yapcasia.org/2012/talk/show/645d66c...4e6aeab6a4 | 08:52 | |
jnthn: do you have your slides up anywhere? | |||
jnthn | lestrrat: No, will fix that now | ||
Thanks for the reminder | |||
lestrrat | :) | ||
jnthn | lestrrat: jnthn.net/papers/2012-yapcasia-modules.pdf | 09:03 | |
diakopter | o.o | ||
lestrrat | jnthn: registered! thanks :) | 09:04 | |
09:06
MikeFair___ left
09:07
buubot_backup joined
09:08
tomaw_ is now known as tomaw
|
|||
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 | |
hello everyone. | |||
09:09
buubot_backup left
|
|||
jnthn | lestrrat: Awesome that the video is up so fast, BTW! | 09:10 | |
lestrrat++ | |||
lestrrat | If you felt it that way, then I did my job right ;) | ||
jnthn: please thank this guy -> twitter.com/941 | 09:11 | ||
I'm like the foreign relations / tech / finance guy. He does the rest | |||
09:12
buubot_backup joined
|
|||
lestrrat | if you haven't seen me talk about him, please peruse slides 40-42 www.slideshare.net/lestrrat/running...na-2011/40 :) | 09:13 | |
09:17
kurahaupo joined
|
|||
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 | ||
lestrrat | sorear: huh? what made you think that way? | ||
TimToady | sorear: you sure you aren't confusing lestrrat++ with someone else? | 09:20 | |
lestrrat | I AM against ustream'ing, if you ask :) | ||
but I don't think I've gone and talked about it much :) | 09:21 | ||
sorear | blogs.perl.org/users/yapceurope_201...ent-122259 | ||
lestrrat | Ah, I must have been thinking ustreaming but typed otherwise, or something. | 09:22 | |
sorear | what's ustreaming? | ||
lestrrat | people around here likes to www.ustream.tv/ their conferences (I don't know about europe or na) | 09:23 | |
i.e. stream it live | |||
also, we lower the quality of our videos. | |||
on purpose. | |||
that's what I wanted to say in that comment, I think. | |||
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 | ||
to which I was like, "well, yeah, I can give you some video, but not the real thing" | |||
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 | |
24 hours is never enough | |||
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 | |||
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 日本語. :) | ||
gets easier to choose if you don't :) | |||
lestrrat | the language barrier is one of the reasons why we are making the videos and slides available so quickly | ||
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 | ||
lestrrat | but they can figure it out if they watch the videos carefully. | ||
TimToady | which is why I picked something that can largely be understood by reading the code on the screen | 09:29 | |
though if they can't see that from the video, it'd be a problem | |||
sorear | lestrrat: what goes into making the videos presentable? why do na and europe take months? | ||
lestrrat | sorear: Right, but you don't need Japanese or English to understand stuff like this: www.youtube.com/watch?v=3C7Ngq6bM4M :) | ||
sorear: beats me. we just have an HD handycam on each room, and just download, cut, and upload. done. | 09:30 | ||
I have no clue why it would take more than a week or two to do the above work. | |||
sorear | lestrrat: is that the reduced quality version? | 09:31 | |
lestrrat | yep. | ||
sorear | I guess I need new glasses, because I can't see any unusal blurring :D | 09:32 | |
or rather, "it seems in focus to me :D" | |||
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 | |
TimToady: I meant to ask you - since you did live coding, you have no slides, right? | |||
just wanted to make sure. | |||
sorear | well I had better head off to sleep. | 09:34 | |
lestrrat++ 941++ # even if I didn't go I consider this a valuable community service | |||
& | |||
lestrrat | thanks. g'night | ||
mhasch | lestrrat: "live coding" might still have been prepared in advance... :-) | 09:35 | |
TimToady | lestrrat: in a sense I had 1377 slides | ||
lestrrat | meh :) | ||
TimToady | since it was a vim keystroke file | ||
lestrrat | oh, so you can actually repro the entire step ? | 09:36 | |
TimToady | but one can see teh before and after on rosettacode.org :) | ||
in the Perl 5 and Perl 6 entries for strand sort | |||
but yes, I can repro the whole thing | |||
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 | ||
(sorry, too tired to type properly this morning) | 09:38 | ||
vim keystroke file as presentation tool. Very cool. | |||
TimToady | the technology has a few rough edges yet | 09:40 | |
you have to be very careful not to use screen-relative commands like H | |||
mathw | I imagine setting it up is quite tedious | 09:41 | |
TimToady | well, depends on how safe you want it to be | ||
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 | ||
but that clobbers your position if you do j or k across a short line, so I had to compensate for that too | |||
and my popups didn't work quite right | |||
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
arnsholt_ is now known as arnsholt
|
|||
TimToady | also, inserts go in all as a single transaction, when you'd want to simulate typing one char at a time sometimes | 09:44 | |
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 | ||
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) | ||
Su-Shee | mathw: vim has a perl api, you can just enable it or use vimscript. | ||
TimToady | what the popups did was start a gnome-term with zoom=3 or so, fullscreen | ||
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. :) | ||
TimToady wasn't trying to use embedded Perl | |||
mathw | Su-Shee: then I'd have to learn vimscript :) | ||
Which I don't really object to, but it would be more fun to write something in Perl 6 or Haskell | |||
Su-Shee | mathw: www.ibm.com/developerworks/linux/li...index.html and there's a part 2, 3, 4 and 5 too. | 09:48 | |
TimToady | my vim script is all of three lines | ||
map <F12> :let feed = readfile(input("vs: ", "x", "file") . '.vs') | |||
map <Insert> :call feedkeys((len(feed)?remove(feed,0):''),'t') | |||
mhasch | TheDamian mentioned a little project "vimpoint" back in '08 or so; dont' know whether he pursued it further. | 09:49 | |
TimToady | map <Insert>: | ||
that's supposed to be a ^V-space | |||
oh, I had to write a program to take a keystroke file and split it into separate lines per command | 09:50 | ||
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:52
FROGGS left,
flightrecorder left
|
|||
mhasch | TimToady: did ^L not work? | 09:53 | |
TimToady | didn't seem to | ||
I tried lotsa things | |||
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 | ||
it certainly gave me the capability of recovering in ::eu when my cursor got off from where it belonged | |||
mathw | which is definitely worthwhile | 09:56 | |
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 | |
So `git status' in the spec repo shows it as untracked. | |||
10:02
skids left
10:03
wk left
|
|||
moritz | patches to change that would be appreciated | 10:05 | |
10:06
daxim joined
10:12
grondilu joined
|
|||
grondilu | Check out this: perl6 --target=pir -e 'sub infix:<m+>($x, $y) { $x + $y }' | 10:13 | |
===SORRY!=== | |||
Serialization Error: could not locate static code ref for closure 'infix:sym<m+>' | |||
? | 10:14 | ||
Am I missing something? | 10:15 | ||
"perl6 --target=pir -e 'sub m($x, $y) { $x + $y }'" works just fine. | 10:16 | ||
Please do not all anwser in the same time :/ | 10:22 | ||
In case you wonder, I wanted to precompile one of my library to make it faster. But I got the above error. | 10:24 | ||
10:27
cognominal left
10:28
cognominal joined
|
|||
TimToady | most of the experts are asleep or having Indian food :) | 10:29 | |
grondilu | ok, I'll wait, then. | ||
10:31
flightrecorder joined,
FROGGS joined
10:37
_jaldhar_ joined
|
|||
grondilu | r: sub postfix:<%> { $^x / 100 }; say 14% + 1; say 13 % 10; | 10:46 | |
p6eval | rakudo 3d31af: OUTPUT«1.143» | ||
grondilu | cool :) | ||
FROGGS | ya, it is :o) | 10:53 | |
10:56
mucker joined
11:05
Su-Shee_ joined
11:07
Su-Shee left
11:08
Su-Shee_ is now known as Su-Shee
|
|||
flussence | re: irclog.perlgeek.de/perl6/2012-10-02#i_6031394 -- I have! :D | 11:12 | |
mathw | flussence: fun, isn't it! | 11:13 | |
flussence | worse than that, I had to *fix* it into a proper structure | 11:14 | |
mathw | I *want* to | 11:15 | |
but I can't | |||
flussence | (which is real fun when the entire system you've been given is undocumented...) | ||
mathw | oooh | ||
at least I've got the author of the system in question here to beat up | |||
sorry, ask questions of | |||
11:17
sisar joined
11:20
leont joined,
SamuraiJack joined
|
|||
aharoni | moritz, I tried to fix that remaining test temp file issue: github.com/perl6/roast/pull/25 | 11:23 | |
11:24
sisar left
11:30
Tanktalus left
|
|||
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. | ||
moritz | (tomorrow is national holliday in .de) | ||
ingy | jnthn: hi | 11:40 | |
jnthn: can you pass me my beer please? | |||
11:41
cognominal left
|
|||
jnthn does so | 11:41 | ||
11:41
cognominal joined
|
|||
ingy drinkz | 11:41 | ||
jnthn | grondilu: Problem is that pre-compilation of things with custom operators doesn't work. | 11:42 | |
grondilu: It's already on my "stuff that really needs fixing" list. | |||
11:43
gootle left
11:44
Tanktalus joined,
gootle joined
11:48
simcop2387 left
11:50
gootle left
11:56
leprevost joined,
simcop2387 joined
11:57
gootle joined
|
|||
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:00 | |
12:01
mikemol left
|
|||
grondilu | jnthn: ok. | 12:02 | |
12:04
ireekennational joined
|
|||
leont | Ah, a maybe operator, nice | 12:05 | |
12:06
xinming joined
|
|||
FROGGS | flussence: what does it do? | 12:10 | |
.?() I mean | |||
12:10
SamuraiJack left
|
|||
Timbus | r: Any.?this-fails(); say 'alive'; | 12:13 | |
p6eval | rakudo 3d31af: OUTPUT«alive» | ||
daxim | doc.perl6.org/language/operators#postfix+.%3F | ||
the point is that you can safely chain method calls | 12:14 | ||
Timbus | kinda | ||
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» | ||
Timbus | r: class A { multi method foo(Int $a){"got int"} }; say A.?foo('bar'); | ||
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:19
benabik left
|
|||
jnthn | .? is not about bindability, just "is there a method with the right name" | 12:25 | |
12:30
Tanktalus left
|
|||
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 | ||
FROGGS | daxims answer speaks for the latter | ||
k | |||
what does it do if the method doesnt exist? | 12:33 | ||
is there a $! or something? | |||
12:33
tokuhiro_ joined
|
|||
moritz | it returns Nil | 12:34 | |
FROGGS | thanks | 12:35 | |
moritz | if you want $! set, you do to try $obj.?method() instead | ||
12:37
_jaldhar_ left
12:41
hoelzro|away is now known as hoelzro
12:44
Tanktalus joined
12:53
atrodo joined
12:56
flightrecorder left,
FROGGS left
|
|||
[Coke] wonders what diakopter's problem is. | 12:59 | ||
12:59
hash_table joined
13:02
Guest20650 is now known as aramisf
13:03
PacoAir left
|
|||
[Coke] | (referring to the discussion that occurred after sorear answered his C question) | 13:03 | |
13:03
PacoAir joined
13:04
am0c joined,
leprevost left
13:06
cognominal left
|
|||
[Coke] | to clarify: sorear was trying to be helpful, and IMO, diakopter reacted very (too?) defensively. | 13:07 | |
nqp precedence question: +@args[0].getList() | 13:08 | ||
is the + modifying the result of the getList method? | 13:09 | ||
13:09
flightrecorder joined
|
|||
[Coke] | jnthn: does nqp-latest support parrot HLL mappings for pmcs? | 13:09 | |
moritz | [Coke]: yes, the + binds less tight than method calls | 13:10 | |
jnthn | [Coke]: CompUnit lets you specify a hll | ||
[Coke] | jnthn: yes, but I'm not seeing args autoconverted. | ||
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) | ||
they are classes now. | |||
jnthn | How do you set up the mapping? | ||
13:12
FROGGS joined,
ireekennational left
|
|||
[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:12 | |
moritz++ #thanks. | 13:13 | ||
jnthn: I don't see any declarations to try to make that mapping work, no. | |||
13:14
snearch joined
|
|||
[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:15 | |
(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:16 | ||
sorry, on TclStrings and TclLists | 13:17 | ||
13:18
leprevost joined
13:22
kurahaupo left,
leprevost left
13:26
grondilu left
13:30
cognominal joined
13:32
GlitchMr joined
13:34
tokuhiro_ left,
hash_table left
13:58
bluescreen10 joined
14:01
flightrecorder left
14:03
FROGGS left
14:04
flightrecorder joined
14:11
snearch left
|
|||
pmichaud | good morning, #perl6 | 14:11 | |
moritz | good am, pm | 14:12 | |
14:12
stopbit joined
|
|||
dalek | kudo/nom: c1ddea8 | pmichaud++ | .gitignore: Remove '*~' from .gitignore . |
14:12 | |
14:12
sctt joined
14:16
FROGGS joined
|
|||
jnthn | hi, pmichaud | 14:20 | |
14:24
jaldhar joined,
wtw left
14:30
kaare__ joined
14:32
hoelzro is now known as hoelzro|away
|
|||
[Coke] misread that commit hash as my last name. | 14:34 | ||
O_o | |||
14:36
jaldhar left
14:37
sctt left,
hash_table joined
14:38
buubot_backup left
|
|||
[Coke] adds more caffeine to be safe. | 14:38 | ||
14:40
Kim_Breitwieser joined
|
|||
mathw | \o/ | 14:40 | |
14:41
jaldhar joined
|
|||
mathw contacts FedEx pls send caffeine stop urgent stop | 14:41 | ||
mathw is in need of tea | |||
14:41
kst left
|
|||
jnthn | [Coke]: It would be far more worrying if you misread a sha-1 hash as your first name... :) | 14:42 | |
14:43
cognominal left
|
|||
jnthn | sleep & | 14:44 | |
14:49
sirrobert joined
14:50
sctt joined
|
|||
sirrobert | r: "a b c 4 e" ~~ /$<num>=(\d+)/; say $<num>; say $num; | 14:50 | |
p6eval | rakudo 3d31af: OUTPUT«===SORRY!===Variable $num is not declaredat /tmp/OZlTDMIt_b:1» | ||
sirrobert | how do I refer to the var after capture? | ||
mathw wonders what locale jnthn is in right now | |||
14:50
cognominal joined
|
|||
sirrobert | r: say "a b c 4 e" ~~ /$<num>=(\d+)/; | 14:51 | |
mathw | r: "a b c 4 e" ~~ /$<num>=(\d+)/; say $/<num>; | ||
p6eval | rakudo 3d31af: OUTPUT«「4」 num => 「4」» | ||
rakudo 3d31af: OUTPUT«「4」» | |||
FROGGS | r: "a b c 4 e" ~~ /$<num>=(\d+)/; say $<num>; | ||
sirrobert | mathw: ah, thanks | ||
p6eval | rakudo 3d31af: OUTPUT«「4」» | ||
FROGGS | ya | ||
mathw | $/ is the default match object | ||
sirrobert | thanks, both | ||
14:51
tokuhiro_ joined
|
|||
mathw | I was kind of surprised I remember that correctly actually :) | 14:52 | |
I'm not very current on the finer points of matches | |||
I should write some more Perl 6 :) | |||
sirrobert | ahhh... I see my issue | ||
the repl doesn't keep $/ from one command to the next. | |||
FROGGS | I had no chance to write something for the last weeks xF3.xF2 | 14:53 | |
mathw | aaah | ||
flussence | r: my $m = "a b c 4 e".match(/$<num>=(\d+)/); say $m<num>; | 14:54 | |
p6eval | rakudo 3d31af: OUTPUT«「4」» | ||
sirrobert | flussence: hm! I didn't know that | 14:55 | |
FROGGS | feels a little bit like javascript | ||
sirrobert | I guess it's returning a Regex which uses a postcircumfix operator '<>' to access named captures? | ||
mathw | oh yes you can save match objects | ||
r: my $m = "a b c 4 e".match(/$<num>=(\d+)/); say $m.WHAT; | |||
p6eval | rakudo 3d31af: OUTPUT«Match()» | ||
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
|
|||
mathw | so you can use postfix [] for numbered captures | 14:57 | |
sirrobert | ahh, that's cool | 14:58 | |
mathw | and {} and <> and «» for named ones | ||
sirrobert | and the special var $/ stores "last created Regex" ? | ||
mathw | that's the Match object from the last match operation | ||
the Regex object just has the pattern in it, Match is where the action is once you start doing things | 15:00 | ||
15:03
sctt left
15:04
atrodo left,
atrodo joined,
MayDaniel joined
15:05
birdwindupbird left
15:13
cognominal left
15:14
macae joined
15:20
benabik joined
15:31
skids joined
15:33
am0c left
15:35
benabik_ joined
15:37
benabik left,
benabik_ is now known as benabik,
flightrecorder left,
FROGGS left
15:38
tokuhiro_ left
15:41
benabik_ joined
|
|||
dalek | rlito: 5488b30 | (Flavio S. Glock)++ | / (4 files): Perlito5 - js - migrate array and hash accessors from "js3" to "js" |
15:43 | |
15:45
benabik left,
benabik_ is now known as benabik
15:48
Targen left
|
|||
dalek | rlito: 414f594 | (Flavio S. Glock)++ | README-perlito5-js: Perlito5 - js3 - README - add milestones |
15:51 | |
15:54
wk joined
16:01
cognominal joined
|
|||
kresike | bye folks | 16:03 | |
16:03
kresike left
16:13
wk left
16:18
daxim left
16:21
SamuraiJack joined
16:29
wk joined
16:31
macae2 joined
16:33
macae left
16:35
macae2 left
16:38
bluescreen10 left
16:40
kurahaupo joined
16:41
Chillance joined
16:44
fgomez left,
macae joined,
kurahaupo left
16:46
rummik- joined,
_jaldhar joined
16:48
aloha left,
rummik left,
skids left,
jaldhar left,
skids joined
16:49
cognominal left
16:50
bluescreen10 joined
16:53
aloha joined
16:54
dakkar left
16:57
kurahaupo joined
17:01
leont left
17:15
kurahaupo left,
tomaw_ joined
|
|||
diakopter | [Coke]: you're right; I do have a problem. I'm trying to get help. <- please don't take as an excuse | 17:16 | |
17:16
fhelmberger left
|
|||
[Coke] | hugme: hug diakopter | 17:21 | |
hugme hugs diakopter | |||
[Coke] | diakopter: | 17:24 | |
whoops. ENOMESSAGE, sorry about that. | 17:40 | ||
17:41
mjreed joined
|
|||
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:42 | |
[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 … | ||
[Coke] | I don't know about variable introspections. | 17:48 | |
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» | ||
tadzik | hehe, to clever | ||
r: say DateTime.^attributes | |||
p6eval | rakudo c1ddea: OUTPUT«$!year $!month $!day $!hour $!minute $!second $!timezone &!formatter $!saved-offset» | ||
17:52
buubot_backup joined
|
|||
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» | ||
GlitchMr | r: say Set.^attributes | ||
p6eval | rakudo c1ddea: OUTPUT«%!elems» | ||
mjreed | Thanks! | 17:57 | |
17:57
mucker left
18:00
benabik left
|
|||
[Coke] | should attributes be telling us the priva attributes? | 18:00 | |
tadzik | there is only one type of attributes :) | 18:04 | |
they can only have public accessors | |||
18:06
leont joined
18:13
erkan left
18:14
erkan joined,
erkan left,
erkan joined,
aharoni left
18:19
tokuhiro_ joined
18:21
_jaldhar left,
kaleem joined,
_jaldhar joined
18:24
Targen joined
18:25
kaleem left
18:29
fgomez joined
18:34
tokuhiro_ left
|
|||
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:35 | |
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. | ||
GlitchMr | Where 8 is your number of instances | ||
... | |||
oh, perhaps it will | |||
oh, it doesn' | |||
t | |||
It doesn't | |||
18:37
Targen left
|
|||
GlitchMr | mjreed: | 18:38 | |
> rand xx 8 | |||
0.26045819402589 0.758167870898859 0.671191730109182 0.588028023807915 0.819969979708805 0.181961273527108 0.60098118721211 0.477937755681602 | |||
It's feature :-) | |||
rn: print join ' ', join xx 8 | |||
p6eval | niecza v22-6-g9e5350d: OUTPUT«===SORRY!===Undeclared routine: 'xx' used at line 1Unhandled 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… | ||
..rakudo c1ddea: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&xx' called (line 1)» | |||
GlitchMr | rn: print join ' ', rand xx 8 | ||
p6eval | rakudo c1ddea: OUTPUT«0.599440810809941 0.501246903880627 0.043752178355259 0.387303263970303 0.751670024253219 0.833972400039769 0.432674116824582 0.104679755674702» | 18:39 | |
..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
|
|||
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» | ||
GlitchMr | infix:<xx>, expression repetition operator | 18:43 | |
I guess it explains the operator | |||
18:43
Exodist left
|
|||
GlitchMr | Foo.new xx 2 is like map { Foo.new }, ^2 | 18:44 | |
colomon | yes | 18:51 | |
18:53
XphX joined
19:00
XphX left
19:01
Targen joined
19:05
aharoni joined
|
|||
nyuszika7h | ohai | 19:14 | |
tadzik | hello nyuszika7h | ||
19:14
leont left
|
|||
nyuszika7h | rn: print 'hi' | 19:14 | |
p6eval | rakudo c1ddea, niecza v22-6-g9e5350d: OUTPUT«hi» | ||
19:18
kst joined
19:26
benabik joined
19:30
FROGGS joined
19:31
flightrecorder joined
|
|||
GlitchMr | hi | 19:33 | |
rn: say 'hi' | 19:34 | ||
p6eval | rakudo c1ddea, niecza v22-6-g9e5350d: OUTPUT«hi» | ||
sirrobert | how can I insert breakpoints in my code for the perl6-debug to catch (rakudo) | ||
? | |||
I mean, not during runtime | 19:35 | ||
GlitchMr | I guess you cannot... yet | 19:38 | |
sirrobert | ok, thanks =) | 19:40 | |
GlitchMr | rn: Exception.new(:message<Hello, world!>).throw | 19:45 | |
p6eval | niecza v22-6-g9e5350d: OUTPUT«===SORRY!===Undeclared name: 'Exception' used at line 1Unhandled 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… | ||
..rakudo c1ddea: OUTPUT« in block at /tmp/kho4NU2HNG:1» | |||
GlitchMr | Uhmmm... how can I throw exceptions properly? | ||
benabik | rn: throw "oops" | ||
p6eval | niecza v22-6-g9e5350d: OUTPUT«===SORRY!===Undeclared routine: 'throw' used at line 1Unhandled 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… | ||
..rakudo c1ddea: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&throw' called (line 1)» | |||
benabik | oops. | ||
GlitchMr | I know I can use die | 19:46 | |
But those exception types are to be used, aren't they? | |||
Oh, I have to extend them. | 19:47 | ||
ok | |||
sirrobert | dunno =) | ||
19:55
rindolf joined
19:57
rindolf left,
rindolf joined
|
|||
flussence | r: X::AdHoc.new(:payload<hai>).throw | 19:57 | |
p6eval | rakudo c1ddea: OUTPUT«hai in block at /tmp/oHnBmLfdHd:1» | ||
GlitchMr | Perl 6 debugger is awesome: 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? | ||
GlitchMr | But it looks better in action, with colors | ||
sirrobert: it's probably recursive hash then | 19:59 | ||
Currently, Perl 6 freezes on recursive hashes | |||
sirrobert | What's a recursive hash? | ||
a hash with itself as one of the elements? | |||
one of the values? | |||
GlitchMr | > my $a = {} | ||
().hash | |||
> $a<a> = $a | |||
yes | |||
sirrobert | huh, ok. I don't *think* I did that, but maybe so =) | ||
thanks, GM | 20:00 | ||
GlitchMr | This hash contains $a<a><a><a><a><a><a><a><a>... | ||
20:00
antigremlin joined,
GlitchMr left
20:07
sqirrel left
|
|||
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:27 | |
What does the <:D> stand for? | 20:28 | ||
moritz | defined | ||
ie Int:D allows 1, 2 or 3 but not the Int type object | |||
aharoni | I'm not sure that I understand the difference. | 20:29 | |
moritz | r: sub f(Int $x) { say $x.perl }; f(3) | ||
p6eval | rakudo c1ddea: OUTPUT«3» | ||
moritz | r: sub f(Int $x) { say $x.perl }; f(Int) | ||
p6eval | rakudo c1ddea: OUTPUT«Int» | ||
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» | ||
moritz | r: sub f(Int:D $x) { say $x.perl }; f(3) | ||
p6eval | rakudo c1ddea: OUTPUT«3» | ||
sirrobert | or, if it helps: | ||
r: say defined(Int); say defined(4); | |||
p6eval | rakudo c1ddea: OUTPUT«FalseTrue» | ||
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
|
|||
moritz | sure | 20:31 | |
you can use it for type checking, for example | |||
or for creating new instances | |||
or for introspection | 20:32 | ||
sirrobert | typechecking is the big deal (imho): | ||
moritz | r: say grep Int, 1, 2, 'string', ['arr', 'ay'] | ||
p6eval | rakudo c1ddea: OUTPUT«1 2» | ||
moritz | there I pass the Int type object to the grep() function | ||
sorear | or for type-friendly semipredicates, Maybe-style | 20:33 | |
sirrobert | my Int $foo; #do something else#; some_func($foo); | ||
You don't know if $foo is defined or not at runtime, say. | |||
But it does have to be an Int. | |||
20:33
kurahaupo joined
|
|||
aharoni | Ah, finally found it in perlcabal.org/syn/S12.html . | 20:34 | |
I would expect it to appear in S03 - Operators, but I don't see anything like it there. | |||
moritz | well, actually S06 is about subroutines, and the signatures belong to subroutines | 20:35 | |
so I'd expect it in S06, or maybe S02, beause everything is in S02 :-) | |||
aharoni | I couldn't find it in S02 either. Of course, it's possible that I don't understand what to look for. | 20:36 | |
moritz | indeed, it's only in S12 | 20:37 | |
sirrobert | What's the difference that makes the second one of these hang: | 20:40 | |
r: my %foo = {}; %foo ,= {a=>1}; say %foo; | |||
p6eval | rakudo c1ddea: OUTPUT«("a" => 1).hash» | ||
sirrobert | r: my $foo = {}; $foo ,= {a=>1}; say $foo; | ||
p6eval | rakudo c1ddea: OUTPUT«(timeout)» | ||
sirrobert | r: my $foo = {}; say $foo; $foo ,= {a=>1}; say $foo; | 20:41 | |
p6eval | rakudo c1ddea: OUTPUT«(timeout)().hash» | ||
sirrobert | it's definitely a hash before the freeze | ||
benabik | $foo = $foo, {a => 1} ? | 20:43 | |
sirrobert | except $foo is initialized as a hash | ||
r: my $foo = {}; $foo ,= $foo, {a=>1}; | |||
p6eval | rakudo c1ddea: ( no output ) | ||
benabik | r: say {}, {a =>1} | 20:44 | |
p6eval | rakudo c1ddea: OUTPUT«().hash("a" => 1).hash» | ||
sirrobert | no freeze | ||
say {} ,= {a => 1}; | |||
benabik | r: say {{}, {a =>1}}, {b => 2} | ||
p6eval | rakudo c1ddea: OUTPUT«Block.new()("b" => 2).hash» | ||
sirrobert | r: say {} ,= {a => 1}; | ||
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» | ||
sirrobert | that makes sense =) | ||
benabik | ().hash("a"=>1).hash ? | ||
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 | ||
sirrobert | benabik it does in the first example... | ||
benabik | I think it's creating something recursive. | ||
sirrobert | hmm | ||
why does the first one work? | |||
r: my %foo = {}; %foo ,= {a=>1}; say %foo; | |||
p6eval | rakudo c1ddea: OUTPUT«("a" => 1).hash» | ||
sorear | because you're using the % sigil | ||
benabik | r: my $foo = {}; $foo = %{$foo, a => 1}; say $foo; | 20:46 | |
p6eval | rakudo c1ddea: OUTPUT«===SORRY!===Non-declarative sigil is missing its nameat /tmp/vIWEU0UONO:1» | ||
sirrobert | so I can't *quite* use a hash stored in $ transparently... | ||
benabik | Bah. | ||
sirrobert | r: my Hash $foo = {}; $foo ,= $foo, {a=>1}; | ||
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:46
benabik left
|
|||
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» | ||
sirrobert | huh | ||
sorear | sirrobert: don't use ,= ever, it's very wasteful | ||
sirrobert | I can *see* that the difference is $ vs %, but I don't understand why. | ||
sorear: what's a better way to concatenate two hashes? | |||
,= was suggested | |||
or "merge" two hashes | 20:48 | ||
sorear | can't you use .push for that? | ||
anyway | 20:49 | ||
sirrobert | I dunno | ||
sorear | $foo ,= {} expands to $foo = $foo, {} | ||
or rather $foo = ($foo, {}) | |||
$foo may be a hash, but the variable itself doesn't know that | |||
so after that statement, you are left with $foo being a Parcel pair ($foo, {}) | |||
sirrobert | the reason that's a bummer is that means I can't do things like: %hash<x> = {...}; | ||
[Coke] | r: my $foo = {a=>1}; my $bar = {bar =>2}; $foo.push($bar); say $foo.perl; | ||
p6eval | rakudo c1ddea: OUTPUT«Trailing item in Hash.push in block at /tmp/qiJedzNkOu:1{"a" => 1}» | ||
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; | ||
p6eval | rakudo c1ddea: OUTPUT«{"a" => 1, "bar" => 2}» | ||
[Coke] | sirrobert: there's a version with push | ||
sirrobert | [Coke]: thanks =) | ||
20:50
SamuraiJack left
|
|||
sirrobert | my other version was a for loop. | 20:50 | |
[Coke] | de nada | ||
yah, I would ahve used a for loop, too. sorear++ | 20:51 | ||
20:53
Targen left
20:55
hash_table left
|
|||
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
|
|||
sirrobert | [Coke]: fwiw, the .kv isn't needed. | 20:57 | |
[Coke] | it was in my example. | 21:03 | |
look at the scrollback. | 21:04 | ||
21:06
Kim_Breitwieser left
|
|||
sirrobert | yeah, I was saying I re-tried your example... it works without the .kv | 21:07 | |
in case it was helpful | |||
colomon | sirrobert++ | 21:11 | |
21:15
sirrobert left
21:16
cognominal joined
21:18
adam7504 left,
birdwindupbird left
21:19
antigremlin left
21:30
rindolf left
|
|||
[Coke] | I'm saying I just got an error without the kv. | 21:31 | |
can you show an example here that doesn't use the colon syntax, uses the $ var, and doesn't get the error? | |||
(you changed both of those from my example: i'm betting it's the %-sigils that let it work. | |||
21:40
flightrecorder left,
FROGGS left
21:45
hash_table joined
21:50
rindolf joined
21:51
kurahaupo left
22:00
benabik joined
22:02
kaare__ left
22:04
stopbit left
|
|||
sorear | OT: SHA3 contest closes! www.nist.gov/itl/csd/sha-100212.cfm | 22:04 | |
rindolf | sorear: interesting. | 22:06 | |
sorear: someone once interested me in optimising one of the entries for this competition, but they ended up not wanting my help. | |||
22:10
bluescreen10 left
22:19
MayDaniel left
22:31
PacoAir left
22:36
whiteknight joined
23:31
Chillance left
23:45
macae left
23:50
rindolf left
23:51
benabik left
23:57
jerome left,
benabik joined
|