»ö« 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. |
|||
seatek | skink: slurpy: MAIN(*@stuff) | 00:00 | |
skink | danke | 00:02 | |
seatek | bitte | ||
00:02
bazzaar joined
|
|||
bazzaar | o/ perl6 | 00:07 | |
I've just submitted a PR for doc changes to the Grammar_Tutorial, hopefully folks will think they are ok :) | 00:10 | ||
I found that the PR dialoque text box doesn't seem to like <tokens> however | 00:11 | ||
geekosaur | dmaestro, those missing symbols are a misbuilt readline. you are missing either -lncurses or -ltinfo | 00:13 | |
in the link for libreadline | |||
(which one you need depends on how slackware builds ncurses. separate is the convention for BSDish systems and some Linux distributions [notably RH/Fedora and Debian], combined is the convention for System V and some other Linux distributions) | 00:16 | ||
skink | ... Ever sit back and just be like, "what on earth did I just write?" | 00:24 | |
sub MAIN(*@folders) { my $images = (@folders.map: { .IO.dir(test => /:i '.' (jpe?g|png) $/)>>.Str }).flat; ... } | |||
BenGoldberg | Why only jpegs and pngs? No support for gifs, tifs, etc? | 00:27 | |
00:28
imcsk8 left
|
|||
skink | Sshhh. I have to check the format support of the lib I'm using. | 00:28 | |
00:30
notostraca joined,
bazzaar left
00:31
TEttinger left,
notostraca is now known as TEttinger
|
|||
AlexDaniel | BenGoldberg: and the most important format is missing! | 00:31 | |
SVG!! | |||
BenGoldberg | :) | 00:32 | |
skink | This is a pHash wrapper/util for finding duplicate image, where said duplicates are resized/recompressed/reformatted versions, rather than the same file | 00:33 | |
I can post the code, if anyone's interested | |||
00:38
awwaiid left,
awwaiid joined
|
|||
seatek | bazzaar: I like the extra bit on <sym>s! A question though - that's a pretty detailed excursion into <sym>'s. Do you think it might be good to have a <sym> section in the actual grammar page? We don't go into detail like that anywhere else in the tutorial I think. I don't know though. | 00:41 | |
bazzaar: the point of the tutorial was to get people's heads to wrap around just the concept of grammars themselves... not the detail really | |||
but i'm open to anything always ;) | 00:42 | ||
but the main grammar doc could really use A LOT of stuff like that sym piece you did | 00:43 | ||
00:43
pierre_ joined
|
|||
seatek | whatcha think? i don't know really. i know grammars are a stumbling block conceptually at first until they click | 00:44 | |
and my fear is that without that knowledge first, the sym details will just be so much noise.. ? but i can't tell any more for sure. | |||
viki | skink: sub MAIN(*@folders) { my $images = (@folders.map: { .IO.dir(test => *.extension eq any <jpeg jpg png>)>>.Str }).flat; | 00:47 | |
hmmmm | |||
m: "foo.JPG".IO.extension.say | |||
camelia | rakudo-moar 014d4c: OUTPUT«JPG» | ||
00:47
Praise left
|
|||
viki | well, that sucks | 00:47 | |
*.extension.lc eq any <jpeg jpg png> :) | 00:48 | ||
00:48
Praise joined
00:50
imcsk8 joined,
m0ltar joined
00:53
pierre_ left
|
|||
AlexDaniel | viki: lc? But what about unicode extensions? :P | 00:55 | |
viki | What about them? | 00:58 | |
AlexDaniel | well, just joking. Have never seen extension with characters out of ascii range | 00:59 | |
skink | Is there a shorter way of recursively finding those files than the one on the dir docs page? | ||
AlexDaniel | source: "foo.JPG".IO.extension | ||
viki | You mean to use .fc? Then you'd need to .fc the extensions too and .. meh | ||
AlexDaniel | viki: yea | 01:00 | |
SourceBaby: "foo.JPG".IO.extension | |||
SourceBaby: help? | |||
:( | |||
viki | s: "foo.JPG".IO, 'extension', \() | ||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/014d...ath.pm#L66 | ||
viki | SourceBaby: help | ||
SourceBaby | viki, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See modules.perl6.org/dist/CoreHackers::Sourcery | ||
viki | s: "foo.JPG".IO, 'basename', \() | ||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/014d...ath.pm#L65 | ||
viki | s: Rakudo::Internals, 'MAKE-EXT', \("foo.JPG") | 01:01 | |
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/014d...s.pm#L1765 | ||
viki | so basically a substr of extension :) | ||
using nqp ops | |||
AlexDaniel | m: ‘blah.’.IO.extension.say | 01:02 | |
camelia | rakudo-moar 014d4c: OUTPUT«» | ||
01:02
pierre_ joined
|
|||
viki | m: ‘.bashrc’.IO.extension.say | 01:02 | |
camelia | rakudo-moar 014d4c: OUTPUT«bashrc» | ||
AlexDaniel | great | 01:03 | |
01:05
pierre_ left,
pierre_ joined
|
|||
dalek | c: d1d5f70 | bazzaar++ | doc/Language/grammar_tutorial.pod6: Attempt to tighten up the description of how the proto token works, |
01:05 | |
c: 606cb55 | seatek++ | doc/Language/grammar_tutorial.pod6: Merge pull request #1017 from bazzaar/roundrobin-edits Grammar Tutorial : attempt to tighten up the description of how the proto token works. |
|||
synopsebot6 | Link: doc.perl6.org/language/grammar_tutorial | ||
AlexDaniel | m: dd Rakudo::Internals.MAKE-CLEAN-PARTS(‘/foo/foo.jpg’) | 01:06 | |
camelia | rakudo-moar 014d4c: OUTPUT«("", "foo", "foo.jpg", "")» | ||
AlexDaniel | interesting | ||
m: dd Rakudo::Internals.MAKE-CLEAN-PARTS(‘//foo/foo.jpg’) | |||
camelia | rakudo-moar 014d4c: OUTPUT«("//foo", "foo.jpg", "")» | ||
AlexDaniel | m: dd Rakudo::Internals.MAKE-CLEAN-PARTS(‘///foo/foo.jpg’) | ||
camelia | rakudo-moar 014d4c: OUTPUT«("//", "foo", "foo.jpg", "")» | ||
01:06
dogbert17 left,
labster joined
|
|||
AlexDaniel | m: dd Rakudo::Internals.MAKE-CLEAN-PARTS(‘////////foo/foo.jpg’) | 01:07 | |
camelia | rakudo-moar 014d4c: OUTPUT«("//", "foo", "foo.jpg", "")» | ||
AlexDaniel | doesn't look right to be honest | ||
but don't know what would be the effect of this | |||
is there anything that uses MAKE-CLEAN-PARTS ? | 01:08 | ||
01:10
trnh left,
Actualeyes left
01:11
dogbert17 joined
|
|||
MasterDuke | it isn't called by anything | 01:12 | |
01:20
ssm left
|
|||
BenGoldberg | s: Rakudo::Internals, 'MAKE-CLEAN-PARTS', ‘///foo/foo.jpg’ | 01:23 | |
SourceBaby | BenGoldberg, Something's wrong: ERR: Cannot resolve caller sourcery(Rakudo::Internals, Str, Str); none of these signatures match: ($thing, Str:D $method, Capture $c) ($thing, Str:D $method) (&code) (&code, Capture $c) in block <unit> at -e line 6 | ||
01:23
pierre_ left
|
|||
BenGoldberg | s: Rakudo::Internals, 'MAKE-CLEAN-PARTS', \(‘///foo/foo.jpg’) | 01:24 | |
SourceBaby | BenGoldberg, Sauce is at github.com/rakudo/rakudo/blob/014d...s.pm#L1774 | ||
skink | Anyone know why .race doesn't get me any speedups here? | ||
gist.github.com/skinkade/a9a0ebf88...f86ca0a022 | |||
MasterDuke | i seem to recall some weirdness with .race/.hyper and laziness. does anything change if you add a .eager? | 01:26 | |
samcv | anybody here got Inline::Perl5 working on Travis CI? | 01:27 | |
01:27
wamba left
|
|||
samcv | with perl 6 template it only has like perl 5.12... and inline perl 5 needs 5.18 :( | 01:27 | |
skink | MasterDuke, per se, .race, and .eager all gives nearly the exact same times | 01:30 | |
samcv | will try updating perl in the .travis.yml but kinda lame it comes with such an old perl | ||
01:30
pierre_ joined
|
|||
skink | .race.eager makes the script finish instantly without doing anything @_@ | 01:31 | |
MasterDuke | .eager.race? | ||
skink | semantic satiation is already setting in | 01:32 | |
timotimo | you need to .hyper.map or .hyper.for or something | ||
not the other way around | |||
at least i think so ... | |||
maybe you're putting the hyper or race in the wrong place? | |||
skink | I'll try race.map | 01:34 | |
Could be something's blocking in the C lib | 01:37 | ||
01:38
Actualeyes joined
01:40
aborazmeh joined
|
|||
skink | .eager.race and .race.map prevent it from ever finishing, which is... interesting | 01:40 | |
01:41
aborazmeh left,
aborazmeh joined
|
|||
timotimo | well, if you first .eager it, then .race it, it'll try to make the whole list first, then continue with multi-threading whatever comes after that | 01:43 | |
like .eager.race.for would first slurp all results, then do the .for in parallel | |||
skink | I don't think .race.for is a thing | 01:47 | |
01:48
Actualeyes left
|
|||
skink | for foo.eager.race, also sticks | 01:49 | |
timotimo | oh, right, we don't have .for as a method any more | 01:51 | |
but .map will do the trick | |||
skink | right, and .race.map causes it to hang :( | 01:52 | |
timotimo | well, .race and .hyper have been buggy at least in the past ... i haven't looked into them for a few months | 01:54 | |
01:58
finanalyst joined,
cdg joined
|
|||
MasterDuke | jnthn said pretty recently (couple days ago?) he was going to look at them soon, but hasn't yet | 01:59 | |
02:01
Actualeyes joined
02:03
cdg left
02:34
ssm joined
02:35
resol joined
02:38
FreezerburnV joined
02:45
ilbot3 left
02:47
ilbot3 joined
03:01
skink left
03:12
mattp__ joined,
mattp_ left
03:13
Unavowed left,
Unavowed joined,
canopus left,
smash left
03:14
vytas left
03:15
vytas joined,
smash joined
03:20
canopus joined
03:25
roguelazer left
03:26
FreezerburnV left
03:33
FreezerburnV joined
03:34
noganex_ joined
03:37
noganex left
03:46
FreezerburnV left
03:56
AlexDaniel left
04:00
pierre_ left
04:01
pierre_ joined
04:14
khw left
04:16
rpburkholder left
|
|||
resol | p6: class Node { has $!name; } | 04:20 | |
camelia | ( no output ) | ||
resol | class Edge { has Node $!first; has Node $!second; } | ||
for me this generates are whole mess of errors .. Package 'Edge' already has an attribute named '$!first' in any add_attribute at gen/moar/m-Metamodel.nqp line 368 in any pkg_add_attribute at src/Perl6/World.nqp line 2830 in any declare_variable at gen/moar/m-Perl6-Actions.nqp line 3162 in any variable_declarator at gen/moar/m-Perl6-Actions.nqp line 3073 in any variable_declarator at src/Perl6/Grammar.nqp line 2525 in any declarator a | 04:21 | ||
04:22
geekosaur left
|
|||
resol | Trying to follow some of the hands on tutorials for classes. | 04:22 | |
Obviously I'm doing something incorrectly ... just don't know quote what it is. | 04:23 | ||
gfldex | m: class Edge { has Node $!first; has Node $!second; } | 04:25 | |
camelia | rakudo-moar 014d4c: OUTPUT«5===SORRY!5===Type 'Node' is not declared. Did you mean 'Code'?at <tmp>:1------> 3class Edge { has Node7⏏5 $!first; has Node $!second; }Malformed hasat <tmp>:1------> 3class Edge { has7⏏5 Node $!first; has Node $!second; }…» | ||
gfldex | m: class Node {}; class Edge { has Node $!first; has Node $!second; } | ||
camelia | ( no output ) | ||
gfldex | resol: what does perl6 --version say? | 04:26 | |
resol | This is Rakudo version 2016.10 built on MoarVM version 2016.10 implementing Perl 6.c. | 04:27 | |
timotimo | resol: are you doing this in a file or in a REPL? | 04:28 | |
resol | Hi there timotimo, yes, was trying it in REPL ... maybe that's the problem ... can't experiment there? | 04:29 | |
timotimo | well, it'll potentially already have a class Edge and try to add the attributes to it again | ||
the REPL is ... kind of problematic sometimes | 04:30 | ||
resol | It also does the same if I try the example in the intro | ||
class Human { has $.name ; has $.age; } | |||
04:31
aries_liuxueyang joined
|
|||
timotimo | huh, so when you open a fresh repl, and copy-paste that code in, it explodes with that error? | 04:31 | |
resol | Ha, oddly enough, I just tried to close and re-open REPL, and voila the one for the Human worked. | 04:32 | |
So my choice of Edge and Node are the problem. | |||
timotimo | maybe not | ||
try doing it again | |||
resol | I was trying to do a quick test to set up a directed graph | ||
And I chose Node and Edge as classes | 04:33 | ||
timotimo | it works fine on my machine, fwiw | ||
and it should most definitely work when put into a file | |||
i need to sleep :) | 04:35 | ||
good luck! | |||
resol | Thanks ... I put things into a file, and changed the name of Edge to Link and it works fine. | 04:36 | |
Thanks for the help | |||
04:37
geekosaur joined,
geekosaur left
04:38
vendethiel joined
04:39
aborazmeh left,
geekosaur joined
04:47
vendethiel left
05:01
pierre_ left
05:07
skids left
05:10
pierre_ joined
05:11
daph joined
05:13
Cabanossi left
05:14
pierre_ left
05:16
Cabanossi joined
05:31
labster left
05:40
BenGoldberg left
05:41
labster joined
05:42
Tonik joined
05:45
xtreak joined
05:51
eisen74 left,
Tonik left
06:04
xiaomiao left
06:07
llfourn left
06:08
finanalyst left
06:10
xiaomiao joined,
xiaomiao left,
xiaomiao joined
06:20
aborazmeh joined,
aborazmeh left,
aborazmeh joined
06:26
domidumont joined
06:28
girafe left
06:29
domidumont left
06:30
domidumont joined
06:34
bjz joined
|
|||
seatek | m: class C { method a_12() { say 'hi' }}; | 06:35 | |
camelia | ( no output ) | ||
seatek | m: class C { method a-12() { say 'hi' }}; | ||
camelia | rakudo-moar 014d4c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Missing blockat <tmp>:1------> 3class C { method a7⏏5-12() { say 'hi' }};» | ||
seatek | m: class C { method a12() { say 'hi' }}; | ||
camelia | ( no output ) | ||
seatek | m: class C { method a-bc() { say 'hi' }}; | 06:36 | |
camelia | ( no output ) | ||
psch | m: my $a-12 | ||
camelia | rakudo-moar 014d4c: OUTPUT«WARNINGS for <tmp>:Useless use of "-" in expression "my $a-12" in sink context (line 1)Use of uninitialized value of type Any in numeric context in block <unit> at <tmp> line 1» | ||
psch | m: my $a12-a; | 06:37 | |
camelia | ( no output ) | ||
seatek | yeah it thinks it might be math after method | ||
psch | it always commits to math if there's a number on the RHS of - | 06:38 | |
seatek | ok | 06:39 | |
06:39
raiph joined
06:40
pierre_ joined,
bjz left
06:41
wamba joined
06:48
RabidGravy joined,
domidumont left
06:50
resol left
|
|||
psch | m: class A { method ::("a12-5") { "baz" } }; say A."a12-5"() | 06:51 | |
camelia | rakudo-moar 014d4c: OUTPUT«baz» | ||
psch | seatek: ^^^ if you *have* to... | ||
06:52
bjz joined
|
|||
seatek | no, i just get all happy about being able to use $this-stuff instead of $this_stuff, but then i keep running into places where that's not always possible | 06:52 | |
just trying to find the happy ground level ;) | 06:53 | ||
psch | well, it works as long as you have an alphabetical grapheme on the right side of the dash | ||
06:54
brillenfux joined
|
|||
seatek | it's true - and i've adjusted my creativity to conform to such fascism that is expedient. ;) | 06:54 | |
i tried method 123-abc() btw too ;) | 06:56 | ||
psch | well, it does have to start with alpha too | 06:57 | |
seatek | :) | ||
i feel so oppressed | |||
psch | great | ||
seatek | hehe :) | ||
actually never have seen anything that could start with numbers | |||
i wonder why that is. | |||
no language i can think of does | |||
except assembly | 06:58 | ||
i guess i have all of unicode as my canvas though, except for numbers. curse my feeble keyboards | 06:59 | ||
actually, it's probably for the best | 07:00 | ||
07:03
labster left
07:09
ufobat joined
07:12
rpburkholder joined
07:16
darutoko joined
07:21
ZzZombo joined
|
|||
ZzZombo | I have not been following Perl 6 development for a while, but today I learned a new RC is out. So on the scale from 0 till 10, how good is it this time to start using it? | 07:22 | |
psch | ZzZombo: it's not an RC, it's a release | ||
ZzZombo: as for "using it", it depends on what you want to use it for | |||
ZzZombo | I want to switch over to it. | 07:23 | |
psch | for what? system programming? web dev? glue? | ||
ZzZombo | For new applications. | ||
seatek | I've been having lots of fun with it :) | 07:24 | |
psch | i'd assume the biggest concern for developing new applications is deployability | 07:25 | |
ZzZombo | I'm mostly doing nothing but coding random pieces of programs for my own use. More of playing with the language, like with LEGO. | ||
psch | assuming you're not exclusively doing stuff inhouse | ||
seatek | it's been working out well for me ZzZombo. Definitely worth playing around with. And it's not changing fast -- it's pretty stablized | 07:27 | |
psch | the "1.0" of the specification has been released last christmas, "1.1" is slowly starting to emerge | 07:28 | |
the recommended compiler Rakudo largely complies to that specification | |||
specifically the MoarVM backend. jvm is kind of a mess in a few spots, due to big architectural differences | 07:29 | ||
ZzZombo | Hm, but I assume there is lack of editor support. Is there Perl 6 support for Eclipse? | ||
psch | it's still useable, though | ||
seatek | I use an Emacs major mode for Perl6 - not sure about anything else | ||
psch | i think atom has syntax highlighting, there's a vim plugin too | ||
i personally find the language intuitive and visually distinctive enough to not use syntax highlighting | 07:30 | ||
seatek | you know i wonder if notepad++ on windows has support yet for it | ||
ZzZombo | I dismissed Atom, because most of claimed features were working wrong. | ||
psch | as for auto completion and such, i'm not sure. we have some support for that in the REPL, but i'm not aware of anyone utilizing that in an editor | 07:31 | |
07:32
firstdayonthejob joined
|
|||
ZzZombo | Hm, rakudo.org/downloads/star/ is missing the latest version for Windows. Shame. | 07:35 | |
07:35
domidumont joined
|
|||
seatek | someone just said a day or 2 ago that the new windows build was out... | 07:36 | |
pl6anet.org/drop/ was that it? | 07:38 | ||
07:39
firstdayonthejob left
|
|||
psch | it does look like a R* MSI from here... :) | 07:40 | |
seatek | yeah just skipping .10 altogether and going on to .11 eh? | ||
07:41
pierre_ left
|
|||
psch | star is every 3 months | 07:41 | |
...i thought at least? | |||
star-m: say $*PERL.compiler | |||
camelia | star-m 2016.10: OUTPUT«rakudo (2016.10)» | ||
ZzZombo | Wait, what? The installer won't even let me change installation directory?? | ||
psch has been wrong before, and apparently is wrong now | |||
ZzZombo | Ugh, uh oh | 07:42 | |
how odd | |||
I have NO desire to let it settle on C: | |||
psch | ZzZombo: the vm unfortunately still has some hardcoded paths. there's usually more pressing issues, patches welcome :) | ||
samcv | is it normal for comb :match to show the wrong number of elements? if i add a .eager after it, it works fine | ||
seatek | yeah there's something about that on windows... that's it's locked in | ||
samcv | but unless I do that it misses the second half of everything it combs through | ||
psch | samcv: do you have an example? | 07:43 | |
samcv | yes | ||
andrzejku | hey | 07:44 | |
:) | |||
samcv | hold on maybe that's not the issue. give me some more time to check some things | ||
07:45
stux|RC-only left
|
|||
ZzZombo | P6 XML module lacks XPath support. A pity. | 07:45 | |
moritz | patch it in! | ||
ZzZombo | Guess I'll have to fiddle with getting XML::LibXML work in P6? | ||
I know way too little for that to happen, I fear. | |||
samcv | ugh it's showing different numbers every time. and i tried slurping the file it's processing, instead of getting it thrcough curl | ||
and then it hangs on comb, and uses 100% cpu | 07:46 | ||
lemme upload it | |||
ok here's the perl 6 file gist.github.com/66ac86ada35cf24ba1...4e552556de | 07:47 | ||
here is the file i'm slurping gist.github.com/66ac86ada35cf24ba1...4e552556de | |||
07:48
stux|RC-only joined
|
|||
samcv | it slurps fine i can print out the variable it puts it in, but it hangs. and curling the page using qx, it will work but have inconsistent numbers of matches, tho now 100% sure if that's comb's fault or something else, the site not always replying the same. | 07:48 | |
but it always hangs for me when i slurp that file | |||
andrzejku | :-) | ||
07:49
pierre_ joined
|
|||
samcv | so had nothing to do with eager/lazy or not, must have been coincidence i added that, and got a higher number of matches | 07:49 | |
07:49
andrzejku left
|
|||
psch | hm, it does look pretty reasonable, what you're doing | 07:50 | |
07:50
xtreak left
|
|||
psch | although i suspect you pasted the wrong link for the file that's being slurped :) | 07:50 | |
samcv | yeah... and it ''works'' if i curl it into a variable | ||
oh | |||
yes | |||
gist.github.com/50209bf6ba2716860d...03b64c40b5 here it is :) | 07:51 | ||
07:51
domidumont left
07:52
domidumont joined
07:54
pierre_ left
|
|||
psch | hm, i'm not seeing anything that i'd would expect to match your pattern in the second file | 07:54 | |
...it is a big file though, so yeah :) | |||
07:55
pierre_ joined
|
|||
psch | yeah, there's not even a single '<span>' in there afaict | 07:57 | |
as in, all opening span tags have attributes | |||
07:57
CIAvash joined
|
|||
samcv | yeah shouldn't hang tho :\ | 07:57 | |
psch | soo i'd guess it loops because it finds a \d+ followed by a '</span>', then non-greedy walks through the whole file, doesn't find anything, tries the next \d+... | ||
i suspect it'd finish eventually :) | 07:58 | ||
samcv | hahah | ||
seatek | sometimes it pays to be greedy? | ||
psch | eh, i think greedy wouldn't help here, it'd just shift to backtracking instead of "forwardtracking" | 07:59 | |
ahh, github truncated the file | |||
so maybe there *is* a '<span>' somewhere... | |||
hm, browser still says no | 08:00 | ||
seatek | you could use greedy grammar rules :) | ||
samcv | my $matches = $data.comb( / (\d+) '</span>' (.** 1..10 '<span>' /, :match, ∞); doing this finishes | 08:01 | |
so yeah it was just uh. i guess going through everything again and again haha | |||
psch | still curious that i don't see the string '<span>' anywhere in the file :) | ||
08:01
andrzejku joined
|
|||
samcv | though. it should notice there isn't any <span> or something | 08:01 | |
ah i saved it from my browser. so it must have totally changed it | 08:02 | ||
psch | the all have attribute, hence '<span .+>' | ||
08:04
salva0 left
08:13
trnh joined,
trnh left
08:14
trnh joined
08:17
salva joined
08:18
xtreak joined
08:23
labster joined
08:32
domidumont left
08:33
domidumont joined
|
|||
seatek | yet again i weep in thankfulness for multi-line comments | 08:33 | |
08:35
aborazmeh left
|
|||
ZzZombo | How do I install modules in Perl 6? I don't seem to see that anywhere. | 08:37 | |
seatek | you should have gotten the program panda along with your distro i think | 08:38 | |
zef also does it | |||
panda pulls modules from the repository at modules.perl6.org/ | 08:39 | ||
ZzZombo | Does it come with the installer? | 08:40 | |
because for me it says unknown program "panda" | |||
seatek | i don't know.. i think it's part of rakudo-star distribution | ||
hmm | |||
moritz | it is | ||
08:41
g4 joined,
g4 left,
g4 joined
|
|||
seatek | is it in c:\rakudo\bin? | 08:43 | |
i don't know what terminals and paths and whatnot of windows ways | 08:44 | ||
ZzZombo | It's not here, but I made a mistake of not launching a new cmd.exe instance, since the one I used of course missed the new PATH values. | 08:45 | |
now it works. | |||
seatek | ah ok :) | ||
08:45
rindolf joined
08:48
cibs left,
xtreak left
08:50
cibs joined
|
|||
masak | good morning, #perl6 | 08:52 | |
08:55
mj41 joined
|
|||
seatek | good morning masak | 08:56 | |
09:00
ocbtec joined
|
|||
[ptc] | o/ | 09:04 | |
samcv | ZzZombo, welcome to perl 6" | 09:05 | |
perl6! i mean | |||
DrForr | o/ | ||
09:17
rpburkholder left
09:18
dakkar joined
09:29
trnh left,
ggoebel left
|
|||
grondilu | oh we have a str type? | 09:34 | |
m: say my str $ = "foo" | |||
camelia | rakudo-moar 014d4c: OUTPUT«foo» | ||
ZzZombo | samcv, thanks. | ||
speaking of it, how do I nicely translate a P5 module into P6? I have a class module named X, invoked via the usual X->new(blah). | 09:37 | ||
in P6, if I leave it in the same named file, I would have to use X::X->new for the same purpose, wouldn't I? And it is not pretty to repeat yourself. | |||
09:38
domidumont left
|
|||
seatek | m: class MyClass { has $.x; method doit() { say $.x } }; my $c = MyClass.new(x => 3); $c.doit; | 09:39 | |
camelia | rakudo-moar 014d4c: OUTPUT«3» | ||
grondilu | if it's a class it's not a module. So 'use X; X.new(blah);' | ||
psch | if you have a Perl 5 class and want to use it, install Inline::Perl5 and 'use Perl5Class:from<Perl5>', i'd say :) | 09:40 | |
ZzZombo | hm | ||
grondilu | unlinke in P5, there is an explicit distinction between packages, modules and classes. | ||
ZzZombo | no, I'm translating my own class into P6 for learning | 09:41 | |
psch | probably start at docs.perl6.org/language/classtut | ||
seatek | there are actual keywords now to define classes | ||
class Blah { define_in_here } | |||
ZzZombo | so, I'm feel like I miss where should I define that class for using that in other modules. | ||
psch | a class is a module is a package | 09:42 | |
grondilu | ZzZombo: define your class as a computing unit | ||
unit class X; <= your file will begin as such | |||
and then you do 'use X;' | 09:43 | ||
'use X; X.new' as psch said : a class *is* a module | 09:44 | ||
seatek | that class tutorial is pretty good | ||
ZzZombo | so I can add a :ver to it, for example> | 09:45 | |
?* | |||
09:46
ggoebel joined
|
|||
psch | the version of a module is defined in its META6.json | 09:46 | |
seatek | you can do version in unit stuff | ||
and author | |||
psch | at least if i'm still up-to-date on CURI stuff... | ||
09:46
xinming left
|
|||
ZzZombo | ugh, there is a lot to learn. Not that it's bad, just exhausting :) | 09:46 | |
seatek | it's very much like Moose if you've ever used it. Or moose is a lot like it | ||
09:48
xtreak joined
09:51
domidumont joined
10:04
aries_liuxueyang left
10:11
FROGGS joined,
bazzaar joined
10:14
labster left,
FROGGS left
10:15
FROGGS[mobile] joined
|
|||
bazzaar | seatek: thanks for approving/merging my edits of the proto-regex part of the grammar tutorial doc | 10:16 | |
El_Che | Update Linux Rakudo packages: github.com/nxadm/rakudo-pkg/releas...ag/2016.11 (not rakudo star, just monthly rakudo) | 10:17 | |
seatek | bazzaar: thank you for helping others out! was a little worried it might be too detailed for the tutorial, but unfounded worry i think! | 10:20 | |
bazzaar | I understand your concern, as to how much detail should be in the tutorial. I quess it was the use of this mysterious <sym> token in the doc, that prompted me to make those edits :) | 10:22 | |
10:22
FROGGS[mobile]2 joined
|
|||
seatek | yeah, i wrestled with that exact question when i was writing it, and decided to gloss over it... but i think you did it in a very clear way that only helps and shouldn't derail new learners | 10:23 | |
10:23
rindolf left
10:26
FROGGS[mobile] left
|
|||
dalek | : b808a67 | (brian d foy)++ | misc/perl6advent-2016/schedule: I'll do the advent calendar Zoffix pinged me on Twitter. |
10:29 | |
: b4b3b5f | RabidGravy++ | misc/perl6advent-2016/schedule: Merge pull request #16 from briandfoy/patch-1 I'll do the advent calendar |
|||
bazzaar | seatek: Thank you for writing the Grammar Tutorial doc, it's certainly helped me to better understand the use of Grammars and Action classes. | ||
10:33
bazzaar left
|
|||
seatek | oh well that made me feel good | 10:35 | |
gfldex | :) | 10:36 | |
it's a funny feeling to look some detail up in the docs and to realise that I wrote that | 10:37 | ||
10:43
ilmari[m] joined
|
|||
seatek | :) | 10:43 | |
10:45
tadzik joined,
Matthew[m] joined,
M-Illandan joined,
Matias[m] joined
10:46
CIAvash left
10:48
wamba left
10:51
pierre_ left
10:55
CIAvash joined,
CIAvash left
|
|||
ZzZombo | hm | 10:57 | |
I just found something I don't like about P6: | 10:58 | ||
new syntax for the ternary operator! | |||
whyyyy... | |||
psch | m: say ?"0" | ||
camelia | rakudo-moar 014d4c: OUTPUT«True» | ||
psch | because LTM means we cannot have a prefix:<?> *and* the old ternary operator | ||
FROGGS[mobile]2 | we needed the colon | ||
psch came after that meme | 10:59 | ||
ZzZombo | what does that do, psch? | ||
FROGGS[mobile]2 | boolify | ||
ZzZombo | So "0" is true? | ||
psch | ZzZombo: it's the high precedence for of &so, which is the opposite of ¬, so yes, as FROGGS[mobile]2++ says, boolify | 11:00 | |
FROGGS[mobile]2 | sure | ||
psch | s/for/form/ | ||
ZzZombo | hmm | ||
FROGGS[mobile]2 | it is a non-empty string | ||
ZzZombo | add that the the list of things I don't like, then. :P | ||
to* | |||
jnthn | Also, the various other conditional-y operators that short-circuit are double-chars (consider &&, || and //) | ||
FROGGS[mobile]2 | *g* | ||
jnthn | And : doesn't suggest "not" in any way, while !! does | 11:01 | |
So a ?? b !! c is more consistent in various ways | |||
FROGGS[mobile]2 | ZzZombo: you have to admit that "0e0" in P5 is a hack | ||
jnthn | (We had it as a ?? b :: c at some point) | 11:02 | |
ZzZombo | I don't really care about that, I just think '0' should be false. | ||
psch | m: say so +'0' | ||
camelia | rakudo-moar 014d4c: OUTPUT«False» | ||
psch | it *can* be | ||
:) | |||
ZzZombo | ugh | ||
what | |||
the | |||
??? | |||
FROGGS[mobile]2 | consistency | ||
ZzZombo | m: say ?"0" | 11:03 | |
camelia | rakudo-moar 014d4c: OUTPUT«True» | ||
ZzZombo | ^ ? | ||
jnthn | + just numifies it first | ||
FROGGS[mobile]2 | a string is not the same type as an integer | ||
ZzZombo | yes, I got it. | ||
FROGGS[mobile]2 | we can destinguish, and we do | ||
ZzZombo | anyway, I was about to write that '' and '0' out of all string values should be false, IMO. | 11:04 | |
FROGGS[mobile]2 | P5 cannot always, so it does not | ||
why "0"? | |||
psch | ...and why ' ' not? | ||
FROGGS[mobile]2 | and why not "0.0" too then? | 11:05 | |
psch | and '0+0i' | ||
TEttinger | "zero" | ||
ZzZombo | is there a difference between '' and "" other than interpolation? | ||
FROGGS[mobile]2 | no | ||
ZzZombo | well, that's it. | ||
I just omitted it | 11:06 | ||
May I suggest an edit to docs, and where? | 11:08 | ||
viki | ZzZombo: github.com/perl6/doc | ||
ZzZombo: why would "0" be False? It's a string with content in it! | |||
FROGGS[mobile]2 | ZzZombo: there are things that feel foreign the first days, but when you accepted it you can start loving it for its consistency and logic | 11:09 | |
I certainly do | |||
viki | ZzZombo: as for the ternary.... you'll get used to it. It's far more visible than traditional one. I actually hate how other languages do it now, because it just blends with the rest of the code. | ||
ZzZombo | I guess I too accustmed to Perl 5, but I have some other reasons behind that, that are too hard to explain for me. Especially since I'm not a native English speaker. | 11:10 | |
FROGGS[mobile]2 | especially when there is no whitespace | ||
me neither | |||
jnthn | We did actually have "0" as True at first. It was quite funny when we changed it, because reivewing places we'd need to tweak showed that various pieces of code were already assuming it meant "string is not empty", so we got some free bug fixes. :-) | 11:11 | |
viki | ZzZombo: well, then if you're accustomed to Perl 5 you know that "0" being false was a giant pain in the ass as you always had to do if (defined $user_input and length $user_input) {} and after 5.14 you could finally write if (length $user_input) {} but in Perl 6 you can just write if $user_input { ... } | ||
ZzZombo | viki: thanks, edited the page. | 11:17 | |
11:21
wamba joined
11:22
xtreak left,
wamba left
11:23
jonas1 joined,
wamba joined,
xtreak joined
11:25
TEttinger left
11:26
xtreak left
11:31
pmurias joined
|
|||
pmurias | ZzZombo: I really like the new ternary operator as it visually stands out more | 11:32 | |
11:40
wamba left
11:43
ocbtec left
11:44
smls joined
|
|||
smls | bisectable6: say (1...5).list.WHAT | 11:45 | |
bisectable6 | smls, On both starting points (old=2015.12 new=014d4cf) the exit code is 0 and the output is identical as well | ||
smls, Output on both points: (List) | |||
smls | Hm, I thought a lower-case .list used to pass through any Iterable as-is | 11:46 | |
psch | bisectable6: old=2014.12 say (1...5).list.WHAT | 11:47 | |
bisectable6 | psch, On both starting points (old=2014.12 new=014d4cf) the exit code is 0 and the output is identical as well | ||
psch, Output on both points: (List) | |||
psch | that must've been quite some time ago | ||
smls | guess I misremembered | ||
tbrowder | hi #perl6 | ||
psch | oh, except Iterable... those are rather new | ||
smls | Problem of the current behavior is that `for @$foo { ... }` is not memory-efficient if $foo is a large Seq | 11:48 | |
I guess this means .list enforces "positional iterable" context, not just "iterable" context? | 11:49 | ||
psch | m: say { :1a, :2b }.list.keys | 11:50 | |
camelia | rakudo-moar 014d4c: OUTPUT«(0 1)» | ||
psch | i always took it as such, yes | ||
smls | ok | ||
jnthn | @ actually does .cache these days rather than .list | ||
m: my $a = 1..5; for $a { .say } | 11:51 | ||
camelia | rakudo-moar 014d4c: OUTPUT«1..5» | ||
jnthn | m: my $a = 1..5; for |$a { .say } | ||
camelia | rakudo-moar 014d4c: OUTPUT«12345» | ||
jnthn | That doesn't cause any caching though | ||
smls | ok | ||
jnthn | So is preferable to for @$a { .say } | ||
tbrowder | I'm trying to test a CGI script and need to provide the %*ENV normally expected with Apache. I have a test module that provides that hash for my CGI utils module but it doesn't seem to hold its values after it's first loaded. I have declared it as a state variable. Ideas? | ||
Maybe put it in a BEGIN block? | 11:52 | ||
11:53
wamba joined
|
|||
viki | ZzZombo: I'm not seeing the edit.... | 11:53 | |
tbrowder | BEGIN block didn't help. I'll but code in a gist... | 11:54 | |
ZzZombo | github.com/ZzZombo/doc | ||
tbrowder | s/but/put/ | ||
ZzZombo | @array[$i]:exists tests if @array has element at $i, not if it has a value of $i, doesn't it? | 11:55 | |
moritz | it checks if it has an index of $i | ||
11:55
jonas1 left
|
|||
viki | ¯\_(ツ)_/¯ | 11:55 | |
I guess you'll send a PR :) | |||
ZzZombo | I did already, didn't I? | 11:56 | |
viki | Nope | ||
11:56
jonas1 joined
|
|||
viki | ZzZombo: right, has element at.... $i is the index | 11:56 | |
m: my @a; say @a[5]:exists | |||
camelia | rakudo-moar 014d4c: OUTPUT«False» | ||
viki | m: my @a = ^10; say @a[5]:exists | ||
camelia | rakudo-moar 014d4c: OUTPUT«True» | ||
viki | m: my @a = ^10; @a[5]:delete; say @a[5]:exists | ||
camelia | rakudo-moar 014d4c: OUTPUT«False» | ||
viki | ZzZombo: oh sorry you did | 11:58 | |
ZzZombo: I forgot I have notifications turned off in that repo | |||
dalek | c: 80b5ce9 | ZzZombo++ | doc/Language/5to6-nutshell.pod6: I believe this emphasis was wrong At first I got the impression I DO HAVE to take care with ranges. |
||
synopsebot6 | Link: doc.perl6.org/language/5to6-nutshell | ||
dalek | c: aeabf1a | (Zoffix Znet)++ | doc/Language/5to6-nutshell.pod6: Merge pull request #1018 from ZzZombo/patch-1 I believe this emphasis was wrong |
||
synopsebot6 | Link: doc.perl6.org/language/5to6-nutshell | ||
ZzZombo | eh, I almost started to curse Github for somehow losing my PR. | 11:59 | |
I frantically searched it, but for some reason I indeed couldn't find it. | 12:00 | ||
sigh | |||
gfldex | ZzZombo: the docs are free for all. If you comtribute often, you are more then welcome to skip the RPs and mess things up directly. :-> | ||
ZzZombo | Nice to know. | 12:01 | |
I guess I'll hang around here, so maybe I will be of some use after all. | |||
viki | \o/ | ||
dogbert17 | o/ | 12:02 | |
is moritz around by any chance? | |||
viki | But on the topic of '0' being true. It makes sense in Perl 6 because Perl 6 has types. 0 is an Int and '0' is a Str. BUT, if you're dead bent on it being false, you can make it false. | 12:03 | |
m: say my $v = '0' but False; say so $v | |||
camelia | rakudo-moar 014d4c: OUTPUT«0False» | ||
viki | hehe | ||
12:03
jonas1 left
|
|||
viki | m: my $v = '0' does False; say so '0' | 12:03 | |
camelia | rakudo-moar 014d4c: OUTPUT«True» | ||
viki | m: my $v = '0' does False; say so $cv | 12:04 | |
camelia | rakudo-moar 014d4c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$cv' is not declaredat <tmp>:1------> 3my $v = '0' does False; say so 7⏏5$cv» | ||
viki | m: my $v = '0' does False; say so $v | ||
camelia | rakudo-moar 014d4c: OUTPUT«False» | ||
12:04
jonas1 joined
12:05
FROGGS[mobile]2 left
|
|||
moritz | dogbert17: I am, on and off | 12:05 | |
viki doesn't really get why that works. False ain't a role.... | |||
m: my $v = '0' but 1; say +$v | |||
camelia | rakudo-moar 014d4c: OUTPUT«0» | ||
viki | m: my $v = '0' but 1; say $v | ||
camelia | rakudo-moar 014d4c: OUTPUT«0» | ||
viki | :| | ||
dogbert17 | moritz: take a look at this, time permitting: gist.github.com/dogbert17/511c3dd5...3204be40c0 | ||
trying to remove the duplicated .from documentation | 12:06 | ||
moritz | dogbert17: by adding a third? :-) | ||
dogbert17: no, looks good | |||
dogbert17 | moritz: thx, will update | 12:07 | |
12:08
nowan_ joined,
sufrostico joined
|
|||
viki | s: &infix:<but>, \(0, 1) | 12:09 | |
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/014d...ors.pm#L83 | ||
viki | m: my $v = '0' but 1; say $v.Int | 12:10 | |
camelia | rakudo-moar 014d4c: OUTPUT«1» | ||
viki | Ah | ||
ZzZombo | "# pi, e, i are built-in constants in Perl 6" | ||
what is i? | |||
viki | m: say i.^name | 12:11 | |
camelia | rakudo-moar 014d4c: OUTPUT«Complex» | ||
moritz | ZzZombo: sqrt(-1) | ||
12:11
nowan left
|
|||
ZzZombo | is it for complex numbers? | 12:11 | |
moritz | yes | ||
ZzZombo | oh | ||
ninja'd | |||
viki | τ is also built-in | ||
m: my $v = '0' but class { method ^name { Numeric }; method gist { "meows!" } }; say +$v | 12:12 | ||
camelia | rakudo-moar 014d4c: OUTPUT«X::Mixin::NotComposable exception produced no message in block <unit> at <tmp> line 1» | ||
12:12
pierre_ joined
|
|||
viki | bah | 12:12 | |
m: my $v = '0' but class { method ^name { Numeric }; method gist { "meows!" } }.new; say +$v | |||
camelia | rakudo-moar 014d4c: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in method name at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
ZzZombo | produced no message | ||
how funny | |||
viki | m: my $v = '0' but class { method ^name ($) { Numeric }; method gist { "meows!" } }.new; say +$v | ||
camelia | rakudo-moar 014d4c: OUTPUT«0» | ||
viki | :( | ||
Well, so much for that! | |||
m: my $v = '0' but class { method ^name ($) { 'Numeric' }; method gist { "meows!" } }.new; say +$v | 12:13 | ||
camelia | rakudo-moar 014d4c: OUTPUT«meows!» | ||
viki | win! | ||
dalek | c: 7b42420 | (Jan-Olof Hendig)++ | doc/Type/List.pod6: The docs for .from was incorrect. moritz++ |
12:14 | |
synopsebot6 | Link: doc.perl6.org/type/List | ||
12:16
pierre_ left
|
|||
viki | m: X::Mixin::NotComposable.new(:target('0'), :rolish(class { method ^name { Numeric }; method gist { "meows!" } })).throw; | 12:16 | |
camelia | rakudo-moar 014d4c: OUTPUT«X::Mixin::NotComposable exception produced no message in block <unit> at <tmp> line 1» | ||
viki | dafuq | 12:17 | |
m: X::Mixin::NotComposable.new(:target('0'), :rolish(class { method ^name { 'Numeric' }; method gist { "meows!" } })).throw | |||
camelia | rakudo-moar 014d4c: OUTPUT«X::Mixin::NotComposable exception produced no message in block <unit> at <tmp> line 1» | ||
viki | Ahhh | 12:19 | |
12:20
smls left
|
|||
viki | It's cause I messed around with ^name. So when it calls it, inside the exception things hexplode | 12:20 | |
m: X::Mixin::NotComposable.new(:target('0'), :rolish(class { method ^name ($) { 'Numeric' }; method gist { "meows!" } })).throw | |||
camelia | rakudo-moar 014d4c: OUTPUT«Cannot mix in non-composable type Numeric into object of type Str in block <unit> at <tmp> line 1» | ||
12:20
kurahaupo__ joined
12:22
khw joined
|
|||
tbrowder | problem solved: I put this line **inside** the subs needing %*ENV: state %*ENV = get-env(); | 12:23 | |
12:23
chienjo joined
|
|||
chienjo | /nick hchienjo | 12:24 | |
12:24
chienjo is now known as hchienjo
|
|||
viki | tbrowder: what was the original problem? | 12:25 | |
12:25
hchienjo left
|
|||
viki | "trying to test a CGI script" ah... well, there's your proble m^_^ | 12:26 | |
^_^ | |||
But the fact that you got a Perl 6 CGI script and you aren't complaining that it's unbearably slow makes me happy :) | |||
And I'm guessing it didn't work before is 'cause it's a dynamic variable | 12:27 | ||
arnsholt | tbrowder: There may be shenanigans going on with persisting %*ENV across process boundaries | 12:29 | |
Depending on exactly how you've got the testing stuff set up | |||
12:33
FROGGS[mobile] joined
|
|||
dalek | c: 049f91e | (Jan-Olof Hendig)++ | doc/Type/List.pod6: Some tidying up |
12:41 | |
synopsebot6 | Link: doc.perl6.org/type/List | ||
12:43
wamba left
12:47
rindolf joined
|
|||
tbrowder | so far it seems to be working, at least enough so i can test the subs from Perl 5 CGI i want. | 12:50 | |
I will provide gist if anyone is interested | |||
BTW, what about putting a link to brian d foy's kickstarter campaign on Perl 6 somewhere? | 12:51 | ||
gfldex | it's on reddit | 12:52 | |
12:54
itaipu left
12:59
kalkin- joined
|
|||
kalkin- | hi | 12:59 | |
A few days ago i had some issues, because I assumed that foo: arg1, arg2. is a valid way to call a function. (Now I know it isn't, it's a label). Now I'm rereading docs.perl6.org/language/functions....#Arguments and notice that i can do f: { say "foo" }; to pass a block to function f | 13:01 | ||
psch | kalkin-: please taboo "function", use "sub" or "method", as appropriate | 13:02 | |
kalkin- | why does this work? shouldn't 'f:' be a label? | ||
psch: ok, thanks | |||
viki | m: sub f(&c) { c xx 10 }; f: { say "wat" } | ||
camelia | rakudo-moar 014d4c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routine: xx used at line 1» | ||
viki | :| | ||
m: sub f(&c) { c() xx 10 }; f: { say "wat" } | |||
camelia | rakudo-moar 014d4c: OUTPUT«wat» | ||
viki | kalkin-: seems to be a mistake in the docs | ||
m: sub f(&c) { c() xx 10 }; f { say "wat" } | 13:03 | ||
camelia | rakudo-moar 014d4c: OUTPUT«watwatwatwatwatwatwatwatwatwat» | ||
jnthn | I think confused docs too. Maybe somebody over-abstracted from the method call colon syntax | 13:04 | |
($foo.bar: $arg1, $arg2) | |||
13:04
pierre_ joined
|
|||
kalkin- | I think viki mentioned last time, that I'm not the first one assuming it, this may be the source of the confusion | 13:04 | |
dalek | c: fde45f2 | (Zoffix Znet)++ | doc/Language/functions.pod6: Fix up function arguments prose to exclude erroneous "adverbial form" |
13:05 | |
synopsebot6 | Link: doc.perl6.org/language/functions | ||
kalkin- | Hmm, why can i do colon syntax on methods? | 13:07 | |
viki | Because it's a thing that exists. | ||
kalkin- | ok but whats' the motivation behind adding a unique way to pass parameters to a method, which subs don't have? | 13:08 | |
viki | Makes it cleaner, especially when nesting. say @foos.map(*.base: 16).grep: * eq '2212'; | ||
jnthn | Subs have listop syntax. Methods don't. | ||
dalek | c: 8858b54 | seatek++ | doc/Language/traps.pod6: documented tail method for last elements too |
13:09 | |
synopsebot6 | Link: doc.perl6.org/language/traps | ||
viki | and you have ambiguity with labels too | ||
jnthn | foo bar 42; # foo(bar(42)) | ||
$x.foo $y.bar 42 # illegal | |||
$x.foo: $y.bar: 42 # $x.foo($y.bar(42)) | |||
viki calls the police | |||
jnthn watches viki | 13:10 | ||
viki puts more clothes on | 13:11 | ||
jnthn | .oO( That sounds freaky if you miss the reference... ) |
||
kalkin- | hmm, i see | 13:12 | |
Thank you for the explanation | |||
cosimo | @madamski: would appreciate if you could have a look at HSD-7409 | 13:14 | |
(sorry) | |||
13:15
seatek left
13:17
bazzaar joined
|
|||
bazzaar | o/ | 13:18 | |
viki | \o | ||
ZzZombo | Do I read it right that each time I create an object, it's possible that a field will be initialized several times by different inherited constructors? | 13:20 | |
bazzaar | moritz: I tried to subscribe to the mailing list for your new perl6 book project, but when I hit the subscribe button on your blog page, nothing seems to happen. | ||
viki | ZzZombo: don't think so, where'd ya read that? | 13:21 | |
DrForr | \o/ \o\ /o/ /o\ HEY MACARENA | ||
kalkin- | m: say f(|c) { .say }; f :a:b | ||
camelia | rakudo-moar 014d4c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unexpected block in infix position (missing statement control word before the expression?)at <tmp>:1------> 3say f(|c)7⏏5 { .say }; f :a:b expecting any of: infix infix …» | ||
ZzZombo | "BUILDALL walks all subclasses in reverse method resolution order (i.e. from Mu to most derived classes) and in each class checks for existence of a method named BUILD. If it exists, it is called, again passing all named arguments from method new to it. If not, the public attributes from this class are initialized from named arguments of the same name." | ||
viki | bazzaar: did you get an email? | ||
kalkin- | m: sub f(|c) { .say }; f :a:b | 13:22 | |
camelia | rakudo-moar 014d4c: OUTPUT«(Any)» | ||
psch | m: class A { has $.a is default(Proxy.new(FETCH => -> $ { say "fetched" }, STORE => -> $, $ { say "stored" })) }; class B is A { }; class C is B { }; C.new(:1a).perl.say | ||
camelia | rakudo-moar 014d4c: OUTPUT«fetchedfetchedfetchedfetchedC.new(a => 1)» | ||
bazzaar | viki: no email, it's been about 10mins | 13:23 | |
viki | bazzaar: try one on perl6book.com/ | ||
ZzZombo: ah, yeah BUILD will be called on each. That's why it's a submethod | 13:24 | ||
kalkin- | m: sub f(|c) { .say }; f :a:b # how do I access all the arguments stored in c? | ||
camelia | rakudo-moar 014d4c: OUTPUT«(Any)» | ||
viki | m: sub f(|c) { c.say }; f :a:b | ||
camelia | rakudo-moar 014d4c: OUTPUT«\(:a, :b)» | ||
kalkin- | ahh no sigil | ||
viki | "c" in that syntax is just a name... you could write f(|whatever) | 13:25 | |
13:25
wamba joined
|
|||
viki | and it's a Capture | 13:26 | |
huggable: Capture | |||
huggable | viki, Argument list suitable for passing to a: docs.perl6.org/type/Capture | ||
viki | huggable: Capture :is: Argument list suitable for passing to a Signature: docs.perl6.org/type/Capture | 13:27 | |
huggable | viki, Added Capture as Argument list suitable for passing to a Signature: docs.perl6.org/type/Capture | ||
ZzZombo | so, there is a caveat of redudant initialization; say I have has $.a=MyClass.new, each constructor in the chain will allocate a new object, won't it? | 13:28 | |
moritz | no | 13:29 | |
viki | ZzZombo: don't think so. It'll just call submethod BUILD for each thing in the chain | ||
moritz | there's one allocation for the object | ||
viki | if it exists | ||
13:29
wamba left
|
|||
moritz | and possibly multiple different BUILD methods are called on the same instance | 13:29 | |
bazzaar: if you /msg me your email address and first name, I can add you manually to the list | 13:30 | ||
13:30
mj41 left
|
|||
bazzaar | viki: nice link, the form also asks for 'Last Name' which the blog form did not, however still nothing seems to happen when the subscribe button is clicked | 13:30 | |
kalkin- | Is there a way to alias subroutine arguments? What i want to achieve is that ls :a is the same as ls :all | ||
viki | kalkin-: yeah... | ||
umm | |||
moritz | kalkin-: yes, sub ls(:all(:$a)) { } | ||
viki | s: 'foo', 'match', \() | 13:31 | |
SourceBaby | viki, Something's wrong: ERR: Could not find candidate that can do \() in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29 in block <unit> at -e line 6 | ||
viki | well, there :) | ||
s: 'foo', 'match', \(/x/) | |||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/014d...r.pm#L1013 | ||
13:31
lucasb_ joined
|
|||
psch | m: sub f(:everything(:all(:$a))) { say "$a" }; f :a; f :all; f :everything | 13:31 | |
camelia | rakudo-moar 014d4c: OUTPUT«TrueTrueTrue» | ||
psch | to arbitrary depths \o/ | ||
although i think the parser pays a bit when there's many of those | |||
kalkin- | psch: how does it work? | 13:32 | |
psch | kalkin-: how does what work? the parser? | ||
viki | I think that's part of destructuring, innit? | 13:33 | |
kalkin- | or can i wrap passed arguments in anything inside a the () of a subroutine? | ||
btw very awesome, that this works :) | 13:34 | ||
viki | There's a blurb in docs.perl6.org/type/Signature#inde...gnature%29 | ||
psch | m: sub f(% (:$a, *%)) { $a }; say f { :a } | ||
camelia | rakudo-moar 014d4c: OUTPUT«True» | ||
bazzaar | moritz: will do, thanks. PS. the book news is really exciting | ||
psch | viki: i suppose it fit at least thematically to destructuring, yeah | ||
i don't have it there in my head, i just have it as "aliasing named parameters" or so | 13:35 | ||
kalkin- | I think destructuring is the keyword I wanted to know, thank psch & viki | ||
jnthn | Me too fwiw; it's just a way to give a named param another name | ||
s/another/an alternative/ | 13:36 | ||
kalkin- | btw: this feature makes perl6 useful as a shell language | ||
I mean as a _shell_ | |||
lucasb_ | when I call methods that use $*ARGFILES (implicitly or explicitly), is it supposed to consume @*ARGS? | 13:37 | |
when I'm done reading $*ARGFILES, then @*ARGS is empty | 13:38 | ||
should it operate on a copy of it? | |||
*shouldn't ... | 13:39 | ||
viki | heh | ||
"write string requires an object with REPR MVMOSHandle" | 13:40 | ||
with perl6 -e 'for $*ARGFILES { .say }; say @*ARGS' foo.txt | |||
pmurias | kalkin-: you mean as a comman line shell of the sorts bash etc. is? | ||
* command | |||
viki | lucasb_: well, what are you doing to $*ARGFILES? | ||
lucasb_ | perl6 -e 'for $*ARGFILES.lines { .say }; say @*ARGS' file... | ||
kalkin- | pmurias: yes | ||
lucasb_ | viki: I'm just reading it using lines() | ||
viki | yeah, weird. | 13:41 | |
lucasb_: I'd say that's a bug, at least as far as what my expectations of behaviour would be | |||
s: $*ARGFILES, 'lines', \() | |||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/014d...les.pm#L79 | ||
lucasb_ | the thing is that ARGFILES is initialized with IO::ArgFiles.new(:args(@*ARGS)) | 13:42 | |
and IO::ArgFiles just goes "shifting" the same array passed as argument, the original array, not a copy | |||
dalek | c: 90da8ef | (Jan-Olof Hendig)++ | doc/Type/Match.pod6: Added some examples to .prematch and .postmatch |
13:43 | |
synopsebot6 | Link: doc.perl6.org/type/Match | ||
jnthn | lucasb_: That could well be intentional. Suppose you found some input error and wanted to report the remaining files that were not processed... | 13:44 | |
13:44
wamba joined
|
|||
jnthn didn't implement it though, so doesn't actually know if it was a concious choise | 13:44 | ||
*choice | |||
I can see the use of it being in-place though | |||
viki | Wouldn't that information be preserved in $*ARGFILES.args ? | 13:45 | |
viki shrugs | |||
Well, the fix is technologically simple :) But I now don't know what the right thing is :) | |||
lucasb_: why did you need @*ARGS to remain? | 13:46 | ||
lucasb_ | I didn't need it for anything... yet :) | ||
I was just surprised the array changed | 13:47 | ||
IO::ArgFiles iterates over the files in @*ARGS... wouldn't it be better if this information be kept inside the object itself | |||
viki | Actually, I call that a bug. The second loop doesn't run here, for example: perl6 -e 'for $*ARGFILES.lines.cache { .say }; for $*ARGFILES.lines { .say }; say @*ARGS' foo.txt | 13:48 | |
lucasb_ | information like, the original :args argument passed, the current filename, the remaing ones, etc. | ||
viki | So you can only do stuff with $*ARGFILES once and then you're screwed | ||
will spectest a fix after my current commit stresstests and goes in | 13:49 | ||
lucasb_ | well, I consider ARGFILES, a *pseudo-handle*, so I wouldn't expect to be able to rewind it, after having read to the end | ||
ZzZombo | am I missing something? All examples only show how to add a getter for a property, but not setters. | ||
Why? | |||
viki | hm | 13:50 | |
ZzZombo | Am I forced to use "set_$prop" names for them, separate from the underlying attribute and the getter? | ||
viki | ZzZombo: use `is rw` | ||
class Foo { has $.meow is rw } | 13:51 | ||
ZzZombo | but if I __NEED__ a custom setter? | ||
psch | 'is rw' gives you an lvalue method | ||
viki | ZzZombo: then write a method | ||
psch | you can just write a multi if you need special logic | ||
or a Proxy | |||
psch & | |||
ZzZombo | I'll keep it mind to learn them then. | ||
13:52
obfusk_ left
|
|||
viki | m: my $cat = class Foo { has $.meow; method whatever is rw { $!meow } }; $cat.new: :meow<mew>; say $cat.meow; $cat.whatever = "moo"; say $cat.meow | 13:52 | |
camelia | rakudo-moar 6d726f: OUTPUT«Cannot look up attributes in a Foo type object in block <unit> at <tmp> line 1» | ||
13:52
pierre_ left
|
|||
viki | camelia: your mother! | 13:52 | |
m: my $cat = class Foo { has $.meow; method whatever is rw { $!meow } }.new: :meow<mew>; say $cat.meow; $cat.whatever = "moo"; say $cat.meow | |||
camelia | rakudo-moar 6d726f: OUTPUT«mewmoo» | ||
viki | ZzZombo: ^ that's one way to do it. Another is to make the method take an arg instead, so you'd use it ast $cat.whatever($some-new-value) | 13:53 | |
lucasb_: OK, then I won't fix anything. Will leave it to someone more familiar with that area | 13:54 | ||
lucasb_ | viki, jnthn: ok, thanks | 13:55 | |
13:55
pierre_ joined
|
|||
dalek | c: af750fd | coke++ | doc/Language/ (3 files): remove trailing whitespace |
14:10 | |
c: d3a0a01 | coke++ | doc/Language/grammar_tutorial.pod6: e.g./i.e. have periods. Replace the i.e. here with an e.g. as it appears to be giving an example, not providing a definition |
|||
synopsebot6 | Link: doc.perl6.org/language/grammar_tutorial | ||
c: 8b1dd9f | coke++ | / (3 files): learn new words, correct small typo |
|||
14:13
pierre_ left
14:14
stux|RC-only left
|
|||
dalek | /advent_volunteer_day4: c1b0abb | (Brian Duggan)++ | misc/perl6advent-2016/schedule: advent day 4: bduggan |
14:14 | |
14:14
pierre_ joined
|
|||
ZzZombo | m: my @a=42,13,666;.say for @$@a; | 14:14 | |
camelia | rakudo-moar 6d726f: OUTPUT«4213666» | ||
ZzZombo | m: my @a=42,13,666;.say for @$@@@$@a; | ||
camelia | rakudo-moar 6d726f: OUTPUT«4213666» | ||
ZzZombo | xD | ||
14:15
stux|RC-only joined
14:16
stux|RC-only left
|
|||
[Coke] grumbles at DrForr for mentioning the macarena, now it's stuck in his head again. | 14:16 | ||
14:17
stux|RC-only joined
|
|||
[Coke] sees he's still on the hook for Dec-01 | 14:17 | ||
ZzZombo | there isn't a module for an array that triggers events for item insertion, replacement and deletion, is there? | 14:18 | |
14:19
pierre_ left
|
|||
timotimo | item insertion is a bit tricky, unless you mean only actually creating new slots | 14:19 | |
other than that, that should be easy to build | |||
ZzZombo | yeah, I think so too, just don't want another wheel on my desk ;) | ||
kalkin- | The REPL can't complete history backwards with a prefix or haven't i just figured out the keybinding? | 14:20 | |
14:20
kalkin- left
|
|||
dalek | : c1b0abb | (Brian Duggan)++ | misc/perl6advent-2016/schedule: advent day 4: bduggan |
14:21 | |
: bec01fb | RabidGravy++ | misc/perl6advent-2016/schedule: Merge pull request #17 from perl6/advent_volunteer_day4 advent day 4: secret santa |
|||
14:21
kalkin- joined
|
|||
timotimo | kalkin-: depends on whether you have Readline or Linenoise, i suppose | ||
kalkin- | Linenoise | ||
timotimo | don't know much about that, but i expect it should have that feature | ||
it may not have logs from previous sessions? | |||
kalkin- | it does | ||
timotimo | OK | ||
kalkin- | normal backward completion works, but not with prefix | 14:22 | |
timotimo | huh | ||
hm, we do ship linenoise source code with the Linenoise module, don't we? | |||
maybe we ought to update that. it could be like a year old by now :P | |||
[Coke] | kalkin - should be the bindings for whatever module you installed, Linenoise, or Readline | 14:24 | |
... I need to make sure I'm caught up in backlog before responding. | |||
gfldex | m: class SpammyArray is Array { multi method ASSIGN-POS(int $pos, Mu \assignee){ say 'oi‽'; callsame } }; my @a is SpammyArray = SpammyArray.new; @a[1] = 42; | ||
camelia | ( no output ) | 14:25 | |
gfldex | m: class SpammyArray is Array { multi method ASSIGN-POS(Int:D $pos, Mu \assignee){ say 'oi‽'; callsame } }; my @a is SpammyArray = SpammyArray.new; @a[1] = 42; | ||
camelia | rakudo-moar 6d726f: OUTPUT«oi‽» | ||
moritz | m: class SpammyArray is Array { multi method ASSIGN-POS(int $pos, Mu \assignee){ say 'oi‽'; callsame } }; my @a := SpammyArray.new; @a[1] = 42; | ||
camelia | ( no output ) | ||
moritz | m: class SpammyArray is Array { method ASSIGN-POS(|c){ say 'oi‽'; callsame } }; my @a := SpammyArray.new; @a[1] = 42; | 14:26 | |
camelia | rakudo-moar 6d726f: OUTPUT«oi‽» | ||
moritz | when you make it a method, you don't compete for specificity with the multis of the parent class | ||
m: class SpammyArray is Array { method ASSIGN-POS(|c){ say 'oi‽'; callsame } }; my @a := SpammyArray.new; @a[1] = 42;; say @a | |||
camelia | rakudo-moar 6d726f: OUTPUT«oi‽[(Any) 42]» | ||
jnthn suggests emitting the events using a Supply too ;) | 14:27 | ||
gfldex | that's a ENODOC I shall fix later | ||
ZzZombo | say (1, 2)[-1]; # Error | 14:28 | |
sigh | |||
jnthn | m: say (1, 2)[*-1] | ||
camelia | rakudo-moar 6d726f: OUTPUT«2» | ||
ZzZombo | m: my @a=1,2;say @a[-1]; | ||
camelia | rakudo-moar 6d726f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1at <tmp>:1------> 3my @a=1,2;say @a[-1]7⏏5;» | ||
ZzZombo | what | ||
jnthn | Heh, it even tells you what I just did :) | ||
ZzZombo | I see but why? | 14:29 | |
timotimo | don't forget that putting in more values can also happen through autovivivfication via AT-POS. | ||
ZzZombo | m: my @a=1,2;say @a[*-1]; | ||
camelia | rakudo-moar 6d726f: OUTPUT«2» | ||
gfldex | because that collects a lot of-by-one bugs | ||
14:29
skids joined
|
|||
timotimo | now if you want to actually go from the end, it's not enough to (even accidentally) give a negative number. you have to state explicitly that you want it | 14:30 | |
also, it generalizes well to percentiles when your array is sorted | |||
14:30
chris2 left
|
|||
gfldex | m: say (1,2).tail | 14:30 | |
camelia | rakudo-moar 6d726f: OUTPUT«2» | ||
ZzZombo | m: my @a=1,2;say @a[*-2..*-1].perl; | 14:31 | |
camelia | rakudo-moar 6d726f: OUTPUT«(1, 2)» | ||
ZzZombo | m: my @a=1,2;say @a[*-2..-1].perl; | ||
camelia | rakudo-moar 6d726f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1at <tmp>:1------> 3my @a=1,2;say @a[*-2..-1]7⏏5.perl;» | ||
ZzZombo | ...I guess I'll just have to accept this and move on. | ||
14:32
chris2 joined
|
|||
viki | m: my @a = ^10; say @a[{$_-1...0}] | 14:33 | |
camelia | rakudo-moar 6d726f: OUTPUT«(9 8 7 6 5 4 3 2 1 0)» | ||
viki | ZzZombo: the *-1 is a fancy way to write sub ($arg) { return $arg - 1 } | ||
ZzZombo: and in this case, the $arg is the length of the array | |||
ZzZombo | m: @a := (1,2; 3,4); | ||
say @a.flat; | |||
camelia | rakudo-moar 6d726f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@a' is not declaredat <tmp>:1------> 3<BOL>7⏏5@a := (1,2; 3,4);» | ||
ZzZombo | eh | ||
m: my @a := (1,2; 3,4);say @a.flat; | 14:34 | ||
camelia | rakudo-moar 6d726f: OUTPUT«(1 2 3 4)» | ||
14:34
zakharyas joined
|
|||
viki | And going off from that idea, you can go all sorts of things vis-a-vis indexing, other than the limiting "passing negative means from end" | 14:34 | |
ZzZombo | I see. | ||
viki | m: my @a = ^10; say @a[{$_-1, *-2, ...0}] | 14:35 | |
camelia | rakudo-moar 6d726f: OUTPUT«5===SORRY!5===Two terms in a rowat <tmp>:1------> 3my @a = ^10; say @a[{$_-1, *-2, ...7⏏050}] expecting any of: infix infix stopper statement end statement modifier statement modifi…» | ||
viki | /o\ | ||
ZzZombo | docs.perl6.org/language/list#The_@_sigil has an error, the line with "# OUTPUT«((1 2 3 4)»" mismatches the output I just got. | ||
viki | m: my @a = ^10; say @a[{$_-1, *-2 ...0}] | ||
weeeeeeeeeeeeeeee | |||
ZzZombo | a curly brace is excessive. | ||
viki | Halting Problem strikes again | ||
camelia | rakudo-moar 6d726f: OUTPUT«(timeout)» | ||
viki | m: my @a = ^10; say @a[{$_-1, *-2 ... * > 0}] | 14:36 | |
camelia | rakudo-moar 6d726f: OUTPUT«(9)» | ||
viki | m: my @a = ^10; say @a[{$_-1, *-2 ... * < 0}] | ||
camelia | rakudo-moar 6d726f: OUTPUT«Effective index out of range. Is: -1, should be in 0..Inf in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
viki shakes fist at the cloud | |||
kalkin- | Replacing Linenoise with Readline and adjusting .inputrc solved my issues | ||
All hail the GNU Project | |||
mspo | libedit++ | 14:37 | |
DrForr | Thanks :) Need to figure out what to do with version numbers this weekend... | ||
viki | m: my @a = ^10; say @a[{$^curly-brace-is-awesome-and-is-not-excessive-1, *-2 ... * <= 1}] | 14:38 | |
camelia | rakudo-moar 6d726f: OUTPUT«(9 7 5 3 1)» | ||
viki | ZzZombo: would you submit a PR to fix that? | 14:39 | |
14:40
mj41 joined
|
|||
ZzZombo | IDK, I'd rather not to do it for each minor occurence. | 14:40 | |
viki | ZzZombo: why not? :) | ||
ZzZombo: would you like a commit bit so you could commit such fixes directly? | |||
ZzZombo | yea, that. | 14:41 | |
14:41
FROGGS joined
|
|||
ZzZombo | m: say $(2, 3).perl | 14:41 | |
camelia | rakudo-moar 6d726f: OUTPUT«$(2, 3)» | ||
FROGGS | o/ | ||
ZzZombo | eh | ||
m: say $(2, 3).WHAT | |||
camelia | rakudo-moar 6d726f: OUTPUT«(List)» | ||
14:42
FROGGS[mobile] left
|
|||
viki | "ZzZombo has been invited!" | 14:42 | |
ZzZombo | sec | ||
viki | Yeah, the sigil stuff is completely different from Perl 5. | ||
m: my $list = <w a a a aa t>; say $list.elems | |||
camelia | rakudo-moar 6d726f: OUTPUT«6» | ||
viki | m: my $list = <w a a a aa t>; say $list | ||
camelia | rakudo-moar 6d726f: OUTPUT«(w a a a aa t)» | ||
psch | m: my $list = <w a a a aa t>; .say for $list | 14:43 | |
camelia | rakudo-moar 6d726f: OUTPUT«(w a a a aa t)» | ||
viki | m: my $list = <w a a a aa t>; $list does Iterable; .say for $list | ||
camelia | rakudo-moar 6d726f: OUTPUT«(w a a a aa t)» | ||
viki | dang :) | ||
m: my $list = <w a a a aa t>; .say for |$list # proper way | |||
camelia | rakudo-moar 6d726f: OUTPUT«waaaaat» | ||
dalek | c: 0602581 | ZzZombo++ | doc/Language/list.pod6: Unneeded curly brace |
14:45 | |
synopsebot6 | Link: doc.perl6.org/language/list | ||
ZzZombo | Hope I didn't break it | ||
viki | Looks fine | 14:46 | |
timotimo | it's easier to ask for forgiveness than permission :) | ||
ZzZombo | yet now I have to go through all 30+ repos that you automatically subscribed me to... :) | 14:47 | |
timotimo | oh crap ;) | ||
viki | oops | 14:48 | |
ZzZombo | if anybody knows bulk unsubcribe, be my guest. | ||
14:48
cdg joined,
jonas1 left
|
|||
viki | heh the Perl 6 group description: "Members of this team have push access to most repositories in the perl6 organization. Because we like to trust, and are too lazy to manage permissions more fine-grained" | 14:49 | |
ZzZombo | aaand done. | 14:50 | |
looks like my previous job | |||
FROGGS | hehe | 14:51 | |
viki | m: say +'-10-i' | ||
camelia | rakudo-moar 6d726f: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3-10-⏏5i' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
ZzZombo | where everybody had sudo shell access to the servers, regardless of ranks and areas of responsibility. | ||
psch | uh, i think a root shell and commit access to a git repo are somewhat different o.o | ||
cosimo | ZzZombo: that's how it should be :-) | 14:52 | |
viki | m: say +'-i' | ||
camelia | rakudo-moar 6d726f: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3-⏏5i' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
mspo | psch: not really | ||
viki | Should these work? | ||
mspo | if you can commit the code you can commit a vulnerability/backdoor/whatever | ||
viki | I wrote some tests on the assumption that it should and now I feel bad about just deleting them :P | ||
DrForr | But other people are watching as well :) | 14:53 | |
ZzZombo | wait, you aren't a bot since you have feelings? :o | ||
viki | mspo: except you have like a 1000 eyes reviewing everything :) | ||
timotimo | except people are lazy :D | ||
viki | ZzZombo: I'm a bot that can emulate feelings :) | ||
ZzZombo | wow | ||
psch | mspo: oh, sure, commit access to the repo can escalate to a root shell somewhere | 14:54 | |
mspo: but that just brings you to the same point -- you have a root shell | |||
mspo | viki: that sounds like an overestimation ;) | ||
psch | and well, if commit access is means of getting you that other thing you're comparing commit access to... well they clearly are different | 14:55 | |
mspo | psch: sure | ||
viki | mspo: perhaps the number of eyes, but at least with rakudo, people comment on my committes minutes after I make an error.... | ||
mspo | oh yeah | ||
viki: I thought you were talking about a job | |||
viki | Oh | ||
timotimo | viki: i bet the irc bot helps a whole lot there :) | 14:56 | |
mspo | backdooring something like perl is obviously more valuable and there should be more scrutiny | ||
viki | Yeah | ||
ZzZombo | so my evil plan is to DDoS the bot, then commit backdoor into p6. Anything else? | ||
mspo | especially perl6 with its multi stage compilation and many runtime tricks and stuff | 14:57 | |
trusting trust and all that | |||
ZzZombo | did I just hear Crusty Crabs somewhere here? | ||
psch | ZzZombo: the bot DoSes itself often enough vOv | ||
ZzZombo | ORLY | ||
poor wee thing | 14:58 | ||
viki | Well, not DoS. It's just a really dumb bot. If you submit too many commits at once or write a long commit message it reports only X number of lines | ||
ZzZombo | I see | ||
psch | viki: oh, we did get it to not Excess Flood anymore? | ||
FSDO "we" | |||
ZzZombo | LOL | ||
timotimo | right, it's easy to get past the irc bot reports | 14:59 | |
prefix your evil commit with a benign commit that has sufficiently many lines of descriptive text and voila | |||
viki | psch: from what I see... the Excess Flood was prevented by just cutting off long messages, instead of doing something sane, like abridging them or pastebinning them | ||
14:59
andrewalker joined
|
|||
timotimo | well, it'd also be possible to just not send these messages as quickly ... | 15:00 | |
viki | psch: oh, actually I do recall excess floods too | ||
so... | |||
viki shrugs | |||
15:00
finanalyst joined
|
|||
viki | Someone *wink* *wink* Needs to rewrite it with IRC::Client | 15:00 | |
15:01
kyclark joined
|
|||
kyclark | What’s the best way to model a deck of shuffled cards from which I want to draw so that I don’t get duplicates. I.e., I can’t draw “2 Clubs” twice from a single deck. | 15:02 | |
15:03
AlexDaniel joined
|
|||
viki | kyclark: a SetHash? | 15:03 | |
kyclark: there's even a .grab method: docs.perl6.org/type/SetHash#(Setty)_method_grab | 15:04 | ||
kyclark | Hmm, yes, I’ll look at that. | ||
ZzZombo | m: (1, 2, 3)[1, 2, :c(3)] | ||
camelia | rakudo-moar 6d726f: OUTPUT«No such method 'Int' for invocant of type 'Pair' in block <unit> at <tmp> line 1» | ||
viki | :c(3) is a Pair | 15:05 | |
m: say Hash ~~ Cool | |||
camelia | rakudo-moar 6d726f: OUTPUT«True» | ||
viki | Kinda weird Hashes are Cool but Pairs aint | ||
psch | kyclark: i'd say a Bag probably. those are for taking things out or putting them in | 15:06 | |
ZzZombo | my jacket is cool, can I use it here as well? *wink* | ||
15:06
cog_ joined
|
|||
psch | although i suppose that might also need to be a BagHash for mutability..? | 15:06 | |
m: say (1, 1, 2).SetHash.perl | |||
camelia | rakudo-moar 6d726f: OUTPUT«SetHash.new(1,2)» | ||
15:07
brillenfux left
|
|||
DrForr | m: my (@s,@n)=<C H D S>,('A',2..10,'J','Q','K'); say @s X @n | 15:07 | |
camelia | rakudo-moar 6d726f: OUTPUT«()» | ||
viki | Well, a deck of cards has just 1 of each | ||
card | |||
psch | well, and it can have any given card more than once. if you explicitely don't want that... yeah | ||
the Bag{,Hash} that is | |||
ZzZombo | m: Array ~~ List | ||
camelia | ( no output ) | ||
psch | m: my @a = ("\x1f0a1"..."\x1F0DE").Set; say @a.grab(10); say +@a | ||
camelia | rakudo-moar 6d726f: OUTPUT«No such method 'grab' for invocant of type 'Array' in block <unit> at <tmp> line 1» | ||
psch | oh shoo | ||
ZzZombo | m: say Array ~~ List | ||
camelia | rakudo-moar 6d726f: OUTPUT«True» | ||
ZzZombo | m: say Array is List | ||
camelia | rakudo-moar 6d726f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3say Array7⏏5 is List expecting any of: infix infix stopper postfix statement end statement modifier…» | 15:08 | |
psch | m: my $a = ("\x1f0a1"..."\x1F0DE").SetHash; say @a.grab(10); say +@a | ||
camelia | rakudo-moar 6d726f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@a' is not declared. Did you mean '$a'?at <tmp>:1------> 3 = ("\x1f0a1"..."\x1F0DE").SetHash; say 7⏏5@a.grab(10); say +@a» | ||
psch | m: my $a = ("\x1f0a1"..."\x1F0DE").SetHash; say $a.grab(10); say +$a | ||
camelia | rakudo-moar 6d726f: OUTPUT«(🃉 🂣 🂬 🂽 🂿 🃊 🃜 🃏 🂡 🂲)52» | ||
DrForr | m: my @s=<C H D S>;my @n=('A',2..10,'J','Q','K'); say (@s X @n).perl | ||
camelia | rakudo-moar 6d726f: OUTPUT«(("C", "A"), ("C", 2..10), ("C", "J"), ("C", "Q"), ("C", "K"), ("H", "A"), ("H", 2..10), ("H", "J"), ("H", "Q"), ("H", "K"), ("D", "A"), ("D", 2..10), ("D", "J"), ("D", "Q"), ("D", "K"), ("S", "A"), ("S", 2..10), ("S", "J"), ("S", "Q"), ("S", "K")).Seq» | ||
psch | hah, chrome renders exactly *one* of those cards... | ||
15:09
FreezerburnV joined
|
|||
psch | probably not quite the right range either i think, 'cause the one it does render is a joker..? | 15:09 | |
15:09
Praise left,
Praise- joined
|
|||
DrForr | irssi renders 8, though I'd swear one's a ... ah, yeah, joker. | 15:09 | |
15:09
cognominal left
|
|||
viki | ZzZombo: List is immutable, while Array is mutable | 15:09 | |
weechat doesn't render any :( | |||
ZzZombo | ye, I'm reading on them right now. | 15:10 | |
kyclark | m: dd (cross <1 2 3>, <D H>).SetHash | ||
camelia | rakudo-moar 6d726f: OUTPUT«SetHash.new(IntStr.new(1, "1"),"H",IntStr.new(2, "2"),IntStr.new(3, "3"),"D")» | ||
ZzZombo | I just wanted to say if 'is' can be used for inheritance checks like smartmatch. | ||
see* | |||
kyclark | Not what I expect | ||
m: my @cards = cross <1 2 3>, <D H>; dd @cards.SetHash | |||
camelia | rakudo-moar 6d726f: OUTPUT«SetHash.new($(IntStr.new(3, "3"), "D"),$(IntStr.new(3, "3"), "H"),$(IntStr.new(2, "2"), "H"),$(IntStr.new(1, "1"), "D"),$(IntStr.new(2, "2"), "D"),$(IntStr.new(1, "1"), "H"))» | ||
kyclark | Why doesn’t the first way work? | 15:11 | |
viki | m: dd (cross <1 2 3>, <D H>) | ||
camelia | rakudo-moar 6d726f: OUTPUT«((IntStr.new(1, "1"), "D"), (IntStr.new(1, "1"), "H"), (IntStr.new(2, "2"), "D"), (IntStr.new(2, "2"), "H"), (IntStr.new(3, "3"), "D"), (IntStr.new(3, "3"), "H")).Seq» | ||
psch | m: say (< 1 2 3 > X <D H>) | ||
camelia | rakudo-moar 6d726f: OUTPUT«((1 D) (1 H) (2 D) (2 H) (3 D) (3 H))» | ||
psch | m: say (< 1 2 3 > X <D H>).perl | ||
camelia | rakudo-moar 6d726f: OUTPUT«((IntStr.new(1, "1"), "D"), (IntStr.new(1, "1"), "H"), (IntStr.new(2, "2"), "D"), (IntStr.new(2, "2"), "H"), (IntStr.new(3, "3"), "D"), (IntStr.new(3, "3"), "H")).Seq» | ||
psch | eh, yeah, &val | ||
m: say Array.isa(List) | 15:12 | ||
camelia | rakudo-moar 6d726f: OUTPUT«True» | ||
psch | ZzZombo: i suspect you wanted that ^^^ | ||
ZzZombo | yep | ||
viki | kyclark: I suspect in the former the inner lists aren't itimized | ||
*itemized | |||
15:12
FreezerburnV left
|
|||
viki | m: dd (cross (1, 2, 3,), <D H>) | 15:12 | |
camelia | rakudo-moar 6d726f: OUTPUT«((1, "D"), (1, "H"), (2, "D"), (2, "H"), (3, "D"), (3, "H")).Seq» | ||
viki | m: dd @ = (cross (1, 2, 3,), <D H>) | 15:13 | |
camelia | rakudo-moar 6d726f: OUTPUT«Array @ = [(1, "D"), (1, "H"), (2, "D"), (2, "H"), (3, "D"), (3, "H")]» | ||
viki | hm | ||
m: dd @ = (cross (1, 2, 3,), <D H>).SetHash | |||
camelia | rakudo-moar 6d726f: OUTPUT«Array @ = [SetHash.new(3,1,"H",2,"D")]» | ||
viki | s: (cross (1, 2, 3,), <D H>), 'SetHash', \() | ||
SourceBaby | viki, Something's wrong: ERR: Type check failed in binding to &code; expected Callable but got Method+{<anon|50466544>} (Method+{<anon|5046654...) in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42 in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29 in block <unit> at -e line 6xE2x90 | ||
15:13
synopsebot6 left,
synopsebot6 joined
|
|||
viki | that bug annoys me | 15:14 | |
15:14
mj41 left
|
|||
viki | m: Seq.new, 'SetHash', \() | 15:14 | |
camelia | rakudo-moar 6d726f: OUTPUT«WARNINGS for <tmp>:Useless use of constant string "SetHash" in sink context (lines 1, 1)Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1» | ||
viki | s: Seq.new, 'SetHash', \() | ||
SourceBaby | viki, Something's wrong: ERR: Too few positionals passed; expected 2 arguments but got 1 in block <unit> at -e line 6 | ||
viki | :( | ||
15:15
FreezerburnV joined,
canopus left
|
|||
viki | m: say .file, .line given (1...*).^lookup('SetHash') | 15:15 | |
camelia | rakudo-moar 6d726f: OUTPUT«SETTING::src/core/Any.pm414» | ||
viki | \o/ | ||
m: say .file, .line given [].^lookup('SetHash') | |||
camelia | rakudo-moar 6d726f: OUTPUT«SETTING::src/core/Any.pm414» | ||
15:16
zakharyas left
|
|||
viki | m: dd @ = (cross (1, 2, 3,), <D H>).list | 15:16 | |
camelia | rakudo-moar 6d726f: OUTPUT«Array @ = [(1, "D"), (1, "H"), (2, "D"), (2, "H"), (3, "D"), (3, "H")]» | ||
viki | m: dd (@ = (cross (1, 2, 3,), <D H>)).list | ||
camelia | rakudo-moar 6d726f: OUTPUT«Array @ = [(1, "D"), (1, "H"), (2, "D"), (2, "H"), (3, "D"), (3, "H")]» | ||
viki | m: dd (cross (1, 2, 3,), <D H>).list | ||
camelia | rakudo-moar 6d726f: OUTPUT«((1, "D"), (1, "H"), (2, "D"), (2, "H"), (3, "D"), (3, "H"))» | ||
Woodi | hi #perl6 :) | 15:17 | |
viki | \o | ||
ZzZombo | "Any Scalar will be stripped from each value and a new Scalar will be wrapped around it." -- why? | 15:18 | |
viki | context? | ||
ZzZombo | docs.perl6.org/language/list#Assigning | ||
dalek | c: 0a33561 | (Jan-Olof Hendig)++ | doc/Type/Match.pod6: Added example to .Str |
||
synopsebot6 | Link: doc.perl6.org/type/Match | ||
Woodi | just installed R* 2016.10 and .tgz have some modules but I think make install do not installed them... and I remember make modules-install or something but it don't work. any way to install supplied modules ? | ||
15:19
CIAvash joined
|
|||
viki | ZzZombo: I think it's so this doesn't leave the $a and its value in @a tangled my $a = 42; my @a = $a; | 15:19 | |
Scalar is a container, so here you're moving the value into a separate container | 15:20 | ||
or something or other :) | |||
jnthn | m: my $a = 42; my @a = $a, $a; $a++; say @a | ||
camelia | rakudo-moar 6d726f: OUTPUT«[42 42]» | ||
jnthn | It's so that doesn't say [43 43] which would be...rathr nasty action at a distance at scale :) | ||
viki | m: my $a = 42; my @a; @a[0] := $a; $a++; say @a | ||
camelia | rakudo-moar 6d726f: OUTPUT«[43]» | ||
viki | yeah | ||
15:21
canopus joined
|
|||
ZzZombo | but the wording suggests (to me at least) that the scalar of $a will be left with -- IDK, nothing? -- and not that it's simply copied into a new one that is then assigned to a slot into the array. | 15:22 | |
viki | Maybe reword it to "any Scalar values will be copied into a new container"? | 15:23 | |
viki doesn't know much about containers... still | |||
ZzZombo | ye | ||
15:24
mj41 joined
|
|||
ZzZombo | there is also an odd 'each value' in a context of 'any scalar', that is, 1-to-1 relation, with nothing more. | 15:25 | |
Woodi | Woodi: A: cd .. from rakudo dir and do make modules-install :) | ||
Woodi: not, that's not working... | 15:26 | ||
psch | m: 5.VAR; my $x = 5; say $x.VAR | ||
camelia | rakudo-moar 6d726f: OUTPUT«5» | ||
psch | m: 5.VAR.say; my $x = 5; say $x.VAR | ||
camelia | rakudo-moar 6d726f: OUTPUT«55» | ||
psch | oh meh, i keep forgetting how that works | ||
viki | m: sub (*@pairs) {dd @pairs[0] }( (cross (1, 2, 3,), <D H>).list ) | 15:28 | |
camelia | rakudo-moar 6d726f: OUTPUT«Int <element> = 1» | ||
viki | m: sub (*@pairs) {dd @pairs[0] }( [cross (1, 2, 3,), <D H>].list ) | ||
camelia | rakudo-moar 6d726f: OUTPUT«List <element> = $(1, "D")» | ||
moritz | m: my $x = 5; say $x.VAR ~~ Scalar | ||
camelia | rakudo-moar 6d726f: OUTPUT«True» | ||
moritz | m: my $x = 5; say $x.VAR.^name | ||
camelia | rakudo-moar 6d726f: OUTPUT«Scalar» | ||
viki | kyclark: ^ that's why basically... Gonna test a fix to see if any of the tests explode | ||
psch | moritz++ | ||
kyclark | Rock on | 15:29 | |
psch | m: my $x = 5; my @a = $x,; say $x.VAR.WHICH; say @a[0].VAR.WHICH | ||
camelia | rakudo-moar 6d726f: OUTPUT«Scalar|77880080Scalar|77880296» | ||
15:32
kurahaupo__ left
15:35
kalkin- left
|
|||
ZzZombo | m: say @array.tail(1..2); | 15:36 | |
camelia | rakudo-moar cb9df2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@array' is not declared. Did you mean any of these? Array arrayat <tmp>:1------> 3say 7⏏5@array.tail(1..2);» | ||
ZzZombo | m: my @a=1,2,3;say @array.tail(1..2); | ||
camelia | rakudo-moar cb9df2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@array' is not declared. Did you mean any of these? Array arrayat <tmp>:1------> 3my @a=1,2,3;say 7⏏5@array.tail(1..2);» | ||
ZzZombo | m: my @a=1,2,3;say @a.tail(1..2); | 15:37 | |
camelia | rakudo-moar cb9df2: OUTPUT«(2 3)» | ||
15:37
kurahaupo__ joined
|
|||
ZzZombo | m: my @a=1,2,3;say "$foo(" ~ @a ~ ")" | 15:39 | |
camelia | rakudo-moar cb9df2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$foo' is not declaredat <tmp>:1------> 3my @a=1,2,3;say "7⏏5$foo(" ~ @a ~ ")"» | ||
ZzZombo | m: my @a=1,2,3;my $foo='foo';say "$foo(" ~ @a ~ ")" | ||
camelia | rakudo-moar cb9df2: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str' in block <unit> at <tmp> line 1» | ||
ZzZombo | m: my @a=1,2,3;my $foo='foo';say "$foo\(" ~ @a ~ ")" | ||
camelia | rakudo-moar cb9df2: OUTPUT«foo(1 2 3)» | ||
moritz | $foo(...) is a call, even inside a quoted string | 15:40 | |
ZzZombo | ye, since the docs didn't clarify that, I had to poke the bot a few times. | ||
timotimo | we should add that to the docs | ||
15:41
bazzaar left
|
|||
viki | kyclark: no love. There are explicit tests for the current behaviour: github.com/perl6/roast/blob/master...set.t#L332 | 15:43 | |
ZzZombo | alright, gonna sleep. Thank everyone :) | 15:44 | |
viki | \o | ||
15:45
cdg_ joined
|
|||
[ptc] | o/ | 15:47 | |
viki | \o | ||
15:48
cdg left
|
|||
timotimo | ō | 15:51 | |
[ptc] wonders what ö would mean in this context... | 15:52 | ||
ilmari | a de-winged camelia | 15:53 | |
timotimo | :( | ||
15:58
Actualeyes left
16:05
finanalyst left
|
|||
AlexDaniel | .u ōö | 16:10 | |
yoleaux | U+00F6 LATIN SMALL LETTER O WITH DIAERESIS [Ll] (ö) | ||
U+014D LATIN SMALL LETTER O WITH MACRON [Ll] (ō) | |||
ilmari | uh, that's the wrong order | 16:11 | |
AlexDaniel | .u ōö | ||
ilmari | .u æøå | ||
yoleaux | U+00F6 LATIN SMALL LETTER O WITH DIAERESIS [Ll] (ö) | ||
U+014D LATIN SMALL LETTER O WITH MACRON [Ll] (ō) | |||
U+00E5 LATIN SMALL LETTER A WITH RING ABOVE [Ll] (å) | |||
U+00E6 LATIN SMALL LETTER AE [Ll] (æ) | |||
U+00F8 LATIN SMALL LETTER O WITH STROKE [Ll] (ø) | 16:12 | ||
AlexDaniel | heh | ||
by the way | |||
.u 🦋 | |||
yoleaux | No characters found | ||
16:12
kyclark left
|
|||
AlexDaniel | if anybody has nothing to do, please rewrite yole in perl 6 :) | 16:12 | |
… or just update it… | 16:13 | ||
16:13
kyclark joined
|
|||
psch | m: say uniname("🦋") | 16:13 | |
camelia | rakudo-moar cb9df2: OUTPUT«BUTTERFLY» | ||
16:13
kyclark left
|
|||
AlexDaniel | hmmm or I can do it myself… | 16:17 | |
yoleaux: help | |||
yoleaux: url | |||
yoleaux: source | |||
psch | .help | ||
yoleaux | psch: I'm yoleaux. Type .commands to see what I can do, or see dpk.io/yoleaux for a quick guide. | ||
AlexDaniel | .mangle I love Perl 6 | 16:18 | |
yoleaux | AlexDaniel: Sorry, that command (.mangle) crashed. | ||
16:18
sufrostico left
|
|||
AlexDaniel | .at 2016-12-31T23:59 Happy New Year! | 16:20 | |
yoleaux | AlexDaniel: Sorry, that command (.at) crashed. | ||
16:22
sufrostico joined,
nicq20 joined
16:23
kent\n left
16:24
kent\n joined
16:25
lostinfog joined,
lostinfog left
16:26
FreezerburnV left
16:29
CIAvash left
16:32
g4 left
|
|||
viki | heh | 16:33 | |
Well, it's a Ruby bot... I wonder if Ruby has been updated for BUTTERFLY and stuff | 16:34 | ||
Cool, P6Intro is now in... Chinese, I'm guessing: zh.perl6intro.com/ | 16:35 | ||
16:42
mj41 left
16:48
FreezerburnV joined
|
|||
moritz | \o/ | 16:48 | |
[ptc] | cool! | 16:49 | |
I'm trying to test Test::Builder at present. Anyone have an idea how to hide invocations of ok, is, etc. from the enclosing TAP instance? | |||
I've managed to confuse TAP since the test ordering is 1,2,1,3,4 etc. | |||
but I don't need the enclosed invocations, just their output | |||
I've tried EVAL, but that's, well, evil, and also doesn't hide the enclosed ok calls from the wrapping TAP instance... | |||
16:49
FreezerburnV left
16:50
FreezerburnV joined
|
|||
psch | [ptc]: redirect $*OUT for the calls you don't want to reach all the way... out? | 16:50 | |
16:50
domidumont left
|
|||
[ptc] | psch: ok, I'll give that a go, thanks for the tip, I'd not thought of that yet | 16:51 | |
16:53
kyclark joined
16:57
cibs left
16:58
cibs joined
|
|||
[ptc] | psch: tried something like this: my $*OLDOUT = $*OUT; $*OUT = IO::Handle.new; my $ok = $tb.ok(1, "This is a test"); $*OUT = $*OLDOUT; | 17:02 | |
psch: however that still prints the output from the "inside" 'ok' call | 17:03 | ||
psch: was that what you meant, re: redirection? | |||
psch | [ptc]: sort of, yes. i was thinking more along the lines of a IO::Handle subclass or so that doesn't print but stores in an array or something | 17:04 | |
17:04
ufobat_ joined
|
|||
psch | [ptc]: i'm not sure assigning IO::Handle.new actually gives you a different $*OUT | 17:04 | |
#: class DummyHandle is IO::Handle { has @.lines; method say(DummyHandle:D: +@lines) { @.lines.push: |@lines } }; $*OUT = DummyHandle.new; say "hi"; say "by"; # sorta like this | 17:06 | ||
17:06
ufobat left
|
|||
[ptc] | ah, ok. Was thinking along the lines of reassigning STDOUT á la Perl5... | 17:09 | |
psch | i don't know how one would do "redirect into an array" in Perl 5, actually | 17:10 | |
probably way more spooky looking than we do it here... :) | |||
17:10
ocbtec joined
|
|||
[ptc] | heh :-) | 17:10 | |
psch | ah, actually open() does that pretty easily, although into a scalar | 17:11 | |
www.perlmonks.org/?node_id=737134 | |||
[ptc] | psch: the standard stuff is under open() in perlfunc: perldoc.perl.org/perlfunc.html | 17:12 | |
ah, you got there before me | |||
hence why I was trying to simply reassign the variable rather than create a subclass or so | 17:13 | ||
psch | yeah, i suppose it is massively easier in Perl 5, actually | 17:14 | |
17:14
wamba left
|
|||
viki | There *is* Test::Output github.com/zoffixznet/perl6-Test-Output | 17:14 | |
psch | m: class A { method foo { say "foo" } }; (A.new but role { method foo { say "bar" } }).foo | ||
camelia | rakudo-moar cb9df2: OUTPUT«bar» | ||
psch | ^^^ that'd be the simplest way i can think of | 17:15 | |
well, with IO::Handle instead of A and print,say,... instead of foo | |||
...but if we have a module that's probably the cleanest solution :) | |||
[ptc] tries Test::Output... | 17:18 | ||
17:18
labster joined
|
|||
[ptc] | hrm, that still passes information up to the enclosing TAP instance | 17:22 | |
thanks for your help everyone! I might have to leave this one 'til the morrow | |||
viki | What sort of information? | 17:23 | |
You can use IO::MiddleMan to contain the output and test it manually whichever way you want, then, I guess. | 17:24 | ||
17:24
FreezerburnV left
|
|||
viki | modules.perl6.org/repo/IO::MiddleMan | 17:24 | |
17:24
dalek left
|
|||
[ptc] | viki: I'm trying to test Test::Builder, so the object under test actually affects the plan and the ordering of the tests seen by e.g. prove | 17:25 | |
I guess I haven't described the problem well enough... :-/ | |||
17:25
dalek joined,
ChanServ sets mode: +v dalek
17:26
nicq20 left,
nicq20 joined
|
|||
kyclark | m: subset Face of Str where * (elem) <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; put 'Jack' ~~ Face; put '2' ~~ Face; | 17:30 | |
camelia | rakudo-moar cb9df2: OUTPUT«TrueFalse» | ||
kyclark | Why isn't "2" recognized as a Face? | 17:31 | |
arnsholt | IntStr shenanigans maybe? | 17:32 | |
Yeah, I think so: | 17:33 | ||
m: say <2>.WHAT | |||
camelia | rakudo-moar cb9df2: OUTPUT«(IntStr)» | ||
17:37
dakkar left
17:38
gregf_ left
17:39
Praise- is now known as Praise
|
|||
psch | m: subset Face of Str where * (elem) <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>>>.Str; put 'Jack' ~~ Face; put '2' ~~ Face; | 17:40 | |
camelia | rakudo-moar cb9df2: OUTPUT«TrueTrue» | ||
viki | kyclark: because (elem) coerces to a Set, which is sensitive to allomorphs, so <2> is IntStr and isn't the same as plain Str | ||
(there's Quantum::Collapse module on the topic FWIW) | 17:41 | ||
kyclark | Is there a workaround? | ||
psch | well, more general, Set doesn't coerce | ||
and <>-quotes are allomorphic | |||
viki | kyclark: don't use (elem) :) | ||
psch | kyclark: because you're using <> quotes, everything you get is allomorphed if possible. Set doesn't do anything to those values, and (elem) doesn't stringify | 17:42 | |
m: say <2> ~~ "2" | |||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
viki | m: subset Face of Str where * eq any <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; put 'Jack' ~~ Face; put '2' ~~ Face | ||
camelia | rakudo-moar cb9df2: OUTPUT«TrueTrue» | ||
psch | m: say "2" ~~ <2> | ||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
psch | meh, stupid liskov :) | ||
viki | .oO( who's liskov ) |
17:43 | |
psch | that one guy who said it's all the same if it's related | ||
viki | heh | ||
psch | so, i guess everyone is liskov..? | ||
kyclark | viki: Thanks! | ||
psch | m: subset Face of Str where * eq any <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; say 2 ~~ Face | 17:45 | |
camelia | rakudo-moar cb9df2: OUTPUT«False» | ||
viki | 2 is not "of Str" | ||
psch | right, nominal before *post* constraints | 17:46 | |
moritz | m: subset Face of Str where any <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; say '2' ~~ Face | ||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
moritz | m: subset Face of Str where any <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; say '1' ~~ Face | ||
camelia | rakudo-moar cb9df2: OUTPUT«False» | ||
viki | moritz: try to match Jack ;) | ||
moritz | m: subset Face of Str where any <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; say 'Jack' ~~ Face | 17:47 | |
camelia | rakudo-moar cb9df2: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Jack' (indicated by ⏏) in any accepts_type at gen/moar/m-Metamodel.nqp line 3435 in block <unit> at <tmp> line 1Actually thrown at: in any a…» | ||
moritz | eeks | 17:48 | |
viki | :) | ||
moritz | m: subset Face of Str where any ~«<2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; say 'Jack' ~~ Face | ||
camelia | rakudo-moar cb9df2: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Jack' (indicated by ⏏) in any accepts_type at gen/moar/m-Metamodel.nqp line 3435 in block <unit> at <tmp> line 1Actually thrown at: in any a…» | ||
timotimo | yeah, smart match against a number, and we try to numify | ||
viki | m: subset Face of Str where any <2 3 4 5 6 7 8 9 10 Jack Queen King Ace>».Str; say 'Jack' ~~ Face | 17:49 | |
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
psch | yeah, that's the thing i did at the start :P | ||
texan though vOv | 17:50 | ||
viki | This is kinda weird tho: | ||
m: .^name.say for +«<2 3 4 5 6 7 8 9 10> | |||
camelia | rakudo-moar cb9df2: OUTPUT«IntIntIntIntIntIntIntIntInt» | ||
viki | m: .^name.say for ~«<2 3 4 5 6 7 8 9 10> | ||
camelia | rakudo-moar cb9df2: OUTPUT«IntStrIntStrIntStrIntStrIntStrIntStrIntStrIntStrIntStr» | ||
viki | So + collapses to Int, but ~ preserves the allomorphs :S | 17:51 | |
psch | m: say (~<1>).WHAT; say (<1>.Str).WHAT | ||
camelia | rakudo-moar cb9df2: OUTPUT«(IntStr)(Str)» | ||
psch | m: say (+<1>).WHAT; say (<1>.Int).WHAT | ||
camelia | rakudo-moar cb9df2: OUTPUT«(Int)(Int)» | ||
psch | yeah that's inconsistent | ||
viki | s: &prefix:<~>, \(<1>) | ||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/cb9d...r.pm#L2616 | ||
viki | lol | 17:52 | |
There's your problem :D | |||
s: &prefix:<+>, \(<1>) | |||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/cb9d...ric.pm#L41 | ||
viki spectest a fix | |||
japhb | .tell tadzik You'd asked me to create a PR to improve Terminal-ANSIColor's example.pl, which I did a couple weeks ago in github.com/tadzik/Terminal-ANSIColor/pull/7 ... are you still interested in that? | 17:54 | |
yoleaux | japhb: I'll pass your message to tadzik. | ||
17:55
pierre_ joined
|
|||
viki | hmmm... a thought occurs.... | 17:55 | |
never mind | 17:56 | ||
17:58
nicq20 left
|
|||
viki | moritz: FYI: www.reddit.com/r/perl6/comments/5d...e/da9rmlr/ | 17:59 | |
viki points at username | |||
17:59
pierre_ left
18:00
roguelazer joined
|
|||
kyclark | Re: pastie.org/10966908, why do I not get 1 when Ace and ! aces-high? | 18:01 | |
I get 11 both times, so I must not be pattern-matching correctly | |||
psch | m: say False ~~ True | 18:02 | |
camelia | rakudo-moar cb9df2: OUTPUT«Potential difficulties: Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead at <tmp>:1 ------> 3say False ~~ 7⏏5TrueTrue» | ||
psch | kyclark: does that ^^^ warning help? | ||
kyclark: or, well, the suggestion inside that warning :) | 18:03 | ||
18:04
cdg_ left
|
|||
viki | bdfoy kinda scares me with articles like that: www.learningperl6.com/2016/11/17/q...sequences/ | 18:05 | |
kyclark | Hmm, sort of. Does it mean I can't use that "given" construct? I have to write an if/elsif chain? | ||
viki | DrForr: if LP6 will have lots of un-idiomatic Perl 6 it'll be all on you! I'll blame you forever :) | ||
mspo | TMTOWTDI? | 18:06 | |
viki | m: gist.github.com/zoffixznet/82b9cc8...8f1a3b2734 | 18:07 | |
camelia | rakudo-moar cb9df2: OUTPUT«2 (False) = 2Jack (False) = 10Ace (True) = 11Ace (False) = 1» | ||
viki | kyclark: just use :so/:!so instead of True/False | ||
kyclark | Ah! Thanks. | 18:08 | |
I was writing !:so | |||
viki | mspo: there's a fine line between TMTOWTDI and weird constructs ;) | ||
psch | m: say 1 [&({$^a.&infix:<+>($^b)})] 2 | 18:09 | |
camelia | rakudo-moar cb9df2: OUTPUT«3» | ||
psch whistles innocently | |||
viki | Especially that last example with variable shuffling It's just a Perl-5-ism | 18:10 | |
psch: I'll rrrrrrrraise ya | 18:12 | ||
m: say 1 RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR[&({$^a.&infix:<+>($^b)})] 2 | |||
camelia | rakudo-moar cb9df2: OUTPUT«3» | ||
viki | ^_^ | ||
18:14
labster left
18:19
Raimondii joined
18:21
Raimondi left,
Raimondii is now known as Raimondi,
eiro joined
|
|||
eiro | hello | 18:21 | |
is there an equivalent of prove in perl6 ? | |||
viki | eiro: not yet | 18:22 | |
eiro: you can use Perl 5's prove with prove -e 'perl6' | |||
18:22
firstdayonthejob joined
|
|||
FROGGS | what about that? github.com/tony-o/perl6-flow | 18:24 | |
kyclark | Given "enum Dir <N S E W>" can I get all the Dirs? | ||
eiro | OMG! so i can use prove to test my zsh test suites, also! awesome | ||
eiro testing | 18:25 | ||
viki | FROGGS: well, it has one professional license :) www.wtfpl.net/about/ | 18:27 | |
We have TAP in core, but last I recall there were still crashes when running many tests at the same time | 18:28 | ||
18:28
stux|RC-only left
|
|||
AlexDaniel | m: enum Dir <N S E W>; say Dir.pick(*) # haha | 18:28 | |
camelia | rakudo-moar cb9df2: OUTPUT«(N S W E)» | ||
viki | and, I'm guessing once that's done we'd ship some sort of a prove-like thing? (maybe?) | ||
psch | don't we have prove6 somewhere in the works? | ||
viki | AlexDaniel: I don't get it :/ | 18:29 | |
psch | github.com/perl6/mu/blob/master/util/prove6 humm | ||
not really "in the works" i'd say :) | 18:30 | ||
viki | There's t/harness6 in rakudo... | ||
"Last commit: Jan 21, 2008"... should work with a couple of changes ;) | |||
18:31
stux|RC-only joined
|
|||
AlexDaniel | m: enum Dir <N S E W>; say Dir::.values | 18:32 | |
camelia | rakudo-moar cb9df2: OUTPUT«(W E S N)» | ||
AlexDaniel | why in reverse? | ||
psch | m: enum Dir <NW SE NE SW>; say Dir::.values | ||
camelia | rakudo-moar cb9df2: OUTPUT«(NW SE SW NE)» | ||
AlexDaniel | m: enum Dir <N S E W>; say Dir::.keys | ||
camelia | rakudo-moar cb9df2: OUTPUT«(W E S N)» | ||
AlexDaniel | so now keys and values are the same thing, hmm… | 18:33 | |
lizmat | m: enum Dir <N S E W>; dd Dir::.keys | ||
camelia | rakudo-moar cb9df2: OUTPUT«("W", "E", "S", "N").Seq» | ||
lizmat | m: enum Dir <N S E W>; dd Dir::.values | ||
camelia | rakudo-moar cb9df2: OUTPUT«(Dir::W, Dir::E, Dir::S, Dir::N).Seq» | ||
AlexDaniel | ah | ||
lizmat | AlexDaniel: they only looks the same in a gist | ||
AlexDaniel | okay | 18:34 | |
psch | and they are not in reverse, but deterministically not-in-order | ||
AlexDaniel | why? | ||
psch | because Associative isn't in-order | ||
jonadab | Hashes do not preserver order. | ||
Because they gain significant perf advantages by not doing so. | 18:35 | ||
AlexDaniel | well, enums are pretty much ordered | ||
psch | i'm just explaining my assumed reason for the current behavior, not judging if it's a good choice vOv | ||
i do agree that an Enum(eration) could be in-order, because, well, it's kinda in the name | 18:36 | ||
AlexDaniel | m: say False.succ | ||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
AlexDaniel | m: say True.succ | ||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
jonadab | Enums tend to be ordered in other languages, granted. | ||
AlexDaniel | m: enum Dir <N S E W>; say +«(N S E W) | 18:37 | |
camelia | rakudo-moar cb9df2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Missing infix inside Sat <tmp>:1------> 3enum Dir <N S E W>; say +«(N S7⏏5 E W) expecting any of: infix infix stopper» | ||
AlexDaniel | m: enum Dir <N S E W>; say +«(N, S, E, W) | ||
camelia | rakudo-moar cb9df2: OUTPUT«(0 1 2 3)» | ||
jonadab | (Other languages also have things that are in some ways similar to Perl hashes, but preserver order, e.g., alists in lisp. But there are performance tradeoffs there.) | ||
*preserve | |||
viki | m: enum Dir <N S E W>; say Dir::.list | 18:38 | |
camelia | rakudo-moar cb9df2: OUTPUT«(W => W E => E S => S N => N)» | ||
viki | m: enum Dir <N S E W>; say Dir.enums | ||
camelia | rakudo-moar cb9df2: OUTPUT«Map.new((:E(2),:N(0),:S(1),:W(3)))» | ||
AlexDaniel | m: enum Dir <N S E W>; say Dir.^enum_values | ||
camelia | rakudo-moar cb9df2: OUTPUT«{E => 2, N => 0, S => 1, W => 3}» | ||
lizmat | m: enum E (A => 666, B => 42); dd E.enums # which order should these be ? | ||
camelia | rakudo-moar cb9df2: OUTPUT«Map.new((:A(666),:B(42)))» | ||
kyclark | m: subset Dir1 of Str where * eq any <N S E W>; put 'N' ~~ Dir1 | 18:39 | |
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
kyclark | m: my @dirs = <N S E W>; subset Dir1 of Str where * eq any <N S E W>; put 'N' ~~ Dir2 | ||
camelia | rakudo-moar cb9df2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared name: Dir2 used at line 1. Did you mean 'Dir1'?» | ||
lizmat | 1. order of definition, 2. alphabetical order on name, 3. order on value ? | ||
AlexDaniel | order of numeric value | ||
kyclark | m: my @dirs = <N S E W>; subset Dir2 of Str where * eq any @dirs; put 'N' ~~ Dir2 | ||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
lizmat | AlexDaniel: fwiw, order of definition feels more natural to me | 18:40 | |
kyclark | Wait, I get "False" on my Rakudo | ||
18:40
cdg joined
|
|||
AlexDaniel | lizmat: except that it never matters | 18:40 | |
viki | AlexDaniel: isn't using an enum in the first place is so that the numerical order doesn't matter? | 18:41 | |
AlexDaniel | and it matches the numeric order unless you tell it to do otherwise | ||
viki | Or order at all for that matter. | ||
kyclark: what's the perl6 -v ? | |||
kyclark | I'm on 2016.10. | ||
viki | commitable: 2016.10 m: my @dirs = <N S E W>; subset Dir2 of Str where * eq any @dirs; put 'N' ~~ Dir2 | ||
committable6 | viki, ¦«2016.10»: True | ||
kyclark | Hmm, it works fine in a script. I must be confused. | ||
viki | Did you quote the quotes correctly? | 18:42 | |
in the shell | |||
AlexDaniel | ‘N’ ;) | ||
18:42
lucasb_ left
|
|||
viki | m: enum Dir <N S E W>; say Dir.enums.sort: *.value | 18:42 | |
camelia | rakudo-moar cb9df2: OUTPUT«(N => 0 S => 1 E => 2 W => 3)» | ||
AlexDaniel | m: enum Dir <N S E W>; say Dir.^enum_value_list | 18:43 | |
camelia | rakudo-moar cb9df2: OUTPUT«(N S E W)» | ||
AlexDaniel | m: enum Dir <N S E W>; dd Dir.^enum_value_list | ||
camelia | rakudo-moar cb9df2: OUTPUT«(Dir::N, Dir::S, Dir::E, Dir::W)» | ||
viki | 0.o | ||
AlexDaniel | m: enum Dir <N S E W T N S L R Z>; dd Dir.^enum_value_list | ||
camelia | rakudo-moar cb9df2: OUTPUT«Potential difficulties: Redeclaration of symbol 'N and S' at <tmp>:1 ------> 3enum Dir <N S E W T N S L R Z>7⏏5; dd Dir.^enum_value_list(Dir::N, Dir::S, Dir::E, Dir::W, Dir::T, Dir::N, Dir::S, Dir::L, Dir::R, Dir::Z)» | ||
AlexDaniel | m: enum Dir <N S E W T L R Z>; dd Dir.^enum_value_list | ||
camelia | rakudo-moar cb9df2: OUTPUT«(Dir::N, Dir::S, Dir::E, Dir::W, Dir::T, Dir::L, Dir::R, Dir::Z)» | ||
AlexDaniel | there we go | ||
kyclark: note that ^enum_value_list is not part of the spec, and in fact is probably considered internal | 18:44 | ||
kyclark | Cool, thanks. | ||
AlexDaniel | kyclark: so don't use it | ||
:) | 18:45 | ||
kyclark | Right. | ||
18:45
cdg left
|
|||
AlexDaniel | I mean, you can, but expect it to break one day because there are no guarantees | 18:45 | |
viki | In fact, we'll break it on purpose, just to point and laugh at you! | 18:46 | |
18:47
domidumont joined
|
|||
AlexDaniel | m: enum Dir ( N => 9999, S => 250, E => 99, W => 50 ); say Dir.^enum_value_list | 18:47 | |
camelia | rakudo-moar cb9df2: OUTPUT«(N S E W)» | ||
AlexDaniel | so it is in declaration order | ||
lizmat starts working on the Perl 6 Weekly | 18:49 | ||
kyclark | Check this error: pastie.org/10966970 Why are the two "subset"s equivalent? | ||
18:50
girafe joined,
andrzejku_ joined
|
|||
viki | kyclark: likely 'cause you want @faces.any instead of any @faces | 18:53 | |
I don't think it flattens like that. | |||
Juerd | lizmat: ♥ p6w | ||
andrzejku_ | hey guys | ||
what do you think about Ruby | 18:54 | ||
viki | m: my @a = ^2; say "0 1" ~~ any @a | ||
camelia | rakudo-moar cb9df2: OUTPUT«Cannot convert string to number: trailing characters after number in '030⏏5 1' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
andrzejku_ | isn it a Perl6? | ||
AlexDaniel | m: my @a = <a b c d>; say ‘a’ ~~ any @a | ||
camelia | rakudo-moar cb9df2: OUTPUT«True» | ||
viki | kyclark: oh nevermind, I guess it does | ||
AlexDaniel | m: my @a = <a b c d>; say ‘z’ ~~ any @a | ||
camelia | rakudo-moar cb9df2: OUTPUT«False» | ||
andrzejku_ | the same feature I mean | ||
viki | andrzejku_: no | ||
m: 42.put | |||
camelia | rakudo-moar cb9df2: OUTPUT«42» | ||
viki | Try that in Ruby.... Totally different features. | ||
AlexDaniel | xD | 18:55 | |
ahhhh | |||
no… | 18:56 | ||
viki | ? | ||
Well, 42.puts too... | 18:57 | ||
Weren't they advertising it as "everything is an object"? | |||
AlexDaniel | ah nvm I'm trying to figure out the Face issue | 18:58 | |
viki | same | ||
works if class is not involved | |||
AlexDaniel | it should be { $_ eq … } I think | 18:59 | |
viki | oh | ||
AlexDaniel | eval: gist.githubusercontent.com/AlexDan...f5/test.p6 | 19:00 | |
evalable6 | AlexDaniel, Successfully fetched the code from the provided URL. | ||
AlexDaniel, rakudo-moar cb9df2b: OUTPUT«Card2.new(face => "Ace", suite => "Diamond")» | |||
viki | Well, yeah, it works if you make it like that, but it's supposed to work with the Whatevercode too | ||
AlexDaniel | eval: gist.githubusercontent.com/AlexDan...aa/test.p6 | ||
evalable6 | AlexDaniel, Successfully fetched the code from the provided URL. | ||
AlexDaniel, rakudo-moar cb9df2b: OUTPUT«(exit code 1) Type check failed in assignment to $!face; expected Card2::Face but got Str ("Face") in block <unit> at /tmp/HLjBl2_nvE line 11» | |||
19:01
domidumont left
|
|||
viki | or should it | 19:01 | |
El_Che | lizmat: I created Linux rakudo packages for 2016.11 in case you're announcng that realease | ||
viki | lizmat: may be worth asking people for Advent posts too? | 19:02 | |
huggable: advent | |||
huggable | viki, github.com/perl6/mu/blob/master/mi...6/schedule | ||
19:02
vendethiel joined
|
|||
lizmat | El_Che viki: will do | 19:02 | |
viki | lizmat++ | 19:03 | |
m: gist.github.com/zoffixznet/28a0b59...3385f0966f | |||
camelia | rakudo-moar cb9df2: OUTPUT«[]Type check failed in assignment to $!face; expected Card2::Face but got Str ("2") in block <unit> at <tmp> line 6» | ||
AlexDaniel | yeah tried that too | ||
viki | kyclark: ^^ my interpretation is that the WhateverCode form gets made during compile time, when the class is created when the array doesn't have anything in it. Or something along those lines. At a guess, sticking that subset outside the class will work | 19:04 | |
kyclark | Yes, that fixes it! | ||
AlexDaniel | well or just use {} I guess | 19:05 | |
viki | aye, and sticking a BEGIN before the array also corroborates my hypothesis: | ||
m: gist.github.com/zoffixznet/09a9b0b...c88c7459d9 | |||
camelia | rakudo-moar cb9df2: OUTPUT«Card2.new(face => "2")» | ||
viki | kyclark: yeah, the cleanest way is to just use the { $_ eq any @blah } instead of moving it outside the class | ||
now... is this a bug or not? :) | 19:06 | ||
AlexDaniel | a trap for sure | ||
even if it is not a bug, perhaps it should throw a warning? | |||
committable6: all gist.githubusercontent.com/zoffixz...005e/p6.p6 | 19:07 | ||
committable6 | AlexDaniel, Successfully fetched the code from the provided URL. | ||
AlexDaniel, gist.github.com/5368a4dad5611cd1d9...933bd92ea7 | |||
19:08
mr-foobar left
|
|||
viki | If there *is* a way to make it work, that'd be nice | 19:08 | |
m: gist.github.com/zoffixznet/4cc5057...915b0a5df9 | 19:09 | ||
camelia | rakudo-moar cb9df2: OUTPUT«CardWorks1.new(face => IntStr.new(2, "2"))CardWorks2.new(face => IntStr.new(2, "2"))Type check failed in assignment to $!face; expected CardBroken::Face but got IntStr (IntStr.new(2, "2")) in block <unit> at <tmp> line 21» | ||
19:09
xinming joined
|
|||
viki | .ask jnthn is this a bug? A subset‒*located inside a class*‒with a WhateverCode that closes over an array doesn't get the values of that array: gist.github.com/zoffixznet/4cc5057...915b0a5df9 | 19:09 | |
yoleaux | viki: I'll pass your message to jnthn. | ||
19:10
darutoko left
|
|||
kyclark | So it's the same error if I move the code to a module: pastie.org/10966991 | 19:12 | |
19:12
cdg joined
|
|||
kyclark | I guess those arrays don't exist? | 19:12 | |
awwaiid | Come to DC for YAPC::NA 2017 / TPC::NA 2017! June 18-23. I think flights from EU will be affordable. news.perlfoundation.org/2016/11/the...-2017.html | 19:14 | |
19:16
labster joined
|
|||
awwaiid | I see "tadzik: Perl 5, Perl 6, and threading one with the other" -- shall I do one on another day that talks about other Inline::* ? | 19:16 | |
perlpilot | Maybe WhateverCode doesn't actually close over anything .... or it takes the closure in different phase-space. | ||
19:16
briandfoy joined
|
|||
tadzik notices a lot more Inline::s that he knew existed | 19:16 | ||
yoleaux | 17:54Z <japhb> tadzik: You'd asked me to create a PR to improve Terminal-ANSIColor's example.pl, which I did a couple weeks ago in github.com/tadzik/Terminal-ANSIColor/pull/7 ... are you still interested in that? | ||
tadzik | oh! | 19:17 | |
19:17
cdg left
|
|||
tadzik | japhb: yes, thanks! :) | 19:17 | |
19:18
AlexDaniel left,
lucasb_ joined,
AlexDaniel joined
|
|||
DrForr | viki: I'm not sure how much influence I have/will have that way :/ | 19:18 | |
awwaiid | tadzik: ya ... Inline::Ruby works pretty well, and this would give me an excuse to work on Inline::Python and others. I need to update gist.github.com/awwaiid/01fe0e56e2c1220548a1 | 19:21 | |
viki | DrForr: actually, based on the invite I just got, I may have the chance to complain loudly first hand :) | 19:22 | |
DrForr | Oh. | ||
19:23
maybekoo2 joined
|
|||
perlpilot | awwaiid++ something on Inline::* would be nice, if nothing else to get the word out there about what's possible | 19:23 | |
awwaiid | I like to tell people that the subtitle of Perl 6 is "Perl 6: The Polyglot Language", and Inline::* is a great example thereof :) | ||
Tangentally, I watched Matz's keynote on the latest Ruby3 ideas, and he said that they are going to avoid type annotations after all and depend completely on "duck-inference" typing. Very interesting. | 19:24 | ||
19:24
Ven_ joined
|
|||
viki wants to work on Inline::Rust ... | 19:25 | ||
It involves learning things tho :( | |||
awwaiid | viki: go for it! You should sign up to give a talk on it, that helps me get things done | ||
jonadab | viki: Not Inline::Intercal? | ||
viki | No idea what Intercal even is :) | 19:26 | |
awwaiid: meh, I'm not giving any more talks. I'm not cut out for it. | |||
awwaiid | It's the opposite of Extracal | ||
viki | Staring at confused faces while talking is a bit too much for me :) | 19:27 | |
awwaiid | I thought you did well in that one video that one time | ||
perlpilot | viki: I had that exact same experience while teaching a class in college. I don't see how profs do it day in and day out. | 19:28 | |
viki | :) | 19:29 | |
huf | they probably imagine some other faces that arent confused and pretend they're talking to them | ||
lends itself especially well to physics: "take an ideal audience of uniform sense" | 19:30 | ||
19:32
eisen74 joined
|
|||
perlpilot | you'll have to tweak the knob for "senseness" a little though | 19:33 | |
jonadab | viki: Consider yourself fortunate :-) | 19:36 | |
lucasb_ | I found a little problem with the $*ARGFILES.lines($n) method | 19:39 | |
psch | i liked tutoring in uni | ||
talks a probably a lot different though | |||
viki | jonadab: heh | ||
lucasb_: whatisit? | |||
lucasb_ | viki: gist.github.com/anonymous/5e107180...70d8f13ede | 19:40 | |
19:41
dha joined
|
|||
viki | Aha | 19:42 | |
lucasb_ | viki: does it make sense? :) | ||
viki | lucasb_: yeah, building a fix | 19:43 | |
Oh, I guess I should've read far enough to see your patch | 19:45 | ||
Wouldn't it pull 1 extra time tho? | |||
Oh never mind, it's a postfix | 19:46 | ||
19:46
wamba joined
19:47
sufrostico left
19:51
Ven_ left
|
|||
viki | fix works. spectesting | 19:52 | |
19:52
cdg joined
19:55
ufobat_ left
|
|||
viki | I need a faster computer... all this spectesting is cutting into my gaming time ^_^ | 19:56 | |
19:56
pierre_ joined
|
|||
tony-o | vps | 20:00 | |
is anyone out there using green ? | |||
20:00
pierre_ left
|
|||
viki | lucasb_: it's in. Thanks. | 20:01 | |
20:02
Tonik joined
|
|||
lucasb_ | viki: yay, thank you! | 20:03 | |
20:03
sufrostico joined
20:04
tojo joined
|
|||
perlpilot | briandfoy++ nice chrysalis | 20:07 | |
viki | ? | 20:09 | |
oh god | |||
perlpilot | update #6 on the kickstarter | 20:10 | |
viki | That's gross really... Bugs are gross >_< | ||
20:11
ZzZombo left,
domidumont joined
|
|||
perlpilot | viki: bugs are the dominant form of living protein on the planet ;> | 20:11 | |
viki | perlpilot: and manure is the dominant nitrogen source for the plants? | 20:12 | |
:) | |||
20:12
mj41 joined
|
|||
viki | TBH I thought the original butterfly he had on the cover had a bit of entomophob's nightmare thing going on... | 20:13 | |
But now with the thing and the legs :o | |||
20:13
ZzZombo joined
|
|||
viki shudders | 20:13 | ||
20:13
ZzZombo is now known as Guest85310
|
|||
dha goes to look at the latest update | 20:13 | ||
yoleaux | 9 Nov 2016 03:35Z <ugexe> dha: can you tell me what OS you are on and send me the output of `ZEF_PLUGIN_DEBUG=1 zef --debug install $problem-module-name`? That should be enough for me to solve your 'no fetching backend available' issue | ||
dha | Oh. Now I have to remember what the problem was... | 20:14 | |
20:18
domidumont left
|
|||
viki | m: subset Face of Str where any ~«<2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; say 'Jack' ~~ Face | 20:19 | |
camelia | rakudo-moar bd4236: OUTPUT«True» | ||
viki | So this now works on HEAD | ||
20:19
mohae left
|
|||
viki wonders | 20:19 | ||
m: class Foo { my @stuff = ~«<2 3 4 5 6 7 8 9 10 Jack Queen King Ace>; subset Face of Str where any @stuff; has Face $.face; }.new: :face('2') | 20:21 | ||
camelia | rakudo-moar bd4236: OUTPUT«Type check failed in assignment to $!face; expected Foo::Face but got Str ("2") in block <unit> at <tmp> line 1» | ||
20:21
mohae joined
|
|||
viki | oh well | 20:21 | |
20:24
ufobat_ joined
|
|||
ugexe | dha: you said you keep getting 'no fetching backend found' error with zef | 20:25 | |
20:28
committable6 left,
bisectable6 left,
benchable6 left,
evalable6 left
|
|||
AlexDaniel | boom! | 20:28 | |
dha | yeah. unfortunately, that was a while ago now, and I don't remember what module was spitting up at me. I'm now trying to install stuff to see if I can reproduce the problem. | ||
RabidGravy | Oh weird I've just had a recruiter send me an informix 4gl job | 20:30 | |
20:30
bisectable6 joined,
ChanServ sets mode: +v bisectable6
20:31
sunnavy left,
committable6 joined,
ChanServ sets mode: +v committable6,
evalable6 joined
|
|||
RabidGravy | I must be the only person in the country owning up to that | 20:31 | |
20:31
benchable6 joined
20:36
tojo left
|
|||
AlexDaniel | soooo… I can't use TWEAK to change an attribute of a parent? | 20:36 | |
ah no | |||
needs “is rw” | 20:37 | ||
tony-o | tweaker | ||
jferrero | m: fi(9).join("-").say; sub fi($N){(0,1,*+*…∞)[0..$N]} | 20:44 | |
camelia | rakudo-moar bd4236: OUTPUT«0-1-1-2-3-5-8-13-21-34» | ||
20:45
ufobat_ left
|
|||
jferrero | m: fi(9).join("-").say; sub fi($N){(0,1,*+*…∞)[0‥$N]} | 20:45 | |
camelia | rakudo-moar bd4236: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Bogus postfixat <tmp>:1------> 3).join("-").say; sub fi($N){(0,1,*+*…∞)[07⏏5‥$N]} expecting any of: infix infix stopper statement end statemen…» | ||
20:48
wamba left
20:49
wamba joined,
telex left
20:50
telex joined
|
|||
viki | m: fi(9).join("-").say; sub fi{(0,1,*+*…∞)[^($^N+1)]} | 20:52 | |
camelia | rakudo-moar bd4236: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unsupported use of $^N variable; in Perl 6 please use $/[*-1]at <tmp>:1------> 3).join("-").say; sub fi{(0,1,*+*…∞)[^($^N7⏏5+1)]}» | ||
20:52
Tonik left
|
|||
viki | lolwut | 20:52 | |
stupid Perl 5 and its variables | 20:53 | ||
m: fi(9).join("-").say; sub fi{(0,1,*+*…∞)[^($^n+1)]} | |||
camelia | rakudo-moar bd4236: OUTPUT«0-1-1-2-3-5-8-13-21-34» | ||
psch | m: my &fi={(0,1,*+*…∞)[^($^a+1)]};fi(9).join("-").say; | ||
camelia | rakudo-moar bd4236: OUTPUT«0-1-1-2-3-5-8-13-21-34» | ||
psch | oh of course that doesn't help | 20:54 | |
20:54
rindolf left
|
|||
viki | .u ‥ | 20:54 | |
yoleaux | U+2025 TWO DOT LEADER [Po] (‥) | ||
psch | well, it's the same #-chars vOv | ||
pmurias | why was split('', 'foo') changed from what it does in Perl 5? | ||
viki | Is that the only thing that changed? :) | 20:55 | |
psch | isn't that "magically use the last pattern we used before which no one remembers because it could be in a different file"? | 20:56 | |
oh, no, that's split(//, 'foo'), sorry | |||
viki | I don't think it's special | ||
[Coke] | the diff is the blank spaces before and after. | ||
viki | Well, yeah, it's 'cause we have .comb for that | 20:57 | |
[Coke] | some kind of consistency. if you want that particular p5 behavior, the new idiomatic way to get it is with: | ||
m: say "foo".comb | |||
camelia | rakudo-moar bd4236: OUTPUT«(f o o)» | ||
[Coke] | (some kind) but I don't remember what kind. :) | ||
20:57
TEttinger joined
|
|||
viki | With everything else. | 20:57 | |
You need :skip-empty if you want Perl 5's behaviour | 20:58 | ||
[Coke] | m: dd split('', 'foo', :skip-empty); | ||
camelia | rakudo-moar bd4236: OUTPUT«("f", "o", "o")» | ||
jferrero | fi(0).join("-").say }; sub fi{(0,1,*+*…∞)[^$^a+1]} | 20:59 | |
m: fi(0).join("-").say }; sub fi{(0,1,*+*…∞)[^$^a+1]} | |||
camelia | rakudo-moar bd4236: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unexpected closing bracketat <tmp>:1------> 3fi(0).join("-").say 7⏏5}; sub fi{(0,1,*+*…∞)[^$^a+1]}» | ||
jferrero | m: fi(0).join("-").say; sub fi{(0,1,*+*…∞)[^$^a+1]} | ||
camelia | rakudo-moar bd4236: OUTPUT«» | ||
viki | You're missing a paren | 21:00 | |
^$^a+1 shifts the whole range up | |||
m: say eager ^3+1 | |||
camelia | rakudo-moar bd4236: OUTPUT«(1 2 3)» | ||
viki | m: say eager ^(3+1) | ||
camelia | rakudo-moar bd4236: OUTPUT«(0 1 2 3)» | ||
jferrero | Ouch! | ||
21:02
rindolf joined
21:09
kaare_ left
21:10
labster left
21:11
seatek joined
21:20
maybekoo2 left
21:22
andrzejku_ left
|
|||
AlexDaniel | m: 8490.chr.ord.say | 21:25 | |
camelia | rakudo-moar bd4236: OUTPUT«75» | ||
21:26
labster joined
|
|||
viki | erl6 -e 'm: 8490.chr.say' | 21:27 | |
grrr | |||
That 8490 sure doesn't like my copy/paste feature :/ | |||
m: 8490.chr.uniname.say | |||
camelia | rakudo-moar bd4236: OUTPUT«LATIN CAPITAL LETTER K» | ||
[Coke] | Decomposition LATIN CAPITAL LETTER K (U+004B) | ||
^^ from www.fileformat.info/info/unicode/ch.../index.htm | 21:28 | ||
21:28
trnh joined,
trnh left,
trnh joined
|
|||
[Coke] | perl6 respects decomposition. (see also the weird greek semicolon) | 21:28 | |
AlexDaniel | yea-yea, of course | ||
21:32
eisen74 left
21:33
wamba left,
wamba joined
|
|||
Juerd | [Coke]: That's not a greek semicolon, but a greek question mark :P | 21:33 | |
[Coke] | ah, right, it just LOOKS like a semicolon. :) | 21:35 | |
Juerd | They probably think our semicolons look like question marks :) | ||
21:35
wamba left,
wamba joined
21:37
caruzo joined
21:38
ruddur joined
21:40
mj41 left
|
|||
lizmat | and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2016/11/21/...perl-6-入门/ | 21:50 | |
seatek | lizmat++ | 21:55 | |
21:57
dha left,
skids left
|
|||
AlexDaniel | m: say 9000000000000000.uniprop | 21:57 | |
camelia | rakudo-moar bd4236: OUTPUT«should eventually be unreachable in block <unit> at <tmp> line 1» | ||
AlexDaniel | :D | ||
well, that's true | 21:58 | ||
21:59
dha joined
|
|||
perlpilot | lizmat++ | 22:00 | |
22:02
bjz left
22:03
obfusk joined
22:16
kurahaupo__ left
|
|||
dha | FWIW, I haven't come across any fetching backend errors with zef today, but I'm seeing a whole bunch of test errors. | 22:16 | |
Maybe I should check how far out of date I am on my Rakudo | |||
22:21
bjz joined
22:22
zilti joined,
RabidGravy left
22:23
espadrine joined
22:25
nicq20_ joined
22:27
FROGGS left
22:28
kyclark_ joined
22:34
bjz left
22:40
wamba left
|
|||
viki | lizmat++ good weekly | 22:43 | |
So the Next YAPC::NA is close enough to me I could drive to it (8hr drive) | 22:44 | ||
viki would go, but don't wanna risk being detained or searched, like last time.... :( | 22:45 | ||
nicq20_ | viki: Well, you Canadians are know for being aggressive about your Maple Syrup. :) | 22:49 | |
viki | :) | ||
tbrowder | ditto viki's comment: lizmat++ good weekly, as usual! | 22:52 | |
tony-o | where is YAPC this year? | 22:54 | |
::NA | |||
lizmat | Alexandria, VA | 22:57 | |
23:01
pierre_ joined
|
|||
tbrowder | re YAPC::NA 2017: in | 23:01 | |
i plan to go if there is enough p6 activity- | 23:02 | ||
lizmat is not too worried about p6 activity | 23:03 | ||
I'm more worried about the trumpification of the US :-( | |||
viki | :) | 23:04 | |
23:05
pierre_ left
|
|||
viki | We obviously need to relocate YAPC::NA to a safer country... umm.. just a random location: Toronto, Canada ^_^ | 23:06 | |
23:10
pmurias left
|
|||
lizmat would welcome that | 23:11 | ||
never been to Toronto yet | |||
but first, some sleep | 23:13 | ||
so good night, #perl6! | |||
viki | -night | ||
dha | night lizmat | ||
There has been a YAPC::NA in Toronto. | 23:14 | ||
lizmat | there has been a YAPC::EU in Amsterdam :-) | ||
timotimo | "should eventually be unreachable" ought to instead read "are you from the future? what horrible things does the unicode consortium have in store for us?!" | ||
lizmat | so there will be a precedent for 2018 NA :-) | ||
afk& | |||
23:18
kyclark_ left
|
|||
viki | I would go for YAPC::EU in Amsterdam :) | 23:19 | |
23:19
ocbtec left
|
|||
viki | heh... it's the first place I found that doesn't have a travel advisory from canuk gov :P | 23:20 | |
(even in US there's thread of Zika virus) | |||
23:22
skink joined
23:23
espadrine left
|
|||
skink | timotimo, I --profile'd that image matching code and all of runtime is stop, wait-for-result, etc | 23:23 | |
timotimo | stop? wait-for-result? do you have some multi-threading or something? | 23:24 | |
skink | This was that thing about .race not improving performance at all | 23:25 | |
23:25
skids joined
|
|||
tbrowder | lizmat: don't worry about Trumpification, the news you see from the US is not generally reliable | 23:25 | |
timotimo | it'd be more interesting to "perf record -g" and see how much time is spent in invocation-related things | 23:26 | |
like fixed_size_alloc and allocate_frame and stuff like that | |||
23:27
lucasb_ left
|
|||
skink | --profile has negligible time for allocs/gc funny enough | 23:28 | |
timotimo | yeah | ||
those aren't part of what the profiler considers allocation | 23:29 | ||
more invocation | |||
also, the profiler doesn't understand multi-threading yet | |||
23:29
unicodable6 joined
|
|||
AlexDaniel | Welcome our new bot :) | 23:30 | |
u: ✓∞× | |||
unicodable6 | AlexDaniel, U+2713 CHECK MARK [So] (✓) | ||
AlexDaniel, U+221E INFINITY [Sm] (∞) | |||
AlexDaniel, U+00D7 MULTIPLICATION SIGN [Sm] (×) | |||
AlexDaniel | u: if there are too many, it will gist it | ||
unicodable6 | AlexDaniel, U+0069 LATIN SMALL LETTER I [Ll] (i) | ||
AlexDaniel, U+0066 LATIN SMALL LETTER F [Ll] (f) | |||
AlexDaniel, U+0020 SPACE [Zs] ( ) | |||
AlexDaniel, gist.github.com/436dbdcdbd5ddc526f...0afc2e5b6c | |||
AlexDaniel | you can also search for names | ||
u: fly butter | |||
unicodable6 | AlexDaniel, U+1F98B BUTTERFLY [So] (🦋) | 23:31 | |
AlexDaniel | and also filter by properties | ||
u: five Nd | |||
unicodable6 | AlexDaniel, U+0035 DIGIT FIVE [Nd] (5) | ||
AlexDaniel, U+0665 ARABIC-INDIC DIGIT FIVE [Nd] (٥) | |||
AlexDaniel, U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE [Nd] (۵) | |||
AlexDaniel, gist.github.com/826524db6b55625c6c...e6ef3c4b28 | |||
AlexDaniel | but most importantly you can pass code blocks! | ||
u: { .uniname.chars > 60 } | |||
unicodable6 | AlexDaniel, U+069C ARABIC LETTER SEEN WITH THREE DOTS BELOW AND THREE DOTS ABOVE [Lo] (ڜ) | ||
AlexDaniel, U+0753 ARABIC LETTER BEH WITH THREE DOTS POINTING UPWARDS BELOW AND TWO DOTS ABOVE [Lo] (ݓ) | |||
AlexDaniel, U+0759 ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW AND SMALL TAH [Lo] (ݙ) | |||
AlexDaniel, gist.github.com/7f7a16100d045149b1...5a15fd3e82 | |||
timotimo | skink: FWIW, whenever an invocation happens at the moar level, so like a sub call or method call, we run to a single-threaded allocator and have two pieces of memory allocated. each time we take and release a globally shared lock. it's currently far from optimal how this all works. | 23:33 | |
23:33
dextertzu left
|
|||
AlexDaniel | there are some tiny issues with it (occasional MoarVM panic in complex cases), but otherwise it is fine :) | 23:34 | |
nicq20_ | AlexDaniel++ | 23:35 | |
23:35
firstdayonthejob left
23:37
caruzo left
|
|||
viki | AlexDaniel++ neat | 23:37 | |
23:39
sufrostico left
23:40
nicq20_ left
23:41
dalek left,
Guest85310 left,
Guest85310 joined
|
|||
timotimo just pushed a nice memory saving thingie to moarvm's master branch | 23:41 | ||
23:41
Guest85310 is now known as ZzZombo,
firstdayonthejob joined
|
|||
timotimo | it'd be nice if people would test it out and report savings for their real world programs | 23:41 | |
because i've just been measuring perl6 -e '' | |||
23:41
dalek joined
23:42
ChanServ sets mode: +v dalek,
xinming left
23:44
rpburkholder joined
|
|||
dha | Hm. JSON::RPC does not like me. That this has come up in the context of installing Task::Star is concerning. :- | 23:46 | |
dalek | ateverable: 196ba7d | (Aleks-Daniel Jakimenko-Aleksejev)++ | Whateverable.pm6: Add $.always-upload attribute For things that should be gisted rather than being sent with  characters. |
23:48 | |
ateverable: a368d2b | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6: Add Unicodable This is a quick and dirty draft of Unicodable, hoping to improve the code in the future. |
|||
23:51
sufrostico joined
|
|||
dalek | ateverable: b7fd9e0 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6: Oops, delete debugging stuff |
23:53 | |
23:53
unicodable6 left
23:54
unicodable6 joined
|
|||
AlexDaniel | .u 2² | 23:55 | |
yoleaux | U+0032 DIGIT TWO [Nd] (2) | ||
U+00B2 SUPERSCRIPT TWO [No] (²) | |||
23:55
xinming joined
|
|||
AlexDaniel | u: 2² | 23:55 | |
unicodable6 | AlexDaniel, U+0032 DIGIT TWO [Nd] (2) | ||
AlexDaniel, U+00B2 SUPERSCRIPT TWO [No] (²) | |||
AlexDaniel | I wonder why yoleaux has a delay | ||
viki | dha: I think that module has been buggy for ages. | 23:59 | |
And wasn't it removed from R*? |