»ö« 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.
ugexe How do I get access to post on the advent blog? 00:15
SmokeMachine gfldex: do you think that it would work everywhere to get all builtin types? 00:25
m: say $*REPO.writeable-path.child("doc/Type").dir.grep(*.extension eq "pod6").map({::(.basename.subst(/".pod6"/, ""))})
camelia rakudo-moar 7345e0: OUTPUT«No such symbol 'nativeInt'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
SmokeMachine wrong version... 00:26
m: say $*REPO.writeable-path.child("doc/Type").dir.grep(*.extension eq "pod6").map({try {::(.basename.subst(/".pod6"/, ""))}})
camelia rakudo-moar 7345e0: OUTPUT«Proc is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in method gist at src/RESTRICTED.setting line 33␤ in block <unit> at <tmp> line 1␤␤»
SmokeMachine :( 00:26
SmokeMachine every perl6 installation have all type documentation on this path? $*REPO.writeable-path.child("doc/Type") 00:27
SmokeMachine just wondering: that would be great if every type's documentation have examples of possible values and possibly samples of edge cases to I use on Test::Fuzz's generators... 00:30
SmokeMachine ok, that would be better if every type had a method .generate-values() 00:32
SmokeMachine or .generate-samples() 00:32
SmokeMachine oh! that really is a good idea! 00:35
thanks!
geekosaur .oO { role Arbitrary { ... } } 00:38
timotimo ugexe: you need to have a wordpress account and tell someone with admin privileges your username 00:45
ugexe timotimo: thanks... know anyone with admin privs? 00:52
timotimo i have to look if i have it, ugexe 01:21
what's your user name? best to just put it here in irc and see if someone stops by who can Do It
yes, i should be able to give you access 01:22
MasterDuke timotimo: are you familiar with writing QAST nodes? 01:38
samcv hello all. how is everybody 01:40
SmokeMachine what does this means? 01:45
===SORRY!===
STable conflict detected during deserialization.
(Probable attempt to load two modules that cannot be loaded together).
why 2 modules could not be loaded together?
I got it!!! I was running .^compose at compile time! 01:54
itcharlie_linux thank you to whoever added libssl-dev in the prerequisite documentation for Rakudobrew in Ubuntu 02:16
SmokeMachine m: Int.?bla; Failure.?bla
camelia rakudo-moar 7345e0: OUTPUT«Invocant requires an instance of type Failure, but a type object was passed. Did you forget a .new?␤ in any at gen/moar/Metamodel.nqp line 3070␤ in block <unit> at <tmp> line 1␤␤»
SmokeMachine is that expected? 02:17
s: .?, Failure, "" 02:21
SourceBaby SmokeMachine, Something's wrong: ␤ERR: Unhandled exception: Missing or wrong version of dependency 'src/Perl6/Grammar.nqp' (from 'gen/moar/main.nqp')␤ at <unknown>:1 (/home/zoffix/services/sourceable/building-perl6/perl6.moarvm:<dependencies+deserialize>)␤
MasterDuke s: Failure, '?' 02:23
SourceBaby MasterDuke, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil)␤ in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤ in block <unit> at -e line 6␤␤
MasterDuke s: Failure, ? 02:24
SourceBaby MasterDuke, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Prefix ? requires an argument, but no valid term found␤at -e:6␤------> put sourcery( Failure, ? ⏏)[1];␤ expecting any of:␤ prefix␤
MasterDuke s: Failure, ?foo 02:29
SourceBaby MasterDuke, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤ foo used at line 6␤␤
SmokeMachine .tell perlpilot Now Test::Fuzz has generators "pluggable" it uses the method generate-samples(::?CLASS:U:) on the object type... 02:38
yoleaux SmokeMachine: I'll pass your message to perlpilot.
MasterDuke s: Failure, '?foo' 02:59
SourceBaby MasterDuke, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil)␤ in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤ in block <unit> at -e line 6␤␤
ugexe timotimo: ugexe on wordpress 03:18
dudz 41hours to go: www.kickstarter.com/projects/14228...ing-perl-6 03:42
astj I just backed the kickstarter project :+1: 03:54
Herby_ o/ 04:13
Herby_ i'm getting tripped up trying to implement something similar to python's re.findall 04:27
SmokeMachine What's the python re.findall? 04:36
samcv i've made a pretty extensive contributing page for the atom syntax highlighter. i hope that it will make it much easier for people to learn from all that i've learned since starting work on it. 04:39
since there's no guides out there at all
if anybody is curious github.com/perl6/atom-language-per...IBUTING.md
kurahaupo__ SmokeMachine: in P5 @results = $str =~ /pattern/g; 04:52
dalek osystem: f42dab0 | samcv++ | META.list:
Publish IRC::TextColor, style/color for IRC & ANSI color->IRC color

With this module you can add color and style to text for IRC.
You can also take output from the command line which uses ANSI color and convert it to IRC color and styling.
05:15
samcv .tell AlexDaniel added that to the modules. to convert ANSI color to irc color, or style or color for irc 05:15
yoleaux samcv: I'll pass your message to AlexDaniel.
samcv readme coming in like 15 mins 05:23
readme added 05:32
samcv now SourceBaby and evalable6 will be able to print rakdudo colors properly :) and be able to maybe add some fancy colors or something. depending on what their authors want 05:45
dalek href="https://perl6.org:">perl6.org: 5acd6dd | samcv++ | source/whatever/index.html:
Fix link to Atom syntax highlighter. I used a link to

atom-perl6-editor-tools by accident
06:17
samcv u: U+2015 06:43
unicodable6 samcv, U+2015 HORIZONTAL BAR [Pd] (―)
[ptc] morning * 07:07
samcv morning [ptc] 07:08
[ptc] :-) 07:20
RabidGravy good morning 07:22
andrzejku :) 08:02
RabidGravy, hi
lizmat hmmm.... perhaps blogs.perl.org/users/pawel_bbkr_pab...-roll.html should not be listed on pl6anet.org ? 09:05
lizmat so, it was my understanding that .sprintf is sorta deprecated in favour of .fmt ? 09:35
if so, why is the documentation of .fmt referring to sprintf for more information ?
Xliff Is there a way to force a substitution regexp to ignore whitespace in the substituting part? 09:46
m: my $a = 'inches'; $a ~~ s/ inches / in /; say $a;
camelia rakudo-moar 1b3a00: OUTPUT« in ␤»
Xliff I just want "in".
m: my $a = 'inches'; $a ~~ s/ inches / 'in' /; say $a;
camelia rakudo-moar 1b3a00: OUTPUT« 'in' ␤»
moritz m: my $a = 'inches'; $a ~~ s/ inches /in/; say $a 09:49
camelia rakudo-moar 1b3a00: OUTPUT«in␤»
moritz Xliff: the replacement part is not a regex :-)
m: my $a = 'inches'; $a ~~ s[ inches ] = 'in'; say $a
camelia rakudo-moar 1b3a00: OUTPUT«in␤»
masak I keep wanting to reply to Xliff, but moritz keeps pre-empting me and stealing my lines... :P 09:50
moritz++
Xliff Hmmm... that might work. Thanks morits++
Don't worry. I appreciate you too, masak++
masak whee 09:51
Xliff m: my $a = (s[ inches ] = 'in');
camelia rakudo-moar 1b3a00: OUTPUT«No such method 'match' for invocant of type 'Any'␤ in block <unit> at <tmp> line 1␤␤»
Xliff Damn.
masak it's destructive
it acts on $_
m: my $_ = "inches"; s[ inches ] = 'in'; say $_
camelia rakudo-moar 1b3a00: OUTPUT«Potential difficulties:␤ Redeclaration of symbol '$_'␤ at <tmp>:1␤ ------> 3my $_7⏏5 = "inches"; s[ inches ] = 'in'; say $_␤in␤»
Xliff Yeah. I was hoping to store that tranformation to be used later. 09:52
masak m: $_ = "inches"; s[ inches ] = 'in'; say $_
camelia rakudo-moar 1b3a00: OUTPUT«in␤»
masak Xliff: then you need to put it in a lambda.
lizmat m: say |"A".."F" # unexpected and quiet about it
camelia rakudo-moar 1b3a00: OUTPUT«1.."F"␤»
lizmat I wonder whether |"A" should warn or not
masak m: my &xform = -> { s[ inches ] = 'in' }; say xform("here are all my inches")
camelia rakudo-moar 1b3a00: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in block <unit> at <tmp> line 1␤␤»
masak m: my &xform = -> $_ { s[ inches ] = 'in' }; say xform("here are all my inches") 09:53
camelia rakudo-moar 1b3a00: OUTPUT«Cannot assign to a readonly variable ($_) or a value␤ in block <unit> at <tmp> line 1␤␤»
masak m: my &xform = -> $_ is copy { s[ inches ] = 'in'; $_ }; say xform("here are all my inches")
camelia rakudo-moar 1b3a00: OUTPUT«here are all my in␤»
masak Xliff: there ya go :)
Xliff masak++
lizmat m: say |"A".."F" # masak opinions? 09:54
camelia rakudo-moar 1b3a00: OUTPUT«1.."F"␤»
masak lizmat: my reaction is "...what?" 09:58
lizmat yeah.. I had something similar
jnthn |"A" binds tigher than .. 10:00
I guess the range them is like "wtf do I do this a Slip...eh, let's .Numeric it!" :) 10:01
jnthn *with a 10:01
arnsholt Operator precedence strikes again!
pmurias jnthn: question in regards with repossession, some ops change stuff without triggering repossession? is that intended or NYI? 10:02
jnthn: push triggers it, pop doesn't
masak oh, it's about operator precedence
then I'm less likely to want a change
arnsholt I have some sympathy for the Smalltalk position of "everything's the same precedence and left-associative"
masak unless we feel that this one deserves a compiler warning 10:03
jnthn pmurias: It's been added on stuff that needs it... :)
masak but tbh it feels more like a linter thing
jnthn pmurias: Which isn't the most consistent answer, I agree :)
masak arnsholt: I have some sympathy for the Lisp position of "precedence? what's that?"
arnsholt Yeah, that too. It's just a shame that the syntax of Lisp drives me nuts =) 10:05
lizmat well, just wondering whether it would warrant a ticket for a warning ? 10:10
jnthn IMHO it's just not a common enough thing to run into to warrant it 10:17
So, for linters, I think
lizmat this was actually from an example in a new Perl 6 book
for "a".."f", "k", "l" -> $letter { .say $letter } 10:18
m: for "a".."f", "k", "l" -> $letter { .say $letter }
camelia rakudo-moar 1b3a00: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3for "a".."f", "k", "l" -> $letter { .say7⏏5 $letter }␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statem…»
lizmat m: for "a".."f", "k", "l" -> $letter { say $letter }
camelia rakudo-moar 1b3a00: OUTPUT«"a".."f"␤k␤l␤»
lizmat m: for |"a".."f", "k", "l" -> $letter { say $letter }
camelia rakudo-moar 1b3a00: OUTPUT«1.."f"␤k␤l␤»
lizmat m: for |("a".."f", "k", "l") -> $letter { say $letter }
camelia rakudo-moar 1b3a00: OUTPUT«"a".."f"␤k␤l␤»
lizmat m: for |("a".."f"), "k", "l" -> $letter { say $letter } 10:19
camelia rakudo-moar 1b3a00: OUTPUT«a␤b␤c␤d␤e␤f␤k␤l␤»
jnthn for flat "a".."f", "k", "l" -> $letter { say $letter }
m: for flat "a".."f", "k", "l" -> $letter { say $letter }
camelia rakudo-moar 1b3a00: OUTPUT«a␤b␤c␤d␤e␤f␤k␤l␤»
lizmat yeah, that too :-)
ufobat good morning :D
lizmat (running one more spectest)
jnthn Making the mistake in a book would be one good way to make it common enough to warrant a compiler warning, though :P
I just didn't see it before, is all, while I know we had people trip over ^5.pick a bunch 10:20
lizmat perhaps the book should mention it as a gotcha :-) 10:21
lizmat jnthn: fix pushed 10:24
AlexDaniel thank you, samcv 10:25
yoleaux 05:15Z <samcv> AlexDaniel: added that to the modules. to convert ANSI color to irc color, or style or color for irc
pmurias jnthn: If repossession is also used by user code (when a module loads a module and messes around in BEGIN time) don't the missing scwb calls cause bugs? 11:17
jnthn pmurias: Potentially, yes 11:21
Feel free to add tests if you can trigger some :) 11:23
Xliff Is there any way to create constants at runtime? 11:47
Or at least something that acts like such?
Dynamic sigil-less vars?
moritz lexically scoped: my \x = 42; say x 11:48
m: my \x = 42; say x
camelia rakudo-moar b28604: OUTPUT«42␤»
moritz they are assign-once
Xliff Got that, but can it be done via symbol table manipulation?
Because I will only know the proper name at run-time. 11:49
jnthn m: my \x = 42; say ::('x')
camelia rakudo-moar b28604: OUTPUT«42␤»
jnthn Can use that to look them up dynamically 11:49
Xliff Right, but I need to set them dynamically, too.
jnthn Then use a hash or a package instead 11:50
The set of lexical symbols is always settled at compile time in Perl 6.
Xliff kk
jnthn (That's how we can do nice things like detect typo'd sub calls :))
masak .oO( this is why we can have nice things ) 11:57
AlexDaniel unicodable6: hi 12:06
unicodable6 AlexDaniel, U+000E SHIFT OUT [Cc] (control character)
AlexDaniel, U+000F SHIFT IN [Cc] (control character)
AlexDaniel, U+008E SINGLE SHIFT TWO [Cc] (control character)
AlexDaniel, gist.github.com/7549c3cadc5374ed98...7deaf82c93
AlexDaniel hehe, unicodable at 11GB right now :) 12:07
mniip how do I express haskell's ($ value) with perl6's partial application? 12:51
I was expecting (*("hi"))(*.ords) to work but it does something else apparently 12:58
sena_kun mniip, what exatcly you want to do? 13:01
mniip a function that takes a function as argument and applies it to a fixed value 13:02
sena_kun mniip, map?
arnsholt m: say ({ .("hi") })(&ords)
camelia rakudo-moar b28604: OUTPUT«(104 105)␤»
arnsholt That's as close as I've gotten so far 13:03
*.("hi") doesn't parse the way I need it to
mniip huh, what does that syntax even mean 13:03
{ . <...> } 13:04
arnsholt { } is a block, so that creates a closure 13:04
.(...) invokes the value in $_, which is the argument passed in, in this case 13:05
More explicit would be
m: say ({ $^fun.("hi") })(&ords)
camelia rakudo-moar b28604: OUTPUT«(104 105)␤»
arnsholt Or
m: say (-> $fun { $fun.("hi") })(&ords)
camelia rakudo-moar b28604: OUTPUT«(104 105)␤»
mniip naw that is too explicit
mniip huh? f.(x) = f(x)? I need to recheck perl6's syntax 13:07
AlexDaniel m: say ((~*)("hi")).map(*.ords)
camelia rakudo-moar b28604: OUTPUT«((104 105))␤»
arnsholt No, that's not it 13:09
That stringifies "hi" and then calls map on it
AlexDaniel yea, well, I did not really understand the question :)
arnsholt m: say (*.foo).WHAT 13:10
camelia rakudo-moar b28604: OUTPUT«(WhateverCode)␤»
arnsholt m: say (*.("hi")).WHAT
camelia rakudo-moar b28604: OUTPUT«No such method 'CALL-ME' for invocant of type 'Whatever'␤ in block <unit> at <tmp> line 1␤␤»
arnsholt I *think* that might be a parser bug
Or maybe just an unfortunate limitation of how the grammar decides between a Whatever term and a WhateverCode 13:11
m: say (*("hi")).WHAT
camelia rakudo-moar b28604: OUTPUT«No such method 'CALL-ME' for invocant of type 'Whatever'␤ in block <unit> at <tmp> line 1␤␤»
jnthn At least it's consistent between the two :) 13:12
AlexDaniel eval: say ‘hi
evalable6 AlexDaniel, Full output: gist.github.com/33015507858e12dccd...79be28af7f
AlexDaniel, rakudo-moar b286048: OUTPUT«(exit code 1) 04===SORRY!04=== Error while compiling /tmp/ie1255R6iS␤Unable to p…»
AlexDaniel samcv++
arnsholt jnthn: There is that =) 13:13
arnsholt jnthn: One thing I did notice is that there's no Perl 6-level postcircumfix:<( )>, only token postcircumfix:sym<( )> in Grammar.nqp. Could that be a cause? 13:14
(I have no idea how a WhateverCode is constructed, rather than just a Whatever)
jnthn Dobut it 13:16
*doubt
After all...
m: say (*<a>)({ a => 42 }) 13:17
camelia rakudo-moar b28604: OUTPUT«42␤»
jnthn that works, and there's no sub postcircumfix:['< >'] either :)
arnsholt Hmm 13:29
arnsholt jnthn: Looks like postcircumfix:<( )> isn't in the list of postcircumfixes allowed by the code to be whatever-curried 13:35
Not clear to me if it's intentional or an oversight though
arnsholt timotimo: Looks like you worked on this (in 2013 and 2014...), do you remember if there's a reason postcircumfix:<( )> isn't whatever-curried? 13:37
dalek c/coke/levenshtein: 68d2c37 | coke++ | doc/Language/operators.pod6:
fix typo
13:47
AlexDaniel [Coke]: wrong branch? 13:48
[Coke] yup, but that's already on master, 'sfine. 13:50
(I think)
[Coke] 's panda-behind-the-firewall&proxy is failing to get a JSON file again. bah. 14:17
[Coke] which is weird, because I can download the file myself. panda just complains about empty metadata. :| 14:23
tbrowder ref class construction: i have a class f { has @.s ;} and i would like to instantiate it with an array or values to fill the @.s. Is there a way to do that without defining a custom new method? 14:24
[Coke] ... and now it worked. wtf? 14:24
jnthn m: class f { has @.s }; say f.new(s => [1,2,3]).s 14:26
camelia rakudo-moar b28604: OUTPUT«[1 2 3]␤»
jnthn tbrowder: Like that?
tbrowder jnthn: thank you! 14:27
[Coke] jnthn: with latest, rakudo, in the doc repo, I now get: 14:31
perl6 htmlify.p6 --parallel=3
===SORRY!===
unlock when we're not locked!
[Coke] Could that use a golf? 14:31
(actually has 3 different failure modes, one of which is a segv) 14:32
jnthn [Coke]: Yes...that suggests some quite impressive screw-up
(The lock thing) 14:33
[Coke] the third is " such method 'level' for invocant of type 'Pod::Block::Para'" which looks like another weird screw up
Xliff Does anyone know how to stop atom from adding in the closing bracket/quote/brace when typing in its corresponting open character? 14:44
Perl6Robot OHAI! 15:01
moritz \o/ more robots! 15:12
n0tjack Basic question on modules. I have a script foo.pl6 and a module bar.pm6. My folder structure is project/foo.pl6 and project/lib/bar.pm6. In foo.pl6 I say use lib '.'; use bar; But I get an error running foo.pl6 saying it can't find bar. What should I change? 15:31
jnthn use lib 'lib' instead, perhaps? 15:32
n0tjack I tried that, and tried having bar.pm6 in the same dir as foo. No joy. I'm doing something wrong. 15:33
moritz n0tjack: use lib 'lib' is relative to the working directory, so it won't work if you call it from somewhere else 15:35
n0tjack yeah, lib is a subdir of the dir the script is in.
I found it; it is not enough to have module "bar" in bar.pm6, you have to name the file literally bar.pm6 15:36
moritz use lib $?FILE.IO.parent.child("lib").Str
moritz didn't you say it was named bar.pm6? 15:36
n0tjack yes, but that was a lie because I didn't think it was relevant and I wanted to simplify
moritz *facepalm* 15:37
n0tjack my confusion stemmed from the fact that I thought I could spread modules out across files in p6
ugexe or just write the proper mapping in META6.json? 15:58
n0tjack ugexe: Not familiar with that, but on a quick google, looks like it's what I need, I'll dig into it, thanks 15:59
at the moment I'm trying to figure out how to coerce a Seq into an Array[Numeric] with an intermediate assignment. 16:00
ugexe if there is no META6.json it will use perl5 like module loading schematics where lib/Module/Name.pm6 has to exists
n0tjack aha, I thought I wasn't constrained to module name ~~ file name
ugexe github.com/Leont/tap-harness6/blob.../META.info 16:01
n0tjack in my primary language I'm not, so I've got a bit of an accent in perl6, and that's not helping 16:01
ugexe: yes, that link is exactly what I need 16:02
jnthn For anyone who uses Test::Mock, it got some improvements this week that make it useful in a wider range of scenarios (you can provide a fake implementation for a mocked method, as well as having a thunked return value) 16:13
n0tjack I have a Match, $m, and $m.made returns a Seq. I tried coercing it to an Array[Numeric] with Numeric @ $m.made but that didn't work, nor did +>>$m.made (because I got the syntax for hyperoperation wrong). What's the idiomatic way to convert a Seq to Array[Numeric]? 16:43
SmokeMachine How do I use $?RESOURCES without installing the module? 16:45
b2gills m: dd Array[Numeric](+«1234.comb) 16:47
camelia rakudo-moar 9a3c35: OUTPUT«Array[Numeric].new(1, 2, 3, 4)␤»
n0tjack b2gills++ 16:50
I always forget which way the pointy end is supposed to point...
b2gills m: dd 1234.comb»[0] 16:51
camelia rakudo-moar 9a3c35: OUTPUT«("1", "2", "3", "4")␤»
b2gills It points towards the smaller thing 16:52
m: say 1,2,3,4 »+» 2
camelia rakudo-moar 9a3c35: OUTPUT«1236␤»
n0tjack b2gills: Is there some sense in which the + operation is smaller than the array 1 2 3 4?
b2gills s/smaller/fewer/ 16:53
n0tjack I mean unary +, not binary +
in the case of +<< ["1","2","3","4"]
perlpilot n0tjack: I always remember it by thinking about which way the blunt end should point.
yoleaux 02:38Z <SmokeMachine> perlpilot: Now Test::Fuzz has generators "pluggable" it uses the method generate-samples(::?CLASS:U:) on the object type...
b2gills there is only one &prefix:<+> shown, but 4 strings. at least thats how I remember
n0tjack perlpilot: what is your intuition about the blunt end in that example? 16:54
b2gills: yeah, I can see that, maybe it'll work as a mnemonic for me
perlpilot n0tjack: the blunt end always points to the side that is listy (or that has more things to process) 16:55
n0tjack so the smaller end either points towards the smaller list / scalar, or towards the operator? 16:56
perlpilot should stop talking about blunt ends pointing anywhere as they don't really point :)
n0tjack as in "hey, you elements, get in my operator!"
TimToady it's a megaphone for the operator to shout at the many operands 16:57
n0tjack ha! 16:58
well, now that's a mnemonic
donaldh o/
TimToady or a telescope and a microscope, in the case of 1,2,3,4 »+» 2
donaldh I created a Perl 6 keyboard layout for macOS - github.com/donaldh/Perl6-macOS-keyboard 16:59
Just sharing in case anyone finds it useful.
n0tjack I was just thinking about how to type Unicode >> right before you sent that/
Personally, I trust ASCII a lot more than Unicode still, and I don't see a lot of benefit in the Unicode symbols over the ASCII ones 17:00
[Coke] donaldh++ 17:02
perlpilot n0tjack: compact expression is the main benefit. There's also visual distinction sometimes. 17:03
sena_kun rt.perl.org/Public/Bug/Display.html?id=130211 can be closed. 17:09
[Coke] sena_kun: need a pointer to tests first.
sena_kun [Coke], github.com/perl6/roast/commit/a9fd...b598cb624a 17:10
[Coke] looks like zoffix just added it.
and closed the ticket.
sena_kun Ah, I'm too slow. :) 17:11
n0tjack what's the best resource, ideally tutorial rather than reference, for understanding typecasting and coercion? 17:17
bdmatatu p6: say <a1 a2 a3>.map({S/a/x/}).perl 17:30
camelia rakudo-moar 9a3c35: OUTPUT«("x3", "x3", "x3").Seq␤»
bdmatatu I was expecting x1 x2 x3 17:30
AlexDaniel bdmatatu: interesting… looks like there's something wrong with .perl? 17:35
bisect: say <a1 a2 a3>.map({S/a/x/}).perl
bisectable6 AlexDaniel, On both starting points (old=2015.12 new=9a3c350) the exit code is 0 and the output is identical as well 17:36
AlexDaniel, Output on both points: ("x3", "x3", "x3").Seq
AlexDaniel commit: all say <a1 a2 a3>.map({S/a/x/}).perl
committable6 AlexDaniel, gist.github.com/e5004d10ec77d2addd...0d6f1a6771
bdmatatu p6: say <a1 a2 a3>.map({ S/a/x/ })[0] 17:39
camelia rakudo-moar 9a3c35: OUTPUT«x1␤»
bdmatatu p6: say <a1 a2 a3>.map({ S/a/x/ }).eager[0]
camelia rakudo-moar 9a3c35: OUTPUT«x3␤»
AlexDaniel m: say <a1 a2 a3>.map({S/huh//}) 17:40
camelia rakudo-moar 9a3c35: OUTPUT«(a1 a2 a3)␤»
AlexDaniel m: say eager <a1 a2 a3>.map({S/huh//})
camelia rakudo-moar 9a3c35: OUTPUT«(a3 a3 a3)␤»
AlexDaniel huggable: bug report 17:41
huggable AlexDaniel, nothing found
AlexDaniel huggable: bug
huggable AlexDaniel, nothing found
AlexDaniel huggable: report bug
huggable AlexDaniel, nothing found
AlexDaniel meh
bdmatatu: anyway, this looks like a bug, can you submit a ticket?
bdmatatu Okay, sure, thanks
AlexDaniel how can I get the size of some file? 17:49
ugexe .IO.s 17:50
i *think* 17:51
AlexDaniel ugexe: right… the docs are wrong :-/ 17:52
“Returns Bool::True if the invocant is a path and the size is bigger then 0.” – yeah… well…
ugexe at the very least s/is a path/is a regular file/ 17:57
ugexe m: $*CWD.s 17:58
camelia rakudo-moar 9a3c35: OUTPUT«'/home/camelia' is not a regular file while trying to do '.s'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel m: say ‘evalbot.pl’.IO.s 17:59
camelia rakudo-moar 9a3c35: OUTPUT«Failed to find 'evalbot.pl' while trying to do '.s'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel m: say ‘.bashrc’.IO.s
camelia rakudo-moar 9a3c35: OUTPUT«35␤»
ugexe m: my $file = $*TMPDIR.child("foo.tmp"); $file.open(:w).close; say $file.s # not bigger than 0 18:01
camelia rakudo-moar 9a3c35: OUTPUT«Failed to find '/tmp/foo.tmp' while trying to do '.s'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
ugexe m: my $file = $*TMPDIR.child("foo.tmp"); $file.open(:c); say $file.s 18:02
camelia rakudo-moar 9a3c35: OUTPUT«0␤»
Xliff multi method operator<*> (Int, Obj) <- For this to work properly, I'd need to define multi method operator<*> (Obj, Int) too, right? 18:17
samcv :) AlexDaniel
looks good :)
AlexDaniel ?
the color thing? 18:18
samcv evalable6, say '
evalable6 samcv, Full output: gist.github.com/00e1cdf695fcf9f9aa...03bc9af04e
samcv, rakudo-moar 9a3c350: OUTPUT«(exit code 1) 04===SORRY!04=== Error while compiling /tmp/b8CQTcOdxx␤Unable to p…»
samcv yeah
samcv code is ok but i need to write tests before i change anything. because background colors are working for ansi-to-irc atm. so don't want to break that cause i remember that being annoying to get working 18:19
also good morning everyone
Xliff \o 18:20
Mornings are never good, samcv. Just tolerable.
<- Night Owl
AlexDaniel samcv: I don't think I like that part with a Str being rw there
I was expecting a new string to be returned
Xliff: I agree :-| 18:21
Xliff AlexDaniel++ # Owls together, man!
samcv AlexDaniel, there's one that returns a new string and one that doesn't
that work the same way
AlexDaniel mornings are only good if you had like 11 hours to sleep… which is what I did today
samcv irc-text returns a new string, irc-style does the action on the string you give it 18:22
AlexDaniel and the reason for that is…? 18:23
Xliff AlexDaniel: Ooo... I get my chance tomorrow. After I see the Rogue One late-early-show. 8)
samcv good question. lol. i could remove one of them :P
samcv what should the routine be named? irc-text or irc-style? and have it return a new string, and get rid of the other one 18:27
or even some other routine name even i guess
AlexDaniel 🤷
samcv AlexDaniel, ? 18:33
AlexDaniel samcv: I'm only using ansi-to-irc right now :) 18:34
samcv yeah but which name is better though
AlexDaniel “style-irc-text”? This is the only one that sounds like a verb :) 18:35
AlexDaniel I dunno really, I don't feel like coming up with good names today 18:37
lucasb don't blame yourself, that's one of the hardest problems in computer science 18:41
...naming 18:42
samcv i'll have all the things return a copy 18:45
gonna go with style-irc-text
maybe. i wish it were shorter tho. could make it irc-style… hmm
ridofself Failed to open file /home/ridofself/.perl6/precomp/4F2986EC86EC577C7E9279547564C2E1 18:56
A9E9E5A9.1481806511.89096/C7/C712FE6969F786C9380D643DF17E85D06868219E.repo-id: perm
ission denied
sorry, didn't mean to send that yet 18:57
ridofself I'm unable to run test files using the command perl6 t/whatever.t -- i recieve that error 18:58
receive*
lucasb hm... can you type 'ls -l /home/ridofself/.perl6/precomp/4F....' ? 18:59
gfldex ridofself: did you check if the file permissions are borked?
ridofself i went to precomp and did chmod 775 -R, but it didnt make a difference 19:00
gfldex that wont help if the user is wrong
the user for that file that is. 19:01
ridofself is rakudo the user or something like that?
gfldex s/user/owner/
gfldex .oO( ENOTEA )
lucasb you are the user 19:02
ridofself running the command sudo chmod 775 precomp/ -R does nothing, is that because I'm using sudo? 19:04
if I omit it, the operation's not permitted
lucasb you can just 'rm -rf .perl' and start over 19:06
ridofself oh! okay!
lucasb oops, type 'rm -rf ~/.perl6'
lucasb hopes this is harmless :) 19:07
gfldex ridofself: chmod will only produce output on error 19:07
ridofself when i make install, should i I do it as sudo? 19:08
gfldex well, unless you provide -v
no
ridofself the instructions at perl6.org/downloads says to install at /opt/rakudo-star-2016.11 19:10
and I can't seem to do that as a normal user without sudo
gfldex the # at the beginning of the line indicates that you need root permissions for that step 19:12
i'm not sure that those instructions are well tested 19:13
lucasb the instructions are not very clear 19:14
and I wouldn't recommend to install on the system dirs, but rather under your home dir
ridofself all right, I'm going to run them as root and we'll see
oops
gfldex i strongly doubt that works 19:15
star will install a few modules as root under $HOME
you will at least need a root login shell to run Configure.pl
lucasb ridofself: try with this: perl Configure.pl --gen-moar --prefix ~/rakudo-star 19:16
and then put "$HOME/rakudo-star/bin" in your PATH env var
ridofself okay -- it will take a bit to install but I'll let you know how it goes, thanks!
ridofself no good -- Configure.pl at ~/rakudo-star FAILed -- permission denied when 19:23
ridofself "generating src/gen/config/c" 19:23
config.c
n0tjack How can I do this my Numeric @a = +<< $m.made; return @a; without the intermediate assignment to a throw-away name? 19:28
gfldex n0tjack: that's not enough context for proper advice 19:30
AlexDaniel gfldex: why not? He wants to turn an Array into Array[Numeric] 19:31
AlexDaniel m: my @b = 1, 5, 9; say WHAT Array[Numeric].new(@b) 19:32
camelia rakudo-moar 9a3c35: OUTPUT«(Array[Numeric])␤»
AlexDaniel n0tjack: what about this? ↑
n0tjack AlexDaniel: Thanks, that will work. Not super clean, syntactically, but an improvement. 19:33
AlexDaniel n0tjack: oh, you can drop .new
AlexDaniel m: my @b = 1, 5, 9; say WHAT Array[Numeric](@b) 19:34
camelia rakudo-moar 9a3c35: OUTPUT«(Array[Numeric])␤»
AlexDaniel m: my @b = 1, 5, 9; say Array[Numeric](@b)
camelia rakudo-moar 9a3c35: OUTPUT«[1 5 9]␤»
gfldex AlexDaniel: you don't need the return if it's the last statement 19:34
AlexDaniel n0tjack: I don't think it will ever get any cleaner than this. You want Array[Numeric], so you'll have to type it out
n0tjack Now that's what I'm after.
I don't need it cleaner than that; that's what I wanted.
thank you 19:35
AlexDaniel n0tjack: np, I didn't know about this too 19:35
AlexDaniel (I just tried it and it worked :) ) 19:36
n0tjack my problem is I don't know how to look this stuff up
AlexDaniel n0tjack: no idea either
n0tjack so I have to (a) bother everybody and (b) out myself as a moron
AlexDaniel please bother us, we like it 19:37
n0tjack ha, thanks 19:37
AlexDaniel n0tjack: once you get a hang of perl6 reasonably, you'll probably “feel” where you should poke stuff to make it work :)
gfldex n0tjack: most holes that where plugged in the docs started as a question 19:38
AlexDaniel so, we have this: docs.perl6.org/language/list#index...d_array%29
mr_ron nine: ping
AlexDaniel but it does not mention that you can omit .new
m: my @b := Array[Int].new(1, 2, 3); say @b
camelia rakudo-moar 9a3c35: OUTPUT«[1 2 3]␤»
AlexDaniel m: my @b := Array[Int](1, 2, 3); say @b
camelia rakudo-moar 9a3c35: OUTPUT«[1 2 3]␤» 19:39
AlexDaniel m: my @b := Array[Int](1, 2, 3); say WHAT @b
camelia rakudo-moar 9a3c35: OUTPUT«(Array[Int])␤»
n0tjack ok, so another question. I was able to get my module references working thanks to the channel's help earlier, but now I can't seem to reference a grammar in my module inside a grammar in my script.
AlexDaniel 「is export」 ?
n0tjack yeah, did that
this is giving me an error in my script grammar J {rule TOP {^ (<J::Parser::Numeric::J-NUMERIC-LITERAL> | <J-CHARACTER-LITERAL>)* $};.... 19:40
I tried bald J-NUMERIC-LITERAL without the J::Parser::Numeric:: but nope
gfldex you may do something nobody ever did before
n0tjack surely people have exported grammars from modules before 19:40
just for code organization purposes 19:41
gfldex can you name one such module? :->
n0tjack no, that's why I said "surely" ;)
gfldex Perl 6 is less then 1 year old.
n0tjack or more than 14, depending on how you count
AlexDaniel n0tjack: I have created a doc ticket for the previous issue: github.com/perl6/doc/issues/1056 19:42
n0tjack AlexDaniel: Awesome!
gfldex I count the same way then I do with humans. I start after birth.
AlexDaniel I never liked this way of counting 19:43
and what is the age before birth? Some random bits in the memory? NaN? A negative number?
samcv in asian countries age used to be ~1 year old when birth was given 19:44
and then at the end of the year you add one to your age
AlexDaniel cool
samcv so you are 1 year old when born, and at the newyears you become 2 19:45
even if you were born in december
AlexDaniel well, that's a bit inaccurate…
samcv they have done away with that system though, but that's the traditional form of counting ages
mr_ron .tell nine Learning Perl 6 website Tip #30 uses a gist by "niner" ( guessing you) to get some module paths. The code seems out of date and doesn't run with recent Rakudo. With limited knowledge I created clone of gist that I think DRT gist.github.com/ronaldxs/031181332...-source-pl . Could you check when you get a chance? Thanks.
yoleaux mr_ron: I'll pass your message to nine.
gfldex We usually start with conception and reset the counter at birth. What makes sence because the length pregnancy can vary quite a bit.
samcv which makes more sense why they have such a big deal on the new years celebrations
gfldex AlexDaniel: did you check roast for #1056? 19:46
AlexDaniel gfldex: I didn't, let's see… 19:47
AlexDaniel gfldex: yea, nothing 19:49
gfldex m: my $i = Int(42); dd $i; 19:50
camelia rakudo-moar 9a3c35: OUTPUT«Int $i = 42␤» 19:50
shadowpaste "loveperl" at 217.168.150.38 pasted "hashes" (5 lines) at fpaste.scsys.co.uk/540231
gfldex m: my $i = Int.CALL-ME(42); dd $i; 19:51
camelia rakudo-moar 9a3c35: OUTPUT«No such method 'CALL-ME' for invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»
Xliff <Xliff> multi method operator<*> (Int, Obj) <- For this to work properly, I'd need to define multi method operator<*> (Obj, Int) too, right? 19:53
loveperl What is the error? fpaste.scsys.co.uk/540231?tx=on&...rmat+it%21
gfldex I believe to remember a discussion of coercion of buildins that remained inconclusive.
gfldex loveperl: there is a least a comma missing 19:54
what did I win?
AlexDaniel u: PILE
unicodable6 AlexDaniel, U+1F4A9 PILE OF POO [So] (💩)
Xliff I think I will write a compose rule for that. 19:55
<RAlt>&poo
Xliff The & looks like a pileOpoo, doesn't it? 19:55
[Coke] Xliff: positional arguments are ordered, yes. so you need to specify both orders if you want.
Xliff If you squint really hard...?
[Coke]++ : Thanks!
AlexDaniel Xliff: why not use existing compose file? 19:57
shadowpaste "loveperl" at 217.168.150.38 pasted "hashes" (17 lines) at fpaste.scsys.co.uk/540232
AlexDaniel Xliff: this one, for example: github.com/kragen/xcompose 19:57
Xliff: it has most of the common stuff (like poo)
loveperl What is the error? fpaste.scsys.co.uk/540232?tx=on&...rmat+it%21 19:57
AlexDaniel loveperl: that does not look like an error :) 19:58
AlexDaniel loveperl: but yes, { } is a code block instead of a hash in this case 19:58
loveperl: here: buttons => { } 19:59
not sure what you meant there
gfldex m: my \hoh = buttons => { foo => 42, bar => 0 }; dd hoh 20:00
camelia rakudo-moar 9a3c35: OUTPUT«:buttons({:bar(0), :foo(42)})␤»
gfldex m: my @loh; @loh.push: (buttons => {{ foo => 42, bar => 0 }}); dd @loh 20:02
camelia rakudo-moar 9a3c35: OUTPUT«Array @loh = [:buttons(-> ;; $_? is raw { #`(Block|71101912) ... })]␤»
gfldex loveperl: do you see the problem?
gfldex {} may create a anon Hash but does not have to 20:03
it's context sensitive in Perl 6
gfldex one of the few things I don't like in Perl 6 20:03
AlexDaniel I hate this fact, by the way
give me different unicode characters for code blocks and hashes and I'll start using them right away… 20:04
loveperl No, that's what I want, is to put in a key two haches 20:05
gfldex m: my @loh; @loh.push: (buttons => %{ { foo => 42, bar => 0 } } ); dd @loh
camelia rakudo-moar 9a3c35: OUTPUT«Odd number of elements found where hash initializer expected:␤Only saw: -> ;; $_? is raw { #`(Block|82226488) ... }␤ in block <unit> at <tmp> line 1␤␤»
RabidGravy well it's not what you want
gfldex %{} is the texas form of that new literal :)
AlexDaniel m: say %{} 20:06
camelia rakudo-moar 9a3c35: OUTPUT«{}␤»
AlexDaniel m: say &{}
camelia rakudo-moar 9a3c35: OUTPUT«{}␤»
AlexDaniel m: say WHAT &{}
camelia rakudo-moar 9a3c35: OUTPUT«(Hash)␤»
AlexDaniel :S
gfldex m: say WHAT &%{} 20:07
camelia rakudo-moar 9a3c35: OUTPUT«(Hash)␤»
Xliff AlexDaniel: I'm using WinCompose. Not XCompose.
AlexDaniel Xliff: oh well…
gfldex m: say WHAT &&&&&&&&&%{}
camelia rakudo-moar 9a3c35: OUTPUT«(Hash)␤»
gfldex :->
Xliff πoo
gfldex that's a nice answer to a trick question
Xliff Whups! 20:08
loveperl No, that's what I want, is to put in a key two hash? fpaste.scsys.co.uk/540232?tx=on&...rmat+it%21
RabidGravy but you're getting something else
gfldex you need to store the two Hashes in a list first or use a module that provides multi value hashes 20:09
loveperl how would it be? 20:10
gfldex m: my @loh; @loh.push: (buttons => %{ foo => 42}, %{ bar => 0 } ); dd @loh 20:11
camelia rakudo-moar 9a3c35: OUTPUT«Array @loh = [(:buttons({:foo(42)}), {:bar(0)}),]␤»
gfldex , is the list constructor in Perl 6. () is just for precedence. 20:12
TimToady m: say ().WHAT 20:13
camelia rakudo-moar 9a3c35: OUTPUT«(List)␤»
TimToady well, mostly
nine mr_ron: pong 20:14
yoleaux 19:45Z <mr_ron> nine: Learning Perl 6 website Tip #30 uses a gist by "niner" ( guessing you) to get some module paths. The code seems out of date and doesn't run with recent Rakudo. With limited knowledge I created clone of gist that I think DRT gist.github.com/ronaldxs/031181332...-source-pl . Could you check when you get a chance? Thanks.
gfldex I can never remember where I put my empty list.
m: say (,).WHAT # the mostly applies to , too
camelia rakudo-moar 9a3c35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix , instead␤at <tmp>:1␤------> 3say (,7⏏5).WHAT # the mostly applies to , too␤»
nine .tell mr_ron Your gist matches what I have lying around here locally 20:17
yoleaux nine: I'll pass your message to mr_ron.
AlexDaniel just named one of the variables “$let's-save” 20:24
loveperl How can I multihash? 20:29
AlexDaniel multihash?
gfldex loveperl: actually, you could use Hash.append, see docs.perl6.org/type/Hash#method_append 20:31
cfa afternoon all 20:36
cfa regarding group captures in p6, is there a form that's generally considered idiomatic? 20:39
i.e., where in p5 i might write `my ($foo, $bar) = 'foo bar' =~ /(foo) \s+ (bar)/x', ought i use `my ($foo, $bar) = ('foo bar' ~~ /(foo) \s+ (bar)/).list' in p6, or are named captures considered more appropriate?
i ask because the ().list requirement seems a little too much like boilerplate for a bread and butter operation like this.
moritz cfa: in both p5 and p6 you shouldn't use captures withotu checking if the match was successful 20:41
moritz in fact, in p5 it's outright dangerous, because the values of $1, $2. after a failed matched can be just about anything 20:42
RabidGravy I'm tending to think that named captures are the way to go in p6
moritz IMHO it depends o the compleit of the regex
for simple things, positional is fine
cfa moritz: sure, but i use the above expression in an if condition
gfldex m: my (Any:D $foo, Any:D $bar) = ('ab' ~~ /(c)(d)/).list; say $foo, $bar; 20:43
camelia rakudo-moar 9a3c35: OUTPUT«(Any)(Any)␤»
gfldex is this a newbug?
cfa moritz: i can use*
moritz it's rather if 'str' ~ rx/.../ { my ($foo, $bar) = $/.list }
RabidGravy I don't think type smileys work on variables
cfa oh, that's pretty nice
gfldex they do
m: my Any:D $foo = Any; 20:44
camelia rakudo-moar 9a3c35: OUTPUT«Type check failed in assignment to $foo; expected Any:D but got Any (Any)␤ in block <unit> at <tmp> line 1␤␤»
moritz gfldex: dunno; my with signature-like lists is something I tend to avoid, since I can never get their semantics straight on the first attempt
gfldex I know because I complained until TimToady agreed. :->
RabidGravy ooh so they do 20:45
gfldex m: my (Any:D $foo, Any:D $bar) = ('ab' ~~ /(c)(d)/).list; say $foo.^constraint 20:46
camelia rakudo-moar 9a3c35: OUTPUT«No such method 'constraint' for invocant of type 'Perl6::Metamodel::ClassHOW'␤ in block <unit> at <tmp> line 1␤␤»
gfldex how do I introspect a contraint?
RabidGravy m: y Any:D $f = "xx"; say $f.VAR.of 20:47
camelia rakudo-moar 9a3c35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3y Any:D7⏏5 $f = "xx"; say $f.VAR.of␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ statem…»
RabidGravy m: my Any:D $f = "xx"; say $f.VAR.of
camelia rakudo-moar 9a3c35: OUTPUT«(Any:D)␤»
gfldex use variables :D; my ($foo, $bar) = ('ab' ~~ /(c)(d)/).list; say $foo, $bar; 20:48
m: use variables :D; my ($foo, $bar) = ('ab' ~~ /(c)(d)/).list; say $foo, $bar;
camelia rakudo-moar 9a3c35: OUTPUT«Type check failed in assignment to $foo; expected type Any:D cannot be itself (perhaps Nil was assigned to a :D which had no default?)␤ in block <unit> at <tmp> line 1␤␤»
gfldex looks like the contraint isn't set in the inline case
cfa i guess if 'foo bar' ~~ /$<foo>=(foo) \s+ $<bar>=(bar)/ { ... } seems nicer in that instance though
gfldex m: my (Any:D $foo, Any:D $bar) = ('ab' ~~ /(c)(d)/).list; say $foo.VAR.of 20:49
camelia rakudo-moar 9a3c35: OUTPUT«(Any)␤»
gfldex yep, not set
gfldex fills a rakudobug form
cfa although the expression itself reads more noisly i suppose; depends on whether you find $<>= helps document the regex in place or not 20:51
moritz: anyway, thanks for your $/.list example 20:52
moritz cfa: you're welcome 20:53
cfa: things become clearer if you move out some of the named captures into separate, named regexes, though of course that only pays off for more complex stuff 20:54
cfa as in docs.perl6.org/language/regexes#Keep_it_small? 20:55
moritz m: my token identifer { <.alpha> \w* }; my token number { \d+ }; if 'foo=42' ~~ / <identifier> '=' <number> / { say ~$<identifier>; say ~$<number> }
camelia rakudo-moar 9a3c35: OUTPUT«No such method 'identifier' for invocant of type 'Cursor'␤ in block <unit> at <tmp> line 1␤␤»
moritz cfa: right; I might have written most of that section :-) 20:56
cfa nice :) 20:57
oh, hunh, i can use <foo> instead of $<foo>= ?
a lot of these examples employ the latter
jnthn m: if 'foo bar' ~~ /(foo) \s+ (bar)/ { say @() } # another way
camelia rakudo-moar 9a3c35: OUTPUT«(「foo」 「bar」)␤»
gfldex I somehow want to use ‚with‘ instead of ‚if‘ in that case. 20:58
moritz cfa: <foo> calls a rule named foo and captures it as $<foo>
cfa aha, gotcha
moritz gfldex: even zero-width successful matches are true in boolean context
gfldex: though with certainly isn't wrong either
gfldex did we doc the definedness of Match? 20:59
moritz gfldex: it just inherits the definedness from Mu 21:00
that is, defined for instances, undefined for type object
gfldex with/if refer to the result of ~~ anyways 21:01
gfldex and /type/Match#(Capture)_method_Bool seams to be wrong (for Match) if the empty match can be True 21:02
gfldex moritz: my rx-foo is no match for yours. Could you provide me with a zero-match example please? 21:04
zero-with even
moritz m: say 'abc' ~~ /^/; say $/.from, ' ', $/.to, ' ', ?$/ 21:05
camelia rakudo-moar 9a3c35: OUTPUT«「」␤0 0 True␤»
moritz gfldex: ^^ 21:06
gfldex tyvm
shadowpaste "ccntrq" at 217.168.150.38 pasted "Hey guys. I am trying to redirect stdout a file. it works in perl5 but i cannot figur out how to do it in perl6. can you help me out?" (12 lines) at fpaste.scsys.co.uk/540234 21:07
RabidGravy ccntrq, the space between the function name and the ( is important 21:10
it works if you don't have that 21:11
moritz or leave out the parens altogether
open 'filename', :w;
RabidGravy indeed
gfldex /type/Match is pretty anaemic 21:12
dalek c: a43c65e | gfldex++ | doc/Type/Match.pod6:
doc Match.Bool
synopsebot6 Link: doc.perl6.org/type/Match
ccntrq RabidGravy thanks alot... that mustbe the third time since i started looking at perl6 that this happened to me... 21:13
RabidGravy it's never bugged me as I have never put spaces there :) 21:14
gfldex m: $*OUT = ‚lala.out‘.IO.open(:w);
camelia ( no output )
RabidGravy probably should by "my $*OUT" but hey 21:15
gfldex m: $*OUT = ‚lala.out‘.IO.open(:w); say ‚Camelia sweety, shouldn't you complain?‘; 21:16
camelia ( no output )
ccntrq it is. i just made up this example
RabidGravy wasn't there some discussion the other day about this 21:17
gfldex where is camelias repo? 21:19
RabidGravy it was more along the lines of shouldn't the global $*OUT be immutable and you should have to declare a new lexical one 21:20
gfldex as long as $*OUT spills into modules, this form is at least correct 21:21
gfldex m: 'see-irclog.perlgeek.de\perl6\2016-12-15#i_13749102'.IO.open(:w).say(‚Or I'm gonna fill your harddrive!‘); 21:25
camelia ( no output )
gfldex stops being evil 21:26
skids ergh, there is *no* visible difference between ‚ and , on my terminal font. 21:29
moritz .uni ‚,
gfldex i will use them more carefully then
moritz unicodable6: ‚,
unicodable6 moritz, U+002C COMMA [Po] (,)
moritz, U+201A SINGLE LOW-9 QUOTATION MARK [Ps] (‚)
gfldex m: ‚‘ is the german (and quite a few other contries) equivalent of '' 21:30
camelia rakudo-moar 9a3c35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3‚‘7⏏5 is the german (and quite a few other co␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statement …»
gfldex skids: how does „“ look for you? 21:31
skids Easier to tell apart, commas cannot be that close on a fixed width font. 21:32
Plainly it is the font at fault. 21:33
Though there probably should an xkcb about the power of unicode falling into the wrong hands :-) 21:34
AlexDaniel what do you mean by wrong hands? 21:47
AlexDaniel people have been using ‚‘ to quote stuff for years 21:47
and nobody died…
mainly because commas are », and quotes are ‚« 21:49
TimToady yes, terms and infixes are far away from each other most of the time 21:52
skids I wasn't referring to anyone here. 21:54
Just joking.
kalkin- btw would be nice if people posting perl6 stuff to r/perl would also post it to r/perl6. I imagine a lot of people who haven't worked with perl, but are interested in perl6 read only r/perl6 21:59
(or may be it's just me)
kalkin- r/perl6 looks so dead. Mostly the posts are weekly summaries and for now the advent stuff 22:00
AlexDaniel skids: maybe you will also like this nick: dataf3l 22:02
(it is not 31)
skids Oh I already kicked away every font where 1 and l looked the same. Whenever I see one I go straight for the options tab. 22:04
Same with I and l 22:05
gfldex .uni dataf3l
AlexDaniel u: # dataf3l 22:07
unicodable6 AlexDaniel, U+0023 NUMBER SIGN [Po] (#)
AlexDaniel, U+0020 SPACE [Zs] ( )
AlexDaniel, U+0064 LATIN SMALL LETTER D [Ll] (d)
AlexDaniel, gist.github.com/6e90fdf8f8ea5eeffe...70ed1caede
dataf3l yes? 22:08
AlexDaniel dataf3l: sorry! We were discussing characters that look alike
dataf3l I look like a character?
AlexDaniel dataf3l: n… no… but your nickname…
dataf3l lol i get it now 22:09
I some times uppercase it in order to avoid ambiguity
dataf3l this L and 1 ambiguity is just useless, in a digital world. 22:09
AlexDaniel I'm not sure if it is a font problem 22:10
it's just that <:Ll>+\d+ pattern is so common that brain kinda expects it
geekosaur learned typing Back In The Day. 0/O and 1/I is not usually a typing error I make, but one I tend to gloss over when reading because you had to with typewritten text >.> 22:13
geekosaur (funny thing, computers don't like it much...) 22:14
loveperl How to add an array to a hash? 22:15
AlexDaniel m: my @a = <a b c>; my %h = ‘a’ => 42, ‘b’ => 90, ‘c’ => @a; dd %h 22:17
camelia rakudo-moar 9a3c35: OUTPUT«Hash %h = {:a(42), :b(90), :c($["a", "b", "c"])}␤»
[Coke] my (Any:D $a, Any:D $b) = (Any, Any); 22:22
m: my (Any:D $a, Any:D $b) = (Any, Any); # don't need a match
camelia ( no output )
gfldex [Coke]: I know. (RT#130356) 22:23
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130356
[Coke] gfldex: sorry, just didn't see it mentioned in backscroll.
my bad.
gfldex np 22:24
loveperl How to insert in a hash position? 22:27
geekosaur o.O
AlexDaniel m: my @a = <a b c>; my %h = ‘a’ => 42, ‘b’ => 90; %h<c> = @a; dd %h
camelia rakudo-moar 9a3c35: OUTPUT«Hash %h = {:a(42), :b(90), :c($["a", "b", "c"])}␤»
RabidGravy Oooh, segfault
gfldex loveperl: have you considered to read docs.perl6.org/type/Hash ? 22:28
cfa hmm, is it possible to convert a block to a sub in a straightforward way? 22:38
e.g., say i have a composition: &foo o &bar
gfldex there are different control exceptions for blocks and routines
AlexDaniel cfa: what do you mean by “convert” ?
cfa rather than assigning to a scalar and calling with (), i'd like to define a new sub
AlexDaniel run time? 22:39
cfa compile time, ideally
i want to statically say: function baz is the composition of functions foo and bar
not: scalar $baz is the block composition of functions (subs) foo and bar
gfldex cfa: docs.perl6.org/type/Callable#index...combinator 22:40
cfa > my &baz = &foo o &bar
-> |args is raw { #`(Block|140732936055672) ... }
> baz.WHAT
(Block)
i used infix:<o> above in my example above, note 22:41
AlexDaniel ok, so what is wrong with this?
m: sub f($p){ say ‘f’; $p / 2 }; sub g($p){ say ‘g’; $p * 2 }; sub baz($x) { f(g($x)) }; say baz(2)
camelia rakudo-moar acece7: OUTPUT«g␤f␤2␤»
cfa well sure 22:42
i'm asking about composition though
(i don't mind the answer being 'no')
but conceptually i want to compose two subs to get a sub
RabidGravy but it doesn't matter if it's a block, just whether it's a Callable
cfa well it does
AlexDaniel m: sub f($p){ say ‘f’; $p / 2 }; sub g($p){ say ‘g’; $p * 2 }; sub baz($x) { (&f ∘ &g)($x) }; say baz(2)
camelia rakudo-moar acece7: OUTPUT«g␤f␤2␤»
cfa because it can't be used as a list op 22:43
baz(10), but not baz 10
AlexDaniel cfa: what about “my sub” ? Maybe that's what you want?
gfldex you will need macros for that and they are experimental for very good reason
cfa gfldex: hmm, okay 22:44
AlexDaniel: looking
AlexDaniel: but that'll just lexicalise the sub, no? 22:45
AlexDaniel cfa: yes. I just thought that maybe that it could help you
cfa also, i presume in your last example to camelia each invocation of baz will recompute the composition?
basically i just wanted to define foo, bar, then a sub baz as their composition 22:46
AlexDaniel well, hopefully not (depends on how it optimizes it)
gfldex m: sub f($p){ say ‘f’; $p / 2 }; sub g($p){ say ‘g’; $p * 2 }; sub baz($x) { constant &c = &f ∘ &g; c($x) }; say baz(2)
camelia rakudo-moar acece7: OUTPUT«g␤f␤2␤»
cfa if i need to do sub baz($x) { ... } i might as well just call directly 22:47
gfldex i'm not sure if Rakudo is cleaver enough yet to do the inlining correctly
m: sub f($p){ say ‘f’; $p / 2 }; sub g($p){ say ‘g’; $p * 2 }; sub baz($x) { constant &c = &f ∘ &g; c($x) }; say baz 2
camelia rakudo-moar acece7: OUTPUT«g␤f␤2␤»
cfa thanks for your examples 22:47
gfldex initialiser expressions of constant are evaluated at compile time 22:48
cfa nods
gfldex you may want to do some benchmarking before you use it in a tight loop 22:49
dalek osystem: d4e5257 | samcv++ | META.list:
Update metafile location for IRC::TextColor
23:32
ugexe anyone able to give wordpress username ugexe permissions to the advent? 23:52
AlexDaniel Hey everyone! Say hello to our new bot! 23:56
AlexDaniel \o/ 23:56
statisfiable6: CORE.setting size
statisfiable6 AlexDaniel, OK! Working on it…
AlexDaniel it has all the data cached, actually, but it still takes quite some time to draw a graph and gist it…
statisfiable6 AlexDaniel, gist.github.com/1a9e3b8a2afdd53346...d55734c8ff 23:57
AlexDaniel but I hope people won't need that data so urgently