»ö« 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.
Zoffix
.oO( 🎜 🎝 ohhh teeeelll me whyyyy 🎜 🎝 do some Methods don't their .gists from Method.gist 🎜 🎝 )
00:08
m: [].^methods.grep(*.name eq 'eager').say 00:09
camelia (eager)
Zoffix m: "x'.comb.^methods.grep(*.name eq 'eager').say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"'
at <tmp>:1
------> 3omb.^methods.grep(*.name eq 'eager').say7⏏5<EOL>
expecting any of:
double quotes
Zoffix m: 'x'.comb.^methods.grep(*.name eq 'eager').say
camelia (Method+{<anon|63462480>}.new)
Zoffix like this one
I can repro by compiling an `is nodal` method in src/core/Any.pm but can't repro outside core :/ 00:10
And if I change Mu.gist to prepend string "From Mu: " to its normal output, the above includes it 00:11
And `is nodal` mixes in a role into the method. And NOT all `is nodal` methods have this problem :/
ZofBot: any ideas? 00:15
Even if I change Method.gist to be the `only` method instead of multi, still Mu.gist gets called :\ 00:31
Zoffix guesses something about composition.... If only I knew how it works!
skids m: #|(abc) role A { method foo { ... } }; class B does A { method foo { "OK" } }; say B.foo 01:34
camelia OK
skids commit: #|(abc) role A { method foo { ... } }; class B does A { method foo { "OK" } }; say B.foo
committable6 skids, ¦#|(abc): «Cannot find this revision (did you mean “acbbc87”?)»
skids commit: releases #|(abc) role A { method foo { ... } }; class B does A { method foo { "OK" } }; say B.foo
committable6 skids, gist.github.com/1d01aeddcf5402935b...0c53c5ec44 01:35
Zoffix gives up on chasing Method.gist bug 02:47
Filed the ticket with all the info I managed to sprunge up: rt.perl.org/Ticket/Display.html?id=132149
I bet the fix is something totally easy and I'll feel stupid when someone else fixes it :) 02:48
AlexDaniel squashable6: when? 03:32
squashable6 AlexDaniel, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Squashable
AlexDaniel squashable6: status
squashable6 AlexDaniel, Next SQUASHathon in 13 days and ≈6 hours (2017-10-07 UTC-12⌁UTC+14)
kyan Hi! I'm trying to do this: gist.github.com/ethus3h/96fae44656...26c3ccd082 But, because I'm parsing using a specific rule, the code in TOP is never run. What's the right syntax for making the :my $*ST = St.new(); run at the beginning of the grammar? Thanks! 03:57
kyan tried the "has St $.ST;" and "has St $.ST = St.new();" forms, but it didn't seem to like that 03:58
Todd Hi All, on two computers I have two modules: Pause.pm (perl 5) and Pause.pl6 (perl 6). The first computer has no problems with `use Pause; # qw[ Pause ];` (perl 6), but the second computer gives me 04:17
===SORRY!=== Error while compiling /home/linuxutil/Pause.pm (Pause) This appears to be Perl 5 code.
Pause.pm is indeed Perl5. How do I tell the senond machine that my perl6 moduels end in pl6? 04:18
docs.perl6.org/language/modules.html 04:24
Source files generally use the standard .pm extension, and scripts or executables use .pl. However, if you wish to highlight that the file is written in Perl 6 you can use the .pm6 extension for modules, and .p6 or .pl6 extension for scripts
skids Hrm so you have both files on both machines? 04:25
Todd 100% identical. I copied and pasted 04:26
skids Same rakudo version?
Todd Good machine: $ perl6 -v This is Rakudo version 2017.07 built on MoarVM version 2017.07 implementing Perl 6.c. 04:27
Bad machine: # perl6 -v This is Rakudo version 2017.06 built on MoarVM version 2017.06 implementing Perl 6.c.
I am u pgrading right now 04:28
skids yeah probably commit e1e9091f7484ee124 fixd that in July. 04:29
Todd That did the trick! Thank you! I was really scratching my head on that one! And I was following directions (for once) too.
skids timo++ he fixed it :-) 04:30
Todd fix was: dnf upgrade rakudo
skids good n8 p6... sleep time. 04:35
kyan Bed time for me, too, upon further reflection. Gn all! :) 04:45
Todd Hi All. Question. Can I chain these two subsitutions together? ` perl6 -e 'my $x=" State : abc "; $x ~~ s/.*?" : "//; $x ~~ s/" ".*//; say "<$x>";'` 05:09
Todd I will ask on the mailing list. Bye bye 05:27
labster m: my $x=" State : abc "; $x.subst-mutate(/.*?" : "/, "").subst-mutate(/" ".*/, ""); 06:31
yoleaux 14 May 2017 18:20Z <Zoffix> labster: what's the difference between IO::Spec::*.join and .catpath? Seems the only dif is .join has an extra check that dir and file are both not "/"; but what usecase does that cover that there are two methods for it?
camelia Parameter '$self' expected a writable container, but got Match value
in block <unit> at <tmp> line 1
yoleaux 14 May 2017 18:33Z <Zoffix> labster: and another special case in join is with `dirname` = '.' and `file` = 'anything'; with .catpath putting a space between, but .join just returning the filename. How should this stuff be documented??
15 May 2017 16:00Z <Zoffix> labster: and another question is about '.' in Unix and Win32 IO::SPECs. I see Unix changes empty path parts to '.' and if PATH is not set, returns an empty list; On Windows, empty bits are removed and '.' is always shoved to the head of the list. Was all that done on purpose?
15 May 2017 16:08Z <Zoffix> labster: never mind about the '.' in SPECs; figured it all out; still wondering about .join/.catpath tho
28 May 2017 22:03Z <Zoffix> labster: sent you a PR fixing a handle leak in File::Directory::Tree (it's the module recommended by docs.perl6.org): github.com/labster/p6-file-directo...ree/pull/9
5 Jul 2017 11:39Z <lizmat> labster: do you have any thoughts on deprecating (<+) in favour of baggy semantics of (<) and (<=) ?
labster hi yoleaux
I guess I haven't been in-channel for a while. 06:32
Zoffix: I couldn't remember the logic between catpath and join, but I guess I did document it in design.perl6.org/S32/IO.html#.join 06:35
m: my $x="foo"; $x.subst-mutate(/f/, "").subst-mutate(/f/, ""); 06:37
camelia Parameter '$self' expected a writable container, but got Match value
in block <unit> at <tmp> line 1
labster m: my $x="foo"; $x.subst-mutate(/x/, "").subst-mutate(/f/, ""); # change one letter
camelia Invocant of method 'subst-mutate' must be an object instance of type 'Cool', not a type object of type 'Nil'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
labster ok the second error is passable, but the first is whaaa? 06:38
Geth doc: gfldex++ created pull request #1574:
note multi hiding via non-multi in lexical scope
09:27
HoboWithAShotgun how do i check wether a given scalar contains an array (.WHAT saying (Array))? 09:47
moritz if $x ~~ Array { ... } 09:50
timotimo labster: subst-mutate works by mutating the string you're calling it on, but that can only work if you have a variable that can be written to. however, subst-mutate returns a match object for what it replaced, so the second subst-mutate you're calling doesn't apply to the $x. what you want is subst instead, because that will return the string after substitution 09:55
labster: or you can $x.subst-mutate twice in a row
HoboWithAShotgun allright. i have $f = $foo ~~ Array ?? $foo !! [$foo], which works but isn't there a nice way to express that?
timotimo or use something like .trans
but i'd probably do it differently entirely 09:57
labster Oh, I know why it failed. I'm just saying the error is not very helpful, and you get a different one depending on whether or not you matched.
timotimo my $x=" State : abc "; $x .= split(" = ")[*-1].trim-trailing(); say $x.perl
m: my $x=" State : abc "; $x .= split(" = ")[*-1].trim-trailing(); say $x.perl
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in bracketed infix; couldn't find final ']'
at <tmp>:1
------> 3 State : abc "; $x .= split(" = ")[*7⏏5-1].trim-trailing(); say $x.perl
timotimo m: my $x=" State : abc "; $x = $x.split(" = ")[*-1].trim-trailing(); say $x.perl
camelia " State : abc"
timotimo m: my $x=" State : abc "; $x = $x.split(" : ")[*-1].trim-trailing(); say $x.perl 09:58
camelia "abc"
labster Not my case anyway, I was just playing around with the perl6-users question.
timotimo mhm 10:05
i saw it, too
m: my $x = " State : abc "; say $x.comb(/" : " <( \S+ )>/).perl 10:08
camelia ("abc",)
Xliff Does it benefit performance if you store Proxy objects that you plan to reuse? 10:13
Examples here: $XML::LibXML::Globals::skipXMLDeclaration 10:14
Oops.
github.com/Xliff/p6-XML-LibXML/blo...ent.pm#L70
timotimo if the proxy objects would only live until the next GC run or the next one after that, allocating a proxy is probably rather cheap, but if it lives a medium lifetime, it could be worth caching 10:16
moritz Xliff: measure it
Xliff Well, that's the thing. It depends on how its used.
timotimo why does the comment say it's "read-only" but you can set it to a different value? 10:17
Xliff If these properties are used regularly, I can definitely see an argument for caching, but I don't know that since this is a module.
moritz then benchmark different scenarios 10:17
Xliff timotimo: I didn't write that comment. FROGGS did. 10:18
moritz the caching logic might be slower than creating and GCing new proxies
timotimo ah, ok
Xliff moritz: Alright then.
Although I am hardpressed to see why the logic might be expensive. 10:19
Couldn't those methods just use: method prox { state $p = Proxy.new(...); $p }
timotimo m: class T { method S { state $p = rand; $p } }; T.new.S.say; T.new.S.say; 10:20
camelia 0.897041809287646
0.897041809287646
timotimo ^- same value for different instances, bad idea
Xliff timo: That's fine, since it's behavior not value that's required, here. 10:21
I would agree, otherwise.
timotimo huh? 10:22
Xliff Along that same vane, using the same proxy object across instances would be a bonus 10:22
timotimo huh? all future uses of xmlEncoding will change the encoding on the very first Document that ever had it called on it 10:23
Xliff Well crap. Missed that. I thought that self would refer to the right object across instances. 10:24
So yeah, state would not be good, would need Proxy objects per instance.
timotimo it only knows what self to refer to because it's taking a closure when you're first creating it 10:25
xmlDocument is just one per xml file, right?
Xliff Y
xmlDocument per one parsed file or string
timotimo right 10:26
Xliff So...
Xliff m: class T { has %!getSet; has $!a; method a { %!getSet<a> //= Proxy.new(FETCH => -> $ { $!a },STORE => -> $, $new { $!a = $new; }); %!getSet<a> }; }; my $t = T.new; my $tt = T.new; $t.a = "a"; $tt.a = "aa"; $t.a.say; $tt.a.say; 10:38
camelia Cannot modify an immutable Any ((Any))
in block <unit> at <tmp> line 1
Xliff W(h)AT?
(Why do I always do this to myself... get a brainstorm at 5am and then try to make it a reality with !sleep) 10:39
Xliff Fix it later. Eyes gone droopy. 10:41
timotimo it's not missing the "is rw", is it? 11:05
Zoffix . 11:28
Zoffix labster: the different errors is really due to design bug with Nil (and ultimately the safe-call op .?). Nil.subt-mutate should just pass along the Nil, but because Nil is Cool, it goes into the Cool candidate, which expects a Cool:D 11:33
I'm surprised you think that one's passable but the first one's a "whaa". It says exactly what's wrong. What would the improved version look like? 11:34
Zoffix labster: and I think I saw the speculations and the time and I still don't get the difference: descriptions for both methods say "Takes volume, directory and file/[basename] portions and returns an entire path string". Though I guess it don't matter much for me, now that the IO grant is over 11:38
Zoffix oh, the error talks about `$self` 11:55
Xliff timotimo++: That was it. The method needed to be "is rw" 11:57
Geth ecosystem: 9bec029e5c | (Tom Browder)++ (committed using GitHub Web editor) | META.list
new module Geo::Ellipsoid

ported from the Perl 5 version
11:59
Zoffix m: (my Match $ = ("x" ~~ /x/)).subst-mutate(/^/, "y") 12:11
camelia Type check failed in assignment; expected Match but got Str ("yx")
in block <unit> at <tmp> line 1
Zoffix
.oO( huh? )
Oh, I get it now, never mind 12:12
Zoffix What just tryign to figure out why the two different errors here: 12:16
m: 'x'.subst-mutate(/^/, '') 12:17
camelia Cannot resolve caller subst-mutate(Str: Regex, Str); the following candidates
match the type but require mutable arguments:
(Str:D $self is rw: Any:D $matcher, $replacement, :ii(:$samecase), :ss(:$samespace), :mm(:$samemark), *%options)
in bl…
Zoffix m: ($ = 'x').subst-mutate(/^/, '').subst-mutate(/^/, '')
camelia Parameter '$self' expected a writable container, but got Match value
in block <unit> at <tmp> line 1
Zoffix m: 42.subst-mutate(/^/, '')
camelia Parameter '$self' expected a writable container, but got Int value
in block <unit> at <tmp> line 1
Zoffix I see
$ ./perl6 -e '42.subst-mutate: /^/, ""' 12:18
Parameter '$value-to-subst-mutate' expected a writable container, but got Int value
Marginally better
MasterDuke "Can only subst-mutate writable containers, but got Int value (42) instead"? 12:26
moritz m: 42.subst-mutate(/4/, 2) 12:28
camelia Parameter '$self' expected a writable container, but got Int value
in block <unit> at <tmp> line 1
moritz m: 42 ~~ s/4/2/ 12:29
camelia Cannot modify an immutable Int (42)
in block <unit> at <tmp> line 1
moritz oh, I missed a lot of context
Zoffix MasterDuke: that'd need to go into X::Parameter::RW's throwage logic. I think you improved that are in the past. Perhaps you can do so here too, by detecting when `is rw` is an invocant? 12:44
MasterDuke hm, i thought there was some logic about that already 12:44
MasterDuke but i'll take a look 12:46
wander4096 m: sub infix:<space-concat> ($a, $b) { $a ~ " " ~ $b }; my $a = 'word1'; $a space-concat= 'word2'; # RESULT: «'word1 word2'» 12:47
camelia ( no output ) 12:48
wander4096 sub infix:<space-concat> ($a, $b) { $a ~ " " ~ $b }; my $a = 'word1'; $a space-concat= 'word2'; $a.say # RESULT: «'word1 word2'» 12:48
m: sub infix:<space-concat> ($a, $b) { $a ~ " " ~ $b }; my $a = 'word1'; $a space-concat= 'word2'; $a.say # RESULT: «'word1 word2'»
camelia word1 word2
wander4096 ===SORRY!=== Error while compiling: Two terms in a row ------> $a⏏ space-concat= 'word2'; expecting any of: infix infix stopper statement end statement modifier statement modifier loop
Zoffix m: sub infix:<space-concat> { "$^a $^b" }; my $a = 'word1'; $a space-concat= 'word2'; $a.say 12:49
camelia word1 word2
Zoffix wander4096: the error isn't in the code you showed.
wander4096: the infix you define is lexical. Are you calling it from somewhere where it's not in scope? 12:50
wander4096 it should be no error 12:50
but the error msg show when i put them in a REPL line by line 12:51
Zoffix wander4096: ah. It's a bug in REPL. It doesn't remember grammar modifications, which is what your infix does 12:51
You'd need to write that program in a file and run it with `perl6 blah.p6` 12:52
buggable: glot.io
or use online evalers like that ^
huggable: glot.io
huggable Zoffix, Run Perl 6 in your browser: tio.run/nexus/perl6 or glot.io
wander4096 Zoffix: got it. 12:53
MasterDuke heh, when i just slurp the 50mb, 1million line file, i get 660620maxresident. when i remove the 27 lines with unicode in them, 487160maxresident
Zoffix Ticket for that bug: rt.perl.org/Ticket/Display.html?id...et-history
Geth doc: tbrowder++ created pull request #1575:
add new doc for an enum example
13:19
tbrowder i'll merge it after it shows passing unless there are objection--suggestions welcome 13:20
*objections or suggestions 13:21
please see and comment on my reddit post: www.reddit.com/r/perl6/comments/71..._6_versus/ 13:26
gfldex is there a module to store Perl 6 data structures that supports typed undefined values? 13:42
timotimo yaml could in theory support that. i don't think any of our yaml modules does 13:44
dogbert11 .seen moritz 14:22
yoleaux I saw moritz 12:29Z in #perl6: <moritz> oh, I missed a lot of context
samcv any ability to get the width of the terminal? should there be nqp ops to do this? 14:23
audiatorix Hey folks. My friend is trying to use Cro (web framework) and is having trouble because it uses Encoding::Registry.find, and apparently The Registry symbol can't be resolved. The exact same example code works fine for me. Any ideas? 14:32
sena_kun audiatorix, what rakudo version does your friend use? 14:33
audiatorix I would assume the very latest, since he only recently got into perl 6 14:34
let me ask him
sena_kun Encoding::Registry is a part of rakudo, not cro, so seems like an outdated rakudo to me. `perl6 --version` command output is enough to check it. 14:35
audiatorix That's what I assumed, but considering I have a probably-earlier version, it doesn't make much sense. Still waiting for him to get back to me. For reference, I am using 2017.04.03 14:36
audiatorix s/03/3/ 14:36
he is using 2017.06 14:37
and apparently he got it though apt, whereas I installed it myself 14:39
Perhaps a problem with apt's installation method
MasterDuke huggable: deb 14:41
huggable MasterDuke, CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
MasterDuke maybe try those ^^^, the newest release is available there
MasterDuke think Cro needs a more recent rakudo 14:41
sena_kun based on fossies.org/diffs/rakudo/2017.06_vs_2017.07/ Encoding::Registry was added on 2017.7 release.
but yes, Cro needs latest rakudo, because otherwise things are, hmm, bad. 14:42
timotimo moritz: the book flow chart shows up pretty crappily on twitter; the transparent background makes it unreadable in my tweetdeck where pictures are shown in front of a black background :(
audiatorix Then that raises the question of how I am able to run it
audiatorix with rakudo 2017.04 14:42
sena_kun perl6 --version?
audiatorix oh my bad, I am using .7 14:43
Ran perl6 -v on the wrong shell lmao 14:44
sena_kun no problem. You need 2017.08 anyway, iirc.
audiatorix Well, time to update on all my machines 14:45
jeez, still using .04
yoleaux Zoffix: fix what you broke, bruh: rt.perl.org/Ticket/Display.html?id=132128 15:23
Zoffix m: class Foo is Int {}; my Foo $x .= new: 42; say $x; say $x.WHAT; 15:24
camelia 42
(Foo)
Zoffix yoleaux: already fixed, bruh 15:25
Geth doc: 9849f0945f | (Zoffix Znet)++ | 2 files
Remove $?USAGE / Document $*USAGE

Rakudo impl: github.com/rakudo/rakudo/commit/0b15f6728a Spec: github.com/perl6/roast/commit/04b03b1d40
16:02
Zoffix ^ $?USAGE never worked in userland, nor were it specced 16:03
rngoodn What is the purpose of two semicolons after a statement? Are the two semicolons after the third satement in this example a typo? pastebin.com/neXs6b33 16:05
Zoffix rngoodn: yeah. It's no-op
rngoodn: in signatures though, two colons marks off the part where multi dispatch will not consider further parameters 16:06
(docs for that: docs.perl6.org/type/Signature#Long_Names ) 16:07
m: say 42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; say 'but here they have no special meaning'
camelia 42
but here they have no special meaning
rngoodn Zoffix: Thanks... am am reading through this book and it was not explained and done more than once so I started to think it might not have been a typo. 16:08
Zoffix rngoodn: oops :) Which book is it? 16:08
rngoodn Perl 6 Fundamentals
Zoffix Ah.
moritz: ^ you may wanna fix this up for next edition 16:09
wander4096 `$()` has no docs 17:05
what is the usage of `$()` 17:06
i saw it in try MyGrammar.parse(...); if $/ { say $(); }
timotimo it gives you the .ast if it's defined, otherwise the matched string 17:09
i think
from $/
wander4096 emmmm.. 17:12
that is another thing puzzling
`.ast` 17:13
neither i cant find out what AST exactly is in perl 6
*can
wander4096 the doc of `AST` is vague 17:16
leont .ast is a method on Match
It's a synonym for .made 17:17
You can set it with make/.make
timotimo oh, sorry 17:18
i shouldn't have used the deprecated name
wander4096 yes, which says "it returns AST"
so it returns to "what AST is"
wander4096 a dict? 17:19
timotimo no, you decide what you put into the ast
make and made is a bit like returning a value and getting the return value, but it doesn't influence the control flow at all
timotimo the .made is a convenient "storage space" that has short-cuts for accessing 17:23
Geth doc: 66bbcd4bed | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Match.pod6
Clarify Match.make

  - Remove all the waffle about ASTs
  - Tell the user what the method is used for
  - Link to calculator example
17:32
Zoffix wander4096: you can store whatever you want in a Match object by giving that stuff to .make method. You can later retrieve that stuff by calling .made. The $() thing is a shortcut that returns the made stuff if it's truthy or an empty string if nothing was made or if the made stuff is falsy. I wouldn't spend too much time thinking about the $(). Can't say I've seen it used 17:34
m: "" ~~ /^/; make 42; dd $()
camelia 42
Zoffix m: "" ~~ /^/; make 0; dd $()
camelia ""
Zoffix m: "" ~~ /^/; dd $()
camelia ""
Zoffix m: "" ~~ /^/; dd $/.made ?? $/.made !! "" 17:35
camelia ""
Zoffix ^ expanded form of $() basically
kyan Hi! I'm trying to do this: gist.github.com/ethus3h/96fae44656...26c3ccd082 But, because I'm parsing using a specific rule, the code in TOP is never run. What's the right syntax for making the :my $*ST = St.new(); run at the beginning of the grammar? (I tried the "has St $.ST;" and "has St $.ST = St.new();" forms, but they didn't do the trick.) I assume this is because the grammar's constructor is not called on 17:36
parses so it just uses a type object, but I don't know how to write this... Thanks!
Zoffix kyan: stick :my $*ST = St.new(); inside `token foo` 17:37
kyan: you can also stick it before you call .parse (without the leading colon)
my $*ST = St.new; say EM.parse('!', :rule<foo>);
Zoffix $*blah are dynamic variables available via dynamic scope, so `method block` will see it up the callstack from <- foo <- parse 17:38
kyan Ohhhhh! I get it. Would I need to reset it between subsequent parses? 17:38
Zoffix Don't think that code will work. I think grammar's method need to return a Match object or something
kyan (mm, the full code 17:39
Zoffix kyan: I guess. You could wrap it in a sub to reset it for you
kyan does call a token after that.)
Yeah. Cool, thanks! :)
Zoffix m: sub meows { $*ST.say }; sub parse-stuff { my $*ST = 42; meows; $*ST = 70; meows }; parse-stuff; parse-stuff
camelia 42
70
42
70
wander4096 thanks to Zoffix, timotimo and leont, although i still need some time to handle that >_< 17:54
thou Zoffix++ (for On Troll Hugging, Hole Digging, and Improving Open Source Communities)! 18:14
Zoffix \o/ 18:15
SmokeMachine m: say "{$++}" for ^10 19:10
camelia 0
0
0
0
0
0
0
0
0
0
SmokeMachine is that expected? ^^
m: say $++ for ^10 19:11
camelia 0
1
2
3
4
5
6
7
8
9
gfldex SmokeMachine: i'm nor surprised but am leaning towards calling that a bug 19:13
m: (say "" ~ {$++}() ~ "") for ^10 19:14
camelia 0
0
0
0
0
0
0
0
0
0
gfldex i guess that's what happens
Zoffix thinks it's not a bug 19:17
Oh nevermind
m: { say $++ }() for ^5
camelia 0
0
0
0
0
Zoffix shrugs 19:17
gfldex m: { say "" ~ $++ ~ "" } for ^10 20:27
camelia 0
1
2
3
4
5
6
7
8
9
AlexDaniel m: say(""~$++~"")xx⁹ 20:41
camelia 0
1
2
3
4
5
6
7
8
kyan Is there a checking tool available for Perl 6 like Shellcheck, where I can paste my code and get a report of syntactic errors and common mistakes in it? 20:48
AlexDaniel kyan: not yet! But we have this page: docs.perl6.org/language/traps 20:50
kyan AlexDaniel: cool, thanks! 20:51
[Coke] super slow internet here. Can someone get me a link to the github p6 curses module? 21:18
also, is there a secret zef option to not try to update the module list? 21:19
kyan ( Just so you know, docs.perl6.org/language/traps has a broken link to docs.perl6.org/type/MONKEY-SEE-NO-EVAL ) 21:20
[Coke] kyan; please open a ticket at github.com/perl6/doc/issues 21:21
kyan Thanks!
MasterDuke [Coke]: this? github.com/azawawi/perl6-ncurses
[Coke] MasterDuke: danke. trying a clone... 21:22
sooooo slow 21:23
MasterDuke do you need the whole repo? might be faster just to dl master.zip
[Coke] sure. 21:24
bah. Could not resolve host: github.com
MasterDuke github.com/azawawi/perl6-ncurses/a...master.zip
Zoffix [Coke]: ^ that zip file: temp.perl6.party/master.zip (if you're still having trouble resolving github.com) 21:31
Github's IP: 192.30.253.112
japhb [Coke]: Please let me know what you like or don't like about working with ncurses in Perl 6. I'm background-working on writing a from-scratch widget library for Perl 6 to be based on Terminal::Print rather than curses, and I'm aiming for a low annoyance API. 21:32
raschipi samcv: Don't forget to handle SIGWINCH if you're going to detect terminal size. No need to ask again, the kernel signals the program when it's terminal changes shape. 21:58
Lac123 I know its 8 years old, but this perl6 advent (perl6advent.wordpress.com/2009/12/...rameters/) suggests that you can name parameters in your call without the sub having ":"s in front of the variable definitionss. (i.e. that sub draw_line($x1, $y1, $x2, $y2) { say "hi" }; draw_line(:x1($x1), :y1($y1), :x2($x2), :y2($y2)); should work - but it doesn't). Has this changed since, or am I mis 22:00
(I get "Too few positionals passed; expected 4 arguments but got 0" for the above)
raschipi Lac123: To use that calling convention, you need to have the function declared with named parameters instead of positional like above. 22:03
Lac123 ok, thank raschipi; I guess the 8yo advent article is out of date! or I'm reading it too literally. 22:04
raschipi The explanation isn't clear there, but it hasn't changed.
jnthn Actually, long ago it *was* speculated that positional parameters would also be passed by name 22:05
8 years ago that probably was still in a design doc somewhere
In the end, it didn't make the cut 22:06
There were a few other such magical nuisances that also didn't
(With relation to arguments)
japhb "magical nuisances" :-)
Lac123 thank you 22:07
Geth doc: d277ade26b | (Tom Browder)++ | doc/Language/enumeration.pod6
add new doc en an enum example
23:22
doc: 766a905e3a | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/enumeration.pod6
Merge pull request #1575 from tbrowder/enum

add new doc for an enum example
kyan Hi again... is this probably a problem with Grammar::ErrorReporting, or a problem in my use of it, or is it hard to tell? Thanks :) 23:24
kyan ...oh, I never posted the problem. D'oh. Here it is: gist.github.com/ethus3h/e13fbc9aaa...37a45cdd88 23:28
kyan Oh! Never mind me. I see. It's not a problem, actually, I just didn't realize Grammar::ErrorReporting would actually exit the enclosing script rather than just reporting failure. 23:30
Sorry for the noise. :)
AlexDaniel kyan: I don't think it does 23:35
kyan: it simply returns a Failure, and sinking a Failure makes it exit
m: Failure.new(‘uh’); say ‘hello world’ 23:36
camelia uh

Actually thrown at:
in block <unit> at <tmp> line 1
AlexDaniel m: my $x = Failure.new(‘uh’); say ‘hello world’
camelia hello world
kyan Oh, interesting. Thanks! 23:38
kyan Is there a way to wrap up chunks of code e.g. #`( Methods for doing foo ) { in-the-same-scope; }; without creating a new scope? 23:53
AlexDaniel m: class C { (method foo() { say ‘foo’ }; method bar() { }) }; C.new.foo 23:55
camelia foo
AlexDaniel not quite sure why would you need that, but what about this?
kyan Are the parentheses doing the grouping in that example? 23:57
(The reason I'd like to do that, is because I've got a grammar with a fairly large number of token definitions, and want to group them up into batches I can label with comments and fold-up in the editor
kyan Oh! Yeah, parentheses do do that, as long as I put a ; at the end before an immediately subsequent token declaration 23:59
Sweet, thanks again! :D