»ö« 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.
timotimo so ... trivial thread safety i suppose 00:00
TimToady wonders if there's a way to partition and recompile the libraries such that different subsystems could use different "GILs" and scale better 00:06
when there are disjoint sets of libraries 00:07
and maybe we have a similar problem with P5 modules
where instead of a GIL we have a global interpreter crash :) 00:08
timotimo enctype application/json for html formulars \o/
lizmat has banged her head against the settings enough for one day 00:11
sleep&
00:11 lizmat left 00:15 kjs_ left 00:23 KCL_ joined
TimToady incipient meleagris gallopavo consumption & 00:25
00:26 KCL left 00:33 Mouq joined
raydiak re my earlier questions about inputting ∈ and other non-altgr/compose-accessible chars on a US keyboard, fwiw I ended up installing ibus which un-broke ctrl-shift-u, installed ibus-table-compose to get the compose key back, and ibus-table-latex for added awesome ("\in" is easier to remember and type than "ctrl-shift-u 2208") 00:50
00:51 pmurias left 00:52 ssqq joined 00:53 ssqq_ joined 01:02 cognominal joined 01:24 cognominal left 01:29 cognominal joined 01:30 cognominal left 01:37 dayangkun joined, ssqq_ left 01:38 ssqq_ joined, lue left 01:47 Akagi201 joined 01:50 lue joined 01:53 cognominal joined 01:55 ggoebel111111113 left 01:56 ssqq_ left, ssqq left 02:12 JimmyZ joined 02:23 d4l3k_ joined 02:24 dalek left, silug left, silug joined 02:25 d4l3k_ is now known as dalek, ChanServ sets mode: +v dalek, breinbaas left, breinbaas joined 02:45 ilbot3 left 02:47 ilbot3 joined 02:59 noganex left 03:00 noganex joined 03:07 eternaleye left 03:08 eternaleye joined 03:18 noganex_ joined 03:19 Mso150 joined 03:21 noganex left 03:34 chenryn joined 03:49 Mso150 left
hobbs just out of curiosity, can anyone improve my golf? codegolf.stackexchange.com/a/41960/1683 04:17
it's probably about as good as it gets, but it's possible there's a shorter synonym for the split, or a way to use an implicit variable to tighten it up
(this challenge counts the function body but not the signature)
04:27 kaleem joined
Mouq s/split('')/comb 04:28
hobbs ah nice 04:30
I saw that comb existed, but didn't pay enough attention to see that that was its default behavior 04:31
new score is 16 :) 04:33
which is only 2 more than J, and dare I say, more readable 04:34
Mouq Doesn't change the char count, but %%all (divisible by all) might be more readable still :) 04:37
hobbs interesting :) 04:38
yeah, it improves my explanation, I'll do that 04:39
raydiak m: sub golf($n, $r = ?($n%none $n.comb)) { $r }; say golf 123 # if they don't count the signature :)
camelia rakudo-moar 2b2857: OUTPUT«False␤»
04:41 kaleem left
hobbs not gonna abuse like that 04:41
but I didn't realize I could lose the parens on the junction, that seems to save me 1 04:42
raydiak yep
hobbs from 21 to 15 thanks to you both 04:43
Mouq m: my &golf = {$_%%.comb.all}; say golf 123 # signatures are so overrated ;9 04:45
camelia rakudo-moar 2b2857: OUTPUT«all(True, False, True)␤»
raydiak nice 04:46
Mouq was a little disappointed there's not a contortion of * that'll do it, though
hobbs can I do that as sub golf ($_) ? Looks like. 04:48
Timbus its amazing how readable that is for 13 bytes 04:57
hobbs the 15 byte version is clearer, but yeah, it's not bad :) 04:58
beats the pants off of the APL/J/Pyth/CJam versions 04:59
Timbus yep
hobbs (Pyth and CJam are basically golf languages)
Timbus yeah I saw. no idea who keeps making them, but they should stop 05:00
:I
..wait, since when did perl6 not automagically put a $_* into subs without signatures 05:04
uh, *$_
hobbs I dunno, but I did sub golf { ... } in perl6-m and it rejected it, said I was calling a 0-ary sub with 1 arg
05:04 kaare_ joined 05:05 chenryn left
Mouq n: say sub{$_}(42) 05:05
camelia niecza v24-109-g48a8de3: OUTPUT«42␤»
Mouq r: say sub{$_}(42)
camelia rakudo-moar 2b2857: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-parrot 2b2857: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤ in sub at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
Timbus and I never noticed
hobbs I expected it to work too 05:06
Mouq r: say sub{@_}(42) 05:08
camelia rakudo-{parrot,moar} 2b2857: OUTPUT«42␤»
hobbs the mention of @_ makes it variadic? 05:09
Timbus makes sense 05:10
Mouq r: say sub{EVAL '@_'}(42)
camelia rakudo-parrot 2b2857: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤ in sub at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-moar 2b2857: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
05:15 dayangkun left
hobbs I'm off to bed, thanks and good night 05:17
Mouq 'night hobbs! :) 05:21
05:31 chenryn joined 05:42 mr-foobar left 05:51 kaare_ left 06:15 ssqq joined, ssqq left 06:16 ssqq joined
ssqq m: my $capture = \( 1, named => 1); sub foo($a, :$named) { "args is $a and $named" }; foo(|$capture); 06:17
camelia rakudo-moar 2b2857: OUTPUT«use of uninitialized value $named of type Any in string context in sub foo at /tmp/nJhN2pbICj:1␤␤»
ssqq m: my $capture = \(1, named => 1); sub foo($a, :$named) { "args is $a and $named" }; foo(|$capture); 06:18
camelia ( no output )
ssqq why a space before *1* would make output different?
What difference with git repo: *star* and *rakudo*? 06:20
moritz \o
ssqq: 'rakudo' is the compiler; 'star' is a distribution (it bundles the compiler, some docs, and several modules) 06:21
ssqq moritz: I see, start == 'rakudo' ~ 'some doc' ~ 'several modules' 06:22
06:22 kaare_ joined
ssqq moritz: I see, 'star' == 'rakudo' ~ 'some doc' ~ 'several modules' 06:23
ugexe m: my $capture = \(1, named => 1); sub foo($a, :$named) { "args is $a and $named" }; say $capture.perl; 06:26
camelia rakudo-moar 2b2857: OUTPUT«Capture.new(list => (1,), hash => {"named" => 1})␤»
ugexe m: my $capture = \( 1, named => 1); sub foo($a, :$named) { "args is $a and $named" }; say $capture.perl;
camelia rakudo-moar 2b2857: OUTPUT«Capture.new(list => (1, "named" => 1,))␤» 06:27
ugexe that does seem strange
TimToady m: say (\(1, named => 1)).perl 06:30
camelia rakudo-moar 2b2857: OUTPUT«Capture.new(list => (1,), hash => {"named" => 1})␤»
TimToady m: say (\( 1, named => 1)).perl
camelia rakudo-moar 2b2857: OUTPUT«Capture.new(list => (1, "named" => 1,))␤»
TimToady quite odd
06:34 chenryn left
TimToady I see the problem 06:34
06:35 chenryn joined
dalek kudo/nom: c079105 | TimToady++ | src/Perl6/Grammar.nqp:
allow whitespace inside capture
06:36
TimToady ssqq++
06:49 gfldex joined 06:51 grondilu joined 06:55 vendethiel- left 07:03 chenryn left 07:07 chenryn joined
sjn \ 07:17
\o 07:21
07:22 kaleem joined 07:24 anaeem1_ joined 07:27 lue left 07:32 anaeem1_ left, anaeem1_ joined 07:36 jluis joined 07:37 kurahaupo left 07:40 lue joined 07:44 JimmyZ left 07:50 gfldex left 07:55 FROGGS joined 08:03 jimmy__ joined 08:06 grondilu left 08:07 ssqq left 08:09 jimmy__ is now known as JimmyZ_ 08:10 rurban joined 08:14 kaare_ left, kaare__ joined 08:16 darutoko joined 08:17 virtualsue joined 08:21 denis_boyun_ joined 08:23 rurban1 joined 08:27 rurban left 08:29 lizmat joined 08:48 Alina-malina left 08:49 Alina-malina joined 09:01 telex left 09:02 telex joined
lizmat good *, #perl6 on day #2 of the Patch -p2 hackathon in Lyon, France 09:03
jnthn morning, all 09:04
lizmat jnthn: if I'm binding a PIO to a variable, does that variable need to be Mu, or doesn't it matter ? 09:06
09:06 rindolf joined
lizmat aka: my Mu \thePIO := nqp::openpipe( or my \thePIO := nqp::openpipe( 09:06
JimmyZ_ \o
lizmat JimmyZ_ o/ 09:07
jnthn lizmat: Mu is default var type constraint
JimmyZ_ what's the diference? \x = ... vs \x := ...
jnthn JimmyZ_: None.
lizmat ok 09:08
jnthn uh, hmm
Maybe actually = deconts the RHS
I'd have to look at the compiler to remember :P
JimmyZ_ :)
09:09 virtualsue left
JimmyZ_ what does the spec say about it? 09:10
09:14 brrt joined
masak antenoon, #perl6 09:16
moritz \o masak 09:17
jnthn
.oO( what happens when a noon and an antenoon collide? )
moritz anoohiliation
masak .oO( that's not a noon, it's a space nation! ) 09:18
lizmat jnthn: if you can spare a minute, could you look at gist.github.com/lizmat/67c4ed2e0640b11dbc1f
jnthn
.oO( and a lunch particle is emitted )
brrt \o
lizmat am I doing something wrong ?
brrt o/
brrt checks it
jnthn I have a suspicion that an optimization in the class case skips emitting the type check, and we dont' do that with the role one 09:20
And PIO doesn't strictly do Mu.
If working with VM-level handles, nqp::bindattr is always safer. 09:21
09:21 woolfy joined
jnthn Or actually even nqp::bind($!PIO, thePIO) may cut it. 09:21
lizmat trying that 09:22
that doesn't bomb, indeed, jnthn++
checking further
09:23 woolfy left
lizmat jnthn++ again 09:24
I was banging my head against that most of yesterday...
09:24 fhelmberger joined
lizmat I can finally go on... 09:24
yeh!
jnthn ah...sorry if I missed a question on it yesterday
jnthn only sorta follows here while teaching :) 09:25
09:25 cognominal left
JimmyZ_ speaking nqp::bind, I was wondering why there is not a Perl 6 way... 09:27
I saw some Perl 6 module uses it too
09:28 kjs_ joined
moritz there's :=, which should work in almost all non-CORE cases 09:29
jnthn Yeah, := compiles into that plus a type check first
At some point in the near-ish future I'm going to make us require a use statement for nqp:: 09:30
JimmyZ_ oh, the Slang module uses nqp::bind
jnthn So you'll have to declare up front if using it.
Well, the Slang module is prototyping a core feature, so it's kinda legit :)
JimmyZ_ yeah
09:35 woolfy joined 09:38 yeahnoob joined
brrt jnthn++ for not-having-nqp-namespace-by-default 09:38
would it be really bad if we didn't have macro's for rakudo perl6.0.0 09:39
JimmyZ_ we does have :)
do
brrt or 'not the macros your grandchildren will use'
true 09:40
JimmyZ_ Just not good
jnthn brrt: It's not the end of the world. I've written a lot of Perl 6 modules and only one of them uses macros...
If we are really uncomfortable with the design not being final but want to ship some macro support anyway, we do have options there. 09:41
(Like an opt-in pragma, on the understanding there are likely to be changes down the line.)
brrt hmm yes 09:42
dalek ecs: 9057025 | (Elizabeth Mattijsen)++ | S99-glossary.pod:
Add lemma for PIO
09:44
kudo/newio: 58f79c1 | (Elizabeth Mattijsen)++ | src/core/IO/Pipe.pm:
Finally found the magic incantation, jnthn++
kudo/newio: a6b3d5d | (Elizabeth Mattijsen)++ | src/core/PIO.pm:
Make PIO attribute private again
09:46 Mso150 joined
lizmat Is there a reason we don't have a .print and .say on IO::Socket ? 09:49
09:52 zakharyas joined 09:54 denis_boyun_ left
dalek kudo/newio: c079105 | TimToady++ | src/Perl6/Grammar.nqp:
allow whitespace inside capture
09:55
kudo/newio: 9e57f55 | (Elizabeth Mattijsen)++ | src/Perl6/Grammar.nqp:
Merge branch 'nom' into newio
10:22 JimmyZ_ left 10:24 sergot joined, Ven joined
sergot hi o/ 10:25
Ven the thing that's the most difficult when jumping from one language to another is remember the truthiness/falsiness rules
o/, #perl6
10:25 smls joined
smls m: say Buf.HOW 10:26
camelia rakudo-moar c07910: OUTPUT«Perl6::Metamodel::ParametricRoleGroupHOW.new()␤»
smls is Buf supposed to be a role or a class?
S32/Containers:1142 suggests a class, but Rakudo^^ seems to consider it a role... 10:29
synopsebot Link: perlcabal.org/syn/S32/Containers.html#line_1142
dalek kudo/newio: 0520651 | (Elizabeth Mattijsen)++ | src/core/PIO.pm:
Add SeekType enum, deprecate seek(x,Int)
10:30 virtualsue joined
smls p6doc is confused about Buf as well, calling it a class on its own type page but a role in the type graph / type index. 10:33
lizmat I think it was originally a class, but became a role later 10:34
10:35 abraxxa joined 10:36 Ugator joined
FROGGS because we only have parametrized roles, not classes, right? 10:36
smls m: say Buf.new([256]).WHAT
camelia rakudo-moar c07910: OUTPUT«(Buf)␤»
smls FROGGS: Are parametrized classes just NYI, or not part of the design? 10:37
FROGGS smls: I dunno... I just know that the Buf roles gets punned into a class when you use it like one
smls So how is it different from instantiating a class? 10:38
Ven it's not (not really)
10:39 Mso150 left
itz whats newio? 10:40
Ven itz: new s17 I guess
erm, not s17... 10:41
It's s16.
dalek kudo/nom: 28cfa02 | (Elizabeth Mattijsen)++ | src/core/Inc.pm:
Fix warning on unset HOME env variables

Inspired by pull request #334 (carbin++). This approach has fewer dynamic variable lookups than the pull request.
Ven lizmat++ # rewriting s16
10:43 danwyn joined 10:44 denis_boyun joined, yeahnoob left 10:46 danwyn left
smls m: say Buf.new([2, 4]).WHAT; say buf8.new([2, 4]).WHAT 10:46
camelia rakudo-moar c07910: OUTPUT«(Buf)␤(Buf[uint8])␤»
smls ^^ in what way are these different? 10:47
10:47 yeahnoob joined
Ven smls: internal representation, I guess 10:47
smls m: my $x = buf8.new([2, 4]); $x[0] = 257; say $x
camelia rakudo-moar c07910: OUTPUT«Buf:0x<01 04>␤»
smls According to the spec I linked above, "Buf.new([195, 182]) [...] returns a buf8 containing two uint8 items" 10:49
Spec and Rakudo don't seem to be very much in sync in this area... :( 10:52
10:53 TuxCM left
smls From lizmat's and FROGGS's answers I take it that the spec is just outdated here and Rakudo implements the intended semantics for Buf? 10:53
Or are they still in flux?
lizmat I think that's a yes and a yes 10:54
FROGGS I also think that the spec needs adoption
10:55 ptc_p6 joined 11:02 chenryn left 11:04 Ven left 11:08 TuxCM joined 11:24 chenryn joined 11:28 louisch joined
Ugator m: my $t=(1.1+2.2).Num.base(*); $t(16).say 11:34
camelia rakudo-moar 28cfa0: OUTPUT«Type check failed in binding $base; expected 'Int' but got 'Whatever'␤ in method base at src/gen/m-CORE.setting:4719␤ in block <unit> at /tmp/Bu7tChLVPh:1␤␤»
Ugator :-( why doesnt this work?
11:34 kaare__ left
lizmat what do expect Whatever to be? 11:34
Ugator Int? 11:35
jnthn * doesn't mean auto-closure in that context
m: my $t={(1.1+2.2).Num.base($_)}; $t(16).say 11:36
camelia rakudo-moar 28cfa0: OUTPUT«3.4CCCCC␤»
Ugator what's the rule for auto-closure?
11:36 Mouq left
jnthn Happens to operands or invocants 11:37
*.foo is an invocant example, *+1 is an operand one.
dalek kudo/newio: 832bfac | (Elizabeth Mattijsen)++ | src/core/ (2 files):
Introduce internal set-PIO-attributes method
kudo/newio: 584a583 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
Deprecate :enc in favour of :encoding
Ugator ok... thx :-) 11:38
lizmat so I have a role with 2 multi methods "foo"
and I have a class in which I compose that role, and want to have a single method "foo" masking the multi's from the role 11:39
how do I do that ??
11:39 kaleem left
jnthn Does a "method foo() { ... }" in the class not do that? 11:40
lizmat I get the impression it doesn't, lemme write a test case
jnthn I think we auto-upgrade to multi in the role => class direction, but I think not in the other one...
(as in, if the class has a multi and the roles dont', I think we auto-multi the role methods...put another way, writing a proto in a class can serve as a "let's have both and decide at runtime" disambig approach) 11:41
m: role R { multi method m() { }; multi method m($a) { } }; class C does R { method m() { say "class" } }; C.m 11:42
camelia rakudo-moar 28cfa0: OUTPUT«===SORRY!===␤Cannot have a multi candidate for 'm' when an only method is also in the package 'C'␤»
jnthn Ah...
I wonder if the spec says anything on this. 11:43
Mebbe it does and we match it...
Though the behavior you want would make sesne to me.
lizmat specific case: providing a better error message when doing a .seek on an IO::Pipe
jnthn *nod* 11:44
lizmat I guess we could also argue that seek should only work on IO::Handle
11:44 yeahnoob left
jnthn See if the spec says anythign on it. 11:44
If we're out of line with spec then it's probably an easy fix I can do on the train home.
This evening.
lizmat cool
jnthn Distracted with teaching again for a little bit... :) 11:45
lizmat okidoki :-)
dalek kudo/newio: cf051eb | (Elizabeth Mattijsen)++ | src/core/IO/Pipe.pm:
Cannot mask a multi method from a role (yet)
11:48
kudo/newio: e364b33 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
Add SLURP-PATH primitive
12:03
FROGGS m: role R { multi method _m() { say 1 }; multi method _m($a) { say 2 } }; class C does R { method m($a?) { $a ?? self.R::_m($a) !! self.R::_m() } }; C.m 12:05
camelia rakudo-moar 28cfa0: OUTPUT«Cannot invoke this object (REPR: P6opaque, cs = 0)␤ in method dispatch:<::> at src/gen/m-CORE.setting:1292␤ in method m at /tmp/TXvydmaqEc:1␤ in block <unit> at /tmp/TXvydmaqEc:1␤␤»
12:05 woolfy left
FROGGS hmmm, was that invalid syntax? 12:05
lizmat dunno, getting some air&
12:05 lizmat left
raydiak good extra-early morning, #perl6 12:11
FROGGS hi raydiak 12:14
12:14 |Tux| joined, TuxCM left
raydiak \o FROGGS 12:15
12:16 JimmyZ_ joined 12:24 KCL joined 12:27 KCL_ left
raydiak is there a way to test whether or not something is mutable? not as in "is ro/rw", but as in ".WHICH defined by value vs memory address" 12:28
JimmyZ_ I think it depends on the type? 12:29
moritz raydiak: unfortuantely not 12:31
raydiak ah well, won't be doing it that way in the end anyway...thanks JimmyZ_++ and moritz++ 12:33
colomon can't you just assign to it and catch any errors? ;) 12:37
smls m: sub is-immutable (Any:D $x) { $x.clone === $x }; say is-immutable "foo"; say is-immutable [2, 4] 12:39
camelia rakudo-moar 28cfa0: OUTPUT«True␤False␤»
smls raydiak: ^^ (although I have no idea how robust or efficient it is...) 12:40
raydiak smls++: thanks, that might be workable at least for the purpose of development 12:42
colomon: :)
12:42 kaare__ joined 12:45 kaare__ is now known as kaare_
raydiak reading Int's source, we don't really have an explicit concept of mutability in that way, do we? it's just the end result of overriding a few methods like .WHICH? 12:45
12:46 chenryn left 12:47 prime left 12:49 ptc_p6 left 12:51 bjz joined 12:54 bjz_ left 12:57 anaeem1_ left
moritz raydiak: right, we just don't provide any mutators 13:00
13:01 ggoebel111111113 joined
raydiak oic 13:02
moritz and overriding WHICH tells operators like === that it's considered a value type 13:03
13:09 jluis left
raydiak looks like it overrides most of the comparison operators itself in this case, but I get what you mean...am just working on ideas for .perl(), and wanted to get it to do something reasonable with value types without writing a new implementation for each type that needs it, so was just gonna do "<call old .perl> unless .is-mutable" for the moment 13:10
13:13 guru joined, guru is now known as Guest93790 13:14 Guest93790 is now known as ajr_ 13:18 prime joined
timotimo hmm 13:20
raydiak finds int.Range and wonders if it shouldn't be officially specced and documented 13:25
m: say uint8.Range 13:26
camelia rakudo-moar 28cfa0: OUTPUT«0..255␤»
13:27 prime left
colomon ugh, module failures did not go away magically overnight: host08.perl6.com:8080/report 13:33
13:34 psch joined 13:35 kaleem joined, kaleem left
psch hi #perl6 o/ 13:35
13:35 kaleem joined
raydiak \o psch 13:36
psch hey raydiak
i'm kinda-sorta starting to find my way into jvm-interop, i.e. i can point to one spot in the source that's at least partly responsible for why we can't have overloaded foreign methods as multis in perl6-land 13:38
but i can't find a spot to compare differences. as in, a STable always has a hash as method cache, but for perl6-classes we can have multis because the MOP-role MultiMethodContainer does something 13:39
but we don't get many MOP-roles for the JavaHOW and i'm not sure stuffing MultiMethodContainer in there does what i mean, seeing as JavaHOW doesn't have MethodContainer either but methods still work... 13:40
13:40 prime joined
psch so i was thinking solving it lower, i.e. having a MethodCache that's not a hash on the STable would likely do what i mean, but that probably needs to run through the binder somewhere 13:42
or rather, a MethodCache that maps multiple CodeRefs to a short name of non-perl6-object methods 13:43
although maybe that's a suboptimal way of trying to get there in the first place. if anyone has a hint i'd appreciate it :) 13:44
masak why does "hackathon" seem to have the meaning of "lame corporate-arranged one-day coding competition" in some circles? 13:53
13:54 Alina-malina left
brrt uh, my $job also has given that meaning to it 13:55
masak :(
at least I'm glad I went to the good type of hackathon before becoming aware of that meaning.
brrt no, actually, for my $job it means: 'lame corporate-arranged one-day unpayed implementation of $manager's idea'
arnsholt masak: Same here
13:56 Alina-malina joined
arnsholt Bah. The Python docs are very unorganized about speccing what attributes and methods various classes are supposed to have 13:57
Also, the inheritance hierarchy 13:58
brrt arnsholt: in python, you're supposed to run the code, or step through it using a debugger
eh s/run/read/ :-) 13:59
timotimo it's called "duck typing"
arnsholt timotimo: No, I mean the spec documents =)
timotimo if you're relying on the internals of classes, or their methods and attributes, you're doing it wrong
smls arnsholt: So are the Perl 6 specs, unfortunately...
arnsholt timotimo: For example a snippet aobut object(): "[The returned object] has the methods that are common to all instances of Python classes." 14:00
smls in fact it looks like a lot in info on which class is supposed to do which role and which method is supposed to be in which class/role, isn't covered in the synopses at all.
arnsholt But nowhere I've found specifies *what methods* are common to all Python object instances =)
timotimo yeah, you're expected to use python's superb introspective capabilities in combination with the set type 14:01
brrt if you're relying on sanity, you're doing it wrong
:-p
timotimo so, what is perl 6 going to be doing for black friday?
brrt sleep
timotimo i heard that's today
sleep? 'k! i'll chip in a few minutes 14:02
arnsholt timotimo: Yeah, that's what I'm doing. It's just annoying that the spec doesn't spec everything =)
brrt in python russia, spec specs you! 14:03
raydiak is taking advantage of having driven his g/f to work @ the mall @ 4 AM by not going back to bed 14:04
masak thinks about macros and pattern matching 14:05
jnthn thinks about marco and pasta eating 14:07
psch: iirc, the method cache is populated by the Java interop code written in Java 14:08
psch jnthn: yes, it is. in BootJavaInterop.java:278-321
moritz thinks about strangelyconsistent.org and the distinct lack of new blog post(s)
14:09 davido___ left
jnthn Maybe it's because masak is too busy writing hate mail to people who call their macros marco :D 14:09
psch jnthn: i'm mostly unsure how i can resolve overloaded methods to multis.
14:09 davido___ joined
jnthn psch: Right, and we subclass that 14:09
psch: Hm, I'm not entirely sure... :) 14:10
14:10 dayangkun joined
timotimo i bet there's some people who deserve hate mail for calling their macros macro ... 14:10
psch jnthn: one thing i thought of was doing it at runtime, inspecting the capture which the method gets and checking if we have a spec that fits on the jvm-side
jnthn psch: I can see a few ways. One is to code-gen the Java method adapter to do the type matching.
But that's...a lot of code-gen and not that fast maybe 14:11
psch but my way is probably error-prone and maybe slow
jnthn Probably a better way is to code-gen something that uses invokedynamic
And put the real interesting logic inside there
Then we can start caching it and probably be way faster.
psch do the abstraction layers fit for a trial bind? i'm still a bit fuzzy on what exactly happens where... 14:14
what i see is that we have a p6-y CodeRef which corresponds to the jvm-native, overloaded method
that CodeRef has a MethodContext which knows the sig
oh, but we need a SixModelObject for trialbinding, don't we, because Signature is from perl6-land 14:15
jnthn The trial bind is all about compile-time optimization
I wouldn't do it at that level
psch okay
14:16 dayangkun left
psch i'll do some more thinking, thanks so far jnthn++ 14:18
b2gills Slightly OT I just came accross "TWiT Coding 101 Perl", I wonder if someone could help them write or host a Perl6 version www.youtube.com/watch?v=FEtI4BLzzp...yGc8dDYu7J 14:19
14:21 abraxxa left
timotimo huh. one thing the dude in the religious outfit says is that perl is "more structured like C#" as compared to python ... i don't really get it 14:32
smls m: say (1, 2, 3)>>.WHAT 14:34
camelia rakudo-moar 28cfa0: OUTPUT«(Parcel)␤»
smls :(
Why does hyper does not work with .WHAT? And if it is not supposed to work because WHAT is too special, why doesn't it at least throw an error when used with >> ? 14:35
timotimo WHAT is special 14:36
14:36 mr-foobar joined, lizmat joined
psch m: say Any.^can('WHAT')[0].perl 14:37
camelia rakudo-moar 28cfa0: OUTPUT«Mu␤»
psch .oO( Mu is the sound of one hand clapping )
timotimo b2gills: it seems like these twit coding people aren't up to date. didn't anybody tell them perl is dead? 14:38
14:38 woolfy joined
smls timotimo: But is there a reason it can't be made to work with >> ? 14:41
timotimo not really, no
m: say (1, 2, 3).map: *.WHAT
camelia rakudo-moar 28cfa0: OUTPUT«1 2 3␤»
timotimo m: say (1, 2, 3).map: { $_.WHAT }
camelia rakudo-moar 28cfa0: OUTPUT«(Int) (Int) (Int)␤»
timotimo even with whatevercode it doesn't work properly 14:42
smls For context, I wanted to include these two demo snippets in p6doc: gist.github.com/smls/4ff13592041879b218d2
timotimo i'd personally go with .WHAT.say for (1 ,2, 3) in that case
m: .WHAT.say for (1 ,2, 3)
camelia rakudo-moar 28cfa0: OUTPUT«(Int)␤(Int)␤(Int)␤»
smls I went with say (.WHAT for $n.keys); for now, but it looks more distracting and less cute than the >> version... :( 14:43
14:46 dalek left, dalek joined, ChanServ sets mode: +v dalek
timotimo b2gills: i've wanted to work on screencasts for perl6 introductory stuff (since i have such a beautiful and soothing voice), but i didn't get far at all whatsoever 14:47
b2gills: do you know what the machine in the background is? 14:49
the one to the viewer's left, specifically
my first thought was perhaps a 3d printer or CNC machine of some description 14:50
itz I did wonder about a monthly (or whatever) podcast 14:52
timotimo heh heh, he almost mis-said "scalar variables" as "scary variables" 14:54
i'm not terribly happy about them not declaring variables with "my" 14:56
raydiak twit's examples look like bad mass-churned 90s perl...no strict, warnings, my, modern features like say, etc
timotimo well, it's easy to complain about the content from our perspective, but the presentation is pretty great 14:57
raydiak I like what they're trying to do and recognize the need for simplicity...unfortunately omitting those things is a terrible way for people to start learning perl imo 14:58
unless your reason for learning it is one-liners :) 14:59
timotimo aye
b2gills psch: I can clap with one hand and actually produce sound, I know I'm weird. 15:02
psch b2gills: i actually can do that as well :)
timotimo i can, too 15:03
psch with both hands, even
as in, with each hand
timotimo huh. their explanation of the hashbang line is *very* weird 15:04
and the person they have as the "guest" says on a windows server he had to put C: into that line, too ... ?!?
b2gills timotimo: I hadn't watched even the first episode until just now ( I also paused it a few times )
psch back later & 15:05
b2gills There are some instances where you have to write that on Windows, for example msys or possibly Cygwin. (maybe a web-server or two) 15:06
timotimo oh
i've actually bought a quite decent microphone a long-ish time ago
in order to start screencasting or something like that 15:07
now he's explaining case sensitivity of variable names as "a quirk of perl" ... 15:08
raydiak I think the main thing that bothered me about strictures/warnings wasn't actually that they omitted it, but that they explicitly advertised lack of those checks as a primary feature of the language when we've spent the last 15 or 20 years afaik explicitly trying to get people to stop doing that :)
timotimo and nobody points out that python and c# have the same thing, and also nobody mentions that use strict will help you defend against accidentally writing the same variable name differently when using it
right, that's even worse
raydiak they did a decent job of making sigil variance seem less scary though 15:09
timotimo that's very true
15:09 psch left
timotimo hmmm 15:11
i wonder how a slang would fare that forces you to write "beginning of string" and "end of string" as \"
osfameron timotimo: I'm really frustrated by python's lack of use strict and -c (syntax check) 15:12
15:13 gfldex joined
b2gills That reminds me `no strict` actually prevents you from using `my` in Rakudo (which it shouldn't imho) 15:13
15:14 ajr_ left
timotimo i'm pretty sure python has a syntax check commandline argument 15:14
um, really?
15:14 guru joined, brrt left
timotimo m: my $fo = 10; $foo = 20; say $foo; say $fo 15:14
camelia rakudo-moar 28cfa0: OUTPUT«===SORRY!=== Error while compiling /tmp/tHxi2Rudkl␤Variable '$foo' is not declared. Did you mean '$fo'?␤at /tmp/tHxi2Rudkl:1␤------> my $fo = 10; $foo⏏ = 20; say $foo; say $fo␤ expecting any of:␤ p…»
timotimo m: 6; my $fo = 10; $foo = 20; say $foo; say $fo
camelia rakudo-moar 28cfa0: OUTPUT«20␤10␤»
15:14 guru is now known as ajr_
timotimo m: no strict; my $fo = 10; $foo = 20; say $foo; say $fo 15:14
camelia rakudo-moar 28cfa0: OUTPUT«20␤10␤»
timotimo seems to work fine on camelia
b2gills Maybe it's just -e at the command line thats wonky 15:15
raydiak that works here, too
(here as in wfm)
timotimo works on my system, too 15:16
smls m: say (1, 2, 3).map(&WHAT); # timotimo: The subroutine form of WHAT doesn't seem magical though...
camelia rakudo-moar 28cfa0: OUTPUT«(Int) (Int) (Int)␤»
timotimo oh
i didn't know we actually had a little sub for that
in that case, check this out:
m: say (1, 2, 3)>>.&WHAT
camelia rakudo-moar 28cfa0: OUTPUT«(Int) (Int) (Int)␤»
b2gills Maybe it's that I have a shell script named `perl6` instead of a symlink 15:18
timotimo make install will actually install a shell script for you
ooooh, this coincidence is weeeiird 15:19
last night i finally saw the movie Frozen for the first time over at a friend's house. the next day i watch the twit coding perl 101 introductory video which ends in a little out-take-like segment where they sing sons from that exact movie adapted to the show
smls timotimo: Cute, but I'd say the punctuation density is a little too high for unsuspecting doc readers... :P
b2gills never mind switching to a symlink fixed it 15:20
I use rakudobrew and now a symlink in ~/bin/ 15:21
timotimo smls: if you really want to scare people with punctuation, how about a brainfuck slang ...
m: say (1, 2, 3)>>&WHAT 15:22
camelia rakudo-moar 28cfa0: OUTPUT«===SORRY!=== Error while compiling /tmp/ibgN9LAABI␤Missing << or >>␤at /tmp/ibgN9LAABI:1␤------> say (1, 2, 3)>>&⏏WHAT␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-in…»
timotimo right, that doesn't work.
b2gills instead of a bf slang how about an APL slang 15:23
15:25 chenryn joined
smls m: say 3 (&) 1..4; # Huh...Why do the set operators have such tight precedence? 15:26
camelia rakudo-moar 28cfa0: OUTPUT«set()..4␤»
timotimo instead of an APL slang how about a prolog slang? 15:27
Ugator Why not Lisp :P 15:29
b2gills APL has a lot of characters you can't type on a normal keyboard 15:30
arnsholt Because many Lisps are actually kind of complicated. Especially Common Lisp
raydiak
.oO(a Whitespace slang would be nice and clean...)
15:31
15:32 anaeem1_ joined 15:34 chenryn left
smls you mean like Acme::Bleach? :) 15:34
15:34 chenryn joined 15:36 kaleem left
raydiak is that what it does? I always wondered, never tried it 15:36
[Coke] cranks up the daily test to get some heat on this laptop. very cold :| 15:37
15:38 kjs_ left 15:41 chenryn left 15:43 chenryn joined
lizmat it was close to 18C here in Lyon today 15:45
[Coke] it's -1C right here. 15:51
timotimo has multiple hundred kelvin over here 15:52
15:54 chenryn left 15:56 sorear left 15:57 sorear joined
jnthn decommute & 15:57
15:58 fhelmberger left 15:59 woolfy left
timotimo FROGGS: could you rename the Inline module "Inline::C"? 15:59
FROGGS timotimo: it was meant to be a base for other Inline modules 16:00
timotimo oh?
16:00 woolfy joined
FROGGS since is defines the 'is inline' trait 16:00
timotimo oh 16:01
and at the same time it implements C
FROGGS yes, like the P5 module does IIRC
timotimo it doesn't really offer a method of extending the inline trait for other languages 16:02
you could just as well define the inline C trait as:
multi sub trait_mod:<is>(Routine $r, :$inline! = "C") { ... }, no?
FROGGS m: multi sub trait_mod:<is>(Routine $r, :$inline! = "C") { ... }; sub foo is inline("bar") { }; say "alive" 16:03
camelia rakudo-moar 28cfa0: OUTPUT«===SORRY!=== Error while compiling /tmp/GvlXp7OzFr␤Cannot put default on required parameter $inline␤at /tmp/GvlXp7OzFr:1␤------> ait_mod:<is>(Routine $r, :$inline! = "C"⏏) { ... }; sub foo is inline("bar") { };…»
timotimo hm. we'd need a "where" clause, which would kind of suck
but since it's run at compile time anyway ... maybe that's fine
but that'd make it extensible somewhat easily 16:05
16:06 jluis_ joined 16:08 chenryn joined 16:09 anaeem1_ left, anaeem1_ joined
[Coke] gives up trying to make jnthn's macro-ized like work for now. 16:10
16:11 chenryn left
dalek kudo/newio: abef531 | (Elizabeth Mattijsen)++ | src/core/IO/File.pm:
IO::File can now slurp
16:13
kudo/newio: 937b277 | (Elizabeth Mattijsen)++ | src/core/io_operators.pm:
Some further slurp/spurt updates / fixes
kudo/newio: 58f0e4d | (Elizabeth Mattijsen)++ | src/core/Deprecations.pm:
Don't need to make it an IO object
16:20 denis_boyun left 16:24 JimmyZ_ left
dalek kudo/newio: bb40426 | (Elizabeth Mattijsen)++ | src/core/IO/Pipe.pm:
Use the proper way for closing a pipe
16:26
16:27 telex left 16:28 telex joined 16:39 FROGGS left
dalek kudo/newio: 9d568c7 | (Elizabeth Mattijsen)++ | src/core/PIO.pm:
Made (PIO).say a bit faster
16:53
kudo/newio: ad27de1 | (Elizabeth Mattijsen)++ | src/core/PIO.pm:
Make sure we always close on destruction
16:53 anaeem1_ left 16:54 anaeem1 joined 16:55 anaeem1 left 16:56 anaeem1_ joined, rindolf left, ajr_ left 16:57 zakharyas left 16:58 guru joined, guru is now known as Guest38007, Guest38007 is now known as ajr_ 17:00 louisch left 17:01 ajr_ left
timotimo perl5i seems cute 17:03
they can't fix method call syntax, though :P
and references
does perl5i get multiple dispatch somehow? 17:06
smls m: say Date.new; 17:07
camelia rakudo-moar 28cfa0: OUTPUT«2014-12-24␤»
smls Christmas as default? :P
timotimo yup
17:07 kjs_ joined
tony-o that is when perl6 is official for production, isn't it? 17:08
timotimo yes, every christmas 17:09
tony-o timotimo: i'm going to change the hijack example up a little bit and remove the pluggable depends from http-server-async 17:13
17:24 woolfy left
dalek nda: 0741200 | (Nick Logan)++ | bin/panda:
example exit status for 'bin/panda'
17:30
nda: 5a09463 | (Nick Logan)++ | bin/panda- (4 files):
basic exit codes for remaining bin/ scripts
nda: af294db | tadzik++ | bin/panda (5 files):
Merge pull request #118 from ugexe/exit_status

  /bin scripts exit status
tadzik ugexe++
tony-o label out 17:31
17:33 Isp-sec joined
lizmat day 2 shutting down& 17:33
17:33 lizmat left 17:34 virtualsue left
timotimo tony-o: sounds good to me 17:36
17:36 kjs_ left
tadzik smoketest reports down? 17:39
17:40 rindolf joined
tadzik oh, works now 17:42
jnthn evening, #perl6 17:52
tadzik sergot: ping 17:54
17:55 Sqirrel left 17:56 Sqirrel joined 18:15 xinming left 18:16 Mso150 joined, xinming joined
TimToady smls: we used to think of sets as more listy, but got into trouble with it, so sets are more biased towards being scalars now 18:20
so, for instance, if we turned setops into list infixes, you would have to parenthesize my $set = (3 (&) 1..4); 18:21
and creating two new precedence levels won't fly either 18:22
if we put them at the logical ops level, then .. would DWYM but , wouldn't
plus at the time, we actually moved them from the math ops, which were even tighter 18:23
we noted their resemblance to the junctions as well, and figured that was a good mnemonic for which precedence level they live at
but as weird hybrids of scalar-on-the-outside with components-on-the-inside, there isn't really going to be a perfect precedence level 18:25
precedence levels are very waterbeddy
another consideration is that the set operators are primarily aimed at working between sets, and the coercive aspects of the operands is only a secondary consideration 18:26
18:27 rindolf left
timotimo i must have been doing it wrong, then 18:27
i used to like the coercive aspect of sets
TimToady when we tried to make sets listier, we ended up making it really difficult to include sets into other sets
timotimo well, i suppose putting an @blah on one side of a set-op to make it coerce is still acceptable
TimToady yes
smls++ was complaining about the need for parens around .. 18:28
timotimo right, of course 18:30
18:32 FROGGS joined 18:34 dj_goku left 18:35 beastd joined
TimToady there's no way to fix the parens around (^$foo).map either, since people also expect -$x.sin to work without having to say -($x.sin) 18:40
timotimo well, there's now map ^$foo:; 18:41
TimToady well, yeah...but someone will certainly get mad at the use of that for anything more complicated than a variable invocant :) 18:42
timotimo fair enough :) 18:43
18:49 psch joined
psch hey #perl6 o/ 18:49
TimToady yo 18:50
heh, that kind of looks like a back and forth wave with my right hand 18:51
psch it does. would work better with the other hand on the font i'm using 18:52
TimToady pity there are no animated unicodes
oy
colomon oY 18:53
jnthn TimToady: shhh, you'll giveses them ideas!
CAT FACE WITH COMBINING FLOWING TEARS OF JOY 18:54
TimToady 18:56
speed lines help
raydiak reminicent of a peace sign, or maybe a vulcan salute 18:57
TimToady yeah, they should've made the animal composable with the expressions as combining chars
18:57 silug left
TimToady and the face color as another dimension 18:58
18:58 anaeem1_ left
raydiak like this that someone else noticed before? www.unicode.org/reports/tr51/#Emoji_Modifiers 18:58
TimToady discriminates against martians 19:01
raydiak definitely not universal enough... 19:04
19:10 silug joined 19:17 kjs_ joined 19:21 rindolf joined 19:22 anaeem1_ joined 19:24 kurahaupo joined 19:27 guru joined, guru is now known as Guest24741, Guest24741 is now known as ajr_ 19:32 rindolf left
tony-o btyler: (http-server-async) im working on how to timeout async sockets but im getting cross thread probs right now . other than that it should be working a lot better . and current master is passing all tests 19:33
19:37 anaeem1_ left 19:46 dj_goku joined 20:02 darutoko left 20:04 Mso150_f joined 20:05 Mso150 left 20:22 Mso150_f left 20:24 Mso150 joined
btyler tony-o: cool! 20:27
tony-o btyler: gist.github.com/tony-o/de74e2111b2e65802cff 20:46
20:49 kjs_ left
tony-o btyler: this is my error trying to close connections wit the $*SCHEDULER : gist.github.com/tony-o/6de78fe91379a2501415 20:52
20:52 denis_boyun joined 21:00 raiph joined
btyler tony-o: same error here 21:00
21:02 anaeem1_ joined 21:03 anaeem1_ left, alesk joined, anaeem1_ joined 21:06 ennio joined
alesk m: grammar G { regex TOP { bar }}; G.parse('bar').perl.say; G.parse('foobar').perl.say 21:06
camelia rakudo-moar 28cfa0: OUTPUT«Match.new(orig => "bar", from => 0, to => 3, ast => Any, list => ().list, hash => EnumMap.new())␤Any␤»
jnthn Grammars implicitly anchor to string start. 21:07
21:08 pmurias joined, anaeem1_ left
pmurias jnthn: is it possible in nqp for things from the setting of the *compiler* to contaminated the code I'm compiling 21:08
jnthn pmurias: There are ways of getting things wrong that can lead to that, yes. 21:09
21:09 rurban1 left
jnthn pmurias: I had such bugs in the JVM port. 21:09
pmurias jnthn: while working on getting nqpmo support in nqp-js, when I have a 'my class NQPMu {...}' in the setting I get a dependency on the moar setting 21:10
jnthn pmurias: Far less in the MoarVM port, maybe 'cus I was still vaguely concious of them. :)
Yeah.
21:10 rurban joined
pmurias jnthn: would it be possible to add a "generation" to the serialization contexts so such things would be caught while serializing? 21:10
jnthn Are you passing --bootstrap to NQP in your build like we do in the existing backend's makefiles? 21:11
pmurias what does --bootstrap do?
jnthn Also, do you have a compiler/compilee HLL config mechanism in place?
I can't remember. But if you are missing it...I'd start looking there :)
pmurias thanks for the pointers, I'm tired after a train journey now but I'll look into those tomorrow 21:12
jnthn is sstill doing the train journey :)
Lemme know if you need some more specific pointers after taking a glance at those two bits, anyway 21:13
21:16 kurahaupo1 joined 21:23 smls left 21:24 erkan joined, erkan left, erkan joined 21:26 Khisanth left 21:27 Khisanth joined
alesk m: 'a,b,c,d' ~~ / (\w+) % ',' / 21:35
camelia rakudo-moar 28cfa0: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter % (must be quoted to match literally)␤at /tmp/UbW5b2gXnc:1␤------> 'a,b,c,d' ~~ / (\w+) ⏏% ',' /␤Unable to parse regex; couldn't find final '/'␤at /tmp/UbW5b2gXn…»
alesk m: 'a,b,c,d' ~~ / (\w+)+ % ',' /
camelia ( no output )
tony-o any help with this error? . im receiving it trying to close a socket from withint $*SCHEDULER.cue gist.github.com/tony-o/6de78fe91379a2501415
should i be trying to close it from within the same block as my .tap? 21:36
masak *drum roll* 21:37
tony-o uh oh
TimToady finally...
masak lol! I blogged! strangelyconsistent.org/blog/macros...terals-day 21:38
tony-o slang sql is out there :) 21:39
though not with that syntax yet 21:40
masak url?
tony-o github.com/tony-o/perl6-slang-sql 21:42
masak ooh
well, that certainly deserves an edit/mention in the blog post :)
tony-o perljam and a few other folks had some good suggestions but im currently cleaning up and making http server async better 21:43
by better i mean usable 21:44
masak *nod8
*nod*
well, looking at your Slang::SQL, it does look very promising.
my first thought is "if I have interpolation, I don't want to do prepared statements", though.
at least not in 90% of the cases. 21:45
tony-o why is that?
masak something like this: the '?' syntax is there to *safely* inject parameters into the SQL query.
but if I control the slang, I can already do that behind the scenes. 21:46
so it's much more direct to just write the value I want right there, in the query.
21:46 raiph left
masak it gets rid of one level of indirection necessitated by the parametrization of the prepared statements. 21:47
which in turn was necessitated by people doing stupid things with string concatenation -- which is not a problem in Perl 6 slangs, because that's not how we do it, ideally.
does that make sense?
tony-o ahh yea i see what ythat is the plan 21:48
masak \o/
then consider me all aboard! :)
masak edits his post
tony-o i misunderstood what you meant :)
lue masak: Unless ideas have changed since I last saw, I still see slangs as "grammar without a nice way to do actions" and macros as "actions without a nice way to do grammar". I think they could be two halves of the same thing, so I'm not surprised if you have trouble figuring out which you're talking about :) . 21:53
masak lue: :D 21:54
lue: I like your problem statement, even though I'm not 100% sure I agree yet.
tony-o lue: what do you mean "without a nice way to do actions" 21:55
masak lue: perhaps I would frame it as macros being *mostly* action-y, slangs being *mostly* grammar-y, and both of them being aspects of a common, unified thing that we haven't dug out of the sands of confusion yet.
lue: reming me to take you aside one day and tell you all the awesome/crazy plans for Qtrees. 21:56
remind*
lue tony-o: You can insert action-y statements in grammar rules, which I'm fine with, it just feels less structured/defined than the usual grammar + action class procedure.
21:56 kurahaupo1 left
tony-o ah 21:56
lue It's macros' "is parsed" trait that I don't like; I can see very long function openers because of it (or people writing a my token ruleformacro just so they can shorten it to macro foo is parsed(/<ruleformacro>/) ) 21:58
masak that parenthetical solution doesn't sound half-bad. 21:59
22:00 kurahaupo1 joined, kurahaupo1 left
TimToady all the macro is doing is supplying an action method there, basically 22:02
jnthn reming: to make something ming yet again...
TimToady so maybe it ought to look more like an action method
masak jnthn: it's form people who miss that dynasty.
for*
lue masak: It's what I would do with long parsing rules, though when thinking about it I can't help but wonder if Perl 6 couldn't do the is parsed(/<ruleformacro>/) part for me :) . 22:03
TimToady refrains from making a pun on vase-ectomy
masak TimToady: thanks for politely snipping that pun.
TimToady it's just a non-series of tubes 22:04
masak .oO( and the backlog turned into so many snippy remarks )
jnthn Cut it out, guys! :P 22:05
masak eh, vas the big deferens. 22:06
22:06 alesk left
masak lue: maybe in some very arranged cases, Perl 6 could figure out the `is parsed` part for you. (though that sounds to me like something a helpful module could provide if one wanted.) 22:07
lue realizes the major difference between slangs and macros is that slangs are a container with grammar rules, while macros are simply stray action-y functions. 22:09
dalek p: 6f86799 | TimToady++ | src/QRegex/P6Regex/Grammar.nqp:
better message for missing quant on %
22:14
p: f619a5e | TimToady++ | src/QRegex/NFA.nqp:
some nfa timing code (commented out)
TimToady > perl6 -e '/ (\w+) %% \, /' 22:20
===SORRY!=== Error while compiling -e
Missing quantifier on the left argument of %%
alesk++ 22:21
22:21 bjz left 22:27 Mso150_p joined 22:28 Mso150 left 22:29 jluis_ left
pmurias masak: have you seen the quasi-quoting in haskell, it seems to be the same thing you are proposing 22:29
masak pmurias: I have not. do you have a reference I can look at? 22:30
pmurias masak: www.haskell.org/haskellwiki/Quasiquotation 22:33
masak oh, I thought it sounded familiar: I remember when au++ made hackage.haskell.org/package/interpo...ring-perl6 22:35
yes, it looks quite similar. 22:36
they call it "antiquoting" when they break out of the slang. we might want to steal that terminology. 22:37
TimToady the trick is knowing the syntactic category of the unquote so you know what parser state to enter/leave with 22:39
ennio m: grammar G { token TOP { foo } }; class C { method TOP($/) { 'ba' ~~ /bar/ } }; G.parse('foo', :actions(C.new)); 22:40
camelia rakudo-moar 28cfa0: OUTPUT«Cannot assign to a readonly variable or a value␤ in method ACCEPTS at src/gen/m-CORE.setting:14222␤ in method TOP at /tmp/e63CHQE8ST:1␤ in any !reduce at gen/moar/stage2/QRegex.nqp:850␤ in any !cursor_pass at gen/moar/stage2/QRegex.nqp:811␤ …»
ennio no regex possible in action methods?
jnthn ennio: Not if you bind $/ as a parameter. 22:41
ennio jnthn: so, how to do that? 22:43
22:43 denis_boyun left
jnthn ennio: method TOP($a-name-that-is-not-dollar-slash) { } 22:43
masak 'night, #perl6
ennio jnthn: ah, simple :) thanks 22:44
psch that loses the easy access to named captures though, which might be inconvenient 22:45
at least with $a-name-that-is-not-dollar-slash :)
lue masak o/
psch ...where easy just means "few characters" 22:46
jnthn Yes, though it's better that it fails outright if you try right now rather than overwriting $/ with the regex you just matched. 22:48
22:48 Mouq joined
jnthn I'd probably consider factoring the regex in question out into a private method or a sub, and calling that. 22:48
(from the action method)
psch localizing $/ in a block still works, which might be ok if it's just about matching and not capturing 22:49
if the use case is again capturing in the actions there's probably some redesigning to do
jnthn Well, yes...that is also very true 22:50
It's quite rare to do regex matches in action methods because the grammar usually has already pulled out the interesting bits :) 22:51
ennio yeah I finally moved this regex to the grammar itself :)
jnthn \o/
That's a much better way to go.
psch i'm wondering if leaking ACCEPTS is ok or 'too internal'. on the one hand infix:<~~> is designed as a call to ACCEPTS with localized $_, on the other hand the error looks a bit LTA 22:53
maybe something along the lines of "Trying to assign to non-rw parameter" would be nice 22:54
m: sub foo ($a) { $a = 23 }; foo
camelia rakudo-moar 28cfa0: OUTPUT«===SORRY!=== Error while compiling /tmp/gKVI1l4E6S␤Calling 'foo' requires arguments (if you meant to operate on $_, please use .foo or use an explicit invocant or argument)␤ Expected: :(Any $a)␤at /tmp/gKVI1l4E6S:1␤------> [32…»
psch m: sub foo ($a) { $a = 23 }; foo(1)
camelia rakudo-moar 28cfa0: OUTPUT«Cannot assign to an immutable value␤ in block <unit> at /tmp/VvwtXtLU9p:1␤␤»
psch well, we don't even ===SORRY!===, that's definitely LTA
jnthn That one is a runtime error. 22:55
We could catch it at compile time here, though...
psch oh, is that a distinction i didn't realize? SORRYs are compile time?
jnthn Yes 22:58
23:01 Mouq left
psch i probably did know that at one point... hopefully it sticks this time around :) 23:02
re jvm-interop via invokedynamic: from what i understand i need something similar to IndyBootstrap:methcall{,Resolve}_noa but with caching on top? afaiu, the hard linking the jvm would do doesn't work for us because we have multiple candidates 23:04
23:08 lizmat joined
jnthn psch: Forget the caching in the begining. 23:11
psch: The trick for multi-dispatch is to use the bootstrap method to install a call to something that will do the dispatch.
psch jnthn: rereading methcall_noa looked more like the call goes through there anyway. i guess methcallResolve_noa is what calls the bootstrap method which i have to install? 23:18
jnthn: as for installing the call, i'll have to figure out how exactly asm does invokedynamic, but i think i have an idea how to set up the surrounding at least
i do have to generate the something dynamic, right? i'm getting a bit tired 23:19
i'll also have to have a closer look at what exactly the CodeRef knows and what else i need for dispatching 23:22
but i have that noted down and a (in the editor) sensible looking way of gathering things i need to dispatch written down as well 23:23
jnthn psch: Take a read through jnthn.net/papers/2013-bs-invoke-dynamic.pdf (maybe when less tired :))
psch i
i'll do that tomorrow or so though...
jnthn psch: I'm also pretty tired, and I suspect my slides explain it better than I can right now :)
psch jnthn: i'm okay with that, i do need rest about right now :) 23:24
dalek kudo/newio: 9151432 | (Elizabeth Mattijsen)++ | src/core/IO/Handle.pm:
The new IO::Handle, consuming the PIO role
23:25
kudo/newio: 2b592c9 | (Elizabeth Mattijsen)++ | src/core/io_operators.pm:
Simplifications since we have the new IO::Handle
psch jnthn: thanks for the slides
23:25 denis_boyun_ joined
psch well, i did read half of the slides before realizing again i wanted to put away the laptop and turn of the lights... 23:31
i'll do the latter two things now though o/
23:31 psch left, [Sno] left 23:32 [Sno] joined 23:33 denis_boyun_ left 23:34 Isp-sec left 23:36 denis_boyun_ joined 23:40 pmurias left
ennio :q 23:46
hugme hugs ennio, good vi(m) user!
ennio well, yes good night perl6 :) 23:47
jnthn :)
'night, ennio
23:47 ennio left
lizmat gnight ennio 23:47
lizmat also calls it a night
cu 2morrow
23:48 lizmat left
[Coke] waves from the highway. 23:49
23:51 rmgk_ joined, rmgk is now known as Guest24708, Guest24708 left, rmgk_ is now known as rmgk
jnthn o/ [Coke] 23:53
23:56 gfldex left
[Coke] parametrization - on oracle, you actually want this deferred to the DB level so the DB optimizer can play. 23:56
23:59 kurahaupo1 joined