»ö« 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:01
margeas left
00:04
n0tjack left
00:06
troys_ is now known as troys
|
|||
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! | |||
00:41
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:44
HoboWithAShotgun joined
00:45
Cabanossi left
00:46
kyan joined
00:47
Cabanossi joined
00:51
Rawriful left
01:10
vendethiel- joined
01:11
geekosaur left,
Ven`` left
01:15
geekosaur joined
01:30
HoboWithAShotgun left
01:33
raschipi joined
|
|||
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 | |
01:45
Cabanossi left
01:47
ilbot3 left,
Cabanossi joined
01:52
aborazmeh left
01:55
ilbot3 joined,
ChanServ sets mode: +v ilbot3
02:13
raschipi left
02:22
Ven`` joined
02:24
vendethiel- left
|
|||
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 | ||
02:56
geekosaur left,
noganex_ joined
02:59
noganex left
03:03
llfourn joined
03:06
geekosaur joined
03:08
cpage_ left
03:16
zakharyas joined
03:18
rngoodn left
03:22
cpage_ joined
03:26
Xal joined
03:27
troys is now known as troys_
03:29
Cabanossi left
03:31
Cabanossi joined
|
|||
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) | ||
03:37
AlexDaniel left
03:47
zakharyas left
|
|||
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 | ||
04:02
nadim left
04:06
troys_ is now known as troys
04:14
bjz joined,
bjz left
04:15
Todd joined
|
|||
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 | |
04:45
BenGoldberg left
|
|||
kyan | Bed time for me, too, upon further reflection. Gn all! :) | 04:45 | |
04:46
kyan left
04:49
khw left
04:51
Todd left
04:52
skids left
04:58
troys left,
Cabanossi left
05:01
Cabanossi joined
05:06
lizmat left
05:08
Todd joined
|
|||
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 | |
05:10
jargan joined
05:11
john51_ joined,
jast left
05:13
john51 left
05:21
lizmat joined
05:24
[ptc] left,
[ptc] joined
|
|||
Todd | I will ask on the mailing list. Bye bye | 05:27 | |
05:27
Todd left
05:29
Cabanossi left
05:31
moritz left,
moritz joined
05:32
Cabanossi joined
05:36
[ptc] left,
[ptc] joined
05:57
kaare__ left
05:59
geekosaur left
06:08
geekosaur joined
|
|||
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 | |
06:42
setty1 joined
06:45
Cabanossi left,
HoboWithAShotgun joined
06:46
Cabanossi joined
06:52
domidumont joined
06:57
domidumont left
06:58
domidumont joined
07:06
rindolf joined
07:21
wamba joined
07:28
nadim joined
07:29
Cabanossi left
07:32
Cabanossi joined,
kaare__ joined
07:40
geekosaur left
07:43
obfusk joined,
jast joined,
jargan left
07:45
APic left,
geekosaur joined
07:46
jast left
07:47
rindolf left
07:48
jast joined
07:50
ken joined
07:51
ken is now known as Guest51796
07:58
|oLa| joined
08:12
Guest51796 left
08:14
Guest51796 joined
08:23
darutoko joined
08:30
Cabanossi left
08:31
Cabanossi joined
08:42
leah2 left
08:55
potheads joined
09:00
Cabanossi left
09:01
Cabanossi joined
09:08
geekosaur left,
geekosaur joined
09:26
kaare__ left
|
|||
Geth | doc: gfldex++ created pull request #1574: note multi hiding via non-multi in lexical scope |
09:27 | |
09:41
APic joined
09:43
margeas joined
09:45
kaare__ joined
|
|||
HoboWithAShotgun | how do i check wether a given scalar contains an array (.WHAT saying (Array))? | 09:47 | |
moritz | if $x ~~ Array { ... } | 09:50 | |
09:54
espadrine joined
|
|||
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. | ||
09:59
Cabanossi left
10:01
Cabanossi joined
|
|||
timotimo | mhm | 10:05 | |
i saw it, too | |||
m: my $x = " State : abc "; say $x.comb(/" : " <( \S+ )>/).perl | 10:08 | ||
camelia | ("abc",) | ||
10:10
espadrine left
|
|||
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. | ||
10:17
rindolf joined
|
|||
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 | ||
10:21
LanceW joined,
Guest51796 left
|
|||
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 | |
10:22
LanceW left,
Guest51796 joined
|
|||
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 | |
10:23
llfourn left
|
|||
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... | ||
10:26
Aaronepower left
10:31
setty1 left
10:35
Sgeo_ joined
10:36
robertle joined
10:37
Sgeo left
|
|||
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 | ||
10:39
TEttinger left
|
|||
Xliff | Fix it later. Eyes gone droopy. | 10:41 | |
11:03
astj joined
|
|||
timotimo | it's not missing the "is rw", is it? | 11:05 | |
11:13
astj left
|
|||
Zoffix | . | 11:28 | |
11:29
rindolf left
11:30
leont joined
11:32
leah2 joined
|
|||
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 | ||
11:36
astj joined,
geekosaur left
|
|||
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 | |
11:39
astj left
11:40
geekosaur joined
11:44
andrzejku_ joined
11:52
ShalokShalom_ joined
|
|||
Zoffix | oh, the error talks about `$self` | 11:55 | |
11:55
ShalokShalom left
|
|||
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 | |
12:00
Rawriful joined
|
|||
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 | ||
12:14
Cabanossi left
12:16
Cabanossi joined
|
|||
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 | |||
12:19
SourceBaby left,
[ptc] left,
Util left,
synopsebot6 left,
JimmyZ left,
tojo left,
sergot left,
dalek joined,
ChanServ sets mode: +v dalek,
synopsebot6 joined,
ChanServ sets mode: +v synopsebot6
12:21
SourceBaby joined,
ChanServ sets mode: +v SourceBaby
|
|||
MasterDuke | "Can only subst-mutate writable containers, but got Int value (42) instead"? | 12:26 | |
12:26
leont_ joined,
leont left
12:27
leont_ is now known as leont,
leont left,
leont joined
|
|||
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 | ||
12:30
domidumont left
12:38
llfourn joined
12:39
ShalokShalom_ left
12:40
leont left
|
|||
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 | |
12:44
wander4096 joined,
nowan left
|
|||
MasterDuke | hm, i thought there was some logic about that already | 12:44 | |
12:45
Aaronepower joined
|
|||
MasterDuke | but i'll take a look | 12:46 | |
12:47
mr-fooba_ left
|
|||
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 | |
12:48
cdg joined
|
|||
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 | ||
12:50
mr-foobar joined
|
|||
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 | ||
12:51
HoboWithAShotgun left
|
|||
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 | ||
12:54
HoboWithAShotgun joined,
mryan55 joined,
Util joined
12:58
astj joined
12:59
leont joined
13:03
astj left
13:05
HoboWithAShotgun left
13:06
cdg left
13:11
geekosaur left
13:12
HoboWithAShotgun joined
|
|||
Geth | doc: tbrowder++ created pull request #1575: add new doc for an enum example |
13:19 | |
13:20
geekosaur joined
|
|||
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 | ||
13:33
sena_kun joined
|
|||
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 | |
13:44
nowan joined
13:46
Sgeo joined
13:47
mr-foobar left
13:48
Sgeo__ joined
13:49
Sgeo_ left
13:50
mr-foobar joined
13:51
Sgeo left
13:53
kyan joined,
rindolf joined
13:57
HoboWithAShotgun left
13:58
mryan55 left,
skids joined
13:59
geekosaur left
14:11
geekosaur joined
14:12
cdg joined
14:16
mr-foobar left
14:17
cdg left
14:20
mr-foobar joined
14:22
Sgeo_ joined
|
|||
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 | |
14:25
Sgeo__ left
14:28
geekosaur left
14:30
Grauwolf left,
Sgeo_ left,
Morfent joined
14:31
audiatorix joined
|
|||
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 | |||
14:34
Sgeo_ joined
|
|||
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 | |
14:36
astj joined
|
|||
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 | |||
14:40
astj left
|
|||
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 | ||
14:41
geekosaur joined
|
|||
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 | ||
14:42
HoboWithAShotgun joined
|
|||
audiatorix | with rakudo 2017.04 | 14:42 | |
sena_kun | perl6 --version? | ||
14:43
Sgeo_ left
|
|||
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 | |||
14:45
audiatorix left
14:48
mr-foobar left
14:51
mr-foobar joined
14:54
HoboWithAShotgun left
14:59
Cabanossi left
15:02
Cabanossi joined,
espadrine joined
15:05
Sgeo joined
15:06
El_Che left
15:12
Grauwolf joined
15:18
pilne joined
15:21
Sgeo_ joined
15:23
Sgeo left
|
|||
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 | |
15:27
wamba left
15:28
geekosaur left
15:29
geekosaur joined
15:30
skids left
15:34
skids joined
15:40
astj joined,
Guest51796 left
15:42
Guest51796 joined
15:44
astj left
15:50
HoboWithAShotgun joined
15:52
Guest51796 left,
skids left
15:53
Guest51796 joined
|
|||
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 | |
16:03
rngoodn joined
|
|||
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 | |
16:08
HoboWithAShotgun left
|
|||
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 | ||
16:10
gdonald left
16:14
HoboWithAShotgun joined
16:17
mr-foobar left
16:19
mr-foobar joined
16:25
rngoodn left
16:27
khw joined,
HoboWithAShotgun left
16:38
schmause joined
16:48
BenGoldberg joined,
mr-foobar left
16:50
mr-foobar joined
17:00
Grauwolf left
17:04
Grauwolf joined,
Grauwolf left,
Grauwolf joined
|
|||
wander4096 | `$()` has no docs | 17:05 | |
what is the usage of `$()` | 17:06 | ||
i saw it in try MyGrammar.parse(...); if $/ { say $(); } | |||
17:09
setty1 joined
|
|||
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 | |||
17:14
wamba joined
|
|||
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 | |||
17:17
HoboWithAShotgun joined
|
|||
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" | |||
17:18
mr-foobar left
|
|||
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 | |||
17:22
mr-foobar joined
|
|||
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! | |||
17:36
Sgeo__ joined
|
|||
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>); | |||
17:37
eliasr joined
|
|||
Zoffix | $*blah are dynamic variables available via dynamic scope, so `method block` will see it up the callstack from <- foo <- parse | 17:38 | |
17:38
Sgeo_ left
|
|||
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 |
||
17:42
HoboWithAShotgun left
17:46
nadim left
17:49
mr-foobar left
17:50
BenGoldberg left
17:52
mr-foobar joined
|
|||
wander4096 | thanks to Zoffix, timotimo and leont, although i still need some time to handle that >_< | 17:54 | |
17:54
devmikey joined
17:57
araujo left
17:59
araujo joined
18:06
thou joined
18:07
pilne left
18:10
ShalokShalom_ joined
18:11
pecastro left
18:12
lizmat_ joined,
HoboWithAShotgun joined
18:13
lizmat left
|
|||
thou | Zoffix++ (for On Troll Hugging, Hole Digging, and Improving Open Source Communities)! | 18:14 | |
18:14
xxpor left
|
|||
Zoffix | \o/ | 18:15 | |
18:15
astj joined
18:16
xxpor joined
18:17
mr-foobar left
18:18
nadim joined
18:20
astj left
18:21
mr-foobar joined
18:28
pecastro joined
18:37
El_Che joined
18:45
Cabanossi left
18:46
Cabanossi joined
18:47
mr-foobar left
18:51
mr-foobar joined
18:56
ShalokShalom_ is now known as ShalokShalom
19:04
nadim left
|
|||
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 | ||
19:15
Cabanossi left
19:16
Cabanossi joined
|
|||
Zoffix thinks it's not a bug | 19:17 | ||
Oh nevermind | |||
m: { say $++ }() for ^5 | |||
camelia | 0 0 0 0 0 |
||
19:17
mr-foobar left
|
|||
Zoffix shrugs | 19:17 | ||
19:21
mr-foobar joined
19:33
potheads left
19:35
darutoko left
19:41
lizmat_ is now known as lizmat
19:42
schmause left
19:47
mr-foobar left
19:50
mr-foobar joined
19:54
cdg joined
19:59
cdg left
20:01
ufobat joined
20:06
astj joined
20:11
astj left
20:12
andrzejku_ left
20:13
rngoodn joined
20:15
|oLa|1 joined
20:16
AlexDaniel joined,
|oLa| left
20:18
mr-foobar left,
devmikey left
20:20
devmikey joined
20:21
mr-foobar joined
20:23
setty1 left
20:26
TEttinger joined
|
|||
gfldex | m: { say "" ~ $++ ~ "" } for ^10 | 20:27 | |
camelia | 0 1 2 3 4 5 6 7 8 9 |
||
20:41
rngoodn left
|
|||
AlexDaniel | m: say(""~$++~"")xx⁹ | 20:41 | |
camelia | 0 1 2 3 4 5 6 7 8 |
||
20:42
nhywyll joined
20:46
mr-fooba_ joined
|
|||
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 | |
20:48
mr-foobar left
20:49
Mrofnet joined
|
|||
AlexDaniel | kyan: not yet! But we have this page: docs.perl6.org/language/traps | 20:50 | |
kyan | AlexDaniel: cool, thanks! | 20:51 | |
20:51
Morfent left
20:59
ufobat left
21:01
Cabanossi left,
Cabanossi joined
21:07
HoboWithAShotgun left
21:09
Ven`` left
21:11
Ven`` joined
21:14
Rawriful left
|
|||
[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 | ||
21:27
sena_kun left,
rngoodn joined
21:29
nadim joined
|
|||
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 | |
21:32
Guest51796 left
21:43
Rawriful joined,
raschipi joined
21:48
Rawriful left
21:49
Rawriful joined
21:51
geekosaur left
21:52
devmikey left
21:54
Lac123 joined
|
|||
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 | |
21:59
espadrine left
|
|||
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) | |||
22:02
Sgeo__ left,
geekosaur joined
|
|||
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 | |
22:11
gfldex left
22:17
gfldex joined
22:22
Sgeo joined
22:31
leont left
22:33
rindolf left
22:34
wamba left
22:43
Cabanossi left
22:45
geekosaur left
22:46
cdg joined
22:47
Cabanossi joined
22:50
cdg left
22:52
geekosaur joined
22:56
labster left
22:57
labster joined
23:03
rngoodn left
23:05
El_Che left
23:21
nhywyll left
|
|||
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 | |
23:24
rngoodn joined
|
|||
kyan | ...oh, I never posted the problem. D'oh. Here it is: gist.github.com/ethus3h/e13fbc9aaa...37a45cdd88 | 23:28 | |
23:29
itaipu joined
|
|||
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. :) | |||
23:32
wamba joined,
rngoodn left
|
|||
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 | |
23:52
nadim left
|
|||
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 | |||
23:58
margeas left
|
|||
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 |