»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
xiaomiao bpaste.net/show/411842/ amusing nqp-2014.06 build failure 03:22
TimToady haven't seen that one, but I would suspect that it needs to have configure run again 03:29
I usually do that just by saying: . config.status
then it reruns Configure with the same arguments you had before 03:30
or try a fresh checkout (unless this was a fresh checkout, in which case I am clueless)
vendethiel o/ 05:19
yoleaux 26 Jun 2014 21:45Z <timotimo> vendethiel: "Just enter submit to evaluate the code you typed." that "enter submit" sounds weird/wrong
26 Jun 2014 21:46Z <timotimo> vendethiel: i'm not sure if this is the right thing to tell a newbie, but the reason why { say "hello world!" } only outputs "hello world!" and not 1 (the return value of say) is because that piece of code wrote something to stdout and then the return value will not be printed
vendethiel timotimo: yeah, not sure if it's good to tell newbees 05:19
ChoHag When should attributes be referred to as $.foo, and when as <sigil>!foo ? 06:26
moritz ChoHag: $.foo is a method call, so an indirection 07:09
ChoHag: from outside, you always need the indirection, because the attribute itself is private
moritz ChoHag: from inside a class, it's basically your choice, though for write operations you need the ! form, unless the accessor is rw 07:12
ChoHag Can I tell if an attribute has been set (either with an accessor, internally by the class or at initialisation) as opposed to using its default value? 10:48
FROGGS ChoHag: only when you create a Proxy, and do something in its STORE method 10:49
but that is ugly
ChoHag: why do you care? would it be a problem when somebody sets something that is identical to the default value? 10:50
ChoHag On a related not, can I set attributes (or methods) on attributes?
Probably not.
That is - it probably doesn't matter. 10:51
I can apply my own trait to an attribute but I can't, among other things, tell if an attribute has had that trait applied to it.
FROGGS I guess introspecting applied traits is on the roadmap... 10:55
colomon smoke test ran much longer last night, but still ended with 11:07
Segmentation fault (core dumped)
FROGGS :/ 11:10
ChoHag Given a class which has %.foo, how would I set foo to the perl 5 equivalent of: { a => { a1=>1, a2=>2 }, b => { ... } }? 11:11
I'm still getting my brackets mixed up in perl 6.
FROGGS m: class Bar { has %.foo is rw }; my $foo = Bar.new( :foo(a => { a1=>1, a2=>2 }, b => { ... }) ); say $foo 11:17
camelia rakudo-moar f445f8: OUTPUT«Bar.new(foo => ("b" => -> ($_? is parcel) { #`(Block|140372044679712) ... }, "a" => {"a1" => 1, "a2" => 2}).hash)␤»
FROGGS note that the { ... } is not a hash, but Code
sergot hi o/ 12:17
sjn \o 12:18
nwc10 At least there's some good news to temper the continuing delays in SpaceX launching their next soft landing test: spacecollege.org/isee3/isee-3-statu...ccess.html 12:20
nwc10 (oh, and 6 satellites. Apparently that's the official reason for the launch) 12:21
Ven It's a pretty quite day :-) 13:15
timotimo quiet* 13:16
TimToady hackathon hasn't started yet :) 13:23
timotimo would appreciate someone verifying my claims in the p6l mail i just sent 13:26
right now i'm not in a position to properly verify with an actual rakudo 13:28
Ven timotimo: It's quite a day, too ;) 13:37
timotimo: perl6-language ? 13:38
timotimo yes
Ven The most recent seems to be " [perl6/specs] 2d0d5a: Some more elaboration about CompUnit class" ?
timotimo oh
sorry, i meant p6u 13:39
Ven timotimo: perl6-users ? I don't see a message from you there, either 13:39
unless you're kamil Lu/lage
timotimo did my message not make it through? 13:40
i got the bounce
Ven Well, I'm browsing the "archives", so it might be why
timotimo ah
p6u is so low-traffic that it's very worth it to subscribe
Ven It's there on G groups :) 13:41
timotimo fair enough, i guess?
i can see my reply in there
"15 minutes ago" 13:42
groups.google.com/d/msg/perl.perl6...l4yMVCdkgJ
Ven timotimo: yep, `is` works
timotimo the question is: does "is" work like i explained? :)
Ven well, yes, else I wouldn't have said so 13:43
timotimo thank you :)
Ven I admit I havn't checked google groups for a while, probably like 6 months 13:45
Ven m: role A { method foo { say 1 } }; A.new.foo 13:56
camelia rakudo-moar f445f8: OUTPUT«1␤»
Ven being able to `new` roles seems kinda confusing, uh
moritz m: role A { method foo { say 1 } }; say A.new.WHAT === A 13:57
camelia rakudo-moar f445f8: OUTPUT«True␤»
TimToady interesting 13:58
Ven TimToady: that's not by design ?
TimToady arguably role A and class A are two different things
but with the pun, I don't think it's terrible to confuse them
Ven we a lisp/6 now :) ?
timotimo if you can't confuse them, the pun didn't work
TimToady a punnable role is really just a way to write a composable class, in a sense 13:59
the dicey bit is that the role is immutable, and the class is mutable, so it could diverge over time from its role 14:00
timotimo OOP is hard, let's go shopping
TimToady monkey typing will change the class, not the role 14:01
timotimo we already have trouble with monkey typing changes not applying everywhere they ought to
TimToady well, that's mostly because the bootstrap abstraction leaks
hoelzro morning #perl6 14:29
Ven o/ 14:31
TimToady \o 14:33
Ven There's no IO::Path#move ? Where is IO::Path anyway :( 14:33
timotimo "rename"? 14:34
Ven timotimo: yeah, but it's not in IO::Path.^methods nor in the doc.perl6, so I got confused. 14:35
timotimo oh
.^methods(:all)? :P
btyler is feather.perl6.nl having trouble? a panda rebootstrap just failed because it got connection refused while pulling feather.perl6.nl:3000/projects.json 14:40
moritz btyler: not feather having trouble in general, just the web service behind :3000 being dead 14:42
tadzik: ^^ please restart :-)
Ven timotimo: no. not even
moritz tadzik: and please make that web service something installable, I hate to 'su' as your user to restart it 14:43
btyler moritz: thanks 14:46
Ven moritz: you were the one who originally created the p5-to-p6 guide, right ?
did you present it at some conference ? 14:47
Ven or maybe the "idioms" advent posts 14:47
moritz Ven: I didn't conference-present it, no 14:48
Ven moritz: do you think that could be interesting ?
I'm starting to think it'd be
tadzik moritz: done 14:55
moritz: hmm, I can chmod stuff :P
TimToady rosettacode.org/wiki/Events#Perl_6 15:06
lizmat finally arrived in the hackathon room 15:09
(and is off for some Chai Tea Latte)
colomon \o/ 15:10
lizmat is back 15:24
colomon o/
colomon \o
happy hacking!
raiph p5eval: sub foo { 0, 1, 2 }; my @bar = foo; say $bar[1] # just checking 15:25
Ven HOLIDAYS. yay 15:31
lizmat raiph: $ perl -E 'sub foo { 0, 1, 2 }; my @bar = foo; say $bar[1]' 15:40
1
raiph Thanks lizmat++ I was trying in a local shell but getting nowhere. (I needed -E, not -e.) 15:47
hoelzro is the star release going out anytime soon? 15:50
psch hi #perl6 15:52
lizmat_ m: sub a ($a,:$b) { say $a; say $b }; my $s = ("foo", b => 2); say $s.perl; a(|$s) # what am I doing wrong here ? 15:53
camelia rakudo-moar f445f8: OUTPUT«$("foo", "b" => 2)␤Too many positional parameters passed; got 2 but expected 1␤ in sub a at /tmp/xfnw4RGGsF:1␤ in block at /tmp/xfnw4RGGsF:1␤␤» 15:54
timotimo m: sub a ($a,:$b) { say $a; say $b }; my $s := \("foo", b => 2); say $s.perl; a(|$s) 15:54
camelia rakudo-moar f445f8: OUTPUT«Capture.new(list => ("foo",), hash => {"b" => 2})␤foo␤2␤»
lizmat_ timotimo++ 15:55
moritz tadzik: don't chmod stuff; put it into /usr/local/pandaserver or so, and write an init script for it 16:03
tadzik: and maybe we should run it as a separate user account
moritz providing shared services fro a private user account just asks for trouble 16:04
jdv79 jnthn: awesome 6guts post as usual. thanks! 16:29
cognominal jnthn++ 16:38
vendethiel o/ from home. 17:00
vendethiel .u arrow 17:05
yoleaux U+02C2 MODIFIER LETTER LEFT ARROWHEAD [Sk] (˂)
U+02C3 MODIFIER LETTER RIGHT ARROWHEAD [Sk] (˃)
vendethiel .u up arrow
yoleaux U+02C4 MODIFIER LETTER UP ARROWHEAD [Sk] (˄)
U+02F0 MODIFIER LETTER LOW UP ARROWHEAD [Sk] (˰)
U+034E COMBINING UPWARDS ARROW BELOW [Mn] (◌͎)
vendethiel .u ⇧ 17:06
yoleaux U+21E7 UPWARDS WHITE ARROW [So] (⇧)
vendethiel .u ⌃
yoleaux U+2303 UP ARROWHEAD [So] (⌃)
ChoHag How can I return a hash which is lazily generated from a list where the key of the hash is the list element and the value calculated from it? 17:28
vendethiel I'm not sure we have lazy hashes (?)
ChoHag Well, something that looks hash-like. 17:29
nnunley ChoHag: It looks like you'd need something that implements the the Associative and Positional roles (like a PairMap) Possibly delegating to a Hash for memoized values? 17:40
raiph m: sub lazypairs (@list) { @list.map: { $_ => $_ + 1 } }; say lazypairs(^Inf)[3] # ChoHag: A lazy hash doesn't make sense to me. Perhaps you mean a lazily generated list of pairs? 17:45
camelia rakudo-moar 82af72: OUTPUT«3 => 4␤»
Mouq ChoHag: Maybe something like sub lazyhash (@lazy-pair-list) { @lazy-pair-list does role { method postcircumfix:<{ }> ($key) { $.first(*.key == $key) } } }, except that method postcircumfix doesn't work anymore... 18:00
(it's spelled `sub postcircumfix:<...>` now) 18:01
ChoHag I basically just want an attribute which is a hash whose values are calculated only when they're needed. 18:16
But the keys are known in advance. 18:17
tadzik moritz: yeah, you're right. It was supposed to be a temporary solution and all :P 18:24
Mouq ChoHag: Ohhh 18:34
timotimo my %foo is default({ ... }); perhaps 18:36
lizmat m: my %foo is default( {} ); say %foo<a>.perl 18:37
camelia rakudo-moar 82af72: OUTPUT«{}␤»
lizmat m: my %foo is default( {a => 1} ); say %foo<a>.perl
camelia rakudo-moar 82af72: OUTPUT«{"a" => 1}␤»
FROGGS ahh, a blōg by jnthn++ 18:38
weird that I don't get a mail when I follow him :/
timotimo that's not what i meant :) 18:39
m: my %foo is default( -> { rand }); say %foo<a>; say %foo<b>; say %foo<a>
camelia rakudo-moar 82af72: OUTPUT«-> () { #`(Block|140024295223472) ... }␤-> () { #`(Block|140024295223472) ... }␤-> () { #`(Block|140024295223472) ... }␤» 18:39
timotimo doh.
that doesn't thunk
timotimo FSVO thunk 18:44
TimToady rosettacode.org/wiki/Draw_a_clock#Perl_6 <-- more braille graphics 18:45
timotimo now do an analog clock! 18:46
rjbs Cute! 18:49
btyler TimToady: awesome!
FROGGS TimToady: I also thought about doing it, but my version would not be that cool :o) 18:50
rjbs Curious about ( qx/stty size/.words ) -- there is no newline left in $cols because we've split on \s+, basically? 18:51
rjbs Can I make perl6-m accept a program to run from stdin? 18:53
Mouq rjbs: .words is actually more like .comb(/\S+/) 18:54
btyler echo "'hi'.say" | perl6 # simple way worked for me: not the case for you, rjbs?
rjbs btyler: I only arrived at that a minute ago, but in a fit of brain-fever used > instead of | 18:55
btyler: so now I'm recompiling :)
btyler: I had previously tried "./perl6 -" and "./perl6 -- -"
Well, it'll get me a month-newer rakudo and moar, anyway.
btyler rjbs: ah, yes, the brain-fever :) know that one well 18:56
FROGGS TimToady++ # I run it right now, it is awesome!
btyler (also, off topic, but 1.21 jiggawatts and perl5 @ 20 were both awesome talks, rjbs++) 18:57
rjbs btyler: Oh, I'm very glad you enjoyed them, tahnks!
Thanks, eevn.
Oh, nevermind. :)
FROGGS rjbs++ # only watched the awesome 5@20 yet, but started to watch the other one... 18:58
I've only watched a few talks in total, but I think your's are the most entertaining :o) 18:59
rjbs Well, thanks! I was pretty happy with how they turned out. I was also unhappy that once again I didn't manage to get a lightning talk together. Maybe for OSCON…
TimToady++ # That's a nice clock. 19:02
Ulti is there any plans to just have thinly wrapped C like ASCII strings in Perl6? 19:41
is a Buf closer to this than Str?
lizmat Buf and native arrays, afaik 19:43
lizmat native arrays being NYI, afaik 19:43
Ulti moarvm uses 32 bits per character atm right? 19:45
I guess that is a #moarvm question 19:47
labster jnthn++ for blog, TimToady++ for a nice clock 19:47
Ulti oh actually my program isn't really /that/ big in memory footprint its just the runtime overhead... that's not so bad 19:51
and if I can easily quarter the value I'm seeing that is usable 19:52
vendethiel m: say (6,).perl; say @(6).perl; 20:21
camelia rakudo-moar 82af72: OUTPUT«(6,)␤(6,).list␤»
Mouq tadzik: github.com/tadzik/steroids/pull/2
vendethiel Okay, so, I have a dilemna. 20:28
Do I show `join ',', @a` or `@a.join(',')` ??
moritz the answer is clearly "yes" 20:29
lizmat whatever you feel more comfortable with
I feel the latter is slightly more perl6y
vendethiel moritz: thanks.
jercos personally I'd prefer the latter, or join(',', @a)
leaving joins open-ended like that feels off, possibly from perl5 habit 20:30
vendethiel uh ?
moritz if it's the last statement in a line, I prefer the @a.join: ',' form
vendethiel I'm not showing the : stuff 123 lines into the tutorial :P 20:31
TimToady open-ended join ',', ... is for when ... is long 20:32
vendethiel uh² ? 20:33
so, @a.join ?
TimToady talking about end-weight 20:34
vendethiel is getting lost
TimToady short things want to be before long tings
vendethiel that was probably a terrible question to ask, anyway
psch did you show .split or split before? 20:35
i.e. if you're mostly doing method-y stuff, stay with methods, if not, don't
jercos I guess the existance of say sorta eliminates the odd case of |print join ",", @a, @b, "\n"| "oh whoops, gotta add parens on that join."
psch and add a "most of those also work as sub/methods" somewhere
TimToady and one sometimes wants to avoid having parentheses that go many lines
vendethiel psch: I only showed say
TimToady so, for instance, something like: say join ',', gather for @stuff { blah, blah, blah, take blah, blah } 20:36
puting an entire gather into () is a bit crufty, just to put a .join(',') at the end 20:37
psch i'd actually go with join ',', @a first and mention that it also works as method
but that's just how i imagine it to flow well, ymmv 20:38
vendethiel psch: that could be a good time to introduce readers to methods, though 20:40
psch yeah, that's why i said you show the sub and transition to "it also works as method" :) 20:41
i.e. "here, that's say... we also have join... oh btw, those (and many more) also work as methods" 20:42
psch i guess it might also depend on your audience; clog says it's "p5 to p6 for non-p5ers", which i understand as "there is programming knowledge but we don't know what kind", that about right? 20:48
vendethiel psch: not much programming knowledge 20:49
let me update it to my working version
vendethiel maybe I should ask for more programming knowledge, but meh. 20:49
[Coke] .
vendethiel o/ [Coke]
vendethiel psch: scriptogr.am/vendethiel/post/and-pe...came-forth 20:50
psch hi [Coke] 20:51
vendethiel I'm struggling not to add an explanation about what OO is
psch vendethiel: as for content, i think the transition works pretty well as you have it 20:55
Mouq found OO made much more sense when he started using Perl 6 than it did when he was using Perl 5
psch the plenks don't work for me, but that might be cultural :)
vendethiel psch: plenks ? 20:56
psch en.wikipedia.org/wiki/Plenk 20:56
i guess it is a german thing
psch basically, whitespace before punctuation 20:57
vendethiel psch: ooooh. Alright.
That's just an habit because I'm french. Fixing.
psch i think you should add a basic OO introduction with examples though, otherwise methods probably don't make that much sense 21:01
vendethiel yeah, yeah. 21:02
tadzik Mouq: thanks :) 22:19
psch smartmatch tr/// returns the distance now \o/ 22:21
i'm not really happy with my implementation though
(also, it's not yet PR-ready, tr/// against implicit $_ doesn't return the number of changed characters)
but the fact that a stand-alone tr/// doesn't do what it should might mean i've been doing it wrong all along 22:24
Mouq ++psch :) 22:30
mr-foobar lol
Mouq tadzik: np :)
mr-foobar oops, wrong channel 22:31
BenGoldberg m: .ord.say for "ρ℮гןб".comb; .&uniname.say for "ρ℮гןб".comb 22:36
camelia rakudo-moar 8de0fd: OUTPUT«961␤8494␤1075␤1503␤1073␤GREEK SMALL LETTER RHO␤ESTIMATED SYMBOL␤CYRILLIC SMALL LETTER GHE␤HEBREW LETTER FINAL NUN␤CYRILLIC SMALL LETTER BE␤»
vendethiel psch: would you mind telling me what you think about the section I added ? 22:40
I kinda think I'm not doing a good job at explaining at all
psch vendethiel: the progression seems ok to me 22:45
wording is a bit awkward in places, and habits are hard to break as we know ;)
vendethiel psch: don't you feel like I'm going all-out on totally unrelated stuff ? 22:46
psch: you don't put a space before ! either, right?
psch vendethiel: yeah, 'Neat !' looks really weird to me :) 22:47
vendethiel (and the wording is awkward because I'm a terrible engrish speaker. I can try to pretend, but it falls off pretty quickly)
oh, really :P ?
I thought it was a saying 22:48
psch i mean 'Neat !' compared to 'Neat!' :)
vendethiel Oh :)
psch as a word it's fine, it fits with the tone you're writing in
similarly 'Great !'
vendethiel Alright, fixed those.
psch also, i think 'modelize' isn't really used anymore 22:49
and you used '(to) model' before, so you should stick with that
masak '♞, #perl6
psch night masak 22:50
psch vendethiel: in general, i think explaining perl6 for people without any programming knowledge can't be easy unless you constrain yourself to specific concepts you want to teach 22:50
vendethiel psch: do you think I'm going in the wrong direction ? 22:51
Or, other people here, for that matters.
psch not the wrong direction per se, but the nature of the beast just means that many sub-concepts that apply to the concepts you want to teach also apply to other concepts 22:52
i.e. the part about 'is rw'
vendethiel which is definitely why I feel like I'm going all out.
yeah, don't wanna talk about containers
psch you need to show it for mutable attributes, but you don't have to show it for lvalue subs
so that shouldn't come yet, imho
vendethiel I'll just leave the "Important" part then
as a "note"
psch ...that was poor wording on my part; your &increment isn't actually an lvalue sub :) 22:53
vendethiel I'll start writing the XinYminutes tomorrow, then, that should make my vision clearer 22:54
Mouq vendethiel++ 22:55
psch vendethiel++
BenGoldberg m: say 3 ∗ 5;
camelia rakudo-moar 8de0fd: OUTPUT«===SORRY!=== Error while compiling /tmp/Sl28DuGaGV␤Two terms in a row␤at /tmp/Sl28DuGaGV:1␤------> say 3 ⏏∗ 5;␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤…»
vendethiel g'night and thanks, #perl6 22:56
psch .u ∗ 22:57
yoleaux U+2217 ASTERISK OPERATOR [Sm] (∗)
psch BenGoldberg: cheeky
.u *
yoleaux U+002A ASTERISK [Po] (*)
BenGoldberg Sorry, I just discovered the unicode confusables www.unicode.org/Public/security/rev...ummary.txt and I'm having too much fun :) 22:58
m: say 1􏿽xCD􏿽xBE say 2; 22:59
camelia rakudo-moar 8de0fd: OUTPUT«===SORRY!=== Error while compiling /tmp/2R80YMOgAc␤Two terms in a row␤at /tmp/2R80YMOgAc:1␤------> say 1⏏􏿽xCD􏿽xBE say 2;␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix…»
lizmat_ yuck 23:19
psch hm, doc.perl6.org/routine/%2F%2F also doesn't work 23:19
lizmat the semi-colon is not what it seems to be
psch i guess that means the webserver doesn't have (an equivalent to) ALLOW_ENCODED_SLASHES set
lizmat dinner& 23:20
jnthn .u 1 23:21
yoleaux U+0031 DIGIT ONE [Nd] (1)
jnthn Hm, so which char was it... :) 23:22
.u say 1􏿽xCD􏿽xBE
yoleaux U+0020 SPACE [Zs] ( )
U+0031 DIGIT ONE [Nd] (1)
U+0061 LATIN SMALL LETTER A [Ll] (a)
jnthn o.O 23:23
psch .u 􏿽xCD􏿽xBE
yoleaux U+037E GREEK QUESTION MARK [Po] (􏿽xCD􏿽xBE)
psch jnthn: lizmat spoiled it? :P
although yoleaux should probably name all of them..? 23:24
BenGoldberg yoleaux seems to be limited to outputing three lines.
jnthn oh, duh :) 23:25
BenGoldberg: Yes, I was more confused by which 3 it picked :)
BenGoldberg .u say 23:26
yoleaux U+0DC1 SINHALA LETTER TAALUJA SAYANNA [Lo] (ශ)
U+0DC2 SINHALA LETTER MUURDHAJA SAYANNA [Lo] (ෂ)
U+0DC3 SINHALA LETTER DANTAJA SAYANNA [Lo] (ස)
BenGoldberg headscratches.
.u a
yoleaux U+0061 LATIN SMALL LETTER A [Ll] (a)
BenGoldberg .u s 23:26
yoleaux U+0073 LATIN SMALL LETTER S [Ll] (s)
BenGoldberg oh, I see, those were letters with 'say' in their names. 23:27
segomos_ does nativecall handle mapping objects to the perl6 class? as in if i have a c library that returns a c struct, do i need to implement the p6 class to inherit CStruct and have the same order or names or both? 23:29
jnthn Names don't matter; types and order does. 23:30
It's not about inheritance, but rather representation.
BenGoldberg I hope your c library function doesn't actually return a struct ... returning a pointer to a struct seems a little more likely. 23:32
segomos_ so if i have a char* should i use a str or an opaquepointer ?
BenGoldberg: it's libxml2 - it does return the pointer 23:33
jnthn Depends.
If it's actually string data, then str
zengargo1le TimToady: that clock is rather neat, needs U+2800 BRAILLE PATTERN BLANK between characters. otherwise they end up touching or squished together sometimes (at least in my terminal/font/...). 23:35
segomos_ so if i want to read a char* with other data i should probably use a Buf? 23:36
actually it looks like i can't do much with it if i have opaquepointer 23:38
jnthn segomos_: Right; it's opaque. :) You may have better luck with a CArray[int8] or so. 23:56
sleep & 23:59