»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
tushar can i read input file here on irc channel using "m:"? 01:28
geekosaur not in general. there's usually some kind of (usually unicode-y) text file on $*IN though 01:29
tushar geekosaur: thanks. 01:30
m: $*IN.nl-in.say; 01:31
camelia rakudo-moar 3789a0: OUTPUT«[␤
tushar can i set "nl-out" or "nl-in"? 01:34
tushar Is there any special variable or method that can identify the field separator of a file? 01:39
AlexDaniel tushar: what's a field separator of a file? 02:05
tushar AlexDaniel: tab separator or comma separator. It's like field separator in Sed. 02:08
AlexDaniel umm… if $line ~~ /‘;’/ { … } elsif $line ~~ /\t/ { … } ? 02:09
it's hard for me to see how should it decide if it's one or another :) 02:10
especially if the line contains both
committable6: stdin websitetips.com/articles/copy/lorem/ipsum.txt 02:11
committable6 AlexDaniel, Successfully fetched the code from the provided URL.
AlexDaniel, gist.github.com/15e332d3fd7bb9c084...dbd2103fd0
AlexDaniel well, this response is LTA
AlexDaniel committable6: say lines[0] 02:11
committable6 AlexDaniel, ¦«say»: Cannot find this revision
AlexDaniel committable6: HEAD say lines[0]
committable6 AlexDaniel, gist.github.com/c0c06fd17cbcf7e22d...0aad936484
AlexDaniel committable6: HEAD say lines[0].split(‘ ’)[0] 02:12
committable6 AlexDaniel, ¦«HEAD»: Lorem
MasterDuke you should be able to set nl-in
AlexDaniel so yeah, you can use custom STDIN if you use committable. Still can't read a file though
MasterDuke e.g., $filename.IO.lines(:nl-in("\r\n")).elems 02:13
MasterDuke docs.perl6.org/language/5to6-perlv...ilehandles 02:14
Xliff_ m: use NativeCall; my @a = CArray[int32].new; @a.^methods.say 02:50
camelia rakudo-moar 3789a0: OUTPUT«(iterator from-iterator new STORE reification-target shape pop shift splice name of default dynamic Method+{<anon|44748016>}.new Method+{<anon|44748016>}.new Method+{<anon|44748016>}.new Method+{<anon|44748016>}.new BIND-POS Method+{<anon|44748016>}.new Me…»
Xliff_ Is there an easy way to list the roles supported by an object? 02:54
skids m: "foo".^roles.say 03:09
camelia rakudo-moar 3789a0: OUTPUT«((Stringy))␤»
skids m: class A { }; class B is A { }; A.^parents.say # ?? 03:16
camelia rakudo-moar 3789a0: OUTPUT«()␤»
skids star: class A { }; class B is A { }; A.^parents.say # ?? 03:16
camelia star-m 2016.04: OUTPUT«()␤»
skids oh. duh 03:17
m: class A { }; class B is A { }; B.^parents.say
camelia rakudo-moar 3789a0: OUTPUT«((A))␤»
skids m: class A { }; class B is A { }; B.^parents(:all).say
camelia rakudo-moar 3789a0: OUTPUT«((A) (Any) (Mu))␤»
dalek ateverable: d3a3e58 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (2 files):
Remove transitional support for older builds

This code is not needed anymore.
04:07
ateverable: 6b4d623 | (Aleks-Daniel Jakimenko-Aleksejev)++ | README.md:
Less README, more wiki!

Editing documentation with git commits is daunting.
Nex6 question this line: 05:45
my $results = run 'ping', '-c', '1', ' ' $line :out;
throws this error
===SORRY!=== Error while compiling /Users/zero/Perl6_Projects/pingsweep/./pingsweep.pl
Two terms in a row
geekosaur that syntax looks wrong, yes 05:46
Nex6 it worked on Linux, now i am running the script on OS X and it throws error? 05:47
geekosaur not like that it didn't, because ' ' $line is invalid 05:48
:out($line) perhaps?
Nex6 i moved the $line from beginning
geekosaur although that still wouldn't be right because $line would get a filehandle 05:48
what was the original command? 05:49
Nex6 for 'hostfile.txt' .IO.lines -> $line {
its in a for loop 05:50
geekosaur ok, so if you are using run then it needs to be something like: my $proc = run('ping', '-c', '1', :out); for $proc.out.lines -> $line { 05:51
hm, parens are not needed for that run, I was starting to type something else that wouldn't have worked 05:52
my $proc = run 'ping', '-c', '1', :out; for $proc.out.lines -> $line {
zengargoyle is there a .trans like thing that does 'from' => 'to', 'from1' => 'to1' instead of [«from from1»]=>[«to to1»] ?? 06:46
zengargoyle or some simple magic transformation incantation to make the former into the latter? 06:50
zengargoyle thinks "transformation incantation" will be a handy p6 term.... 06:51
perlawhirl zengargoyle: why not subst (or s///) 07:13
m: 'test from test from1 from3'.subst('from', 'to', :g) 07:14
camelia ( no output )
perlawhirl m: say 'test from test from1 from3'.subst('from', 'to', :g)
camelia rakudo-moar 3789a0: OUTPUT«test to test to1 to3␤»
zengargoyle perlawhirl: because there's always a *long* list of A->B, C->D, E->F, G->H, I->J replacements that i want to do in one go. 07:19
zengargoyle and that's an easier format to maintain than [A,C,E,G]->[B,D,F,H] 07:20
perlawhirl *shrug*... put them in a hash and loop over them... for %from-to.kv -> $from, $to { $string .= subst($from, $to, :g) } 07:24
zengargoyle then you have to worry about order of substitutions. IIRC .trans does longest first for you and maybe other optimizations so that it's *one* pass over the string instead of N passes over the strin. 07:26
perlawhirl you can define 2 ordered lists if that's nicer to maintain... .trans( @from => @t ) 07:32
perlawhirl m: my @a = <this is that>; my @b = <now it's this>; say 'this is not that'.trans(@a => @b) 07:33
camelia rakudo-moar 3789a0: OUTPUT«now it's not this␤»
zengargoyle that's exactly the opposite of what i want. when adding new things you need to add one thing to the first list and one thing to the second list and make sure to keep them in order. 07:35
raydiak m: my @vals = { a => 1, b => 2, c => 3 }.pairs; say @vals».key, @vals».value; # more like this maybe... 07:36
camelia rakudo-moar 3789a0: OUTPUT«[a c b][1 3 2]␤»
zengargoyle i want to have one list of x=>y and add more x=>y to that list.
raydiak: yeah, but i was hoping for not having an intermediate variable. :P
i.e. for one-liner usage scenario. 07:37
raydiak m: say $_».key, $_».value given { a => 1, b => 2, c => 3 }.pairs.list # not exactly pretty but no intermediate variable 07:38
camelia rakudo-moar 3789a0: OUTPUT«(a c b)(1 3 2)␤»
zengargoyle where it's much easier to add one more A=>B somewhere than it is to add an A in one place and a B in another. but yeah. that or a {[$_.keys]=>[$_.values]}(a=>b, c=>d) sort of thing. 07:39
raydiak seriously? you have "a long list" of these in a one-liner?
zengargoyle :P
for lines».split: /\s/ -> ($c, $, $t) { say qq{<Multi_key> $t.comb.map({$_.trans([«( ) + - | < > . ^ = & !»]=>[«parenleft parenright plus minus bar less greater period asciicircum equal ampersand excam »])}).fmt("<%s>") : "$c" U+$c.ord.fmt("%X") # $c.uninames()} } 07:40
masak morknink, #perl6
raydiak at first glance looks like a mess that ought to be facotred into something readable to me
o/ masak
zengargoyle i've used Perl5 one-liners from hell for many years and intend to do the same with Perl6. they're one-off things and go into my ~/0liners file and if i need them more they get put in an editor and tidy'd and worked on. 07:43
zengargoyle that takes the list of char,codepoint,texas-symbol cut from the docs and turns it into a .XCompose file. 07:43
the only part of that that was even a tiny PITA was the .trans.... 07:46
lizmat zengargoyle: perhaps link to it from the doc ? 07:48
zengargoyle lizmat: link to what?
lizmat a downloadable copy of the .XCompose file ? 07:49
:-)
zengargoyle oh, yeah, it's the start of a plan to get all the texas to char mappings somehow and generate various IME files (ibus tables, xcompose, ...). 07:50
zengargoyle i wish there was a way to get the mappings from *within* p6 somehow vs keeping a list somewhere. 07:51
lizmat I guess we could add such a module to lib and make it -use-able and in sync with releases that way 07:52
not sure we want to carry that around all the time 07:53
zengargoyle yeah, or maybe when pod6 is a bit more ... just a comment or something that can be got at somehow. 07:55
raydiak m: < a 1 b 2 c 3 >[ (0, 2 ... *), (1, 3 ... *) ].say # any better?
camelia rakudo-moar 3789a0: OUTPUT«((a b c) (1 2 3))␤»
zengargoyle m: sub (*@a) { [@a>>.key]=>[@a>>.value] }((a=>'b',c=>'d')) 08:03
camelia ( no output )
zengargoyle m: say sub (*@a) { [@a>>.key]=>[@a>>.value] }((a=>'b',c=>'d'))
camelia rakudo-moar 3789a0: OUTPUT«[a c] => [b d]␤»
zengargoyle m: {[@^a».key]=>[@^a».value]}((a=>'b',c=>'d')) 08:07
camelia ( no output )
zengargoyle m: say {[@^a».key]=>[@^a».value]}((a=>'b',c=>'d')) 08:07
camelia rakudo-moar 3789a0: OUTPUT«[a c] => [b d]␤»
zengargoyle m: say {[@^a».key]=>[@^a».value]}(a=>'b',c=>'d') 08:16
camelia rakudo-moar 3789a0: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤ in block <unit> at <tmp> line 1␤␤»
masak m: say {[@^a».key]=>[@^a».value]}([a=>'b',c=>'d']) 08:56
camelia rakudo-moar e9409c: OUTPUT«[a c] => [b d]␤»
masak zengargoyle: when you put something like `a => 'b'` *directly* in an argument list, it's interpreted as a named parameter. 08:57
(this feature goes under the name of "ShimmerFairy's Objection") :P
zengargoyle masak: i sorta knew it wouldn't work without something around the pairs, and why ... just thought *maybe* blocks might be different. 09:24
i guess i really want an additial multi for .trans that takes list of pairs. or a op that un-pairs. both are probably doable in real code. 09:26
zengargoyle slaps self for not guessing ibus-daemon needs restarting after changing XCompose file. 10:00
zengargoyle but can now type Compose-!(elem) and get ∉ in new xterms 10:04
DrForr +1 10:10
lizmat masak: ShimmerFairy is not alone in doubts about that feature 10:42
moritz what would be the alternative? only parse colonpairs as named args? 10:48
gfldex loliblogedagain: gfldex.wordpress.com/2016/09/22/ke...-optional/ 10:49
llamatarianism hey 10:52
new to perl; I've got a question about roles 10:53
I know you can do `role Foo[::Bar] { ... }`
is it possible to do something like `role Foo[::Bar is Baz]` or `role Foo[::Bar does Baz]`?
so that I can make a `Foo` of anything that is/does `Baz`, but not any old type 10:54
gfldex m: role Foo[::Bar where * ~~ Baz] {} 10:55
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot do non-typename cases of type_constraint yet␤at <tmp>:1␤------> 3role Foo[::Bar where * ~~ Baz7⏏5] {}␤»
gfldex llamatarianism: ^^^ NYI
llamatarianism gfldex: cool! thanks a lot :) 10:56
gfldex llamatarianism: however, I would goess you could do that with MOP already 10:56
psch m: role R[Positional] { }; R[Array].new
camelia ( no output )
psch m: role R[Positional] { }; R[Int].new
camelia rakudo-moar e9409c: OUTPUT«No appropriate parametric role variant available for 'R'␤ in any specialize at gen/moar/m-Metamodel.nqp line 2649␤ in any specialize at gen/moar/m-Metamodel.nqp line 2240␤ in any compose at gen/moar/m-Metamodel.nqp line 3028␤ in any make_pun at…»
gfldex m: role R[Positional ::P] { }; 10:57
camelia ( no output )
psch gfldex: i think the error from your example is misleading. it seems about "can't parse constraints on generic parametrization" which seems reasonable
gfldex m: role R[Positional ::P] { }; R[Array]
camelia rakudo-moar e9409c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant value R[Array] in sink context (line 1)␤»
gfldex m: role R[Positional ::P] { }; R[Array].new
camelia ( no output )
psch ah, no 10:58
it's fine, actually, i misread, sorry :)
because where constraints are different than type constraints
i.e. "Positional ::P" vs "::P where Positional"
gfldex m: role R[Num ::P] { }; R[Num].new 10:59
camelia ( no output )
gfldex m: role R[Num ::P] { }; R[Int].new
camelia rakudo-moar e9409c: OUTPUT«No appropriate parametric role variant available for 'R'␤ in any specialize at gen/moar/m-Metamodel.nqp line 2649␤ in any specialize at gen/moar/m-Metamodel.nqp line 2240␤ in any compose at gen/moar/m-Metamodel.nqp line 3028␤ in any make_pun at…»
psch which means with Subsets we already offer the same functionality, just not one specific syntax
gfldex so it can be done with a role but inheritance is ignored
psch m: say Int.isa(Num) 11:00
camelia rakudo-moar e9409c: OUTPUT«False␤»
gfldex oh
psch m: role R[Numeric ::N] { }; R[Int].new
camelia ( no output )
gfldex llamatarianism: sorry, I was wrong. It can be done.
psch llamatarianism: you're following along? :)
llamatarianism psch: a little :P
psch llamatarianism: basically there's two types of constraints on variables
s/variables/parameters/ 11:01
llamatarianism: and role parameterization uses, well, parameters
llamatarianism: the two types are type constraints, as in "Int $x" or "Positional ::P"
llamatarianism: the other type is post constraints, as in "$x where * < 10" or "::P where Positional" 11:02
llamatarianism: the latter is not supported yet in role declaration, which is the error gfldex++ showed
gfldex m: class A {}; class B {}; subset A-or-B where * ~~ A|B; role R[A-or-B ::T] {}; R[A.new].new; R[B.new].new;
camelia ( no output )
gfldex llamatarianism: ^^^ that may be what you want
psch llamatarianism: but the former is fully supported, even with subsetting, inheritance, and mixins
gfldex ENODOC 11:03
llamatarianism gfldex, psch: thanks :) 11:05
jkramer Has anyone ever seen this error? I have no idea where it's coming from o_O "Method 'hash' not found for invocant of class 'Mu'" 11:07
dalek c: 9493948 | gfldex++ | doc/Language/typesystem.pod6:
role arguments can have constraints
psch m: Mu.hash 11:08
jkramer The code I'm looking at doesn't have 'hash' anywhere in it
camelia rakudo-moar e9409c: OUTPUT«Method 'hash' not found for invocant of class 'Mu'␤ in block <unit> at <tmp> line 1␤␤»
gfldex jkramer: are there threads involved?
jkramer Well yeah, thanks psch :)
psch scnr :l
jkramer: maybe hash coercer or %() or something like that?
jkramer gfldex: None that I know of :) However the code is a bit "special" and looking for call frames for a stack trace. 11:09
I'm trying to make this module work: github.com/moznion/p6-Log-Minimal/...inimal.pm6 11:10
psch m: callframe(11).say
camelia rakudo-moar e9409c: OUTPUT«Method 'hash' not found for invocant of class 'Mu'␤ in block <unit> at <tmp> line 1␤␤»
psch jkramer: you're running out of stack :)
m: callframe(11).perl.say 11:11
camelia rakudo-moar e9409c: OUTPUT«CallFrame.new(level => 13, annotations => Mu, my => {})␤»
psch or, well, the empty annotations are to blame actually i guess >_>
gfldex m: callframe(11).WHAT.say 11:12
camelia rakudo-moar e9409c: OUTPUT«(CallFrame)␤»
psch m: callframe(2).say
camelia rakudo-moar e9409c: OUTPUT«gen/moar/stage2/NQPHLL.nqp at line 1428␤»
jkramer m: callframe(1000).WHAT.say
camelia rakudo-moar e9409c: OUTPUT«ctxcaller needs an MVMContext␤ in block <unit> at <tmp> line 1␤␤»
psch m: callframe(2).perl.say
camelia rakudo-moar e9409c: OUTPUT«Method 'WHICH' not found for invocant of class 'Perl6::Compiler'␤ in block <unit> at <tmp> line 1␤␤»
bioduds hi guys 11:13
how do I do this: say qqx{@técnicos};
it won't interpolate the array
psch m: my @a = 1,2,3; say qq{@a[]} 11:14
camelia rakudo-moar e9409c: OUTPUT«1 2 3␤»
psch m: my @a = 1,2,3; say qq{$@a} 11:15
camelia rakudo-moar e9409c: OUTPUT«1 2 3␤»
bioduds let me try
zengargoyle forgets the diff between @x[] and @x[*] 11:16
jkramer psch: Thanks for the pointer, I just added this and it seems to work now :) .grep({ $_.annotations ~~ Hash }) 11:18
Now I can continue to fix the unit tests \o/ 11:20
bioduds thanks 11:21
bioduds psch 11:21
~= is concat for string now?
instead of .= ? 11:22
lizmat bioduds: yes
bioduds tx
lizmat ~ indicates Str
+ indicates numeric
? indicates Bool
m: say ?1
camelia rakudo-moar e9409c: OUTPUT«True␤»
lizmat m: dd ?1
camelia rakudo-moar e9409c: OUTPUT«Bool::True␤»
lizmat m: dd ~1
camelia rakudo-moar e9409c: OUTPUT«"1"␤»
lizmat m: dd +"42" 11:23
camelia rakudo-moar e9409c: OUTPUT«42␤»
llamatarianism is there a difference between `so` and `?`? 11:29
m: say so 1
camelia rakudo-moar e9409c: OUTPUT«True␤»
lizmat llamatarianism: precedence 11:30
llamatarianism lizmat: good point, thanks
timotimo m: say so 1 + 5; say ?1 + 5 11:32
camelia rakudo-moar e9409c: OUTPUT«True␤6␤»
zengargoyle m: say ?2 + 5 11:33
camelia rakudo-moar e9409c: OUTPUT«6␤»
bioduds for @técnicos -> $tecnico { 11:37
SORRY Variable '$tecnico' is not declared. Did you mean any of these?
?
isn't that for in perl6?
timotimo do you have some " " around there somewhere?
bioduds yes
timotimo maybe you accidentally made your quotes go past there? 11:38
bioduds i shouldn't? 11:38
im interpolating for a string
inside the for loop
timotimo m: say "for @tecnicos -> $tecnico { }"
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$tecnico' is not declared␤at <tmp>:1␤------> 3say "for @tecnicos -> 7⏏5$tecnico { }"␤»
timotimo like that?
moritz bioduds: it looks like your syntax error comes before the piece of the code you pasted
bioduds let me check 11:39
sub ef8a4da32a-get-json is export { my Str $ret-val = "{ tecnicos ["; for @técnicos -> $técnico { $ret-val ~= "{nome: $técnico.nome, genero: $técnico.gênero, idade: $técnico.idade, $técnico.rate },"; } 11:41
bioduds is in pm file 11:41
no clue here
timotimo m: for ^10 -> $técnico { say "yo" } 11:42
camelia rakudo-moar e9409c: OUTPUT«yo␤yo␤yo␤yo␤yo␤yo␤yo␤yo␤yo␤yo␤»
timotimo it should work
m: sub ef8a4da32a-get-json is export { my Str $ret-val = "{ tecnicos ["; for @técnicos -> $técnico { $ret-val ~= "{nome: $técnico.nome, genero: $técnico.gênero, idade: $técnico.idade, $técnico.rate },"; }
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$técnico' is not declared␤at <tmp>:1␤------> 3l = "{ tecnicos ["; for @técnicos -> 7⏏5$técnico { $ret-val ~= "{nome: $técn␤»
timotimo oh, that's interesting
m: sub ef8a4da32a-get-json is export { my Str $ret-val = "{ tecnicos ["; for @técnicos -> $técnico { $ret-val ~= "{nome: $técnico.nome, genero: $técnico.gênero, idade: $técnico.idade, $técnico.rate },"; }
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$técnico' is not declared␤at <tmp>:1␤------> 3l = "{ tecnicos ["; for @técnicos -> 7⏏5$técnico { $ret-val ~= "{nome: $técn␤» 11:43
bioduds exactly
timotimo oh, hehe
easy peasy
bioduds should work, right?
timotimo m: sub ef8a4da32a-get-json is export { my Str $ret-val = "\{ tecnicos ["; for @técnicos -> $técnico { $ret-val ~= "{nome: $técnico.nome, genero: $técnico.gênero, idade: $técnico.idade, $técnico.rate },"; }
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@técnicos' is not declared␤at <tmp>:1␤------> 3 Str $ret-val = "\{ tecnicos ["; for 7⏏5@técnicos -> $técnico { $ret-val ~= ␤»
timotimo m: sub ef8a4da32a-get-json is export { my Str $ret-val = "\{ tecnicos ["; for @técnicos -> $técnico { $ret-val ~= "\{nome: $técnico.nome, genero: $técnico.gênero, idade: $técnico.idade, $técnico.rate },"; }
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@técnicos' is not declared␤at <tmp>:1␤------> 3 Str $ret-val = "\{ tecnicos ["; for 7⏏5@técnicos -> $técnico { $ret-val ~= ␤»
timotimo not as easy as i thought, obviously 11:44
m: sub ef8a4da32a-get-json is export { my Str $ret-val = '{ tecnicos ['; for @técnicos -> $técnico { $ret-val ~= "\{nome: $técnico.nome, genero: $técnico.gênero, idade: $técnico.idade, $técnico.rate },"; }
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@técnicos' is not declared␤at <tmp>:1␤------> 3y Str $ret-val = '{ tecnicos ['; for 7⏏5@técnicos -> $técnico { $ret-val ~= ␤»
timotimo oh, right
the error changed
timotimo the problem was you were opening a { inside your string 11:44
that lets you put code in
so your "for @tecnicos -> $tecnico" was inside string quotes
the string quotes started by the " after the [
bioduds so i should escape { ? 11:45
timotimo basically you were writing $ret-val = "{ call sub tecnicos with array ["this is string: ; for @tecnicos -> $tecnico { ...
either escape the { or use '' (because '' won't interpolate)
bioduds ok, so rule of thumb in p6 should be start with single ' ? 11:46
timotimo you're free to do it whatever way you like
zengargoyle isn't there a qq:!e or similar to disable the {} in qq
timotimo correct
bioduds okeydokey
timotimo it's spelled :!c
for "no closures"
zengargoyle :)
bioduds works now
thanks a lot
timotimo m: say "test { say "hi" }" 11:47
camelia rakudo-moar e9409c: OUTPUT«hi␤test True␤»
timotimo m: say q:!c"test { say "hi" }"
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say q:!c"test { say "7⏏5hi" }"␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ statement m…»
zengargoyle guess quotes don't nest... 11:49
psch m: say q:!c/test { say "hi" }/ 11:50
camelia rakudo-moar e9409c: OUTPUT«test { say "hi" }␤»
timotimo can't, if you have the same delimiter character for start and end
m: say q:!c“test { say "hi" }”
camelia rakudo-moar e9409c: OUTPUT«test { say "hi" }␤»
timotimo m: say q:!c“test { say “hi” }”
camelia rakudo-moar e9409c: OUTPUT«test { say “hi” }␤»
timotimo ^- those do nest
zengargoyle m: say qq:!c“test { say "hi" }” 11:53
camelia rakudo-moar e9409c: OUTPUT«test { say "hi" }␤»
zengargoyle muahahaha
timotimo what is muahaha about that?
zengargoyle spent so much time figuring out how to type “ that i didn't see yours. 11:54
timotimo oh 11:55
for me, i have „“” for shift 8 9 0 and ‚‘’ for capslock 8 9 0
⟨⟩₀ are shift + capslock + 8 9 0
m: say ⟨foobar⟩ 11:57
camelia rakudo-moar e9409c: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say7⏏5 ⟨foobar⟩␤Bogus postfix␤at <tmp>:1␤------> 3say 7⏏5⟨foobar⟩␤ expecting any of:␤ infix␤ infix stopper␤ postf…»
zengargoyle you don't have *() for shift 890 ??
timotimo aaw
of course not
timotimo those are capslock g j k 11:57
zengargoyle lol
timotimo of course when i press g j and k i really get o n and r 11:58
psch /o\
AlexDaniel hehe, well, “ is altgr + v for me. And AltGr is on the spacebar 12:00
timotimo *on* the spacebar?
that's interesting
AlexDaniel yes
and v is of course dvorak v… ;)
timotimo where did you move the space key?
AlexDaniel timotimo: I moved it to 無変換 12:01
timotimo what :) :) :)
AlexDaniel timotimo: the key on the left of the spacebar: auctions.c.yimg.jp/images.auctions....z27972.jpg 12:02
timotimo cool
that's a really tiny spacebar
but that's normal in chinese-and-nearby areas?
zengargoyle hehe
AlexDaniel I have no idea. I live in Estonia 12:03
zengargoyle japanese
timotimo OK 12:04
AlexDaniel I just figured that the only way to get more thumb keys for a laptop keyboard is to get a japanese one
zengargoyle old language study partner swore by the thumb keys for conversions.
timotimo mhm 12:05
timotimo very good at distinguishing chinese and japanese, clearly
zengargoyle vs the many who actually use standard US type keyboards and IME
might be a generational thing.
AlexDaniel timotimo: by the way, altgr+.oeu (qwerty esdf) is what I use for arrow keys. 12:06
timotimo that's what i have, too
AlexDaniel nice 12:07
timotimo and altgr uiojklm,. and space are 7894561230 12:07
AlexDaniel timotimo: ;{[?("|<“ 12:08
I figured that I use those more frequently than numbers :)
(reaching for a number row is way too hard ;) ) 12:09
timotimo and of course 90ßpö- are /*-+,;
timotimo and on n i have a : for those pesky ipv6 addresses 12:09
zengargoyle eek, you people are crazy. :)
timotimo sadly, though, no abcdef nearby, i have to drop the modifier for that first 12:10
zengargoyle learned to touch type 30 years ago in HS and couldn't possibly do such remappings w/o going mad.
AlexDaniel yeah, I should make : more reachable
timotimo that's not "do remappings", that's just "setxkbmap de neo" 12:11
AlexDaniel (currently requires altgr+shift, which is fine because both are thumb buttons, but anyway)
[Coke] yawns.
timotimo : is either capslock + ö or of course altgr + n 12:12
AlexDaniel zengargoyle: yeah, I don't think I can recommend all this stuff to anyone
zengargoyle: it is just too much pain. You have to decide yourself if you really want to go through all of this
in fact, neo is available on most systems. My custom layout is not, let alone japanese keyboards… 12:13
timotimo most systems ... unfortunately only on linuces 12:14
zengargoyle yeah, guess i'm US ASCII centric and only know bits about other keyboard layouts and difficulties charset and coding wise.
pretty much why i prefer compose for special chars vs trying to remember AltGr+Shift+key while standing on one leg to get funny characters. 12:16
AlexDaniel zengargoyle: unless you use some character very often, which is why you might actually want to stand on one leg :) 12:16
timotimo i must admit it took me an extra long while to learn all the special char keys on the capslock key 12:17
and capslock + shift i haven't learned any :P
oh, wait, capslock + shift is easy. it's just greek
λολ τψατ ισ φννυ 12:18
zengargoyle and if my laptop actually had extra keys i might use them, but it's more like i'm missing keys than have any extra anywhere.
AlexDaniel zengargoyle: it's kinda other way round here. Once I moved everything to the middle of the keyboard, I no longer need most of the keys
zengargoyle so it's XCompose or totally different IM for stuff.
AlexDaniel I never liked them anyway, stretching my pinky to the side is not the most comfortable thing 12:19
zengargoyle get a smaller keyboard. ?P
geekosaur chord keyboard?
timotimo did you see www.youtube.com/watch?v=1H7JuYqfFAE ? hello world: a suite for visual studio in C# Minor 12:20
AlexDaniel lately I figured that japanese keyboards have another column of keys on the right. So you can move the whole right hand one key to the right and it will basically give you a column of keys in the middle of the keyboard
poor man's ergonomic keyboard!
AlexDaniel timotimo: yeah. It's cool but I'm not sure if it is useful. This, however, is potentially useful: www.youtube.com/watch?v=8SkdfdXWYaI 12:24
like, for sure. If somebody cuts my hands off that's what I am going to do
timotimo YES.
do you remember the "mother of all demos" where this man demonstrates a lot of things and all the dumb audience noticed was the "mouse"?
gfldex m: sub f(:+@a){}; f(a => 1); 12:25
camelia rakudo-moar 73ae93: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub f(:7⏏5+@a){}; f(a => 1);␤»
AlexDaniel timotimo: huh? Not sure what are you referring to
bioduds weird behavior when I include my pm lib
if I put the code on the pl file, it prints to the stdout 12:26
timotimo www.youtube.com/watch?v=yJDv-zdhzMY
The Mother of All Demos, presented by Douglas Engelbart (1968)
bioduds if I use lib and use the pm file it does not
so I run on my shell it prints fine
if i call from an external source it does not
exactly the same code 12:27
timotimo precompilation
you will want to put all your code into subs and use those subs 12:28
rather than rely on the mainline of the module to be run
jkramer m: "\r\n\t".subst(/\r/, '\r', :g).subst(/\n/, '\n', :g).subst(/\t/, '\t', :g) 12:30
camelia ( no output )
jkramer m: "\r\n\t".subst(/\r/, '\r', :g).subst(/\n/, '\n', :g).subst(/\t/, '\t', :g).say
camelia rakudo-moar 73ae93: OUTPUT«\n\t␤»
jkramer What's going on here?
bioduds timotimo : that answer was for me? 12:31
timotimo yes
bioduds oh ok
jkramer Ah, I guess those are not literal \r's
bioduds so, instead of putting an our var
on the pm
i must get the info from a sub that returns it?
geekosaur m: "\r\n".chars
camelia ( no output )
timotimo oh, you just have a var that you're trying to read out?
geekosaur oops 12:32
m: "\r\n".chars.say
timotimo my crystal ball did not tell me this
camelia rakudo-moar 73ae93: OUTPUT«1␤»
bioduds yes
geekosaur jkramer, I think \r\n gets turned into a synthetic newline which matches \n?
bioduds an our var
with export
AlexDaniel timotimo: 1968! Oh wow. No, I haven't seen that.
geekosaur (which is intended to try to make unix vs. windows newline conventions halfway sane/portable)
jkramer geekosaur: Hmm, tricky. So I guess I have to .encode the string and replace the bytes myself? 12:34
geekosaur m: "\r\n".NFD.chars.say
camelia rakudo-moar 73ae93: OUTPUT«Method 'chars' not found for invocant of class 'NFD'␤ in block <unit> at <tmp> line 1␤␤»
geekosaur bleh
moritz m: "\r\n".NFD.codes.day 12:35
camelia rakudo-moar 73ae93: OUTPUT«Method 'day' not found for invocant of class 'Int'␤ in block <unit> at <tmp> line 1␤␤»
timotimo you can sidestep the logical \r or \n by using \xASCIICODE
moritz m: "\r\n".NFD.codes.say
camelia rakudo-moar 73ae93: OUTPUT«2␤»
timotimo mostly needed for inside regexes, actually
zengargoyle on a decent day i typa about as fast as i can talk. on a good day i type faster than i can think.
jkramer timotimo: Already tried that
timotimo no, wait, we do the translation at program boundaries, don't we?
bioduds nope
didnt work
jkramer m: "\r\n".subst(/\x0d/, '\r').subst(/\x0a/, '\n').encode.say
camelia rakudo-moar 73ae93: OUTPUT«utf8:0x<0d 0a>␤»
timotimo bioduds: it's quite difficult to help you with so little information about what you're doing, trying to do, what exactly is going wrong 12:36
bioduds let me try to explain
i have a pl file
AlexDaniel timotimo: nooo! Nooo! It cuts on 34:40
timotimo AlexDaniel: wow, you watched that half hour really fast
bioduds and a pm file
I'm including the pm file and it works fine 12:37
but
when I call it from an external program
bioduds it only shows the stdout if the code is inside the pl file 12:37
not if I put the code in the pm file
if i run perl6 get_data.pl 12:38
works fine
AlexDaniel timotimo: don't use use 2x speed on youtube for watching talks? :)
bioduds both with the code in the pm file and if I put in the pl file
AlexDaniel timotimo: but yeah, I've skipped some
bioduds but
when it is called from another program
that uses
moritz bioduds: did you put the code into a subroutine in the .pm file?
AlexDaniel don't you**
timotimo bioduds: could you instead of describing on IRC put the code and terminal output into a multi-file gist on gist.github.com ? 12:39
bioduds_ that uses the /bin/sh -c perl6 get_data.pl 12:39
then it only works
if the code is inside the pl file
could you see what I mean? 12:40
I don't know why
it happens
moritz then show us the code!
bioduds_ would you like me to try to explain again?
sure
it is simple
timotimo put it into a multi-file gist please 12:41
bioduds_ in the pl file I have: #!/usr/bin/env perl6 use v6; use lib 'lib'; use ef8a4da32a; say ef8a4da32a-get-json;
timotimo not just paste into irc
bioduds_ can you please point me that gist link again? 12:41
the one I used once in the past?
timotimo gist.github.com
let's see ... 12:42
no, i can not :(
bioduds_ gist.github.com/bioduds/994ab32212...72226786ed 12:44
it works fine on command line called by me 12:45
but it only works getting called from another program if i put the code that is in the pm file in the pl file
I am not being able to figure out the reason 12:46
moritz that won't ever work
because Technico has no method to-json
AlexDaniel timotimo: wait so, they are not going to talk about their chorded keyboard? Nooooooooooooooooooo…
timotimo that should work 12:47
zengargoyle when you call it from another program are you in the same directory as the file.
timotimo AlexDaniel: people didn't seem to take note of the chorded keyboard at all
bioduds_ when i call it from another program i am not 12:49
but it works if i get the code in pm file and put directly in the pl
moritz m: say so Any.^can('to-json') 12:49
camelia rakudo-moar 73ae93: OUTPUT«False␤»
bioduds_ and remove use 'lib' and use ef8a4da32a; of course
moritz bioduds_: where would that to-json method come from?
jkramer m: "foo\r\n\tbaz".encode>>.&{ { 13 => "\\r", 10 => "\\n", 9 => "\\t" }{$_} || $_.chr }.join.say 12:50
camelia rakudo-moar 73ae93: OUTPUT«foo\r\n\tbaz␤»
jkramer \o/
bioduds_ from use JSON::Class;
moritz oh, that does some weird magic?
so, what exactly doesn't work?
do you get an error? 12:51
bioduds_ no error
just stdout is empty
if I try using with code inside the pm
if I get the code in the pm and move to the pl
and remove use lib it works 12:52
moritz so if you add some debug output to the start of the sub, do you see that?
timotimo how are you calling your program?
bioduds_ yes I see
timotimo are you calling it in a way that'll actually let stdout output through?
like, if you start "echo 'hi there'" the same way, will 'hi there' show up?
bioduds_ it is called from Meteor Server it uses /bin/sh -c to run the command
var exec = Npm.require('child_process').exec; 12:53
exec('perl6 /home/ubuntu/dev/futs/scripts/get_data.pl', function( error, stdout, stderr ) {
this works, as I told you guys, if code is only in the pl file
timotimo ah
bioduds_ if I use 'lib' and put the code in the pm
it does not
altough 12:54
timotimo are you sure it's not crashing or erroring or something?
bioduds_ although it works if I run manually
sure not crashing
cause I run manually and runs fine
does the pm creates a new process?
or thread?
could that be it?
moritz it might, for precompilation
zengargoyle not sure what you're doing exactly by 'calling from another program' but works fine for me.
bioduds_ zengargoyle : works fine yes 12:55
but if I call from Meteor server, not
stdout is empty
but
moritz so either meteor doesn't like new processes, or some environment is different
bioduds_ if I put the code from the pm file directly in the pl file
then it works
moritz you've repeated that like 10 times already 12:56
bioduds_ it calls a child_process
sorry, just to make it clear
cause it is a little weird problem, right?
AlexDaniel timotimo: wow. Just wow. Thank you for this link 12:57
bioduds_ I guess modularity is of the table then here, right?
timotimo AlexDaniel: it's both greatly positive and greatly negative to watch, isn't it? :)
AlexDaniel timotimo: negative in what sense? 12:58
bioduds_ curiously, any libs from standard panda work 12:59
timotimo all those revolutionary concepts that were shown were promptly forgotten and "discovered" again much later
bioduds_ but the one on the use 'lib' does not
moritz bioduds_: because it's already precompiled
bioduds_ oh
I believe you solved it moritz
timotimo in some ways, the thing doug is working on is a bit more productive and useful than many things we have today
moritz bioduds_: does meteor call it as separate system user?
bioduds_ i believe not moritz
moritz bioduds_: don't just believe, verify :-)
bioduds_ but it looks like it will only listen to the child process it creates 13:00
and the pm as you wisely said
is not precompiled
it must run in another child process
AlexDaniel timotimo: nah, I find it motivational
bioduds_ let me try to investigate it
just one other thing before I do 13:01
timotimo OK
that's good, then :)
bioduds_ is it simple to have my lib pm precompiled?
timotimo bioduds_: could you try giving each individual line you send a bit more time & thought, so you're not sending 6 messages for every message other person sends?
bioduds_ sure, sorry. I'm very prolix 13:03
timotimo i have no idea what prolix means :)
bioduds_ wordy
timotimo wordy isn't so problematic, as long as you can keep yourself from hitting the enter key after five of 'em :) 13:04
bioduds_ :) ok
timotimo i may just be an old fart, but it would make me feel better. thanks! 13:05
zengargoyle i do not know what meteor server is... 13:07
moritz it's a piece of rock that glows while entering earth's athmosphere 13:08
timotimo last time i looked at meteor, it was made for HTTP long polling
timotimo like, a way to send messages to browsers asynchronously to make stuff happen spontaneously when server state changes 13:08
since EventSource and websockets exist now, i'd bet that Meteor has pivoted and is now doing something very different 13:09
zengargoyle $ /bin/sh -c 'cd /home/zen/tmp/7fd613a8e70542099a88dd8ca0dc1683 && /opt/rakudobrew/bin/perl6 the.pl' 13:11
moritz back when I was a grumpy young man, pivots mostly came up in pivot tables
timotimo is that also what english people call those? 13:12
zengargoyle tots works for me...
bioduds_ timotimo : Meteor is a JS framework that uses js both on client and server
timotimo OK. i don't think node.js was already a thing when i last looked at meteor 13:13
bioduds_ on server-side it uses node.js
timotimo yeah. i'm saying node.js didn't exist when i last looked at meteor :) 13:14
bioduds_ oh lol
timotimo so clearly their project has pivoted in that way
zengargoyle bioduds_: you might want to make a test script that just dumps /usr/bin/env to a file in /tmp or something and check things out and work up to making the perl6 work.
timotimo or i am mis-remembering
jast timotimo: Meteor was first released in 2012. node.js was first released in 2009.
timotimo oh? 13:15
maybe i was thinking of a different "Meteor"
bioduds_ zengargoyle : tx, going to try yes
stmuk in the olde days we had meta refresh tags :)
zengargoyle have meteor run the script and run it manually yourself from where your .pl is and compare.
bioduds_ ok 13:16
premise is to have that "middle agent" from client to server extinguished, I believe 13:17
I can have big pl files for this project too, that shouldn't be a nuisance 13:20
zengargoyle has totally had weird thing like this happen with cron etc. make sure all your files like lib/.precomp have appropriate permissions (maybe meteor suid to nobody) and your umask is blocking somehting. 13:21
bioduds_ Do you guys know Code Fights? 13:21
gfldex m: say so ().any;
camelia rakudo-moar fef365: OUTPUT«False␤»
gfldex is that by definition or do I just not see the logic?
zengargoyle does perl6 still do weird things requiring ~/.perl6 being available?
mspo caching bytecode? 13:24
masak bioduds_: rule #1 of Code Fights: you do not talk about Code Fights. 13:26
:P
bioduds_ lolololol 13:27
moritz gfldex: do any of the values in the list evaluate to a True value? No. Hence the answer
zengargoyle maybe, and if it does that it's going to break any posibility of running a p6 program from a user with no home to write to.
zengargoyle unless it fail gracefully... 13:28
moritz if not, that's what we have to implement 13:29
bioduds_ moritz : you wrote JSON::Tiny? 13:30
moritz bioduds_: yes
bioduds_ just panda install JSON:Tiny will do?
moritz you need a second colon 13:31
otherwise, yes 13:32
bioduds_ :D 13:33
masak ::D
bioduds_ silly question: do I need to cd to the directory I installed perl6 to do panda install module? 13:34
moritz no
bioduds_ ok, tx
masak .oO( <masak> mst: he meant "ta" ) 13:35
timotimo i'm more of a rx person myself
ilmari timotimo: TMI
masak I like "pzh" 13:36
perlpilot wonders who's handling flow control
zengargoyle Mr. S and Mr. Q 13:37
masak two very dependable gentlemen 13:38
dogbert17 o/ #perl6 13:40
zengargoyle namespace query. module or two to a) keep track of Texas versions; b) converty Texas to various IME formats (XCompose, etc.)
dogbert17 do you think that this short gist does Range.reverse any justice? gist.github.com/dogbert17/1b7fcc19...a0d18b2ef7
masak m: say "hello, dogbert1" ~ ("perl6" ~~ /\d/) + 1 13:41
camelia rakudo-moar fef365: OUTPUT«hello, dogbert17␤»
zengargoyle one to provide just a simple mapping of Texas -> Unicode with a few routines to extract.
AlexDaniel wonders if someone can be rx or tx, what would it mean to be bidirectional
zengargoyle some other to use that one and generate Input Method tables for various Input Methods. 13:42
dogbert17 hello masak
perlpilot dogbert17: you might mention that in order to reverse the range, all elements must be generated. (i.e. say (5..Inf).reverse; might take a while ;-) 13:42
dogbert17 m: say (5..Inf).reverse 13:43
camelia rakudo-moar fef365: OUTPUT«(Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf…»
koo_ is perl compatible with everything php is?
masak seems legit.
perlpilot koo_: What does that even mean?
AlexDaniel benchable6: say (5..Inf).reverse.list # well, let's bench it
benchable6 AlexDaniel, starting to benchmark the 1 given commits
AlexDaniel, ¦«say»:Cannot find this revision
AlexDaniel benchable6: releases say (5..Inf).reverse.list # well, let's bench it
benchable6 AlexDaniel, starting to benchmark the 11 given commits
AlexDaniel ;P
masak koo_: not when PHP does things that are very bad ;)
benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences
MetaZoffix heh 13:44
dogbert17 reversing an infinite Range doesn't seem overly useful
MetaZoffix We scared them off
perlpilot dogbert17: nope, but it's something that someone might accidentally do
vcv Maybe they were asking if Perl is compatible with all the issues on phpsadness.com/? 13:45
ilmari m: say (-Inf..5).reverse
camelia rakudo-moar fef365: OUTPUT«(...)␤»
ilmari m: say (-Inf..5).reverse.list
camelia rakudo-moar fef365: OUTPUT«(...)␤»
dalek c: 1f7b1ee | coke++ | doc/Language/exceptions.pod6:
fix whitespace
13:46
MetaZoffix m: say (-Inf..5).reverse[1,2,3]
camelia rakudo-moar fef365: OUTPUT«(4 3 2)␤»
AlexDaniel benchable6: what's up??
benchable6 AlexDaniel, starting to benchmark the 1 given commits
AlexDaniel, ¦«what's»:Cannot find this revision
AlexDaniel benchable6: releases say (5..Inf).reverse.list # well, let's bench it
benchable6 AlexDaniel, starting to benchmark the 11 given commits
bioduds_ what does the .perl thing mean?? 13:46
[Coke] ideally, generate an EVAL'able bit of code that gets you the original object back. 13:47
MetaZoffix bioduds_: it serializes code. You can later EVAL that and get data back... More or less
It's not fool-proof.
dogbert17 [Coke]: do you have a sec to take a look at github.com/perl6/doc/issues/791
AlexDaniel benchable6: releases say (5..Inf).reverse.list # well, let's bench it 13:47
benchable6 AlexDaniel, starting to benchmark the 11 given commits
bioduds_ so the opposite of .perl would be .EVAL?
MetaZoffix bioduds_: yeah
bioduds_ great
AlexDaniel bioduds_: … kinda
benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences
bioduds_ ok
MetaZoffix m: my $m = "foo" ~~ /(.)(.)?(.)/; use Test; is-deeply $m.perl.EVAL, $m
camelia rakudo-moar fef365: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 1, from => 0), Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to …»
MetaZoffix m: my $m = "foo" ~~ /.+/; use Test; is-deeply $m.perl.EVAL, $m 13:48
camelia rakudo-moar fef365: OUTPUT«ok 1 - ␤»
gfldex m: my &c = { say "called with $^a" }; say so 10 ~~ &c; 13:49
camelia rakudo-moar fef365: OUTPUT«called with 10␤True␤»
gfldex ~~ is really smart :)
moritz we don't call it dumbmatch for no reason! 13:51
perlpilot m: say ("f,,b,c,d".split: /","/, :k, :skip-empty).perl; 13:54
camelia rakudo-moar fef365: OUTPUT«("f", 0, 0, "b", 0, "c", 0, "d")␤»
perlpilot m: say ("f,,b,c,d".split: /","/, :v, :skip-empty); 13:56
camelia rakudo-moar fef365: OUTPUT«(f 「,」 「,」 b 「,」 c 「,」 d)␤»
perlpilot anyway ... someone might want to be sure that's the correct intent.
Seems like a bug to me.
AlexDaniel committable6: releases say ("f,,b,c,d".split: /","/, :k, :skip-empty).perl;
perlpilot er, at least one bug
committable6 AlexDaniel, ¦«2015.10»: ("f", "", "b", "c", "d").Seq␤¦«2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,HEAD»: ("f", 0, 0, "b", 0, "c", 0, "d") 13:57
MetaZoffix What's the bug? That :k/:kv get inserted for skipped items? 13:57
timotimo is skip-empty only about the first and last? that seems like a misnomer, then
AlexDaniel committable6: releases say ("f,,b,c,d".split: /","/, :v, :skip-empty);
perlpilot MetaZoffix: aye
committable6 AlexDaniel, ¦«2015.10»: (f b c d)␤¦«2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.07.1,2016.08.1,HEAD»: (f 「,」 「,」 b 「,」 c 「,」 d)␤¦«2016.06»: ===SORRY!===␤While looking for 'ModuleLoader.moarvm': no such file or directory «exit code = 1»
timotimo oh, that was only one version in the middle there
timotimo that didn't have :k yet i'd think 13:57
AlexDaniel committable6: releases say ("f,,b,c,d".split: /","/, :v, :skip-empty);
committable6 AlexDaniel, ¦«2015.10»: (f b c d)␤¦«2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,HEAD»: (f 「,」 「,」 b 「,」 c 「,」 d)
dalek c: b04cf9d | (Jan-Olof Hendig)++ | doc/Type/Range.pod6:
Added docs for Range.reverse. masak++, perlpilot++
13:59
perlpilot MetaZoffix: also, from reading the docs, I'm not sure what :k really means. The docs say "C<:k> interleaves the keys, that is, the indexes:" ... indexes of what exactly? If it's the "list that is interleaved with the non-matching parts" from the previous paragraph, then I don't understand the repeated zeroes
timotimo oh! 14:00
that only makes sense if you split with multiple strings
m: say "a b,c^d:e".split: [" ", ",", "^", "d"], :v
camelia rakudo-moar fef365: OUTPUT«(a b , c ^ d :e)␤»
timotimo m: say "a b,c^d:e".split: [" ", ",", "^", "d"], :kv
camelia rakudo-moar fef365: OUTPUT«(a 0 b 1 , c 2 ^ 3 d :e)␤»
timotimo so you can reconstruct which of the strings have been used for splitting
perlpilot aye. I guess that second thing is just a doc bug. 14:01
timotimo likely
AlexDaniel jnthn: by the way, things got significantly better with your latest moarvm fix. However, something is still wrong (as can be seen in committable responses above). So expect another ticket on a similar topic soon :) 14:02
jnthn AlexDaniel: OK :) 14:04
masak m: say "a b,c d,e".split: [" ", ",", "^", "d"], :kv 14:11
camelia rakudo-moar fef365: OUTPUT«(a 0 b 1 , c 0 3 d 1 , e)␤»
masak has his false-positives paranoia satisfied -- for now 14:12
m: say "a:b::c".split: [":", "::"], :kv 14:13
camelia rakudo-moar fef365: OUTPUT«(a 0 : b 1 :: c)␤»
masak impressive. :)
MetaZoffix m: say "a:b:::c".split: [":", "::"], :kv
camelia rakudo-moar fef365: OUTPUT«(a 0 : b 1 :: 0 : c)␤»
MetaZoffix m: say "a:b::::c".split: [":", "::"], :kv
camelia rakudo-moar fef365: OUTPUT«(a 0 : b 1 :: 1 :: c)␤»
lizmat yeah, same position takes the longest :-)
masak I like that. very consistent with, say, .trans 14:14
lizmat masak: I think .trans nowadays uses the .split internally
masak chalk it up as a "moment of charm" :) well done, someone
lizmat: ooh, interesting.
then it has changed quite a bit since I implemented it. 14:15
lizmat .trans is just splitting with .kv, replacing the keys and then joining again
(I think, from memory :-)
masak design-wise, that sounds good because that keeps the two methods consistent with each other 14:15
timotimo hopefully trans works from memory and not from hard drive :) :)
masak as seen above :)
MetaZoffix New blog post: "Perl 6 Core Hacking: Can Has Moar Cover?": perl6.party/post/Perl-6-Core-Hackin...Moar-Cover 14:18
masak MetaZoffix++ # a proliferation of bots, in the best of ways 14:20
lizmat MetaZoffix++ 14:22
bioduds_ how can I print an array separated by comma? 14:26
DrForr m: say <foo bar>.join(',') 14:27
camelia rakudo-moar fef365: OUTPUT«foo,bar␤»
bioduds_ wow, so simple. I hope these simple things get simple to me as well as I advance. Tx, DrForr! 14:28
MetaZoffix :)
DrForr No worries. 14:37
stmuk is there a list of zoffix bots? I'm losing track 14:41
maybe there needs to be a meta overload bot
overlord *
El_Che stmuk: maybe Zoffix is himself a bot. 14:45
stmuk who herds the bot herder? 14:47
ilmari Zoffix is a bot, MetaZoffix is the herder? 14:52
but is MetaZoffix also a bot?
AlexDaniel if it does not have a fixed nickname it is probably a bot 15:04
harmil_wk AlexDaniel: also if it replies late and claims not to be a bot, it's probably a bot. But I'm not. 15:55
AlexDaniel harmil_wk: yeah. Sure. 15:55
Kolin_ Zoffix is definitely a bot. Just ask him if he follows the laws of robotics 15:59
bioduds_ good thing I'm being able to use unicode code in javascript 16:12
bioduds_ this works: this.genero_do_tecnico.set( sjson.ef8a4da32a[0].gênero ); 16:15
:)
RabidGravy ah hah! 16:16
bioduds_, your issue on JSON::Marshal - I can't replicate 16:17
bioduds_ really?
do you have perhaps an idea what might happened?
RabidGravy well apart from the missing "use JSON::Class;" I haven't the faintest idea
bioduds_ but don't worry, I have solved with another approach 16:18
lol, don't worry, I thank you for the caring :D
RabidGravy I would say that there is a chance that it's the 2016-07 that's the problem however I've tested the module with every month's rakudo whether I've changed it or not 16:26
Kolin_ 2016.07 was broken, use 2016.07.1 16:27
RabidGravy I would suggest golfing that code down to see if it fails without using the JSON::Marshal 16:29
AlexDaniel star: say (<a b c>, (<a b c>)) 16:47
camelia star-m 2016.04: OUTPUT«((a b c) (a b c))␤»
AlexDaniel m: say (<a b c>, (<a b c>))
camelia rakudo-moar fef365: OUTPUT«((a b c) (a b c))␤»
bioduds_ is there include or require in perl6? somewhat like php? 18:02
mst bioduds_: docs.perl6.org/language/modules 18:05
bioduds_ mst : tx. im actually running from the module since it wont run like I need now 18:06
mst bioduds_: what 18:07
bioduds_ but there may be a way to do it that will work for me
timotimo there is nothing that includes another file's source so the parser eats it as if the code had been copy-pasted 18:09
but EVALFILE exists, if i remember correctly
mst right, but you should never do that anyway 18:11
PHP's include() exists as an artifact of it originally being a malignant perl templating system that metastasised
edegard hey 18:23
wassup
DrForr Not much, working on Perl6::Tidy, straightening sheets on a proverbial waterbed. 18:24
zacts hi perl6 nerds 18:43
timotimo hello zacts 18:46
AlexDaniel was it a compliment? 18:47
timotimo could be 18:49
AlexDaniel
.oO( maybe I should have got used to that irclog.perlgeek.de/perl6/search/?ni...6+nerds%22 )
18:50
mst why would it be anything else? 18:51
zacts it was indeed a compliment 19:06
the reason I use nerd instead of geek is because of the etymology of those words
nerd's etymology is cooler than geek 19:07
nerd was coined by Dr. Seuss in his 1950s book If I Ran the Zoo
geek has an etymology of something like 'a fool'
nerd was a character of his book iirc
so I tend to use nerd as the cooler more positive word
wikipedia mentions this, but I have actually personally researched this myself and have read If I Ran the Zoo 19:08
Dr. Seuss > Ancient Attic Greek / Plato in this case
:-)
dalek c: 2061fa7 | (Jan-Olof Hendig)++ | doc/Type/Range.pod6:
Added code examples to a few methods
19:09
zacts (Ancient Greek / Plato's language) <-- I meant to phrase it like this
bbl
Guest7645 Trying to run: rosettacode.org/wiki/Compiler/lexic...zer#Perl_6 20:40
But get: Method 'lines' not found for invocant of class 'Any' in sub parse_it at l.perl line 76 in block <unit> at l.perl line 88 20:41
Tried with: This is Rakudo version 2016.07.1 built on MoarVM version 2016.07 implementing Perl 6.c.
And: This is Rakudo version 2016.09 built on MoarVM version 2016.09 implementing Perl 6.c.
Guest7645 I'm a Perl newbie, and have little idea what the problem is. 20:43
lizmat Guest7645: looks to me the tiny_C.parse failed to produce a Match ?
and that gets past on to the tokenizer, which then calls .lines on an Any
Guest7645 It is as simple as that? And I think you are correct - thanks! 20:44
I tried with input of just "foobar", and that works correctly.
lizmat *passed
:-)
Guest7645 I guess I was expecting a different error message. Thanks for the help!
lizmat there's a Grammar::Tracer and Grammar::Debugger in the ecosystem, it should allow you to find out where a parse failed 20:46
masak soft failures can sometimes lead to Less-Than-Awesome error messages 20:47
I wonder what the extreme point of providing an Awesome error message would be on this one... :) 20:48
"Oops! Looks like when you called .parse and got an undefined result back, your code assumed that you'd always get a Match back! Time to review that assumption."
lizmat well, it would be nice if it returned a Failure that could tell where the parse went wrong, no ? 20:52
masak "where the parse went wrong" is not so easy -- I'd love to be wrong about that, though :) 20:53
sometimes backtracking is healthy and expected; sometimes not
bioduds_ this here is freakingawesome! subset RateTécnico where (0.0..5.0)|"-"; 21:39
a mixed type!!!
bioduds_ perl6 is (not) 2 cool 2 b true 21:39
Zoffix using failures in boolean context disarms them, but is there a similarly easy way to explode them? 22:49
m: $ = 0 + sub { fail }(); # This is the best I know of, but I don't want to assume that I can do a mathy operator on the return value
camelia rakudo-moar 553ced: OUTPUT«Failed␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
timotimo try .sink? 22:53
Zoffix m: sub { fail }().sink
camelia rakudo-moar 553ced: OUTPUT«Failed␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
Zoffix Thanks, timotimo++
m: sub { 4 }().sink
camelia ( no output )
Zoffix Great.
timotimo Zoffix: have you tried sending the data from moarvm --dump through a grep to make parsing the annotations file faster? 23:03
Zoffix timotimo, no. What would I be grepping for? 23:07
tushar Yesterday, I had asked question about field-separator such as comma, tab or space. Unfortunately, I went to bed and missed the responses. 23:13
How can I detect them? Is there any special variable such as "$/ "and "$, " in Perl 6? I am aware that not all the Perl 5 special variable is available in Perl 6. 23:14
Can someone also provide example for "nl-in" and "nl-out"? Thanks.
grondilu tushar: not sure but I think it's best you provide your own character class. 23:15
m: my $FS = /<[ ,: ]>/; say "foo, bar: see?".split: $FS; 23:16
camelia rakudo-moar 553ced: OUTPUT«(foo bar see?)␤»
tushar grondilu: can you please provide me an example?
grondilu: Thanks.
timotimo Zoffix: github.com/MoarVM/MoarVM/blob/line...ort.p6#L13 23:17
grondilu if I'm not mistaken, $, in Perl 5 was designed more or less for AWK-like behavior. Perl 6 does not need that jargon, IIUC 23:18
timotimo Zoffix: actually, the format is so fixed that this could be done completely without regex, so it'd be at least 100x faster anyway
Zoffix: i didn't have the motivation yet to do a performance pass over that script, apart from multithreading it 23:19
timotimo and unfortunately multithreading a script makes it unprofilable at the moment ... 23:25
Zoffix really?
timotimo yes, the profiler doesn't handle multiple threads yet 23:29
it either crashes or it gives you a random thread's routines 23:30