»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋 Set by Zoffix on 25 July 2018. |
|||
irced | m: for <'bleh' blah bloop' 'bleep meep> { say $_ } | 00:01 | |
camelia | 'bleh' blah bloop' 'bleep meep |
||
irced | m: for <'bleh' blah bloop' 'bleep meep> { say $_ ~~ / .* / } | 00:02 | |
camelia | 「'bleh'」 「blah」 「bloop'」 「'bleep」 「meep」 |
||
00:02
rindolf left
|
|||
irced | m: for <'bleh' blah bloop' 'bleep meep> { say $_ ~~ / <[']>? (.*) <[']>? / } | 00:02 | |
camelia | 「'bleh'」 0 => 「bleh'」 「blah」 0 => 「blah」 「bloop'」 0 => 「bloop'」 「'bleep」 0 => 「bleep」 「meep」 0 => 「meep」 |
||
irced eyes cross. | 00:03 | ||
m: for <'bleh' blah bloop' 'bleep meep> { $_ ~~ / <[']>? (.*) <[']>? /; say ~$0; } | 00:04 | ||
camelia | bleh' blah bloop' bleep meep |
||
00:04
pecastro left
|
|||
irced | m: for <'bleh' blah bloop' 'bleep meep> { $_ ~~ / <[']>? (.*) <[']>? /; say ~$1; } | 00:05 | |
camelia | Use of Nil in string context in block at <tmp> line 1 Use of Nil in string context in block at <tmp> line 1 Use of Nil in string context in block at <tmp> line 1 Use of Nil in string context in block at <tmp> l… |
||
irced | m: for <'bleh' blah bloop' 'bleep meep> { $_ ~~ / <[']>? ([^']*) <[']>? /; say ~$0; } | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in metachar:sym<( )>; couldn't find final ')' (corresponding starter was at line 1) at <tmp>:1 ------> 3leep meep> { $_ ~~ / <[']>? ([^']*) <[']7⏏5>? /; say ~$0; }… |
||
irced | m: for <'bleh' blah bloop' 'bleep meep> { $_ ~~ / <[']>? (<-[']>*) <[']>? /; say $0; } | 00:06 | |
camelia | 「bleh」 「blah」 「bloop」 「bleep」 「meep」 |
00:07 | |
irced | that's somewhat perly | ||
maybe I can go sed on it | |||
but i'll spare you the spam, any suggestions on making that more perly? | 00:08 | ||
00:08
kotrcka left
00:09
nepugia left
|
|||
timotimo | m: for <'bleh' blah bloop' 'bleep meep> { say m/"'"? <( .*? )> "'"? } | 00:09 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Couldn't find terminator / (corresponding / was at line 1) at <tmp>:1 ------> 3bleep meep> { say m/"'"? <( .*? )> "'"? 7⏏5} expecting any of: / |
||
timotimo | m: for <'bleh' blah bloop' 'bleep meep> { say m/"'"? <( .*? )> "'"?/.Str } | ||
camelia | |||
timotimo | m: for <'bleh' blah bloop' 'bleep meep> { say m/"'"? <( .*? )> "'"?/ } | ||
camelia | 「」 「」 「」 「」 「」 |
||
irced begins to applaud but stops mid air. | |||
timotimo | yeah that didn't work | 00:10 | |
m: for <'bleh' blah bloop' 'bleep meep> { say $_ ~~ /"'"? <( .*? )> "'"?/ } | |||
camelia | 「」 「」 「」 「」 「」 |
||
irced checks his watch. | |||
timotimo | m: for <'bleh' blah bloop' 'bleep meep> { say $_ ~~ /"'"? <( .* )> "'"?/ } | ||
camelia | 「bleh'」 「blah」 「bloop'」 「bleep」 「meep」 |
||
00:10
candr joined
|
|||
irced looks up from his watch face for an ephemeral moment. | 00:10 | ||
timotimo | the trim methods and subs are only for whitespace | 00:11 | |
m: for <'bleh' blah bloop' 'bleep meep> { say $_ ~~ /^"'"? <( .*? )> "'"?$/ } | 00:12 | ||
camelia | 「bleh」 「blah」 「bloop」 「bleep」 「meep」 |
||
timotimo | that's the important bit | ||
irced | hmm | ||
AlexDaniel | tobs: nice | ||
timotimo | anchoring it, else it'll just get the shortest match it can | 00:13 | |
irced golf claps. | |||
candr | does a nested module have access to it's parent's modules private subs and variables? or does it even make sense to nest modules in perl6? | ||
timotimo | "private" is something only methods have | 00:14 | |
subs meanwhile are usually lexically scoped | |||
irced | timotimo: upon inspection, that is indeed quite perly. thanks! | ||
i'll give the floor to candr though there are some wrinkles I think worth ironing | 00:15 | ||
timotimo | if you put the one module lexically into the other, then it will have access, too | 00:16 | |
candr | maybe a better question is this.. i want to break up some source code into multiple files and wars thinking of making a few new .pm6 files with a single module in each. Those modules need to share a few boolean variables though so i war thinking of making a module Foo with what needs to be shared and a then a Foo::A and Foo::B | 00:18 | |
timotimo | not sure what the bast way for that is, maybe it's better to have your users handle that? dunno | 00:25 | |
00:27
Manifest0 left
|
|||
thundergnat | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''" ~~ m:g| \w \w* [\S+ \w*]* \w |; # without other comment | 00:27 | |
camelia | (「bleh」 「blah」 「bloop」 「bleep」 「meep」 「can't」 「up-to-date」 「jack-o'-lantern」 「1990's」) | ||
thundergnat | actually, that probably should have been jack-'o-lantern. ah well, same, same. | 00:29 | |
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-latnern 1990's''" ~~ m:g| ^^"'"? <(.*?)> "'"?$$| | ||
camelia | (「bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-latnern 1990's'」) | ||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''" ~~ m:g| ^^"'"? <(.*?)> "'"?$$| | 00:30 | |
camelia | (「bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's'」) | ||
irced | ack | ||
err, that's right in a way tho | 00:31 | ||
00:31
Manifest0 joined
|
|||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''" ~~ m:| ^^"'"? <(.*?)> "'"?$$| | 00:31 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Colons may not be used to delimit quoting constructs at <tmp>:1 ------> 3to-date' jack-o'-lantern 1990's''" ~~ m:7⏏5| ^^"'"? <(.*?)> "'"?$$| expecting any of: colon pair (restr… |
||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''" ~~ / ^^"'"? <(.*?)> "'"?$$ / | ||
camelia | 「bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's'」 | ||
irced | thundergnat: good work, still dissecting it thanks | 00:32 | |
m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ") ~~ / ^^"'"? <(.*?)> "'"?$$ / | 00:33 | ||
camelia | 「bleh」 | ||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ").lines ~~ / ^^"'"? <(.*?)> "'"?$$ / | ||
camelia | 「bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's'」 | ||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ").lines ~~ / ^^"'"? <(.*)> "'"?$$ / | 00:35 | |
camelia | 「bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''」 | ||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ").lines ~~ / ^^"'"? <(-[ ' ])> "'"?$$ / | ||
camelia | 5===SORRY!5=== Unrecognized regex metacharacter - (must be quoted to match literally) at <tmp>:1 ------> 03990's''".split(" ").lines ~~ / ^^"'"? <(7⏏5-[ ' ])> "'"?$$ / Unable to parse regex; couldn't find final '/' at <tmp>:1 ---… |
||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ").lines ~~ / ^^"'"? (<-[ ' ]>) "'"?$$ / | ||
camelia | Nil | ||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ").lines ~~ / ^^"'"? (<-[ ' ]>*) "'"?$$ / | 00:36 | |
camelia | Nil | ||
irced | m: say "'bleh' blah bloop' 'bleep meep 'can't' '''''up-to-date' jack-o'-lantern 1990's''".split(" ").lines ~~ / ^^"'"? (<-[ ' ]*>) "'"?$$ / | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in metachar:sym<assert>; couldn't find final '>' (corresponding starter was at line 1) at <tmp>:1 ------> 3'".split(" ").lines ~~ / ^^"'"? (<-[ ' ]7⏏5*>) "'"?$$ / |
||
irced | anywayz | ||
thanks all | |||
00:42
aborazmeh left,
reach_satori_ joined
00:48
Manifest0 left
00:53
Manifest0 joined
01:00
Manifest0 left
|
|||
AlexDaniel | m: my $s = (1…∞); say $s.iterator.pull-one; say $s.iterator.pull-one | 01:01 | |
camelia | 1 The iterator of this Seq is already in use/consumed by another Seq (you might solve this by adding .cache on usages of the Seq, or by assigning the Seq into an array) in block <unit> at <tmp> line 1 |
||
AlexDaniel | eh, what am I missing? I want to pull values from $s one by one when I need | ||
so I can store the iterator, right, but… I'm not sure that I like that | |||
m: my $s = (1…∞); say $s[0]; say $s.skip(1) | 01:03 | ||
camelia | 1 (...) |
||
AlexDaniel | m: my $s = (1…∞); say $s[0]; say $s.skip(1); say $s[0]; say $s.skip(1) | ||
camelia | 1 (...) 1 (...) |
||
AlexDaniel | whoops, not what I wanted :) | ||
thundergnat | m: my $s = cache (1…∞); say $s.iterator.pull-one; say $s.iterator.pull-one | 01:04 | |
camelia | 1 1 |
||
AlexDaniel | thundergnat: no, I don't want caching | ||
thundergnat | Right but pulling one didn't change the sequence. | ||
returned 1 each time. | |||
01:04
empee0 left
01:05
Manifest0 joined
|
|||
AlexDaniel | thundergnat: it kinda did, except that it gave you a new iterator for the cached Seq | 01:05 | |
thundergnat | Ah. D'oh. Right. | 01:06 | |
AlexDaniel | m: my $s = (1…∞); $it = $s.iterator; $it.pull-one; say Seq.new($it) | 01:07 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$it' is not declared at <tmp>:1 ------> 3my $s = (1…∞); 7⏏5$it = $s.iterator; $it.pull-one; say Seq |
||
AlexDaniel | m: my $s = (1…∞); my $it = $s.iterator; $it.pull-one; say Seq.new($it) | ||
camelia | (...) | ||
AlexDaniel | m: my $s = (1…∞); my $it = $s.iterator; say $it.pull-one; say Seq.new($it)[^10] | ||
camelia | 1 (2 3 4 5 6 7 8 9 10 11) |
||
AlexDaniel | ok so I need to rewrap the iterator? | ||
I don't mind that, I guess… | |||
01:11
khisanth_ left
01:12
Manifest0 left
01:17
noisegul_ joined
01:19
Manifest0 joined
01:21
noisegul left
01:24
khisanth_ joined
01:30
Manifest0 left
01:31
kaare_ joined
|
|||
tobs | AlexDaniel: that seems to be required, yeah. I once did this github.com/taboege/p6-Seq-Partial (without putting it into the ecosystem it seems :/) | 01:33 | |
irced | anywayz | 01:34 | |
01:34
molaf left
|
|||
irced | i ended up using the UCD code point quote as in my $regex-pattern = rx / ^<:!quote>? (.*?) <:!quote>? /; | 01:36 | |
01:37
Manifest0 joined
|
|||
irced | which covers the other quote character as well | 01:38 | |
amazingly, but i can't see where it's explicitly documented at www.unicode.org | 01:43 | ||
01:45
Manifest0 left
|
|||
irced | any1 know where the exhaustive list of such names Unicode properties can be found? | 01:47 | |
01:47
molaf joined
01:50
Manifest0 joined
|
|||
vrurg | irced: did you try wikipedia's 'unicode character property' topic? There is a link to a PDF at the references section. Could be what you're looking for. | 01:50 | |
irced | vrurg: cool let me see | ||
vrurg | To justify myself: I googled it! ;) | 01:51 | |
I mean, to excuse myself... | 01:52 | ||
irced | vrurg: I don't see it in there | ||
vrurg | www.unicode.org/versions/Unicode12.0.0/ch04.pdf – this one? | 01:53 | |
irced | vrurg: i tried duck duck go on some working names | ||
vrurg | en.wikipedia.org/wiki/Unicode_char...r_property | ||
irced | vrug: yep yep | ||
vrurg | The wiki page might have even more info. | 01:54 | |
vrurg still prefers google over duckduck due to better relevance | |||
irced | oh, I am allergic to google and microsoft. | 01:55 | |
found something that might work with perl6 | 01:58 | ||
found something that might work with perl6 | 02:00 | ||
02:01
jaldhar left
|
|||
irced | nope, could only find the code points for specific unicode, I am interested in these names that cover complex matches i.e. several code points lumped into one | 02:02 | |
i see many code points that can match via \c[LONG NAME FOR UNICODE] | |||
which is cool, so thanks for the help | 02:03 | ||
AlexDaniel | m: my $i = 3; my $it = ((1…∞).rotor(1 => 1).flat.rotor(2 => 1).flat).skip(2).iterator; say (1, 3, { $i++; my $val = $it.pull-one; $it = Seq.new($it).rotor($val - $i => 1, ($val - 1 => 1) xx ∞).flat.iterator; $val} … ∞)[^100] | 02:05 | |
camelia | (1 3 7 9 13 15 21 25 31 33 37 43 49 51 63 67 69 73 75 79 87 93 99 105 111 115 127 129 133 135 141 151 159 163 169 171 189 193 195 201 205 211 219 223 231 235 237 241 259 261 267 273 283 285 289 297 303 307 319 321 327 331 339 349 357 361 367 385 391 3… | ||
irced | vrurg: i also see some ranges so that's cool. | ||
AlexDaniel | .tell lizmat maybe this is a good benchmark: colabti.org/irclogger/irclogger_lo...07-06#l154 | 02:06 | |
yoleaux | AlexDaniel: I'll pass your message to lizmat. | ||
irced | in fact, looks like i was mistaken about the specific named property :quote | ||
AlexDaniel | .tell lizmat it's really slow but I don't think it should be | ||
yoleaux | AlexDaniel: I'll pass your message to lizmat. | ||
candr | if i have an `our class A` in a `module Foo`, how can I bring A into the current scope? if I `use Foo` i need to access A with Foo::A everywhere. I don't want to `class A is export` in Foo because that forces it into the current scope which doesn't always seem appropriate. I would think there is something `use Foo::A` or `from Foo use A` .... can't | ||
find it in the docs though... | |||
irced | nevertheless, such named properties are available in perl6 without \c[CODE POINT NAME] via <:concise property name> | ||
vrurg | candr: use import classes. like is export(:FOO) | 02:08 | |
irced: I didn't work that much with unicode classes. Usually I'm ok with what's documented for Regex'es. | 02:09 | ||
irced | vrurg: you helped me get a more proper solution anyway as follows | 02:11 | |
candr | So if i want to be able to arbitrarily bring any thing from Foo into the current scope I have to assign a separate import class to every "our" in the module ahead of time? Seems... redundant... | ||
irced | my regex quote { <[\c[QUOTATION MARK]\c[APOSTROPHE]]> }; my $regex-pat = rx / ^<quote>? (.*?) <quote>?$ /; ~~ $regex-pattern etc. i yield for other discussions now. | 02:12 | |
vrurg | candr: Look at docs.perl6.org/language/modules#is_export – perhaps you'll have some better ideas. Besides, you can always define your own EXPORT sub for the purpose. | 02:13 | |
candr: moreover, EXPORT would be the best solution for you, perhaps. | |||
candr | i am just not liking how export leaves to trace as to where something came from... seems like that could get confusing quick... | 02:15 | |
02:15
MasterDuke left
|
|||
AlexDaniel | .tell lizmat I looked at the profile but I don't see anything obvious. I think it's an interesting case, unless I'm missing something obvious, it should be just a bunch of iterators glued together in interesting ways. The logic basically skips values at certain indexes (that's it!). Even though it's not fun to have 100 iterators on top of each other, it should still be really really fast. | 02:16 | |
yoleaux | AlexDaniel: I'll pass your message to lizmat. | ||
vrurg | candr: Usually it doesn't. | ||
candr: If one needs to know where something came from then there're ways to introspect concrete objects and type objects as well. | 02:17 | ||
candr | just seems like you should be able to know where something came from by just reading the source code... either from the use statement or by a fully qualified name. | 02:21 | |
"Note: there currently is no way for the user to import a single object if the module author hasn't made provision for that, and it is not an easy task at the moment (see RT #127305). One way the author can provide such access is to give each export trait its own unique tag. (And the tag can be the object name!)." | |||
synopsebot | RT#127305 [open]: rt.perl.org/Ticket/Display.html?id=127305 EXPORT ignored when unit module/package is used | ||
candr | ^ found that in the docs | ||
seems it has been thought of, but is a tricky issue... | 02:22 | ||
vrurg | candr: That ticket is not valid. EXPORT must be defined outside of any module/package/class declaration. | 02:23 | |
Note that EXPORT can be multi. With that one has numerous possibilities of exporting symbols in any combinations, including aliasing and re-exporting from other modules. That's pretty much enough, I think. | 02:24 | ||
candr: You can have a look at Red sources. It's using EXPORT and does't pretty much in a self-explanatory way. | 02:25 | ||
s/does't/doest it/ | 02:26 | ||
candr | I'll take a look... it does seem to have a similar file structure as what I am working on now.. | 02:28 | |
02:30
irced left
|
|||
candr | thanks vrurg | 02:30 | |
vrurg | candr: welcome :) | 02:31 | |
02:41
Cabanossi joined
02:42
Manifest0 left,
Cabanoss- left
02:47
Manifest0 joined
02:54
jaldhar joined,
Manifest0 left
03:00
candr left,
Manifest0 joined
03:02
kaare_ left
03:06
jaldhar left,
jaldhar joined
|
|||
AlexDaniel | .tell lizmat here's a more readable version: github.com/ajs/perl6-Math-Sequence...69f6c12b8d | 03:10 | |
yoleaux | AlexDaniel: I'll pass your message to lizmat. | ||
03:23
Manifest0 left
03:29
Manifest0 joined
03:36
Manifest0 left
03:37
candr joined
|
|||
candr | Ok I must be missing something simple.. I have a Foo.pm6 with a module Foo and an `our sub a()` in the module... from main.p6 I `use Foo;` and call the sub with `Foo::a;` , but get a runtime error: Could not find symbol '&a' | 03:40 | |
03:41
Manifest0 joined
03:45
Manifest0 left
03:52
Manifest0 joined
03:56
Manifest0 left
|
|||
candr | interesting... seems to be a conflict in use... i have some other modules that use the one i need and when i comment those out the sub is found... seems like i might need the equivelent of #ifndef #define.... guards... so modules don't get used more than once... | 03:58 | |
AlexDaniel | candr: it should be working just fine | 03:59 | |
candr: can you golf it? | 04:00 | ||
what's the minimal set of files to reproduce the issue? | |||
candr | yeah... let me write something up... | ||
04:02
dominix_ joined,
Manifest0 joined
|
|||
AlexDaniel | I need to get some sleep, will check it later | 04:04 | |
04:05
dominix__ left
04:06
Manifest0 left
|
|||
candr | I got a minimal test if you have just a sec... it is interesting... seems module order also matters... | 04:11 | |
04:11
Manifest0 joined
|
|||
candr | pastebin.com/yvcgzjza | 04:16 | |
main.p6 (pastebin.com/yvcgzjza) Foo.pm6 (pastebin.com/gFs5whC6) Foo_Bar.pm6 (pastebin.com/XVa9UJF0) | 04:17 | ||
oh shoot... I think I just figured it out... I think I need `use lib` in Foo_Bar also .... | 04:19 | ||
nope... that gives another error ... 'use lib' may not be pre-compiled | 04:20 | ||
ah got it.... the `use Foo;` in Foo_Bar.pm6 needs to be outside of the module. | 04:24 | ||
04:54
marmor joined
05:05
Manifest0 left
05:09
Manifest0 joined
05:17
candr left
05:22
Manifest0 left
05:25
marmor left
05:26
Manifest0 joined
05:31
Manifest0 left
05:37
Manifest0 joined,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
05:45
domidumont joined
05:49
Manifest0 left
05:51
molaf left,
ryn1x joined
|
|||
ryn1x | is this a bug? gist.github.com/ryn1x/360e63f89075...879ffc507a | 05:54 | |
05:55
ryn1x left,
ryn1x joined,
Manifest0 joined
|
|||
ryn1x | using the traditional if statement works fine, but the postfix style errors with a strange List error... | 05:56 | |
06:04
Manifest0 left
06:07
lizmat left
|
|||
Kaiepi | m: module M { our sub foo { say 'foo' } }; M::foo() if 1 | 06:07 | |
camelia | Cannot find method 'Nil' on object of type List in block <unit> at <tmp> line 1 |
||
Kaiepi | oh | ||
m: module M { our sub foo { say 'foo' } }; &M::foo() if 1 | |||
camelia | foo | ||
Kaiepi | that's how you use it ryn1x | ||
the problem is `our sub foo` is actually named &foo | 06:08 | ||
m: module M { OUR::<foo> := anon sub foo { say 'foo' } }; M::foo if 1 | 06:09 | ||
camelia | Could not find symbol '&foo' in block <unit> at <tmp> line 1 |
||
06:09
Manifest0 joined
|
|||
ryn1x | ah ok... but the & is only required with the if... | 06:09 | |
06:10
marmor joined
|
|||
Kaiepi | m: module M { our sub foo { say 'foo' } }; M::foo | 06:10 | |
camelia | foo | ||
ryn1x | something about the postfix if needs it's "real" name... | ||
Kaiepi | hm | ||
06:13
domidumont left
|
|||
Kaiepi | m: module M { OUR::<foo> := anon sub { say 'foo' } }; M::foo | 06:14 | |
camelia | Could not find symbol '&foo' in block <unit> at <tmp> line 1 |
||
Kaiepi | m: module M { OUR::<foo> := anon sub { say 'foo' } }; M::foo() | ||
camelia | Could not find symbol '&foo' in block <unit> at <tmp> line 1 |
||
06:14
domidumont joined
|
|||
Kaiepi | m: module M { BEGIN OUR::<foo> := anon sub { say 'foo' } }; M::foo() | 06:14 | |
camelia | foo | ||
Kaiepi | m: module M { BEGIN OUR::<foo> := anon sub { say 'foo' } }; M::foo | ||
camelia | WARNINGS for <tmp>: Useless use of constant value M::foo in sink context (line 1) |
||
Kaiepi | m: module M { BEGIN OUR::<foo> := anon sub { say 'foo' } }; M::foo() if 1 | 06:15 | |
camelia | foo | ||
Kaiepi | there's another way to go about it | ||
06:16
Manifest0 left,
domidumont left
|
|||
ryn1x | adding the & works fine... I just wonder if the inconstancy is a bug... | 06:16 | |
06:20
Manifest0 joined
|
|||
Kaiepi | possibly | 06:22 | |
it's hard to say until someone more familiar with that part of perl 6's internals logs in | |||
06:25
marmor left
06:35
kybr left
06:37
Manifest0 left
06:38
kybr joined
|
|||
ryn1x | github.com/rakudo/rakudo/issues/3034 opened an issue just in case | 06:38 | |
06:39
lizmat joined
06:42
Manifest0 joined
06:47
Manifest0 left
|
|||
ryn1x | huh... not only do you need to add the & when calling the sub with the if statement modifier, but you also have to add the parens.... without the parens there is no error, but the sub does not do anything.... | 06:48 | |
06:48
rindolf joined
06:51
Manifest0 joined
06:58
Manifest0 left
07:01
lizmat left
07:03
Manifest0 joined
07:08
Manifest0 left
07:10
antoniogamiz joined
07:12
MasterDuke joined
07:14
Manifest0 joined
07:18
domidumont joined
07:21
Manifest0 left
07:25
marmor joined,
Manifest0 joined
07:26
vrurg left
07:34
marmor left,
domidumont left
07:35
domidumont joined
07:44
Manifest0 left
07:47
Celelibi left,
domidumont left
07:49
Manifest0 joined
08:02
molaf joined
08:09
aborazmeh left
08:18
telex left
08:19
Manifest0 left,
telex joined
08:24
Manifest0 joined
08:31
Manifest0 left
08:38
Manifest0 joined
08:42
lancew joined
08:43
molaf left
08:49
Manifest0 left
08:54
Manifest0 joined
08:55
antoniogamiz left
08:57
ryn1x left
09:00
antoniogamiz joined,
antoniogamiz left
09:06
Manifest0 left
09:12
Manifest0 joined
09:14
rfold joined
09:16
Manifest0 left
09:17
kylese joined
09:20
mniip left
09:21
Manifest0 joined
09:29
kylese left,
kylese joined
09:31
Manifest0 left
09:35
Manifest0 joined
09:40
Manifest0 left
09:41
kylese left
09:44
Kaiepi left
09:45
Manifest0 joined,
Kaiepi joined
09:46
Sgeo__ joined
09:49
Sgeo_ left
09:50
sena_kun joined
09:51
Manifest0 left
10:00
Manifest0 joined
10:01
Kaiepi left
10:05
Kaiepi joined
10:07
nepugia joined
10:21
Kaiepi left,
Kaiepi joined
10:24
Black_Ribbon left
10:29
Manifest0 left
10:37
Manifest0 joined
10:38
Kaiepi left
10:39
Kaiepi joined
10:45
Manifest0 left
10:49
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
Manifest0 joined
10:54
Manifest0 left
11:01
Manifest0 joined
|
|||
Kaiepi | > wcswidth "\c[FACE WITH TEARS OF JOY]\0", 1 | 11:10 | |
4294967295 | |||
still really buggy but wide string support for nativecall is coming along! | 11:11 | ||
11:11
Manifest0 left
|
|||
AlexDaniel | squashable6: status | 11:15 | |
11:15
lancew left
|
|||
squashable6 | AlexDaniel, 🍕🍕 SQUASHathon is in progress! The end of the event in 1 day and ≈2 hours. See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | 11:15 | |
Kaiepi | how can i pass NULL to a nativecall sub that takes a string? | ||
11:17
lancew joined
|
|||
timotimo | just pass Str | 11:19 | |
11:20
Manifest0 joined
|
|||
Kaiepi | thanks | 11:21 | |
11:23
pecastro joined
11:30
Manifest0 left
11:35
Manifest0 joined
11:39
Manifest0 left
|
|||
AlexDaniel | aaand I just merged a bunch of PRs | 11:43 | |
11:46
Manifest0 joined
|
|||
lancew | :) | 11:51 | |
lucs | My perl6 is installed by root. | 11:53 | |
I can install a module as non-root with 'zef --install-to=/some/dir install Some::Module'. | |||
How do I make the module visible to my programs; something like PERL6LIB=...? | |||
Is this the correct approach? | 11:54 | ||
12:01
Manifest0 left
12:06
Manifest0 joined
|
|||
ugexe | ryn1x: my &foo — how else would one test this for truth *without* invoking it? | 12:09 | |
hence needing to invoke it to test the result | 12:10 | ||
otherwise yku are testing the symbol for truth not the result | 12:11 | ||
12:17
noisegul_ left,
Manifest0 left
12:18
kaare_ joined,
lancew left
12:19
marmor joined,
aborazmeh left
12:22
Manifest0 joined
12:26
goon_ left,
Manifest0 left
12:33
Manifest0 joined
12:40
kaare_ left,
marmor left
12:41
denis666 joined
12:43
denis666 left
|
|||
lucs | ...? | 12:43 | |
El_Che | .tell lizmat: sungo.wtf/2019/07/05/leaving-irc.perl.org.html | 12:45 | |
yoleaux | El_Che: What kind of a name is "lizmat:"?! | ||
El_Che | .tell lizmat sungo.wtf/2019/07/05/leaving-irc.perl.org.html | ||
yoleaux | El_Che: I'll pass your message to lizmat. | ||
timotimo | lucs: i think you address it with -I inst#/some/dir | 12:47 | |
lucs | timotimo: I'm kinda looking for a solution where I don't have to specify the directory on each invocation. | 12:49 | |
Also, what if I install more than one module locally? | 12:50 | ||
AlexDaniel | wheeeew I think things are alright now | 12:55 | |
there's a lot of fun going on in github.com/ajs/perl6-Math-Sequences :) | |||
please join :) | |||
sena_kun | AlexDaniel++ | 12:56 | |
AlexDaniel | we might not have a webhook but that's not going to stop us :) | ||
13:00
Manifest0 left
13:01
jeromelanteri joined
|
|||
lucs attempts a cheap trick... | 13:04 | ||
So I guess it's impossible to install modules locally and to have them visible by default to my (root owned) perl6 executable, eh. | |||
El_Che | export PERL6LIB ? | ||
(didn't read the backlog) | |||
thundergnat | AlexDaniel: It may be worth putting up a file somewhere editable like this: gist.github.com/thundergnat/474ec2...f3f4bbad7d so people can "claim" a sequence and not step all over each other. | 13:05 | |
And update it every time you push. | |||
13:06
Manifest0 joined
|
|||
lucs | El_Che: Yeah, something like that, but not sure how. | 13:06 | |
El_Che | lucs: yeah, the infamous sha1 | 13:07 | |
woolfy | Claudio Ramirez: Thanks, that is one heavy blog by sungo... wow... Anyway lizmat is on the road driving home from another country after 4 days of intense work and she might not read / react soon. | 13:09 | |
13:09
marmor joined
|
|||
El_Che | woolfy: hi, have fun. Take some time to decompress! | 13:09 | |
woolfy | Claudio Ramirez: I am at home, not with lizmat (does not happen often that we are 4 days apart from eachother, we both had different things to do), and I will make sure lizmat will take time to decompress. | 13:12 | |
El_Che | woolfy: good she's coming back then! | ||
13:13
marmor left
|
|||
timotimo | lucs: yeah, PERL6LIB will also accept that value | 13:16 | |
woolfy | Claudio Ramirez: indeed. | 13:18 | |
13:19
Manifest0 left
|
|||
AlexDaniel | thundergnat: maybe, or maybe we should just merge things faster | 13:19 | |
thundergnat | AlexDaniel: Or that. :-) | 13:20 | |
lucs | timotimo: Maybe I should have tried :/ Thanks, I'll let you know how it goes. | ||
AlexDaniel | thundergnat: I wonder, do you actually need `lazy` ? | 13:21 | |
timotimo | lucs: if ".say for $*REPO.repo-chain" outputs an inst# in your home, you can also probably use --to with that | 13:22 | |
MasterDuke | AlexDaniel: is there a way to tell what sequences are missing/wanted? | ||
AlexDaniel | MasterDuke: grep -B 1 '&NOSEQ ...' ./lib/Math/Sequences/Integer.pm6 | 13:23 | |
thundergnat | AlexDaniel: Some do, some don't. At least one of the sequences I added hung without it so I started adding it defensively. | ||
13:23
Manifest0 joined
|
|||
AlexDaniel | thundergnat: there are just 69 sequences that are not implemented yet. Should I file a ticket for each of them? | 13:23 | |
thundergnat | Or perhaps superstitiously may be a better term... | ||
AlexDaniel | thundergnat: that'd serve as a todo list and as a discussion platform… also with a mechanism to assign yourself :) | 13:24 | |
thundergnat | AlexDaniel: Seems like it might be helpful but I don't want to make more work for you (and JJ), you guys do a lot as it is. | 13:25 | |
AlexDaniel | that's just 3 pagefuls of tickets | ||
thundergnat | burnout is a thing | ||
AlexDaniel | well, I have a script! Let me try that | ||
thundergnat: says a person who implemented a jaw-dropping amount of sequences :) | 13:27 | ||
sena_kun agrees with thundergnat and wants to express gratitude for such amounts of work | |||
thundergnat | AlexDaniel: Yeah, but I'm not in public and don't have people expectantly watching me. | 13:29 | |
thundergnat watches expectantly :-) | |||
13:30
nepugia left
|
|||
lucs | timotimo: Makes sense. A problem I have: for personal project handling reasons, even as $USER, I change the value of $HOME a lot. | 13:31 | |
MasterDuke | AlexDaniel: i don't know. wasn't there some picture posted of you programming on the bus? that seems pretty public to me | ||
AlexDaniel | MasterDuke: yes :D | ||
lucs | Hmm... Maybe I can simply symlink those $HOME/.perl6 to /home/$USER/.perl6, that should work. | ||
AlexDaniel | thundergnat: what should I write in the ticket body? | 13:32 | |
qq:to/TEMPLATE/ | |||
Sequence [$sequence](oeis.org/$sequence) is not implemented yet. | |||
TEMPLATE | |||
anything else? | |||
13:32
rindolf left
|
|||
thundergnat | AlexDaniel: Um. Not really... Though it might be nice if you can capture the comment line above each unimplemented sequence. Has the common name for the sequence to ease wikipedia searching. I suppose users can get that from OEIS though. | 13:35 | |
tbrowder | AlexDaniel: i just submitted pr for math-seq | 13:36 | |
AlexDaniel | thundergnat: yeah, the name of the sequence is kinda important, I agree | 13:38 | |
thundergnat: let's see what info OEIS module can provide… | 13:39 | ||
13:39
rindolf joined
13:44
Manifest0 left
13:49
Manifest0 joined
|
|||
AlexDaniel | thundergnat: ok, more feedback please? gist.github.com/AlexDaniel/2c62bc0...ues-p6-L11 | 13:51 | |
thundergnat: like, I have access to all of the fields: modules.perl6.org/dist/OEIS:cpan:T...y.pm6#L232 | 13:52 | ||
so I can put anything in the ticket description | |||
13:52
mowcat joined
|
|||
thundergnat | AlexDaniel: That looks pretty good to me. Really, the critical parts to me are the ID, the NAME and a link directly to the oeis page. Everything else is going to be a little manual anyway as there is o much variation between sequences | 13:56 | |
* so | 13:57 | ||
tobs | AlexDaniel: I wish that module was more helpful already. OEIS supports searching for all sequences tagged 'core' for example (wrt github.com/ajs/perl6-Math-Sequence...08919554), but I couldn't design a cute interface to the advanced search syntaxes in time. | ||
AlexDaniel: other than that, this script would be really helpful. I had the same idea but suppressed it yesterday :/ | 14:00 | ||
AlexDaniel | tobs: testing it right now :) | ||
14:00
jeromelanteri left
|
|||
AlexDaniel | tobs: it's good that we first implemented a bunch of sequences before populating the ticket list, less spammy this way | 14:01 | |
tobs: is there a short name of some sort? | |||
tobs: right now the format of the issue title is like A000005 / d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n. | 14:02 | ||
tobs | this doesn't exist afaik. Struck me as something ajs came up with | ||
AlexDaniel | tobs: no way? They have no short identifiers whatsoever??? | 14:03 | |
tobs | let me double check | 14:04 | |
AlexDaniel: no, there is only the ID and the full name (oeis.org/eishelp1.html) | 14:05 | ||
AlexDaniel | yes, I guess you're right… ew | ||
alright | 14:06 | ||
MasterDuke: can't find that pic btw, somewhere on Zoffix's twitter I think. But it's really old, couldn't scroll that far | |||
tobs | I'll be back later, have to arrange and catch a train | 14:07 | |
AlexDaniel | thundergnat: anyway, ready for the first automated ticket? | 14:08 | |
thundergnat | AlexDaniel: There is a hash %oeis-core in ./lib/Math/Sequences/Integer.pm6 that has ajs's short names | ||
AlexDaniel | thundergnat: yeah but uh… do I want to import that and do a lookup? | ||
thundergnat | AlexDaniel: Woot! lay it on us! | ||
AlexDaniel | wait, let's try with short naes | ||
long titles are really annoying | 14:09 | ||
thundergnat watches expectantly. SCNR | |||
AlexDaniel | thundergnat: but is there a short-name <=> id mapping? | 14:10 | |
thundergnat | The hash is short_name => seq_id pairs. | 14:11 | |
in Integer.pm6, if that wasn't clear. | |||
AlexDaniel | thundergnat: the value is the variable, so maybe… | 14:12 | |
thundergnat | Could invert it and get id => short_name pretty easily | ||
AlexDaniel | thundergnat: there's no id, just the @ variable | 14:13 | |
I can format it with macros in emacs but I'd prefer something that can work live… | |||
m: say @foobar; say @foobar.VAR | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '@foobar' is not declared at <tmp>:1 ------> 3say 7⏏5@foobar; say @foobar.VAR |
||
AlexDaniel | m: my @foobar; say @foobar.VAR | ||
camelia | [] | ||
AlexDaniel | what's the trick to get the variable name? | 14:14 | |
Kaiepi | m: my @foobr; say @foobar.^name | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '@foobar' is not declared. Did you mean '@foobr'? at <tmp>:1 ------> 3my @foobr; say 7⏏5@foobar.^name |
||
sena_kun | .name | ||
Kaiepi | m: my @foobar; say @foobar.name | ||
camelia | @foobar | ||
sena_kun | m: my @foobar; say @foobar.VAR.name; | ||
camelia | @foobar | ||
Kaiepi | m: my @foobar; say @foobar.^name | ||
camelia | Array | ||
Kaiepi | oh right | 14:15 | |
AlexDaniel | weird I'm getting %oeis-core | 14:16 | |
it's like: our %oeis-core is export = ( "groups" => @A000001, ) | 14:17 | ||
and I want A000001 | |||
m: my @A000001; my @A000002; my %oeis-core = ("groups" => @A000001, "kolakoski" => @A000002,); for %oeis-core { say .value.VAR.name } | 14:18 | ||
camelia | %oeis-core %oeis-core |
||
MasterDuke | m: my @A000001; my @A000002; my %oeis-core = ("groups" => @A000001, "kolakoski" => @A000002,); for %oeis-core { say .value.name } | ||
camelia | @A000002 @A000001 |
||
AlexDaniel | pfffffffffft | 14:19 | |
14:19
HarmtH_ left
|
|||
AlexDaniel | MasterDuke: thank you :) | 14:19 | |
MasterDuke | heh | ||
14:19
HarmtH_ joined
|
|||
thundergnat | Ah. too slow. gist.github.com/thundergnat/e2021b...b3c7ccfdd4 | 14:21 | |
14:21
HarmtH_ is now known as HarmtH
|
|||
AlexDaniel | yeah I think it's just this or something: my %short-names = %oeis-core.map({.value.name.substr(1) => .key}); | 14:22 | |
thundergnat | alex | ||
14:22
goon_ joined
|
|||
AlexDaniel | yes? :) | 14:22 | |
thundergnat | AlexDaniel: ^^^ see above gist | ||
Sorry, fatfingers | 14:23 | ||
14:27
vrurg joined
|
|||
AlexDaniel | thundergnat: github.com/ajs/perl6-Math-Sequences/issues/52 | 14:27 | |
what do you think? | |||
the “name” has a dot at the end :S | |||
14:28
mniip joined
|
|||
AlexDaniel | thundergnat: github.com/ajs/perl6-Math-Sequences/issues/53 ? | 14:28 | |
thundergnat | AlexDaniel: Looks good to me. | 14:29 | |
MasterDuke | wow. the initial compile of Math::Sequences::Integer is slow!! | 14:30 | |
AlexDaniel | thundergnat: I can also put these keywords as labels. Should I? | ||
thundergnat | AlexDaniel: May be useful. Can't see how it would hurt. | 14:31 | |
MasterDuke | was it this slow for everybody else? `perl6 -I lib/ -e 'use Math::Sequences::Integer'` has been running for about 3 min now... | ||
thundergnat | Even after the squashathon, any tickets for sequences left undone will be useful for bookkeeping. | 14:32 | |
MasterDuke: Hmm. Compiled in about 25 seconds for me earlier. Sounds like there may be a sequence that needs a lazy. | 14:33 | ||
Let me try pulling again and compiling | |||
14:33
lancew joined
|
|||
AlexDaniel | MasterDuke: checkout an earlier version and measure again? Then bisect? | 14:36 | |
thundergnat | MasterDuke: I got a bunch of timeouts in individual sequences on latest master so something is up | ||
MasterDuke | took just a couple seconds at 082c440702f1c9db41d75614380ceb0d78143b52 | 14:39 | |
thundergnat | Hmm. I'm getting a timeout in A000793 that wasn't happening earlier. (only the one actualy) | ||
AlexDaniel | thundergnat: is there a description for OEIS keywords somewhere? | 14:42 | |
thundergnat: yeah, that test is ticketed here: github.com/ajs/perl6-Math-Sequences/issues/48 | |||
but nothing should be using that sequence during the compilation so I don't think it's the problem | 14:43 | ||
MasterDuke | huh. now HEAD just takes a couple seconds | ||
AlexDaniel | MasterDuke: heh… very precompiled now? :P | ||
MasterDuke: and if you purge your .precomp folder? | |||
MasterDuke | i rm -rf'ed lib/.precomp | ||
heh. seems the culprit is my change | 14:44 | ||
AlexDaniel | found it: oeis.org/wiki/Keywords | ||
thundergnat | AlexDaniel: Maybe the OEIS glossary? oeis.org/wiki/Index_to_OEIS:_Section_Cor <-- Core sequences entry | ||
Arrgh. to slow again. (and wrong too.) | |||
MasterDuke | -our @A000364 is export = 1, &NOSEQ ... *; | 14:45 | |
+our @A000364 is export = lazy @A000111[0, 2 ... *]; | |||
14:48
lancew left
14:53
Manifest0 left
|
|||
AlexDaniel | thundergnat: it works :) github.com/ajs/perl6-Math-Sequences/issues/55 | 14:58 | |
thundergnat | AlexDaniel: Cool! May not be strictly necessary but cool nonetheless. | 15:00 | |
MasterDuke | oh wow. `@A000111` is slow! `say @A000111[0]` is instant, but `say @A000111[1]` hasn't finished after a 1.5min | ||
AlexDaniel | github.com/ajs/perl6-Math-Sequences/issues | 15:02 | |
MasterDuke: ↑ which ones are not implemented yet :) | |||
thundergnat | MasterDuke: That sound suspicious. I would it expect it to get slow quickly, but not that quickly. | ||
MasterDuke | is it the same for you? | 15:03 | |
15:03
Manifest0 joined
|
|||
AlexDaniel | just imagine ajs coming back from vacation or whatever, and seeing what we've done to their repo :D | 15:04 | |
thundergnat: look, this one doesn't have a short name: github.com/ajs/perl6-Math-Sequences/issues/77 | 15:05 | ||
maybe add one? I'll take a small break | |||
15:10
Manifest0 left
|
|||
thundergnat | AlexDaniel: Hm. Looks like there is collision with A005588 which is also named binary-rooted-trees. | 15:11 | |
MasterDuke | an implementation of @A000111 done with multi Entringer subs takes 3s for the first 10 numbers | ||
AlexDaniel | thundergnat: very cool that we noticed it :) | 15:13 | |
thundergnat | AlexDaniel: Seems like A005588 should be named "free-binary-rooted-trees" and A002572 "binary-rooted-trees". I'll make a pull request. | 15:15 | |
15:17
Manifest0 joined
|
|||
AlexDaniel | tobs: it's a relatively short script: github.com/ajs/perl6-Math-Sequence...-issues.p6 | 15:17 | |
tobs: I ♥ Perl 6 :) | |||
squashable6: status | 15:18 | ||
squashable6 | AlexDaniel, 🍕🍕 SQUASHathon is in progress! The end of the event in ≈22 hours. See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
MasterDuke | m: my @a = lazy (^Inf); say @a[^5]; my @b = lazy @a[0,2...*]; say @b[^5] | 15:19 | |
AlexDaniel | Now with an issue tracker! github.com/ajs/perl6-Math-Sequences/issues | ||
camelia | (timeout)(0 1 2 3 4) | ||
MasterDuke | huh, i thought you could make a lazy list from a lazy list | ||
AlexDaniel | MasterDuke: btw you might also like this one: github.com/ajs/perl6-Math-Sequence...69f6c12b8d | 15:20 | |
MasterDuke: some explanation: colabti.org/irclogger/irclogger_lo...07-06#l174 | 15:21 | ||
MasterDuke: and then on top of that it causes this: github.com/ajs/perl6-Math-Sequences/issues/47 | |||
rfold | p6: sub f { my @xs = 1, 2, 3; my $x = 1; [<=] @xs>>.sqrt, $x; }; say f.perl | ||
camelia | Bool::False | ||
rfold | Amn't I supposed to slip @xs>>.sqrt before using it with [<=]? Like so: [<=] |@xs>>.sqrt, $x | 15:22 | |
timotimo | if you want the $x to be part of that comparison, you'll need to flatten the @xs>>.sqrt list into it somehow, yeah | 15:23 | |
rfold | Then why doesn't it crash? | ||
MasterDuke | AlexDaniel: can you assign github.com/ajs/perl6-Math-Sequences/issues/100 to me? | ||
rfold | p6: say([1, 2, 3] <= 3); | 15:24 | |
camelia | True | ||
rfold | Apparently <= with a list and an integer compares the length of the list. | 15:25 | |
MasterDuke | thundergnat, AlexDaniel: have you tried `say @A000111[1]`? | 15:26 | |
rfold | Which happens because it calls .Real on the argument: | ||
p6: say [1, 2, 3].Real; | |||
camelia | 3 | ||
rfold | timotimo: thanks I get it! | 15:27 | |
thundergnat | MasterDuke: Yes. it IS ridiculously slow, but haven't investigated it yet. | ||
MasterDuke | k. i'll submit a PR with an alternate implementation. still slow, but not as much | ||
AlexDaniel | MasterDuke: yeah but I wonder why tests are skipping that sequence… | 15:28 | |
down to 0 PRs again! :) | 15:30 | ||
thundergnat | AlexDaniel: github.com/ajs/perl6-Math-Sequence...r.pm6#L158 | 15:31 | |
AlexDaniel | ah | ||
so is it broken or just slow? | |||
MasterDuke | ha! | ||
AlexDaniel | well, I guess both | 15:32 | |
15:33
Cabanossi left
15:35
Cabanossi joined
15:37
natrys joined
|
|||
thundergnat | AlexDaniel: github.com/ajs/perl6-Math-Sequences/issues/74 is already done. (That was one of my pull requests while you were still writing the generator script.) | 15:44 | |
15:46
Manifest0 left
|
|||
thundergnat | AlexDaniel: Also, assign #66 to me when you have a moment. github.com/ajs/perl6-Math-Sequences/issues/66 Thanks! | 15:49 | |
15:51
Manifest0 joined
|
|||
MasterDuke | afk, going to take my daughter to a festival in the nearby park | 15:55 | |
AlexDaniel | thundergnat: just leave a comment saying you're working on it | 16:00 | |
thundergnat: again, a weird limitation of github… can't assign anyone who doesn't have write permissions to the repo | |||
thundergnat | AlexDaniel: Ah. Ok. Weird, but not a real problem. | 16:01 | |
16:02
dominix__ joined
16:05
dominix_ left
16:12
Manifest0 left
16:17
Manifest0 joined
16:36
Manifest0 left
16:41
Manifest0 joined
16:47
Manifest0 left
16:53
Manifest0 joined
17:03
Manifest0 left
17:08
Manifest0 joined
17:12
vike left
17:14
Joe65 joined
17:21
Manifest0 left
|
|||
Joe65 | Anyone have a good example of p6 script that implements the usual command-line input behavior (stdin by default, one or more files on cmdline, "-", etc)? Do I have to explicitly parse arguments or is there a simpler way? I can't seem to find a complete example for perl6. | 17:22 | |
17:23
vike joined
17:26
Manifest0 joined
|
|||
rfold | Joe65: here's a full program that reads stdin by default, otherwise reads files given as arguments, again treating - as stdin: $*ARGFILES.slurp.uc.say; | 17:28 | |
17:32
mowcat left
|
|||
Joe65 | Thanks! Let me play `with that a bit. I had trouble using $*ARGFILES when I tried it previously. | 17:34 | |
tobs | AlexDaniel: yay, I did something useful \o/ | 17:36 | |
17:45
mniip left
17:50
mniip joined
17:51
Manifest0 left
17:56
Manifest0 joined
|
|||
Joe65 | Here's an example (I forgot to mention named cmdline args): | 18:12 | |
Oops. Best way to paste a few lines of code (I forget)? | 18:13 | ||
sena_kun | any paste service? github gists? | 18:14 | |
Joe65 | nm thx | 18:20 | |
18:20
Joe65 left
18:22
Manifest0 left
18:26
Manifest0 joined
18:34
Joe65 joined
|
|||
Joe65 | ok, sample code here: <script src="gist.github.com/nd3i/80e5da536fa73...script> | 18:34 | |
sena_kun | Joe65, can you post a link to gist page here? | 18:36 | |
Joe65 | I'm trying to get named args and standard cmdline input filename(s). Running the script with a named argument, --fmt='%5d' seems to interfere with getting a following file name into $*ARGFILES | 18:37 | |
Oops. Sry. I pasted the embed link. Share link: gist.github.com/nd3i/80e5da536fa73...1d32ce7dc7 | 18:38 | ||
tbrowder | AlexDaniel: i added another minor pr to math-seq | 18:40 | |
sena_kun | Joe65, the thing is, MAIN gives you a new signature that overrides the default one | 18:41 | |
Joe65 | ok | 18:44 | |
sena_kun | I am not very familliar with MAIN, but playing with it now... | 18:46 | |
to get something you might want... | |||
timotimo | if you want, you can use *@*ARGS as the last argument to your MAIN | 18:47 | |
sena_kun | timotimo, hmm, I am doing `$fmt = '%d ', *@*ARGS`, but on `perl6 perl6.pl6 test.lua` @*ARGS is empty | 18:48 | |
timotimo | that's not where to put the * :) | 18:49 | |
sena_kun is confused | |||
ok, made it working... | 18:50 | ||
timotimo++ | |||
gist.github.com/Altai-man/44aee256...a16539c837 <- Joe65 | 18:51 | ||
18:53
robertle joined
18:59
lizmat joined
|
|||
timotimo | i didn't come up with that trick :) | 18:59 | |
i think it might have been bdf? | |||
sena_kun | Ballroom Dancers' Federation? | 19:01 | |
Joe65 | ok tnx! Any advantage using $*ARGFILES there in place of $*ARGS? It seems that either works. | 19:02 | |
sena_kun | Joe65, unrelated to MAIN(which changes things a bit), @*ARGS are just all arguments passed to script, while $*ARGFILES is an object of docs.perl6.org/type/IO::ArgFiles class, constructed from @*ARGS, so they are different beasts. | 19:04 | |
but considering you are overloading this processing with a MAIN subroutine, any name can be there, actually, even e.g. @files. | |||
so I'd use *@files in signature and just @files in body. | 19:05 | ||
I'd even say that my gist is bad because it uses @*ARGS, it is really unrelated here, just any suitable name will be less confuseable for the reader. | 19:06 | ||
19:13
Black_Ribbon joined
19:15
Manifest0 left
|
|||
Joe65 | ok, i feel like there should be something more concise @files.IO.lines but that seems to give the whole file for each $line. | 19:17 | |
AlexDaniel | thundergnat: if you say in your commit message “Resolves #123” then #123 will be closed automatically when your PR is merged | ||
Joe65 | Thanks for the help. something to start with at least. TYVM | ||
AlexDaniel | squashable6: status | 19:18 | |
squashable6 | AlexDaniel, 🍕🍕 SQUASHathon is in progress! The end of the event in ≈18 hours. See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
AlexDaniel | going strong! Still 65 tickets to resolve! github.com/ajs/perl6-Math-Sequences/issues | ||
thundergnat | AlexDaniel: Ah. Well that's handy to know. Sorry for not doing that. My git foo is not so great. | 19:19 | |
AlexDaniel | thundergnat: it's not git foo, it's github foo :) | ||
thundergnat | Indeed. :-/ | ||
19:20
Joe65 left,
Manifest0 joined
19:25
anon joined
|
|||
AlexDaniel | thundergnat: it'd be really cool to get that ticket count to 0 (so that all core sequences have a perl6 implementation) | 19:25 | |
anon | hello | ||
anyone here? | |||
AlexDaniel | anon: hi! | ||
sena_kun | anon, hi | 19:26 | |
19:26
anon is now known as Guest96979
|
|||
AlexDaniel | thundergnat: by the way now I'm wondering, are any of the sequences already implemented on rosettacode? | 19:26 | |
Guest96979 | i love scripting and love writing bash scripts the most | ||
i am considering perl | |||
could any1 please highlight whether perl is better for scripting tasks for a system? | 19:27 | ||
than bash | |||
sena_kun | Guest96979, perl or perl 6? they are pretty different languages. | ||
Guest96979 | and i am also confused about perl5 or perl6 | ||
sorry | |||
is perl6 just improvement on perl5 or complete change in syntax? | 19:28 | ||
El_Che | Bash is a great language for procedural, step-by-step talks | ||
thundergnat | AlexDaniel: Yep, several of them. | ||
sena_kun | no problem, there is a bit of confusion around this topic. perl(5) is one language, perl 6 is a different one. it is a complete change of a lot of things. | ||
lizmat | weekly: perlweeklychallenge.org/blog/meet-...mpion-014/ | ||
yoleaux | 02:06Z <AlexDaniel> lizmat: maybe this is a good benchmark: colabti.org/irclogger/irclogger_lo...07-06#l154 | ||
02:06Z <AlexDaniel> lizmat: it's really slow but I don't think it should be | |||
notable6 | lizmat, Noted! | ||
yoleaux | 02:16Z <AlexDaniel> lizmat: I looked at the profile but I don't see anything obvious. I think it's an interesting case, unless I'm missing something obvious, it should be just a bunch of iterators glued together in interesting ways. The logic basically skips values at certain indexes (that's it!). Even though it's not fun to have 100 iterators on top of each other, it should still be really really fast. | ||
03:10Z <AlexDaniel> lizmat: here's a more readable version: github.com/ajs/perl6-Math-Sequence...69f6c12b8d | |||
12:23Z <AlexDaniel> lizmat: another weird bug: github.com/ajs/perl6-Math-Sequences/issues/47 | |||
El_Che | Perl and other programming languages are better suited when you need to transform data or when the logic is more complicated | ||
yoleaux | 12:23Z <AlexDaniel> lizmat: (with the same code) | ||
Guest96979 | we can use parallel command for running tasks in concurrently..is perl capable of that? | ||
yoleaux | 12:45Z <El_Che> lizmat: sungo.wtf/2019/07/05/leaving-irc.perl.org.html | ||
sena_kun | Guest96979, it sure is. | 19:29 | |
El_Che | Guest96979: Perl 6, yes, very nicely. Perl 5 can use forks | ||
AlexDaniel | well, piping in bash is much easier | ||
Guest96979 | El_Che, is it like awk then? | ||
El_Che | bigger, with a bigger standard library | 19:30 | |
Guest96979 | ok | ||
El_Che | more datatypes | ||
Guest96979 | sounds interesting.. | ||
which one would u recommend to a newbie ? perl5 or perl6 | |||
El_Che | They are both different languages, so it depends on you usage. As a bash replacement I think perl6 is more fun | 19:31 | |
(but you're in a perl 6 channel) | |||
AlexDaniel | also bash is not a bad choice for a lot of small tasks | ||
Guest96979 | how does piping look like in perl6 though? | 19:32 | |
thundergnat | AlexDaniel: E.G. A000602 hydrocarbons is on there, but it called Paraffins on Rosettacode rosettacode.org/wiki/Paraffins#Perl_6 | ||
Guest96979 | is it as simple as chaining | | ||
"|" | |||
AlexDaniel | a bit more verbose | 19:33 | |
Guest96979 | would it require constructing objects and passing them as parameter?' | ||
AlexDaniel | Guest96979: see some examples here: docs.perl6.org/type/Proc | ||
sena_kun .oO ( need to write a library with | operator, as Haskell has ) | |||
thundergnat | AlexDaniel: But it isn't implemented as a lazy list, and I'm not sure how easy it may be to convert it. (You have to specify how many terms you want up front) | ||
El_Che | Guest96979: you tend to do a lot of less piping in programming languages in my experience | 19:34 | |
you transform the data along the way | |||
and more often than not you don't need to run shell commands | |||
AlexDaniel | thundergnat: you can make almost any code lazy with gather/take | ||
Guest96979 | i guess then recommended way is to get required output through bash and transform using perl/perl6 and again filter using pipes in bash? | 19:35 | |
thundergnat | afk for a bit | ||
AlexDaniel | thundergnat: actually, it already uses gather take, so why is it not lazy? | ||
oooh because you have to provide N? | |||
Guest96979: why not do the processing in perl 6 ? | 19:36 | ||
thundergnat: fwiw github.com/ajs/perl6-Math-Sequences/issues/87 is the only remaining sequence that is covered on wikipedia | 19:37 | ||
Guest96979 | ok.if it can get the job done then that's great | ||
but in that doc page, is it really required to construct your command as "run process, arg1, arg2, arg3,..."? | 19:38 | ||
why not a simple string of entire command? | |||
AlexDaniel | Guest96979: because then you're more likely to introduce shell injection bugs | 19:42 | |
Guest96979: but yes, you can do "shell 'some cmd | here | no prob'" | |||
Guest96979 | ok..thanks m8 | 19:44 | |
will give it a try | |||
any1 here uses scala here? | 19:45 | ||
19:46
Guest96979 left
19:50
mowcat joined
|
|||
TreyHarris | Guest43313: I have, but it's been some years... | 19:50 | |
Geth | ¦ problem-solving: AlexDaniel assigned to jnthn Issue Need a substitute for Perl 5 die with newline for raising end-user errors? github.com/perl6/problem-solving/issues/59 | 19:51 | |
AlexDaniel | TreyHarris: that's a wrong guest :) | 19:52 | |
TreyHarris | oops | 19:53 | |
19:57
pecastro left
19:58
Manifest0 left
20:04
Manifest0 joined
20:06
mowcat left
20:11
Manifest0 left
20:17
|oLa| left,
Manifest0 joined
20:22
Manifest0 left
20:26
Manifest0 joined
20:30
Manifest0 left
20:31
kaare_ joined
20:35
Manifest0 joined
20:42
lancew joined
20:45
lizmat_ joined
20:49
lizmat left
20:50
Manifest0 left
20:53
lizmat_ is now known as lizmat
20:56
Manifest0 joined
21:01
lancew left
21:05
Manifest0 left
21:11
Manifest0 joined
21:17
Manifest0 left
21:19
jaldhar left,
jaldhar joined
21:23
Manifest0 joined
21:24
|oLa| joined
21:31
Manifest0 left
21:37
Manifest0 joined
21:43
Manifest0 left
21:46
kaare_ left,
kaare_ joined
21:49
Manifest0 joined,
rfold left
21:52
rindolf left,
kaare_ left
22:03
Manifest0 left
22:10
Manifest0 joined
22:17
Manifest0 left
22:19
natrys left
22:22
Manifest0 joined
22:26
Manifest0 left
22:32
Manifest0 joined
22:36
Manifest0 left
22:42
Manifest0 joined,
denix13 joined
22:46
denix13 left
22:47
_jrjsmrtn joined
22:48
__jrjsmrtn__ left,
Manifest0 left
22:54
Manifest0 joined
|
|||
AlexDaniel | thundergnat: what's @_.clone ? | 22:54 | |
thundergnat: btw “Resolves #123” needs to be in the commit message, not in the PR title. I don't think it'll work :) | 22:55 | ||
thundergnat | AlexDaniel: Ah phooey. | 22:58 | |
AlexDaniel: @_ is the sequence up to that point. I'm cloning it so I can iterate it several times. | |||
AlexDaniel | thundergnat: that sounds weird… | 22:59 | |
thundergnat: isn't @ cached anyway? | |||
thundergnat: what if you use @A000311 instead? Can you iterate it then? | |||
thundergnat: or is this the problem: @seq.tail ? | 23:00 | ||
you have $n, so you don't need .tail, just access it using the index | |||
I just dislike the idea of cloning the whole sequence for every next element… | |||
thundergnat | AlexDaniel: you would think so but using @_ directly or the sequence id results in "sequence already iterated" errors. | ||
AlexDaniel | m: my @A000311 = 0, 1, { state $n = 1; my @seq = @_.clone; ++$n; -($n-1) * @seq.tail + sum (1 .. ($n - 1)).map: -> $k { ($n choose $k) * @seq[$k] * @seq[$n - $k] } } ... *; say @A000311[^10] | 23:01 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3l + sum (1 .. ($n - 1)).map: -> $k { ($n7⏏5 choose $k) * @seq[$k] * @seq[$n - $k] } expecting any of: infix infix stopper … |
||
AlexDaniel | ah sheesh no `choose` | ||
thundergnat: isn't it because of .tail though? | |||
thundergnat: accessing by the index should be just fine | 23:02 | ||
thundergnat | AlexDaniel: possibly... probably | ||
AlexDaniel: Pushing a fix in few seconds | 23:14 | ||
Kaiepi | i'm hesitant to say i'm completely done implementing wide string support on moarvm since i'm wary of how nativecall handles a few things but i'm at the point where i can have a basic implementation working once i finish my work on the rakudo end! | ||
23:15
Manifest0 left
|
|||
AlexDaniel | what do you guys think about github.com/ajs/perl6-Math-Sequences/pull/129 ? | 23:16 | |
thundergnat, MasterDuke | |||
thundergnat | Looking: | 23:18 | |
23:20
Manifest0 joined
|
|||
thundergnat | AlexDaniel: I agree. The only thing I would suggest is to add as many items as OEIS has to the sequence before &NOSEQ marker. (You may have already, I didn't dig that deep) | 23:21 | |
AlexDaniel | thundergnat: yes, I did | 23:22 | |
these sequences tend to be very short though | |||
that's what the PR does :) | |||
OK I'll start merging stuff | 23:23 | ||
thundergnat | AlexDaniel: Ok, I pushed better code for A000311. No more cloning the entire sequence on each iteration. Thanks for the nudge. | 23:24 | |
AlexDaniel | thundergnat: nice! | 23:25 | |
I merged everything | |||
squashable6: status | 23:26 | ||
squashable6 | AlexDaniel, 🍕🍕 SQUASHathon is in progress! The end of the event in ≈14 hours. See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
AlexDaniel | thundergnat: the labels were very useful :) | 23:27 | |
thundergnat | AlexDaniel: Turns out they were quite useful, I look smart in retrospect but I was just spitballing at the time ;-) | 23:28 | |
AlexDaniel | :) | ||
how many sequences are there in total? | 23:29 | ||
thundergnat | AlexDaniel: I am in moderate awe of how fast you knocked all the scripting together and really made the squashathon move along. | ||
AlexDaniel | 184, and only 50 left to implement | 23:30 | |
thundergnat: I stole some code from my past self | |||
thundergnat: here, we did it before: github.com/perl6/ecosystem-unbitro...-issues.p6 | 23:31 | ||
thundergnat | AlexDaniel: That past self guy is a damn useful fellow to have around! | ||
AlexDaniel | thundergnat: last time it was a bit more fun though, because unbitrot repo was in perl6 org and github used to autosubscribe all people in the organization | ||
thundergnat: so we sent like more than 300 notifications, to each person out of 300 people subscribed, if I'm not mistaken | 23:32 | ||
it was great :) | 23:33 | ||
ahhh, there's no license in that repo?? | 23:35 | ||
m: my %A001519; multi sub A001519(0 --> 1) { }; multi sub A001519(1 --> 1) { }; multi sub A001519($n) { %A001519{$n} //= 3 * A001519($n - 1) - A001519($n - 2) }; our @A001519 = lazy 𝕀.map: -> $n { A001519($n) }; say @A001519[^10] | 23:39 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: 𝕀 used at line 1 |
||
thundergnat | AlexDaniel: Hm. Indeed there isn't. That puts a little damper on my enthusiasm. Several of his other repos are MIT or Artistic licensed. Hopefully it's just an oversite. | 23:40 | |
AlexDaniel | m: my %A001519; multi sub A001519(0 --> 1) { }; multi sub A001519(1 --> 1) { }; multi sub A001519($n) { %A001519{$n} //= 3 * A001519($n - 1) - A001519($n - 2) }; our @A001519 = lazy (1…∞).map: -> $n { A001519($n) }; say @A001519[^10] | ||
camelia | (1 2 5 13 34 89 233 610 1597 4181) | ||
AlexDaniel | thundergnat: yeah, I'm pretty sure it's a mistake | ||
thundergnat: btw where are they, I saw some commits from them today | |||
thundergnat | AlexDaniel: shrug. Your guess is as good as mine. | 23:41 | |
AlexDaniel | m: our @A001519 = 1, 1, -> $n2, $n1 { 3 * $n1 - $n1 }; say @A001519[^10] | 23:42 | |
camelia | (1 1 -> $n2, $n1 { #`(Block|72919064) ... } (Any) (Any) (Any) (Any) (Any) (Any) (Any)) | ||
AlexDaniel | m: our @A001519 = 1, 1, -> $n2, $n1 { 3 * $n1 - $n1 } … ∞; say @A001519[^10] | ||
camelia | (1 1 2 4 8 16 32 64 128 256) | ||
AlexDaniel | m: our @A001519 = 1, 1, -> $n2, $n1 { 3 * $n1 - $n2 } … ∞; say @A001519[^10] | ||
camelia | (1 1 2 5 13 34 89 233 610 1597) | ||
23:48
sena_kun left
23:52
Manifest0 left
23:57
Manifest0 joined
|