»ö« 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. |
|||
00:11
Guest39821 is now known as nemo
00:14
nadim left
00:21
pierre_ joined
00:22
pierre_ left,
pierre_ joined
00:25
dataange` left
00:26
dataangel joined
00:55
b2gills left
01:04
_sfiguser left
01:07
Actualeyes joined
01:13
b2gills joined,
eliasr left
01:17
_sfiguser joined
01:18
b2gills left
01:24
pierre_ left
01:25
doc_ joined,
doc_ left
|
|||
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 | |
01:30
BenGoldberg joined,
pierre_ joined
|
|||
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 | |
01:35
pierre_ left
01:39
fulaiche88 joined,
pullphinger left
|
|||
tushar | Is there any special variable or method that can identify the field separator of a file? | 01:39 | |
01:44
pierre_ joined
01:46
ilbot3 left
01:47
ilbot3 joined
01:48
raiph joined
01:49
MasterDuke joined
01:55
b2gills joined
02:01
sufrostico left
02:02
lue joined
02:04
ShimmerFairy left,
lue is now known as ShimmerFairy
|
|||
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 | ||
02:11
BenGoldberg left
|
|||
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 | |
02:14
noganex joined
|
|||
MasterDuke | docs.perl6.org/language/5to6-perlv...ilehandles | 02:14 | |
02:16
pierre_ left
02:17
noganex_ left
02:19
pierre_ joined
02:25
ka left
02:31
committable6 left
02:32
committable6 joined
02:33
committable6 left,
committable6 joined,
bisectable6 left
02:34
bisectable6 joined,
bisectable6 left,
bisectable6 joined
02:36
bisectable6 left
02:37
bisectable6 joined
02:43
skids joined
|
|||
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…» | ||
02:52
rindolf joined
|
|||
Xliff_ | Is there an easy way to list the roles supported by an object? | 02:54 | |
02:54
wamba joined
03:00
fulaiche88 left
03:01
tushar left
03:02
cpage_ left
03:04
ka joined
03:09
AndyBotwin joined
|
|||
skids | m: "foo".^roles.say | 03:09 | |
camelia | rakudo-moar 3789a0: OUTPUT«((Stringy))» | ||
03:11
Actualeyes left
03:12
pierre_ left
|
|||
skids | m: class A { }; class B is A { }; A.^parents.say # ?? | 03:16 | |
camelia | rakudo-moar 3789a0: OUTPUT«()» | ||
03:16
cooper_ is now known as cooper
|
|||
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))» | ||
03:18
pierre_ joined
03:24
_sfiguser left
03:36
pierre_ left,
ka left
03:37
pierre_ joined
03:52
wamba left
03:54
skids left
03:55
rindolf left
04:00
rindolf joined
|
|||
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. |
|||
04:15
cpage_ joined
04:21
_slade_ joined
04:31
ugexe left
04:33
khw left,
AlexDaniel left
04:34
kerframil left
04:41
dayangkun joined
04:42
MasterDuke left
04:44
pierrot left,
cbk_ joined,
cbk_ left
04:47
cbk_ joined
04:48
Actualeyes joined,
Cabanossi left
04:49
pierrot joined
04:52
Cabanossi joined
04:54
cbk_ left
04:57
ugexe joined
04:58
pierre_ left
04:59
pierre_ joined
05:00
rurban joined,
rurban left
05:04
pierre_ left
05:08
dayangkun left
05:10
araujo joined,
araujo left,
araujo joined
05:11
wamba joined
05:15
cbk_ joined,
cbk_ left
05:19
cbk_ joined
05:22
wamba left
05:23
ugexe left,
wamba joined
05:36
domidumont joined
05:38
ugexe joined
05:41
skids joined,
domidumont left
05:42
domidumont joined
05:44
wamba left,
Nex6 joined
|
|||
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 | ||
05:48
ufobat joined
|
|||
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 { | |||
05:53
cdc left
05:55
araujo left
06:00
pierre_ joined
06:02
nadim joined,
skids left
06:05
pierre_ left,
bob777 left,
bob777 joined
06:07
araujo joined
06:08
Nex6 left
06:09
araujo left,
araujo joined
06:12
domidumont left
06:13
firstdayonthejob joined
06:21
darutoko joined
06:31
pierre_ joined,
wamba joined
06:41
pierre_ left
06:42
pierre_ joined
06:43
domidumont joined
06:46
firstdayonthejob left
|
|||
zengargoyle | is there a .trans like thing that does 'from' => 'to', 'from1' => 'to1' instead of [«from from1»]=>[«to to1»] ?? | 06:46 | |
06:46
Actualeyes left,
wamba left
06:49
rurban joined
|
|||
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 | ||
06:55
dayangkun joined
06:58
Actualeyes joined
07:04
dayangkun left
07:07
Glitchy left
07:10
dayangkun joined,
dayangkun left
07:11
araujo_ joined
07:12
pierre_ left,
pierre_ joined
07:13
perlawhirl joined
|
|||
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» | ||
07:15
araujo left
07:19
matt_ joined
|
|||
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 | |
07:20
matt_ is now known as Guest72890,
Guest72890 is now known as matt_,
cbk_ left
|
|||
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 | |
07:24
espadrine joined,
CIAvash joined
07:25
holyghost joined
|
|||
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 | |
07:28
RabidGravy joined
|
|||
perlawhirl | you can define 2 ordered lists if that's nicer to maintain... .trans( @from => @t ) | 07:32 | |
07:33
zakharyas joined
|
|||
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» | ||
07:34
araujo_ left
|
|||
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 | |
07:36
rurban left
|
|||
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 | ||
07:38
perlawhirl left
|
|||
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 | |||
07:42
El_Che left
|
|||
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 | |
07:43
El_Che joined
|
|||
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 | |
07:51
araujo_ joined
|
|||
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))» | ||
07:57
_slade_ left
08:00
holyghost left
08:01
pierre_ left
08:02
rurban joined
08:03
bpmedley left
|
|||
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]» | ||
08:05
woolfy left
08:07
woolfy joined,
Actualeyes left
|
|||
zengargoyle | m: {[@^a».key]=>[@^a».value]}((a=>'b',c=>'d')) | 08:07 | |
camelia | ( no output ) | ||
08:07
Actualeyes joined
|
|||
zengargoyle | m: say {[@^a».key]=>[@^a».value]}((a=>'b',c=>'d')) | 08:07 | |
camelia | rakudo-moar 3789a0: OUTPUT«[a c] => [b d]» | ||
08:08
mr-foobar left
08:09
mr-foobar joined,
pierre_ joined
08:12
woolfy left
08:15
dakkar joined,
woolfy joined
|
|||
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» | ||
08:26
ocbtec joined
08:32
bjz joined
08:37
espadrine left
08:42
Ven` joined
08:46
wamba joined
08:50
Actualeyes left
08:53
wamba left
|
|||
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 | |||
09:02
Ven` left
09:13
Ven` joined
09:16
pierre_ left
09:18
Ven` left
09:20
pierre_ joined
|
|||
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 | ||
09:28
canopus left
09:30
araujo_ left
09:33
kerframil joined,
kerframil left
09:34
canopus joined
09:43
araujo_ joined
|
|||
zengargoyle slaps self for not guessing ibus-daemon needs restarting after changing XCompose file. | 10:00 | ||
10:04
Woodi left,
Woodi joined
|
|||
zengargoyle | but can now type Compose-!(elem) and get ∉ in new xterms | 10:04 | |
10:06
llamatarianism joined
10:09
bjz left
10:10
pyrimidi_ joined,
bjz joined
|
|||
DrForr | +1 | 10:10 | |
10:12
pyrimidine left
10:13
Hor|zon left,
nowan joined,
scott joined
10:15
nowan_ left
10:16
kaare_ joined
10:31
jmark joined
10:32
brrt joined
|
|||
lizmat | masak: ShimmerFairy is not alone in doubts about that feature | 10:42 | |
10:46
zengargoyle left
10:47
zengargoyle joined
|
|||
moritz | what would be the alternative? only parse colonpairs as named args? | 10:48 | |
10:49
labster left
|
|||
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 | ||
10:54
cog_ joined
|
|||
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 yetat <tmp>:1------> 3role Foo[::Bar where * ~~ Baz7⏏5] {}» | ||
gfldex | llamatarianism: ^^^ NYI | ||
llamatarianism | gfldex: cool! thanks a lot :) | 10:56 | |
10:56
pmurias joined,
cognominal left
|
|||
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…» | ||
10:57
pierre_ left
|
|||
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 | ||
11:21
CIAvash left
|
|||
bioduds | thanks | 11:21 | |
11:21
breinbaas joined
|
|||
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» | ||
11:23
rurban left
11:27
MasterDuke joined,
nowan left
|
|||
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 | ||
11:30
nowan joined
|
|||
timotimo | m: say so 1 + 5; say ?1 + 5 | 11:32 | |
camelia | rakudo-moar e9409c: OUTPUT«True6» | ||
zengargoyle | m: say ?2 + 5 | 11:33 | |
camelia | rakudo-moar e9409c: OUTPUT«6» | ||
11:35
AlexDaniel joined
|
|||
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 | |
11:38
kerframil joined,
kerframil left
|
|||
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 declaredat <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 | ||
11:41
llamatarianism left
|
|||
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«yoyoyoyoyoyoyoyoyoyo» | ||
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 declaredat <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 declaredat <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 declaredat <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 declaredat <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 declaredat <tmp>:1------> 3y Str $ret-val = '{ tecnicos ['; for 7⏏5@técnicos -> $técnico { $ret-val ~= » | ||
timotimo | oh, right | ||
the error changed | |||
11:44
Ven` joined
|
|||
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«hitest 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 rowat <tmp>:1------> 3say q:!c"test { say "7⏏5hi" }" expecting any of: infix infix stopper postfix statement end statement m…» | ||
11:47
araujo__ joined
11:48
araujo_ left
|
|||
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? | ||
11:54
chris2 left
|
|||
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 malformedat <tmp>:1------> 3say7⏏5 ⟨foobar⟩Bogus postfixat <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 | |||
11:57
chris2 joined
|
|||
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 :) :) :) | ||
12:02
chris2 left
|
|||
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. | ||
12:04
chris2 joined
|
|||
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 | |
12:07
mcmillhj joined
|
|||
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 /*-+,; | ||
12:09
pmurias left
|
|||
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. |