»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:01
wamba joined
|
|||
grondilu doubts it's possible | 00:11 | ||
bioduds_ | it compiles | ||
and asks for the input | |||
grondilu looks in S19 | |||
bioduds_ | Usage: ef8a4da32a.pl [--kv=<Associative>] | 00:12 | |
but I can't seem to find the correct input syntax on the command line | |||
zengargoyle thinks there's a getopt-ish module. always found MAIN args to be *really* hard for anything but basic strind/bool type things. | |||
grondilu does not find any occurrence of C<:%> in S19 | |||
sub MAIN( *%options ) {...} does work | 00:15 | ||
and it might be what you wanted to do | |||
strangely though, sub MAIN(Str *%options) {...} fails | 00:16 | ||
zengargoyle | but i myself was thinking of asking a similar question about same sort of thing with '@'. | ||
bioduds_ | grondilu : how would it be called on the command line? | ||
grondilu | perl6 prog.p6 -foo=bar -pi=3.14 | ||
it's not a named h | |||
% | |||
basically you will not use the name of the hash on the command line. You only give the pairs it will be made of. | 00:18 | ||
bioduds_ | let me try | 00:19 | |
grondilu | there's really not much point in using a named parameter when there is only one parameter, anyway. | ||
(unless you have multiple candidates, of course) | 00:20 | ||
bioduds_ | cool, this works for me | ||
grondilu is glad he could help | 00:21 | ||
bioduds_ | thanks, man | 00:23 | |
:) | |||
if you find out later if and how naming the parameter on the MAIN could work, please tell me | 00:24 | ||
grondilu | I keep doubting it's possible. | 00:26 | |
you'd have to somehow pass a Perl 6 syntax on the shell command line. That can't fly, can it? | 00:27 | ||
zengargoyle thinks a HOWTO-MAIN doc is needed. :) | |||
grondilu | how MAIN works should be the main subject of a perl6 man page. | 00:28 | |
wait, scrap that. | |||
zengargoyle | with a bunch of practical-ish examples. | ||
grondilu realizes that not all Perl 6 programs have a MAIN subroutine. | 00:29 | ||
bioduds_ | well, my user-ish role would say: if it's there, there must be a way to use it | ||
anyhow, since this here sub MAIN( *%kv, Str :$new ) { is working | 00:30 | ||
then it does what I need | |||
grondilu | it's kind of special though. MAIN has a Perl 6 syntax but its semantics transcend Perl 6 to go into shell territory. | ||
00:30
canopus left
|
|||
grondilu | so it's not too surprising that there is a mismatch at some point. | 00:31 | |
zengargoyle | i think the issue is that it's just a standard sub specification and going from 'chunk of text from CLI' -> Perl6-thing. | ||
yeah, that. | |||
grondilu is always happy when he can use the verb "transcend" in a sentence :) | |||
bioduds_ | surely, only one hash set so to speak can be captured by this approach | 00:32 | |
but it gives a lot of room actually, doesn't it? | 00:33 | ||
grondilu | I don't follow you | ||
00:33
sufrostico left
|
|||
zengargoyle | the slurpy only permits one hash (or array) at end. | 00:34 | |
00:37
tushar joined
|
|||
zengargoyle thinks that going from array of string from CLI to variables is going to take getopt-ish complexity vs simple sub signature. | 00:41 | ||
otherwise we'd be able to call any P6 sub with and array of strings and have it work. :) | |||
grondilu | also, doesn't the correct syntax for a long parameter name in shell requires two and not just one dash? | 00:50 | |
like $ dothis --with-parameter=the-parameter | 00:51 | ||
and $ dothat -x=2 | |||
zengargoyle | yeah, and Bool have some weird --\name for the false case. | ||
just took a quick peek at perl6-all-modules and found no MAIN that use anything other than :$ | 00:52 | ||
grondilu is not surprised | |||
anything else would require some form of marshallization, shouldn't it? | |||
s/shouldn't/wouldn't/ | 00:53 | ||
zengargoyle | i once made a :$file that was type checked to IO.r or something but it was crazy hard vs just getting a string and checking myself. | ||
grondilu | strings are more or less the only types the shell and Perl 6 have in common. No wonder that's what is used for argument passing between them. | 00:54 | |
zengargoyle | this all brings back horrible memories of programming where you didn't even get an array of strings but just one string you had to parse yourself. | 00:55 | |
grondilu | meh, that happened often for me. | 00:56 | |
I mean like, unacceptably often. | |||
bioduds_ | being able to *%kv is awesome enough | ||
opens up a bunch of opportunities | |||
im already using it | |||
:) | |||
grondilu | bioduds_: I would recommend naming it *%options though | 00:57 | |
bioduds_ | makes no diff, here look: sub MAIN( *%kv, Str :$op ) { with %kv { for %kv.kv -> $key, $value { get-json( WHERE => $key, EQUALS => $value, op => $op ); } } without %kv { get-json; } } | ||
this is what im doing, im treating it right away | 00:58 | ||
grondilu | or even *%command-line-options if you don't mind being verbose. | ||
bioduds_ | cause in my case here, im building a key=>value NoSQL system | ||
so the parameters are actually the key and the value to be searched | 00:59 | ||
so, they are not actually options | |||
grondilu | does sub MAIN (*%kv, Str :$op) {...} behaved as you expected? I'm a bit surprised it's even legal. | ||
bioduds_ | yes, perfectly | ||
now I can do search for name="Some Name" op="eq" | 01:00 | ||
and search rate="4.3" op="gt" | |||
works fine | |||
grondilu | m: sub (*%h, :$foo) { say %h.perl }(foo => "bar") | ||
camelia | rakudo-moar 8aa0aa: OUTPUT«{:foo("bar")}» | ||
grondilu | m: sub (*%h, :$foo) { say %h.perl, " and ", $foo }(foo => "bar") | 01:01 | |
camelia | rakudo-moar 8aa0aa: OUTPUT«{:foo("bar")} and bar» | ||
grondilu | hum... so the argument ends up in both parameters. That's slightly weird. | ||
zengargoyle | how many 'op'? | 01:02 | |
bioduds_ | a few | 01:05 | |
zengargoyle | m: sub (:$foo, *%h) { say %h.perl, " and ", $foo }(foo => "bar") | ||
camelia | rakudo-moar 8aa0aa: OUTPUT«{} and bar» | ||
bioduds_ | eq, lt, gt, lte, gte | ||
for starters | |||
zengargoyle | slurpy should go at end i think. | ||
but makes op need to be first i think. | 01:06 | ||
bioduds_ | what do you mean? | ||
sorry, didn't quite catch what you're trying to say | |||
zengargoyle | m: sub (:$foo, *%h) { say %h.perl, " and ", $foo }(foo => "bar", foo => "baz") | 01:08 | |
camelia | rakudo-moar 8aa0aa: OUTPUT«{} and baz» | ||
zengargoyle | pondering collison when op is a name for a parameter and a poddible key in kv.... | 01:09 | |
bioduds_ | oh, yes | ||
correct | |||
zengargoyle | thought checking :$op first would grab first --op and *% would get any additional --op... | 01:10 | |
bioduds_ | perhaps subset Operator where "eq"|"gt"|"lt"; | ||
zengargoyle | don't seem to work that way. :P | ||
bioduds_ | with sub MAIN( *%kv, Operator :$op ) { | ||
zengargoyle | yeah, or i was thinking earlier of multi sub MAIN('eq', ...) multi sub MAIN('lt', ...) | 01:11 | |
sorta sub-command like. | |||
01:12
Actualeyes joined
|
|||
zengargoyle | but it forces order to your parameters. | 01:12 | |
01:13
pierre_ joined
|
|||
bioduds_ | yes | 01:13 | |
zengargoyle loves to have a multi sub MAIN('test') in progs. | |||
bioduds_ | declarative programming to the rescue! :D | ||
grondilu would rather write it multi sub MAIN(:$test!) | 01:16 | ||
so that it's called as $ perl6 prog --test | |||
01:17
pierre_ left
|
|||
mst | I like my perl5 solution | 01:17 | |
where if it's a module, it loads, and if it's a script, iut runs | |||
see p3rl.org/App::opan | |||
(note i mention this in a spirit of "steal!" not anything else ;) | 01:18 | ||
grondilu wonders if you can call MAIN inside a MAIN to do recursion. | |||
zengargoyle | just another sub. | 01:20 | |
grondilu tries. Indeed, just an other sub. | |||
zengargoyle | i wonder about multi dispatch tho with :$test! | 01:21 | |
vs *@args or somesuch | |||
mst | |c is your friend | 01:22 | |
zengargoyle | always wins? | ||
bioduds_ | how would I go about checking if some string meets my subset? | 01:23 | |
i mean, introspection | |||
zengargoyle | $str ~~ subset | ||
? | |||
bioduds_ | ok, this | 01:24 | |
thanks | |||
zengargoyle | just guess, if is don't work file a LTA bug. :P | ||
bioduds_ | unless ($key ~~ Operator) { get-json( WHERE => $key, EQUALS => $value, op => $op ); } } | ||
scott | I made a really simple perl6 script I'd like to be able to run as part of my shell, but it consistently takes about 250ms to run. I noticed in --stagestats that the parse stage is consistently slow: "Stage parse : 0.160". is there a way to avoid re-parsing every time, for a simple one-off script? | 01:25 | |
part of my shell prompt* | |||
zengargoyle | make most of script a module that gets precomipled and then tiny script that uses module? | 01:26 | |
scott | I wonder if that would even help, considering the script is already tiny | ||
20 lines of uncomplicated code | |||
zengargoyle | maybe not. | ||
scott | this is the script gist.github.com/solson/c28d547b5d3...ed905dc099 | 01:27 | |
running it directly with `perl6` is just too slow for my purpose, unless there's some way to make it avoid re-parsing | 01:28 | ||
bioduds_ | now eq, lt, gt, gte, lte are reserved | ||
great | |||
zengargoyle : also, as you pointed, sub MAIN( Operator :$op, *%kv ) { instead of sub MAIN( *%kv, Operator :$op ) { | |||
zengargoyle | scott: IMHO perl6 isn't fast enough yet for *quick* depending on values of *quick*. | 01:29 | |
scott | startup time is the only thing that really matters here | ||
(which is dominated by parsing) | 01:30 | ||
zengargoyle | yeah, not sure if 'use Foo;Foo::run' is faster than just 'Foo' for 20 lines or not... | 01:31 | |
scott | it'd be cool if standalone scripts could get precompiled like modules do | 01:32 | |
grondilu | just make it a module | 01:33 | |
zengargoyle | i think it's on the wishlist. at least that's what i'm told everytime i bring it up. | ||
scott | I'm not familiar with how to make modules yet, and this kind of becomes more inelegant than ruby as soon as it uses more than one file | ||
01:33
eliasr left
|
|||
grondilu | what if you just add 'unit module ::;' on the top? Wouldn't that do precompilation? | 01:34 | |
zengargoyle | oh, i means script to standalone executable... | ||
scott | grondilu: I'll try it | ||
01:34
canopus joined
|
|||
scott | grondilu: seems to have no effect, at least when running `perl6 format-duration.p6` | 01:35 | |
grondilu | indeed | 01:36 | |
scott | actually, it had an effect in that MAIN wasn't executed anymore, but parsing was still slow each time | ||
grondilu | well, I tried. | ||
a module should execute MAIN though, if called as a program. | 01:37 | ||
shouldn't it? | 01:38 | ||
zengargoyle | i would suspect not | 01:39 | |
grondilu | scott: maybe you can compile it with --target=moar or something | 01:41 | |
scott | that gets me gist.github.com/solson/1e801aef7c3...a75645c63c | 01:42 | |
grondilu | I don't recall the exact syntax. jnthn once showed me but I forgot. | 01:43 | |
I do remember it is possible though. | |||
zengargoyle | maybe that changed when things started going into compunitrepos instead of fs. | 01:44 | |
or try morevm... | |||
01:45
TEttinger joined,
wamba left
|
|||
grondilu | --target=mast do work but it'd be silly to use that. | 01:47 | |
zengargoyle | --target=mbc --output=file.mbc works.... | 01:50 | |
or at least created the file and i don't know how to run it. :P | 01:51 | ||
grondilu | --target=mbc maybe? I can't test it right now I'm compiling rakudo | ||
nope | 01:52 | ||
scott | zengargoyle: yeah, that worked for me | 01:55 | |
zengargoyle | can't figure out how to run it.... think it takes: moar + some libpaths | 01:56 | |
grondilu | just copy what the perl6 executable do :) | ||
$ cat $(which perl6) | 01:57 | ||
scott | I managed to get moarvm to segfault attempting that | ||
grondilu | oh yeah I forgot you want to feed it with bytecode | 01:58 | |
do $ moar --help, I think it tells you to use --dump | 01:59 | ||
oh no, sorry | |||
zengargoyle | Unhandled exception: Could not look up the container config for 'rakudo_scalar' | 02:01 | |
grondilu | yeah, got the same | 02:02 | |
02:07
tushar left
02:08
cbk_ left
02:09
samcv left
|
|||
bioduds_ | grondilu : you're right, this here is better multi sub MAIN( Operator :$op, *%kv ) { for %kv.kv -> $key, $value { unless ($key ~~ Operator) { get-json( WHERE => $key, EQUALS => $value, op => $op ); } } } multi sub MAIN() { get-json; } | 02:10 | |
zengargoyle | my sorta guess is that file.mbc has to be somehow combined with bootstrap or core or some other mbc to get to the stage where it's directly runnable by moar. | ||
like some ld stage... | 02:11 | ||
02:12
noganex joined
02:15
noganex_ left
|
|||
grondilu | as I said I vaguely recall jnthn showing it can be done and it was not very complicated. | 02:17 | |
02:18
BenGoldberg joined
|
|||
grondilu | though it's possible I'm confusing things | 02:18 | |
zengargoyle | yeah, one of those things that waiting for somebody who knows to show up is probably faster than trying to figure it out... | 02:20 | |
scott | thanks for looking into it | 02:32 | |
zengargoyle squirrel! | 02:33 | ||
02:34
johnjohn101 joined
|
|||
johnjohn101 | hi perl6 | 02:34 | |
zengargoyle | it's odd that it's BOOTSTRAP.moarvm where the error pops up. | ||
i'm sorta miff'd that my simple test doesn't work. :P | 02:36 | ||
turning 'perl6 test.p6' into 'nqp test.nqp' into 'moar test.mbp' into just './test' is a worthy progression. | 02:42 | ||
02:49
samcv_ joined,
samcv_ is now known as samcv
03:00
cowens left
03:10
BenGoldberg left
03:12
kaare_ joined
03:14
johnjohn101 left,
pierre_ joined
03:18
flexibeast left
03:19
pierre_ left
|
|||
awwaiid | Just posted blog mentioning Perl 6, thelackthereof.org/TLT/2016.09.23/...he_Methods | 03:32 | |
03:37
labster left,
luis` joined,
kst` joined,
canopus left,
woolfy left,
[1]ringer1 left,
noganex_ joined,
djbkd_ joined,
zhmylove joined,
Xliff_ joined,
mohae_ joined,
setty2 joined,
cpage__ joined,
bisectable6 left,
committable6 left,
amalia_ left,
leego left,
pyrimidine joined,
sjohnsen- left,
luis left,
[particle] left,
pdcawley left,
kmwallio left,
timeless left,
setty1 left,
camelia left,
Timbus left,
inokenty left,
synopsebot6 left,
kmwallio joined,
setty2 is now known as setty1,
notbenh left,
infina left,
ringer1 joined,
DarthGandalf left,
mattp__ joined,
Sgeo_ joined,
Gothmog_ left,
lizmat_ joined,
dalek left,
labster1 joined,
inokenty1 joined,
committable6_ joined,
bisectable6_ joined,
dalek joined,
pdcawley_ joined,
zhmylove_ left,
mattp_ left,
TEttinger left,
perigrin left,
Jonis left,
krunen left,
pochi_ left,
chee left,
sergot left,
ChanServ sets mode: +v dalek,
Timbus joined,
perigrin_ joined,
leego joined,
noganex left,
TimToady left,
ft left,
jnthn left,
mst left,
ggherdov left,
Grrrr left,
Jonis_ joined,
nebuchad` joined,
dj_goku_ joined,
kaare__ joined,
krunen__ joined,
DarthGandalf joined,
kaare_ left,
zoosha left,
dj_goku_ left,
dj_goku_ joined,
sjn left,
cooper left,
awwaiid left,
hcit left,
woodruffw left,
cxreg left,
nightfrog left,
avuserow left,
erdic_ joined,
AndyBotwin left,
psch left,
spider-mario left,
markk left,
Guest60806 left,
shadowpaste left,
sjn_ joined,
pierrot left,
sftp left
03:38
simcop2387 left,
mohae left,
TEttinger joined,
_notbenh joined,
awwaiid joined,
profan_ joined,
Sgeo left,
bpmedley left,
vcv left,
dylanwh left,
rjbs left,
masak left,
rcy left,
tailgate left,
BinGOs_ joined,
cpage_ left,
Khisanth left,
djbkd left,
masak joined,
_notbenh is now known as notbenh,
vcv_ joined,
AlexDaniel left,
breinbaas left,
lizmat left,
perlpilot left,
aindilis` left,
MilkmanDan left,
facetious joined,
cxreg2 joined,
dylanwh joined,
sjohnsen joined,
Praise left,
krunen__ is now known as krunen,
a3r0 left,
ponbiki left,
john51 left,
sftp joined,
cpage__ is now known as cpage_,
kst left,
grondilu left,
broquaint left,
bhm left,
BooK left
03:39
ilogger2_ joined,
AndyBotwin joined,
KotH_ joined,
perlpilot joined,
a3r0 joined,
orevdiabl joined,
ponbiki joined,
mspo_ joined,
richi238 joined
03:40
ponbiki is now known as Guest17098,
amalia_ joined,
telex joined,
pochi joined,
Guest71143 joined,
ggoebel_ joined,
[particle] joined
03:41
arnsholt_ joined,
Khisanth joined
03:42
john51 joined,
grondilu joined,
Grrrr joined,
ChanServ sets mode: +v camelia,
edenc_ joined
03:43
sivoais joined,
pierrot joined,
wtw joined,
mst_ joined,
tinita joined,
Upasaka joined,
Celelibi_ joined
03:44
decent joined,
woodruffw joined
03:48
psch joined,
rjbs joined,
BillSussman joined,
krunen_ joined,
richi238 left,
labster joined,
pochi left,
[1]ringer1 joined,
emdashcomma joined,
bob777 joined,
Bucciarati_ joined,
skaji_ joined,
edenc_ left,
bjz joined,
luis joined,
markk_ joined,
gensym joined,
grondilu_ joined,
[particle] left,
[particle]1 joined,
domm1 joined,
mohae joined,
matt_ joined,
perigrin joined,
matt_ is now known as Guest28917,
kaare__ joined,
Guest71143 left,
richi235 joined,
AndyBotwin left,
vytas-local_ joined,
facetious joined,
wtw left,
MilkmanDan joined
03:49
grondilu left,
vytas left,
garu_ left,
ssm left,
dsp_ left,
Juerd_ joined,
decent left,
telex left,
dan joined,
MilkmanDan left,
MilkmanDan joined,
Juerd_ is now known as Juerd,
decent joined,
canopus joined,
vcv joined,
moritz_ joined,
xinming joined,
Sgeo joined,
beatdown joined,
profan joined,
edenc joined,
gabiruh joined,
Gothmog_ joined,
hcit joined,
wtw joined,
avuserow joined,
m0ltar joined
03:50
ssm joined,
pdcawley joined,
xiaomiao joined,
cgfbee joined,
jnthn joined,
olinkl joined
03:51
tony-o joined
03:52
breinbaas joined,
AlexDaniel joined,
john51 left,
atacama joined,
ilbot3 joined,
john51 joined,
ft joined
03:53
sunnavy joined
03:54
rmmm joined,
raydiak joined
03:55
ingy joined,
giraffe_ joined,
masak_ joined,
dsp_ joined,
shadowpaste joined
03:56
richi235 left,
grondilu_ left,
sivoais left,
sivoais joined
03:57
lizmat joined,
Actualeyes joined
03:58
richi235 joined,
dj_goku joined,
dj_goku left,
dj_goku joined
03:59
garu joined
04:00
bartolin joined,
sivoais left
04:03
pochi joined,
telex joined
04:05
ggherdov joined
04:10
w4and0er96 joined
04:11
BuildTheRobots joined
04:14
timeless joined
04:19
bob777 left,
Actualeyes left,
bob777 joined
04:20
[particle] joined,
ringer1 joined
|
|||
SmokeMachine____ | Hi! I am having this problem, but the module (i think) is in the right place... any suggestion? | 04:20 | |
04:20
mohae_ joined,
garu left,
NeuralAnomaly_ joined,
huggable_ joined
|
|||
SmokeMachine____ | www.irccloud.com/pastebin/TCh2pnb9/ | 04:20 | |
04:20
ingy left,
vcv left,
masak_ left,
john51 left,
[ptc]_ joined,
giraffe_ left,
garu_ joined,
Actualeyes1 joined,
timeless left,
Spot__ joined,
breinbaas left,
markk_ left,
[1]ringer1 left,
Spot__ left,
Spot__ joined,
w4and0er96 left,
[particle]1 left,
SourceBaby joined,
nemo_ joined,
vcv joined,
breinbaas joined,
Woodi_ joined,
atacama left,
[ptc]_ is now known as [ptc],
Khisanth left,
ingy joined,
atacama joined,
richi235 left,
vytas-local_ left,
BuildTheRobots left,
edenc left,
beatdown left,
NeuralAnomaly left,
pochi left,
jcallen left,
ggherdov left,
Juerd left,
arnsholt_ left,
Sgeo left,
pierrot left,
cgfbee left,
dan left,
MilkmanDan left
|
|||
salparadise | SmokeMachine____: code causing the problem will help I think | 04:20 | |
04:20
erdic joined
04:21
Gothmog_ left,
beatdown_ joined,
Gothmog_ joined,
DANtheBEASTman joined,
vytas-local_ joined,
sftp joined,
Juerd joined,
mohae left,
Sgeo joined,
jcallen joined,
poisonby joined
04:22
camelia joined,
spider-mario joined,
cgfbee joined,
richi235 joined,
inokenty joined
04:23
kmwallio joined,
ChanServ sets mode: +v camelia,
pochi joined,
Unavowed joined
04:24
giraffe_ joined
04:25
john51 joined
|
|||
SmokeMachine____ | I have a module ProblemSolver on ./lib/ProblemSolver.pm6 and a ProblemSolver::State on ./lib/ProblemSolver/State.pm6 | 04:25 | |
04:25
petercommand joined,
markk joined
04:26
abruanese joined,
imcsk8 joined
|
|||
SmokeMachine____ | and a test t/03-problem.t that does: use lib "lib"; use ProblemSolver; | 04:26 | |
04:26
huf joined
|
|||
SmokeMachine____ | salparadise: ^^ | 04:26 | |
04:26
john51 left,
simcop2387 joined
|
|||
SmokeMachine____ | ProblemSolver and ProblemSolver::State are classes... | 04:26 | |
04:27
[Coke] joined
|
|||
SmokeMachine____ | salparadise: ant idea? | 04:27 | |
04:27
arnsholt joined,
MilkmanDan joined,
masak_ joined,
japhb joined,
pierrot joined,
Khisanth joined,
labster left
04:28
eyck joined,
cosimo joined,
sivoais joined
04:29
ggherdov joined
|
|||
salparadise | not really, more code, is ProblemSolver something you wrote? | 04:30 | |
SmokeMachine____ | www.irccloud.com/pastebin/0ERDdoJc/ | ||
yes, I did write ProblemSolver and ProblemSolver::State | |||
04:33
clkao joined
04:34
Util joined,
infina joined,
timeless joined
04:35
w4and0er96 joined,
john51 joined
04:36
wtw_ joined,
Cabanossi joined
04:38
wtw left
|
|||
SmokeMachine____ | Looks that the problem is when I create a attribute with the use'd type as type | 04:39 | |
04:41
holyghost joined
04:47
baest_ joined
04:50
baest_ left
04:52
baest joined
05:02
cbk_ joined
05:05
cpage_ joined
05:16
pierre_ joined
05:17
melezhik joined
05:20
pierre_ left
05:21
cbk_ left
05:30
AlexDaniel left
05:38
pierre_ joined
05:50
grondilu joined
05:56
yoleaux joined,
ChanServ sets mode: +v yoleaux
05:58
holyghost left,
pierre_ left
05:59
wamba joined
06:01
kurahaupo joined
06:11
ufobat joined
06:30
andrzejku joined
06:41
kurahaupo left
06:49
KotH_ is now known as KotH
06:52
Matthew[m] joined
06:56
wamba left
07:05
darutoko joined
07:32
firstdayonthejob joined
07:35
kaare__ is now known as 92AAADCOE,
edenc joined,
BuildTheRobots joined,
jnap_ joined,
PotatoGim joined,
kipd joined,
Peter_R joined,
damnlie joined,
jsimonet joined,
albongo joined,
avalenn joined,
isacloud joined,
DrParis joined,
kipd left,
kipd joined,
PotatoGim left,
PotatoGim joined,
jnap_ left,
jnap_ joined,
BuildTheRobots left,
BuildTheRobots joined,
andrzejku left,
BuildTheRobots left
07:36
espadrine joined
07:39
PotatoGim left
07:41
BuildTheRobots joined
07:45
PotatoGim joined
07:50
grondilu left
07:52
andrzejku joined
07:55
RabidGravy joined
08:03
andrzejku left
08:05
cyphase joined
08:07
andrzejku joined
08:08
cpage_ left
08:10
cpage_ joined,
FROGGS joined
08:13
breinbaas left,
cyphase left
08:14
breinbaas joined
|
|||
moritz_ | SmokeMachine____: have you used ProblemSolver::State in ProblemSovler.pm? | 08:17 | |
08:18
cyphase joined
08:25
[particle] left,
[particle] joined
08:29
andrzejku left
08:38
cyphase left
08:39
BinGOs joined
08:41
domidumont joined
08:45
cyphase joined
08:46
domidumont1 joined,
domidumont left
08:47
andrzejku joined
08:48
ka joined
08:58
BillSussman left
09:04
eliasr joined
09:08
bpmedley joined
09:10
labster joined
09:12
domidumont1 left
09:25
hanekomu joined
09:27
Bucciarati_ is now known as Bucciarati,
hanekomu left,
canopus left
09:29
hanekomu joined
09:32
canopus joined,
Ven_ joined
09:37
Ven_ left,
Ven_ joined
|
|||
dalek | line-Perl5: a03cc7b | niner++ | lib/Inline/Perl5.pm6: Faster and safer check to determine if we construct a subclass object |
09:37 | |
09:38
nebuchadnezzar joined
09:51
Ven__ joined
09:52
Ven_ left
09:55
RabidGravy left
10:03
ka left
10:08
setty1 joined
10:11
yqt joined
10:13
nadim_ joined
10:14
firstdayonthejob left
10:20
andrzejku left
10:21
labster left
10:23
ocbtec joined
10:31
Ven__ left
10:35
imcsk8 left,
imcsk8 joined
10:38
wamba joined
|
|||
El_Che | impressive netsplit | 10:42 | |
10:53
Actualeyes1 left
|
|||
dalek | c: 8dd339e | (Jan-Olof Hendig)++ | doc/Type/Range.pod6: Added some more code examples plus some sundry stuff |
11:00 | |
11:08
Actualeyes joined
|
|||
bioduds_ | hey guys | 11:14 | |
is this here valid? a hash of hashes? my %hash-set = { "técnico" => { "Marcelo Oliveira" => Técnico.new( nome=>"Marcelo Oliveira", gênero=>"Homem", idade=>49, rate=>3.88 ) }, { "Levir Culpi" => Técnico.new( nome=>"Levir Culpi", gênero=>"Homem", idade=>52, rate=>4.12 ) }, { "Cuca" => Técnico.new( nome=>"Cuca", gênero=>"Homem", idade=>49, rate=>"-" ) }, "tim | |||
psch | m: my %h = foo => { bar => 1, baz => 2 }; say %h<foo><bar> | 11:15 | |
camelia | rakudo-moar 539a7d: OUTPUT«1» | ||
psch | bioduds_: no, it's not, because you're assigning a one-item list to a hash | 11:16 | |
m: my %h = { a => 1 } | |||
camelia | rakudo-moar 539a7d: OUTPUT«Potential difficulties: Useless use of hash composer on right side of hash assignment; did you mean := instead? at <tmp>:1 ------> 3my %h = { a => 1 }7⏏5<EOL>» | ||
psch | m: my %h = { a => { b => 2 } } | ||
camelia | rakudo-moar 539a7d: OUTPUT«Potential difficulties: Useless use of hash composer on right side of hash assignment; did you mean := instead? at <tmp>:1 ------> 3my %h = { a => { b => 2 } }7⏏5<EOL>» | ||
psch | oh, no, my private test was just weird | ||
bioduds_: do you get an error from the compiler? or just that warning | |||
? | |||
bioduds_: because in general we try to make the compiler make sense when it says something :) | 11:17 | ||
11:23
domidumont joined
|
|||
bioduds_ | warning I guess | 11:23 | |
Potential difficulties: Useless use of hash composer on right side of hash assignment; did you mean := instead? at /home/ubuntu/dev/futs/scripts/ef8a4da32a.pl:37 | |||
psch | m: my %h = { a => 1 }, { b => 2 }; say %h.keys # useful use of hash composers, as counter example | 11:24 | |
camelia | rakudo-moar 539a7d: OUTPUT«(a b)» | ||
psch | m: my @a = [ 1, 2, 3 ]; say @a.elems | ||
camelia | rakudo-moar 539a7d: OUTPUT«3» | ||
dalek | c: 3ad38ad | (Jan-Olof Hendig)++ | doc/Type/Str.pod6: Added blurb in docs for split that specifying a negative limit does not produce any meaningful result. |
11:26 | |
bioduds_ | what is it telling me? I don't understand the warning: Potential difficulties: Useless use of hash composer on right side of hash assignment; did you mean := instead? at /home/ubuntu/dev/futs/scripts/ef8a4da32a.pl:38 | 11:27 | |
psch | bioduds_: { } is a hash composer, it composes a hash | 11:28 | |
bioduds_: a hash assignment means you're assigning to a hash | |||
bioduds_ | why is it saying that it is useless? | 11:29 | |
psch | bioduds_: assignments to sigiled variables are coercive, so you're uselessly creating a hash that the assignment could create for you | ||
bioduds_ | oh, I think I get it, so how would be the non-useless syntax? | ||
psch | leave out the outer-most hash composer | ||
11:30
rindolf joined,
CIAvash joined
|
|||
bioduds_ | oh, I think I got it | 11:30 | |
the outer { is useless | 11:31 | ||
got it, thank guys | |||
11:32
ka joined
|
|||
bioduds_ | meaning, this here will suffice: my %hash-set = "técnico" => { "Marcelo Oliveira" => Técnico.new( nome=>"Marcelo Oliveira", gênero=>"Homem", idade=>49, rate=>3.88 ), "Levir Culpi" => Técnico.new( nome=>"Levir Culpi", gênero=>"Homem", idade=>52, rate=>4.12 ), "Cuca" => Técnico.new( nome=>"Cuca", gênero=>"Homem", idade=>49, rate=>"-" ) }, "time" => { "C | 11:32 | |
great | |||
11:32
scott joined
|
|||
scott | I'm also learning perl6 and just cleared this up for myself in the repl. a => 1 is a Pair, {a => 1} is a Hash, but like they say, assigning a pair or list of pairs to a %-sigil variable coerces to hash anyway | 11:32 | |
11:34
Ven_ joined
11:36
Ven_ left,
Ven_ joined
|
|||
scott | it's also fine to put regular parentheses around your list of pairs, as in `my %h = ( a => 1, b => 2, ... )`, since that's still just a list of pairs | 11:38 | |
SmokeMachine____ | moritz_: yes | 11:40 | |
11:41
mst_ is now known as mst,
mst left,
mst joined
11:42
mst is now known as mst_,
mst_ is now known as mst
11:46
Ven_ left
11:49
ka left
11:55
infina left,
infina joined
11:56
ka joined
12:05
92AAADCOE left
12:06
ka left
12:08
ka joined
12:20
sammers joined
12:21
rindolf left
12:30
dayangkun joined
12:36
rindolf joined,
bstamour joined
12:40
dayangkun left,
dayangkun joined
12:44
pmurias joined
12:45
dayangkun left,
bstamour left
12:47
Zoffix joined
|
|||
Zoffix | scott, I recommend you think of Hash as %(a => 1) rather than {a => 1}. It's easy to get tripped up in cases where the curly version gets treated as a block | 12:48 | |
m: $_ = 42; dd { a => $_ } # case in point | |||
camelia | rakudo-moar 539a7d: OUTPUT«-> ;; $_? is raw { #`(Block|57555136) ... }» | ||
Zoffix | scott, also, you don't need any parentheses at all. my %h = a => 1, b => 2; works | 12:49 | |
m: my %h = a => 1, b => 2; | |||
camelia | ( no output ) | ||
Zoffix | m: my %h = a => 1, b => 2; dd %h | ||
camelia | rakudo-moar 539a7d: OUTPUT«Hash %h = {:a(1), :b(2)}» | ||
scott | heh, I was just messing with cases involving that {} confusion | ||
Zoffix | m: my %h = :1a, :2b; dd %h | ||
camelia | rakudo-moar 539a7d: OUTPUT«Hash %h = {:a(1), :b(2)}» | ||
scott | for multiline hashes, it seems nicer to have a delimiter around it | 12:50 | |
Zoffix | .oO( Death to parentheses! ) |
||
scott | the semicolon looks really awkward when there is no delimiter | ||
on a line by itself, or taking a place where a trailing comma should be | 12:51 | ||
relatedly, I'm attempting to grok the whole variables/bindings/assignment situation in perl6. are there any important differences between `my %h = :1a, :2b` and `my Hash $h := %(:1a, :2b)` (post-creation)? they both seem to handle assignment the same way, they seem to have the same .VAR type | 12:55 | ||
12:56
rindolf left
12:57
pierre_ joined
|
|||
llfourn_ | scott: you don't really need the 'Hash' in the second one if you want it to be like the first | 12:57 | |
also % will behave differently in for loops to $ | |||
12:57
ilbot3 left,
ilbot3 joined
|
|||
llfourn_ | m: my %a = one => "two",three => "four"; for %a { .say } | 12:58 | |
camelia | rakudo-moar 539a7d: OUTPUT«three => fourone => two» | ||
llfourn_ | m: my $a := %( one => "two",three => "four"); for $a { .say } | ||
camelia | rakudo-moar 539a7d: OUTPUT«three => fourone => two» | ||
llfourn_ | oh maybe I'm wrong about that | ||
m: my $a := %( one => "two",three => "four"); for $a { .^name.say } | |||
camelia | rakudo-moar 539a7d: OUTPUT«PairPair» | ||
scott | in this case $a.VAR isn't Scalar, it's Hash | 12:59 | |
llfourn_ | m: my $a = %( one => "two",three => "four"); for $a { .^name.say } | ||
camelia | rakudo-moar 539a7d: OUTPUT«Hash» | ||
12:59
Zoffix left
|
|||
llfourn_ | oh you're right that's the difference | 12:59 | |
so the container type determines loop behaviour rather than the sigil | |||
good to know :) | |||
scott | basically I'm trying to find out if I can reduce all sigils to special cases of $ to help my mental model | 13:00 | |
llfourn_ | I think sigils still affect assignment | 13:01 | |
like when you use '=' rather than ':=' | |||
scott | '=' seems to depend again on the container, not the sigil | ||
once I make $h like above, assigning to it later works the same as for a normal %h | 13:02 | ||
llfourn_ | m: my @a = <one two three>; say @a | ||
camelia | rakudo-moar 539a7d: OUTPUT«[one two three]» | ||
llfourn_ | m: my Array $a = <one two three>; say $a | ||
camelia | rakudo-moar 539a7d: OUTPUT«Type check failed in assignment to $a; expected Array but got List ($("one", "two", "three")) in block <unit> at <tmp> line 1» | ||
scott | right, that's not the case I am referring to | ||
that's assigning to a Scalar-wrapped Array | 13:03 | ||
llfourn_ | m: my Array $a := [one two three]; $a = <one two three>; say $a # oh I see sorry | ||
camelia | rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routines: three used at line 1 two used at line 1» | ||
llfourn_ | m: my Array $a := [<one two three>]; $a = <one two three>; say $a # :S | ||
camelia | rakudo-moar 539a7d: OUTPUT«Cannot assign to an immutable value in block <unit> at <tmp> line 1» | ||
13:03
wamba left
|
|||
scott | interesting | 13:04 | |
I'm unsure what makes @a mutable and $a not when their .VARs are both Array | |||
llfourn_ | you can have @a immuteable as well | ||
13:04
rindolf joined
|
|||
scott | can you make that $a mutable? | 13:04 | |
llfourn_ | m: my @a := <one two three>; @a = <four> | 13:05 | |
camelia | rakudo-moar 539a7d: OUTPUT«Cannot modify an immutable Str in block <unit> at <tmp> line 1» | ||
scott | oh | ||
llfourn_ | it will be mutable if we just assign to an array | ||
m: my $a = [<one two three>; $a = <four>; say $a | |||
camelia | rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Cannot use variable $a in declaration to initialize itselfat <tmp>:1------> 3my $a = [<one two three>; $7⏏5a = <four>; say $a expecting any of: term» | ||
llfourn_ | m: my $a = [<one two three>]; $a = <four>; say $a; #ek | 13:06 | |
camelia | rakudo-moar 539a7d: OUTPUT«four» | ||
llfourn_ | but as sson as you := you get the container fo the RHS | ||
which is immuteable above | |||
of the* | 13:07 | ||
scott | m: my $a = [<one two three>]; say $a.VAR.WHAT | ||
camelia | rakudo-moar 539a7d: OUTPUT«(Scalar)» | ||
scott | m: my @a = <one two three>; say @a.VAR.WHAT | 13:08 | |
camelia | rakudo-moar 539a7d: OUTPUT«(Array)» | ||
scott | m: my $a := [<one two three>]; say $a.VAR.WHAT # this is what I meant, rather | ||
camelia | rakudo-moar 539a7d: OUTPUT«(Array)» | ||
scott | I'm curious what makes one mutable and the other not | ||
if you compare, say, my $a = 42 and my $a := 42, one is Scalar and the other is Int | |||
and the Scalar container makes the former mutale | |||
mutable* | |||
llfourn_ | right. you can't assign the second one for the same reason you can't do '42 = 3' | 13:09 | |
you can't do [<one two three>] = [<four>] either | 13:10 | ||
so the LHS needs to be writeable | |||
13:11
domidumont left
|
|||
scott | hmm, the $h example was writeable because %(:1a, :2b) is writeable | 13:13 | |
but @(1, 2, 3) returns List, not Array | |||
I don't know how to make a writeable array without a @ variable | 13:14 | ||
llfourn_ | m: my $a := [<one two three>]; $a[3] = "four"; # this should work? | ||
camelia | ( no output ) | ||
llfourn_ | m: my $a := @(1,2,3); say $a.^name; | 13:15 | |
camelia | rakudo-moar 539a7d: OUTPUT«List» | ||
llfourn_ | hmm I didn't know whtat | ||
that* | |||
scott | your example with the indexing mutates a container element, not the array | ||
m: my $a := [<one two three>]; push $a, "four" | 13:16 | ||
camelia | ( no output ) | ||
scott | hmm, it is writeable? | ||
llfourn_ | so Array,Hash - elements are writable. List,Map elements are not. | ||
13:17
ilbelkyr joined
|
|||
scott | I still don't get what makes @a assignable | 13:17 | |
timotimo | awwaiid: i like your latest blog post :) | ||
llfourn_ | scott: as opposed to $a := [..]? | 13:18 | |
scott | since arrays, even when you can push to them, complain about immutable values when you assign to them | ||
llfourn_: right | |||
immutable is a bit of a misleading descriptor when you can add, remove, and mutate elements | |||
13:19
grondilu joined
|
|||
timotimo | an array gives you a scalar container for each of the elements in it | 13:19 | |
llfourn_ | scott: yeah I see what you mean. In the case of $a := [..]. it means the variable's container itself is not writable. | ||
gfldex | is there a way to import symbols from a package into the current scope? | ||
timotimo | m: (1, 2, 3, 4)[0].VAR.WHAT.say; [1, 2, 3, 4][0].VAR.WHAT.say; | ||
camelia | rakudo-moar 539a7d: OUTPUT«(Int)(Scalar)» | ||
scott | timotimo: sure, that explains one of the things in my list (mutating) but not the rest | ||
timotimo | i haven't backlogged yet :) | 13:20 | |
scott | you can also push to an "immutable" array | ||
llfourn_ | scott: all arrays are mutable | ||
grondilu | m: (my $ := [])[0] = pi | ||
camelia | ( no output ) | ||
llfourn_ | the variable that contains the array object may not be | ||
timotimo | ah | 13:21 | |
we differentiate on the syntax level between listy assignment and itemy assignment | |||
that's a thing that tripped me up a few times | |||
scott | llfourn_: I'm looking for confirmation of that distinction | 13:22 | |
with scalars it's obvious, like Scalar vs Int | |||
normally a $ variable is bound to a Scalar container | |||
grondilu | [] is a scalar container | ||
scott | but so far I haven't been able to observe the container of a @ variable | ||
it just shows up as Array | 13:23 | ||
but assigning to an Array elsewhere fails | |||
grondilu | $@ | ||
llfourn_ | hmm I'm not sure how you introspect the difference | ||
grondilu stops trying to disrupt the conversation :) | |||
timotimo | m: my $foo := [<one two three>]; @$foo = <nein nein nein>; say $foo.perl | 13:24 | |
camelia | rakudo-moar 539a7d: OUTPUT«["nein", "nein", "nein"]» | ||
timotimo | m: my $foo := [<one two three>]; $foo = <nein nein nein>; say $foo.perl | ||
camelia | rakudo-moar 539a7d: OUTPUT«Cannot assign to an immutable value in block <unit> at <tmp> line 1» | ||
llfourn_ | hmmm i didn't know you could do that | ||
timotimo | the first one uses the p6store op, the second one uses the assign op | 13:25 | |
llfourn_ | so @$foo turns it into array assignment | ||
timotimo | "op" as in nqp::thething | ||
llfourn_ | mmm pretty handy :) | ||
scott | what makes @$foo different from $foo? is there any type of thing I can call on it? | 13:26 | |
all the .WHATs and .VAR.WHATs are the same | |||
timotimo | it's just a thing the parser does | ||
i.e. it's not about the type, it's about the source code itself | |||
13:26
pierre_ left
|
|||
scott | so it would not work to first bind @$foo to something and then assign to that new thing? | 13:27 | |
llfourn_ | mm so it's a syntactical distiction rather than a object property | ||
m: my $foo; @$foo := <one two three> # eh? | |||
camelia | rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Cannot use bind operator with this left-hand sideat <tmp>:1------> 3my $foo; @$foo := <one two three> # eh?7⏏5<EOL>» | ||
llfourn_ | m: my $foo; @$foo = <one two three> | 13:28 | |
camelia | rakudo-moar 539a7d: OUTPUT«Cannot modify an immutable Any in block <unit> at <tmp> line 1» | ||
timotimo | scott: correct | ||
scott | confirmed my own question in the repl | ||
I assumed it was like @$foo returned a new type of thing, and then we assigned to that | |||
timotimo: are there good docs on this? | |||
timotimo | not sure. if not, there ought to be :) | 13:29 | |
scott | I find the variable/binding/container stuff some of the most complex stuff in perl6 so far | ||
llfourn_ | it's pretty tricky tbh :) | ||
scott | hard to see what justifies the complexity a lot of the time | ||
13:29
andrzejku joined
|
|||
scott | unlike, say, operators, which look complex at first but I generally understood after just a day | 13:30 | |
llfourn_ | I think auto-vivification among other things | ||
m: my %h; my $a := %h<one>; say %h; %a = "foo"; say %h | |||
camelia | rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '%a' is not declared. Did you mean '$a'?at <tmp>:1------> 3my %h; my $a := %h<one>; say %h; 7⏏5%a = "foo"; say %h» | ||
llfourn_ | m: my %h; my $a := %h<one>; say %h; $a = "foo"; say %h | 13:31 | |
camelia | rakudo-moar 539a7d: OUTPUT«{}{one => foo}» | ||
timotimo | that's definitely a tricky part, yes | ||
but also incredibly useful | |||
llfourn_ | I am no use at exlpaining it but I also can verify the distinction between variables and containers is very useful. | 13:32 | |
dogbert17 | .seen moritz | 13:35 | |
yoleaux | I saw moritz 22 Sep 2016 13:51Z in #perl6: <moritz> we don't call it dumbmatch for no reason! | ||
dogbert17 | moritz: are you out there? | ||
scott | thanks for the discussion, all. 'night | 13:36 | |
timotimo | gnite scott | ||
llfourn_ | night :) | ||
13:38
rgrinberg joined
13:40
masak_ is now known as masak
|
|||
masak | greetings, #perl6 | 13:42 | |
I see there was a netsplit storm here while I was away... :) | 13:43 | ||
13:43
kaare joined,
kaare is now known as Guest94548
|
|||
timotimo | oh, i missed that | 13:44 | |
13:46
rgrinberg left
13:47
rgrinberg joined
14:01
MilkmanDan left,
setty1 left,
MilkmanDan joined
14:05
skids joined
14:07
rgrinberg left
|
|||
timotimo | twitter.com/kelseyhightower/status...72/photo/1 - teehee | 14:09 | |
14:18
tushar joined
14:25
tushar left,
rindolf left
14:28
Guest94548 left
14:29
ka left
14:30
Guest94548 joined
14:40
AlexDaniel joined
14:41
rindolf joined
14:47
ka joined
14:52
BenGoldberg joined,
Xliff__ joined
14:56
domidumont joined
|
|||
skids | Hrm... COMPOSE{} is NYI? | 15:00 | |
Oh I guess that | 15:03 | ||
's what the role body is anyway. | |||
15:07
rgrinberg joined
15:09
Ven_ joined
15:13
ka left
15:33
Celelibi_ is now known as Celelibi
15:35
firstdayonthejob joined
15:36
Ven_ left
|
|||
scott | haha, once I realized what `@a[*-1]` was really doing, I came up with `@a[*/2]` and @`a[$x mod *]` | 15:37 | |
the latter of which is something that has come up in real stuff I've written | 15:38 | ||
cleanest modular indexing I've seen | |||
15:39
itaipu joined
|
|||
timotimo | i've used * div 2, * * 3 div 4 and * div 4 in the past to get percentiles on a sorted array | 15:39 | |
you can even put them into a list inside the same [foo] | |||
scott | yeah, nice | 15:40 | |
15:40
Ven_ joined
|
|||
AlexDaniel | m: say ‘foo bar’ ~~ / foo { False } / | 15:41 | |
camelia | rakudo-moar 362349: OUTPUT«「foo」» | ||
timotimo | you mean <?{ False }> | ||
alternatively <!> is a token that never matches | |||
AlexDaniel | timotimo: I did not even ask a question yet | ||
timotimo: thank you | |||
timotimo | well ... :) | ||
AlexDaniel | <?{}> is what I needed | ||
psch | or <!{}>, maybe | 15:42 | |
timotimo | <{ }> will let you interpolate the string result of code as a piece of regex | ||
15:45
Ven_ left,
skids left
15:48
Ven_ joined
15:53
Ven_ left,
Ven_ joined
15:56
khw joined
15:58
Ven_ left
16:00
wamba joined
16:02
Ven_ joined
16:22
andrzejku left
16:24
domidumont left,
Ven_ left,
domidumont joined
16:36
tushar joined
16:37
Ven_ joined
16:41
zakharyas joined,
girafe joined
16:44
Ven_ left
16:45
Actualeyes left
16:51
girafe left
17:00
lichtkind__ joined
17:02
Ven_ joined
17:03
girafe joined
17:13
Ven_ left
17:15
Ven_ joined
17:19
andrzejku joined
17:28
Ven_ left
17:32
Ven_ joined
|
|||
mst | hmm, how does '.foo' on its own become a method call? (and more importantly, how do I produce such a thing ;) | 17:37 | |
17:37
RabidGravy joined
|
|||
scott | mst: .foo with no receiver is short for $_.foo | 17:40 | |
17:40
Ven_ left
|
|||
mst | scott: yes | 17:40 | |
scott: how | |||
scott | mst: it's just part of the grammar. I'm not sure I understand the question | 17:41 | |
mst | ok, so, I can define a postfix operator .* and $foo.* will work fine | 17:42 | |
I'm wondering how I annotate or otherwise mess with it | 17:43 | ||
to be able to default to $_ | |||
17:44
zakharyas left
|
|||
geekosaur | you shouldn't have to, it's built into the grammar | 17:44 | |
mst | ... | ||
geekosaur | oh, I see, you want a not-a-method that looks like a method call | 17:45 | |
17:45
benchable6 joined,
committable6 joined
|
|||
geekosaur | I think you'd have to mutate the grammar to support that | 17:45 | |
17:45
bisectable6 joined
|
|||
mst | right, cuz as I say, I can totally do it as a postfix op | 17:46 | |
geekosaur | you can't do it inside the operator definition itself, if you declared it to be postfix then it will want a term to apply the postfix to | ||
mst | right, I was wondering if there was some special magic that said "this is a postfix op that defaults to $_" | 17:47 | |
geekosaur | no, I think you'd also have to declare a term:<> version if you didn't want to have to edit the grammar | ||
17:47
Dunearhp joined
17:48
benchable6 left,
committable6 left,
bisectable6 left
|
|||
mst | where would I find docs on that? | 17:48 | |
17:49
benchable6 joined,
bisectable6 joined,
committable6 joined
|
|||
geekosaur | (also I would disrecommend .* because of the special method syntax docs.perl6.org/language/operators#postfix_.* | 17:49 | |
scott | by the way, why are there methods for calling all methods? | ||
err, operators* | 17:50 | ||
17:51
rgrinberg left
|
|||
timotimo | mst: it might be enough to define a term that uses CALLER::<$_> for its invocant | 17:51 | |
m: sub term:<.notamethod> { CALLER::<$_>.say }; $_ = "hello mst"; .notamethod | 17:52 | ||
camelia | rakudo-moar e4e823: OUTPUT«hello mst» | ||
timotimo | mst: that tickle your fancy? :) | ||
geekosaur | hm. the existence of term:<> is mentioned in the docs for Operators, but not what that and the others mean (should be in Grammars but that is rather sparse currently) | ||
timotimo | ah, geekosaur suggested the term already | ||
mst | that would do the trick, excellent | 17:53 | |
geekosaur | I guess at the moment the only documentation for those is design.perl6.org/S02.html#Grammatical_Categories | 17:54 | |
dalek | ateverable: 5b9ca5d | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (4 files): Use Sift4 to allow typos in bot names For example, it will now allow you to type “omitable6”. |
17:56 | |
AlexDaniel | omitable6: HEAD say 42 | ||
committable6 | AlexDaniel, ¦«HEAD»: 42 | ||
AlexDaniel | bsicetable6: exit 42 | ||
bisectable6 | AlexDaniel, On both starting points (old=2015.12 new=376b5f4) the exit code is 42 and the output is identical as well | ||
AlexDaniel, Output on both points: | |||
AlexDaniel | jnthn: ↑ ;) | ||
17:58
labster joined
|
|||
AlexDaniel | .tell Zoffix IRC::Client and Perl 6 are amazing. See irclog.perlgeek.de/perl6/2016-09-24#i_13272146 | 17:59 | |
yoleaux | AlexDaniel: I'll pass your message to Zoffix. | ||
18:00
Ven_ joined
|
|||
ugexe | scott: you can't think of a reason to call sets of methods? | 18:05 | |
18:06
xdxdxdxd joined
|
|||
xdxdxdxd | How do I check if a variable is an int | 18:06 | |
timotimo | do you mean Int or native int? | ||
also, do you mean "is defined to hold" or "currently holds"? | 18:07 | ||
xdxdxdxd | if I did ' my $a = 1 ' and ' my $b = "hello" ' | ||
$a would be int | |||
and $b wouldn't | |||
how would I check that | |||
ugexe | m: role Logger1 { method log { say "logger1"; } }; role Logger2 { method log { say "logger2" } }; class MyClass { }; my $class = MyClass.new; $class does Logger1; $class.*log; $class does Logger2; $class.*log | ||
camelia | rakudo-moar e4e823: OUTPUT«logger1logger2logger1» | ||
geekosaur | Int, not int | ||
timotimo | xdxdxdxd: smart match ought to help with that. say $a ~~ Int; say $b ~~ Int | 18:08 | |
geekosaur | $a ~~ Int | ||
xdxdxdxd | ah | ||
didn't know you could do that with ~~ | |||
timotimo | ~~ does a lot of things, one of them is type checking | ||
FROGGS | does somebody now of a Perl [5|6] Samba/CIFS server that actually works? | 18:09 | |
18:09
ocbtec left
|
|||
scott | ugexe: I can't think of a reason to call sets of methods with the same name on a single object | 18:10 | |
ugexe: seems aggressively niche for an operator | |||
ugexe: I was wondering if there was some really common pattern I overlooked | |||
ugexe | i just showed one | ||
18:11
ocbtec joined
|
|||
xdxdxdxd | why isn't this working: " get / ^ '/blog/' \d+ $ / => sub ($post) { ... } " | 18:11 | |
that is the get sub from Bailador btw | 18:12 | ||
18:12
firstdayonthejob left
|
|||
ugexe | think outside the inheritance box | 18:16 | |
scott | I rarely think of inheritance at all | 18:17 | |
OOP's not really my thing | |||
xdxdxdxd | how do I fix it lol | 18:19 | |
I get too many positionals passed | |||
18:23
MasterDuke joined
|
|||
ugexe | if you want someone to debug these things you need to give them more to work with | 18:24 | |
m: sub get($pos) { }; get / ^ "/blog/" \d+ $ / => sub ($post) { ... } | |||
camelia | ( no output ) | ||
ugexe | because the line you posted works. so you are leaving out a bunch of neccesary context | 18:25 | |
geekosaur | full source and full error message to an appropriate pastebin is usually a good idea | 18:26 | |
18:26
ocbtec left
|
|||
xdxdxdxd | pastebin.com/XCSkvVLi does this help | 18:31 | |
18:31
zhmylove joined,
Ven_ left
18:32
Ven_ joined
|
|||
ugexe | thats not the full error message | 18:32 | |
18:50
ilogger2 joined,
ChanServ sets mode: +v ilogger2,
cxreg joined,
alnewkirk joined,
ambs joined,
hobbs joined,
decent_ joined,
sivoais joined,
markk joined,
zengargoyle joined,
erdic joined,
TimToady joined
18:51
ChoHag joined,
tushar joined
18:52
revdiablo joined,
AlexDaniel joined,
Jonis joined,
pmichaud joined
|
|||
AlexDaniel | eh | 18:52 | |
18:52
john51 joined,
stmuk_ joined,
tony-o joined,
go|dfish joined
|
|||
AlexDaniel | a bit stormy today | 18:52 | |
18:56
tushar left,
Jonis left,
ambs left
18:57
ilogger2_ joined,
nadim joined,
Timbus joined,
japhb_ joined,
melezhik_ joined
18:58
roguelazer_ joined,
hobbified joined,
tsadok joined,
nine_ joined,
kshannon_ joined,
jnthn joined
18:59
kmwallio_ joined,
tony-o joined,
sjn joined,
poisonby_ joined,
pecastro joined,
hcit joined,
revdiablo joined,
masak joined,
arnsholt joined,
masak is now known as Guest98586
19:00
psch joined,
literal_ joined,
bisectable6 joined,
sQuEE` joined
19:01
[particle] joined
19:02
NEveD joined,
broquaint joined,
rmmm joined,
mspo_ joined,
ggoebel__ joined,
atacama joined,
kst``` joined,
mithaldu_ left
19:03
moritz_ joined,
rmmm is now known as 32NAB4ASC,
dalek joined,
ChanServ sets mode: +v dalek,
jdv79_ joined,
roguelazer_ is now known as roguelazer,
Lucas_One left,
yeltzooo joined,
eythian joined,
alnewkirk joined,
kmwallio_ is now known as kmwallio
19:04
perigrin joined,
nemo_ joined,
TheDir joined,
ponbiki_ joined,
PerlJam joined,
Alikzus_ joined,
nowan joined,
andrzejku joined,
gabiruh joined,
mst_ joined,
canopus joined,
Bucciarati joined
19:05
samcv joined,
pochi joined,
AlexDaniel joined,
huf joined,
ribasushi joined,
itaipu joined,
avar joined,
avar left,
avar joined
19:06
Zoffix joined
|
|||
Zoffix | m: role Role { proto method foo (|) {*}; multi method foo ($x) { say "role one" } }; class Foo does Role { multi method foo (|) {*}; multi method foo (|) {say "Go it!"} }.new.foo: 42 | 19:06 | |
yoleaux | 17:59Z <AlexDaniel> Zoffix: IRC::Client and Perl 6 are amazing. See irclog.perlgeek.de/perl6/2016-09-24#i_13272146 | ||
Zoffix | Is there some way to have the class's multi override the stuff provided by the role? | ||
19:06
bob777 joined,
remmie joined,
andrewalker joined
19:07
chris2 joined
|
|||
Zoffix | Basically, I have a role that provides a bunch of methods and I want one of the classes that `does` it to die if that method is called | 19:07 | |
one particular method from that role | |||
19:07
imcsk8 joined,
zhmylove joined
19:08
tsadok is now known as jonadab,
nightfrog joined,
chansen_ joined,
domidumont joined,
grondilu joined,
shmibs joined
19:09
solarbunny joined,
Ulti joined
19:10
ilbot3 joined,
domm1 joined,
raydiak joined,
shadowpaste joined,
bartolin joined,
lichtkind joined,
akiym joined
19:11
bjz joined,
xdbr joined,
[Coke] joined,
simcop2387 joined
|
|||
Zoffix | Figured it out: role Role { proto method foo (|) {*}; multi method foo ($x) { say "role one" } }; class Foo does Role { proto method foo (|) {say "Go it!"} }.new.foo: 4323 | 19:11 | |
19:12
silug_ joined,
ingy joined,
hoelzro joined,
m0ltar joined
19:13
mtj_ joined,
xinming joined,
wamba joined,
cgfbee joined,
lucs joined
19:14
k-man_ joined,
ruoso joined,
john51 joined,
Woodi joined
19:15
RabidGravy joined,
MilkmanDan joined
19:16
clkao joined,
jstimpfle joined,
jkva joined,
camelia joined,
gensym joined
19:17
stmuk_ joined,
emdashcomma joined,
mniip joined,
pmurias joined,
Gothmog_ joined
19:18
sunnavy joined,
awwaiid joined,
ambs joined
|
|||
dalek | c: 426d4e2 | (Zoffix Znet)++ | doc/Language/typesystem.pod6: where clauses smartmatch so we don't need to smartmatch the smartmatch Also... smartmatch |
19:18 | |
19:18
Possum joined,
peteretep joined,
ChanServ sets mode: +v camelia
19:19
tbrowder joined,
domidumont left,
ssm joined,
eyck joined,
Khisanth joined,
ringer1 joined,
FROGGS joined
19:20
BuildTheRobots joined,
gypsydave5 joined,
PotatoGim joined,
zoosha joined,
telex joined,
telex left
19:21
jkva left,
dj_goku_ joined,
dj_goku_ left,
dj_goku_ joined
19:22
stux|RC-only left,
sergot joined,
telex joined,
esh joined
19:23
a3r0 joined,
Praise joined,
Praise left,
Praise joined
19:24
stux|RC-only joined,
olinkl joined
19:25
tailgate joined,
pmurias left,
Jonis joined,
w4and0er96 joined,
notbenh_ joined
19:26
ggherdov joined
19:27
mithaldu_ joined
19:28
Lucas_One joined,
eliasr joined,
darutoko joined,
darutoko left,
sftp joined
19:29
Guest53008 joined,
CIAvash joined,
SmokeMachine____ joined,
mindos joined
19:30
konobi_ joined,
abruanese joined,
jcallen joined,
markk joined,
hanekomu joined,
timeless joined,
ChoHag joined
19:31
pmurias joined
19:32
nebuchadnezzar joined
19:34
infina joined,
sivoais joined
19:35
smash joined,
mrsolo joined,
Zoffix__ joined
19:36
Xliff_ joined,
noganex joined,
mohae_ joined
19:37
djbkd joined,
dogbert2 joined,
andrewalker left,
kst```` joined,
bob778 joined,
[particle]1 joined
19:38
user10 joined,
Zoffix left,
Zoffix__ is now known as Zoffix,
cpage_ joined,
nadim_ joined
19:39
ruoso left,
lucs left,
xinming left,
m0ltar left,
bartolin left,
zhmylove left,
imcsk8 left,
itaipu left,
[particle] left,
literal_ left,
psch left,
melezhik_ left,
Timbus left,
user10 is now known as user9,
obfusk_ joined,
ranguard left,
sivoais left,
Guest53008 left,
[Coke] left,
lichtkind left,
nightfrog left,
bob777 left,
kst``` left,
nadim left,
crucialrhyme left,
bob778 is now known as bob777
19:40
ShimmerFairy joined,
itaipu joined,
El_Che joined,
garu joined,
captain-adequate joined,
Unavowed joined,
dsp_ joined,
mattp_ joined
19:42
ufobat joined,
moritz_ is now known as moritz
19:43
eliasr left,
rudi_s joined
19:45
TEttinger joined,
Timbus joined,
m0ltar joined
19:46
bartolin joined
19:48
eliasr joined
19:49
imcsk8 joined,
zhmylove joined
19:50
protium joined
19:51
ruoso joined,
noganex_ joined,
djbkd_ joined,
ufobat left,
Zoffix__ joined,
xiaomiao joined
19:52
[particle] joined,
[particle]1 left,
ugexe joined
19:53
mohae joined,
cpage_ left,
konobi_ left,
emdashcomma left,
garu left,
El_Che left,
user9 left,
djbkd left,
tailgate left,
zoosha left,
gypsydave5 left,
eyck left,
awwaiid left,
chris2 left,
user10 joined
19:54
user10 is now known as user9,
zoosha_ joined,
bartolin left,
Unavowed left,
captain-adequate left,
itaipu left,
ShimmerFairy left,
bob777 left,
dogbert2 left,
mohae_ left,
noganex left,
Zoffix left,
nebuchadnezzar left,
pmurias left,
hanekomu left,
markk left,
jcallen left,
CIAvash left,
Praise left,
esh left,
sergot left,
dj_goku_ left,
FROGGS left,
ringer1 left,
ambs left,
sunnavy left,
Gothmog_ left,
gensym left,
vytas joined,
lucs joined,
Jonis left,
andrewalker joined
19:55
konobi joined,
konobi is now known as Guest26058
19:56
chris2 joined,
mniip left
19:57
skaji joined,
wamba left,
zacts joined
20:00
Zoffix__ is now known as Zoffix
20:01
andrzejku left
20:02
melezhik joined
20:03
jcallen joined,
mniip joined
20:04
Upasaka joined,
gensym joined,
Praise- joined,
Praise- left,
Praise- joined,
mst_ is now known as mst,
mst left,
mst joined
20:05
captain-adequate joined,
krunen joined,
bob777 joined,
nightfrog joined,
dogbert2 joined
20:06
sivoais joined,
esh joined,
markk joined,
emdashcomma joined,
Praise- is now known as Praise,
freeze joined,
lichtkind joined
20:07
FROGGS joined,
gypsydave5 joined,
Gothmog joined,
Gothmog is now known as Gothmog_,
awwaiid joined,
ShimmerFairy joined
20:08
ambs joined,
FROGGS left,
cpage_ joined,
psch joined,
f3ew joined
20:09
giraffe_ joined,
eyck joined,
dj_goku joined,
dj_goku left,
dj_goku joined
20:10
Jonis joined
20:11
garu joined
20:12
user10 joined
20:13
bartolin joined
20:15
cpage_ left,
emdashcomma left,
ribasushi left,
nightfrog left,
canopus left,
ponbiki_ left,
kmwallio left,
zostay left,
jonadab left
20:16
hobbified left,
Alikzus joined,
perlpilot joined
20:17
bartolin left,
jcallen_ joined,
notostraca joined,
Upasaka_ joined,
jstimpfl1 joined,
woodruffw joined,
woodruffw left,
woodruffw joined,
woodruffw left,
skaji_ joined,
mattp__ joined,
AlexDani` joined,
woodruffw joined,
woodruffw left,
woodruffw joined,
woodruffw left,
nadim joined,
cosimo joined,
avuserow joined,
[particle]1 joined,
nemo joined,
woodruffw joined,
nemo is now known as Guest45219,
sergot joined,
dsp__ joined,
yeltzooo9 joined,
Xliff joined,
a3r0_ joined,
MilkmanD1n joined,
shadowpaste0 joined,
djbkd joined,
captain-1dequate joined,
noganex joined,
ambs_ joined,
felher joined,
yubimusubi joined,
user9 left,
timeless left,
peteretep left,
clkao left,
chansen_ left,
sivoais left,
skaji left,
andrewalker left,
[particle] left,
eliasr left,
ggherdov left,
tbrowder left,
Jonis left,
dj_goku left,
awwaiid left,
Gothmog_ left,
bob777 left,
Guest26058 left,
protium left,
zhmylove left,
Timbus left,
TEttinger left,
dsp_ left,
stux|RC-only left,
BuildTheRobots left,
Woodi left,
k-man_ left,
silug_ left,
raydiak left,
akiym left,
grondilu left,
Bucciarati left,
mst left,
gabiruh left,
PerlJam left,
jdv79_ left,
eyck left,
ambs left,
ShimmerFairy left,
giraffe_ left,
lichtkind left,
esh left,
krunen left,
captain-adequate left,
Praise left,
Upasaka left,
gensym left,
jcallen left,
melezhik left,
lucs left,
vytas left,
chris2 left,
zoosha_ left,
mohae left,
xiaomiao left,
Zoffix left,
djbkd_ left,
noganex_ left,
ruoso left,
imcsk8 left,
m0ltar left,
rudi_s left,
mattp_ left,
obfusk_ left,
nadim_ left,
kst```` left,
Xliff_ left,
mrsolo left,
smash left,
ChoHag left,
abruanese left,
a3r0 left,
telex left,
PotatoGim left,
Khisanth left,
Possum left,
stmuk_ left,
camelia left,
jstimpfle left,
RabidGravy left,
MilkmanDan left,
john51 left,
cgfbee left,
mtj_ left,
ingy left,
bjz left,
shadowpaste left,
ilbot3 left,
Ulti left,
shmibs left,
simcop2387 left,
remmie left,
avar left,
huf left,
AlexDaniel left,
pochi left,
Alikzus_ left,
nemo_ left,
eythian left,
dalek left,
yeltzooo left,
ssm left,
xdbr left,
bob777 joined,
zoosha joined,
user10 is now known as user9,
huf_ joined,
esh_ joined,
dalek joined,
ChanServ sets mode: +v dalek,
xdbr joined
20:18
samcv left,
El_Che joined,
bjz_ joined,
hobbs joined,
obfusk joined,
bartolin joined,
ggoebel__ left,
notostraca is now known as TEttinger,
silug_ joined,
nightfrog joined,
Bucciarati joined,
krunen joined,
leego joined,
luis joined,
TimToady joined,
girafe joined,
[ptc] joined,
TheDir left
20:19
xiaomiao joined,
ssm joined,
lizmat joined,
samcv joined,
cgfbee joined,
cpage_ joined,
john51 joined,
ShimmerFairy joined,
m0ltar joined,
rudi_s joined
20:20
ribasushi joined,
gabiruh joined,
Unavowed joined,
pmurias joined,
k-man_ joined,
mohae joined,
eythian joined,
akiym joined,
jonadab joined,
Praise- joined,
Praise- left,
Praise- joined,
ggoebel joined
20:21
Timbus joined,
raydiak joined,
andrewalker joined,
shmibs joined,
canopus joined,
kst```` joined
20:22
emdashcomma joined,
vytas joined,
remmie joined,
RabidGravy joined
20:23
ruoso joined
20:25
cpage_ left
20:26
chris2 joined,
m0ltar left,
gabiruh_ joined,
samcv left,
broquaint left
20:27
remmie left,
mohae left,
john51 left,
leego left,
zoosha_ joined,
[ptc] left,
girafe left,
camelia joined,
leego joined
|
|||
gfldex | m: enum E <A B>; sub f(){ "foo" but A }; put f(); | 20:27 | |
20:28
El_Che_ joined,
gensym joined
20:29
ruoso left,
xiaomiao left,
canopus left,
k-man_ left,
NeuralAnomaly joined
20:30
shmibs left,
bisectable6 left
20:31
huggable joined,
ggoebel left,
f3ew left,
mtj_ joined,
eyck joined
20:32
avar joined,
avar left,
avar joined,
pmurias_ joined,
Guest45219 is now known as nemo,
NeuralAnomaly left,
NeuralAnomaly joined,
remmie joined,
gabiruh left,
andrewalker left,
raydiak left,
eythian left,
akiym left,
pmurias left,
El_Che left,
dalek left,
zoosha left,
RabidGravy left,
emdashcomma left,
jonadab left,
rudi_s left,
ShimmerFairy left,
cgfbee left,
bob777 left,
ssm left,
bisectable6_ joined,
dalek joined,
ChanServ sets mode: +v dalek,
Ulti joined
|
|||
camelia | rakudo-moar e8a61d: OUTPUT«foo» | 20:32 | |
20:32
riatre_ joined,
ChanServ sets mode: +v camelia,
ilbot3 joined,
khw joined
20:33
protium joined,
zhmylove joined,
solarbunny left,
esh_ left,
hobbs left,
RabidGravy joined,
lichtkind joined,
eythian joined,
abruanese joined,
[Coke] joined,
samcv joined,
xiaomiao joined,
vytas left,
girafe2 joined,
tbrowder joined,
dj_goku joined,
dj_goku left,
dj_goku joined
20:34
Gothmog joined,
zengargoyle joined,
k-man__ joined,
Gothmog is now known as Gothmog_,
eliasr joined,
akiym joined,
Khisanth joined,
Woodi joined,
ShimmerFairy joined,
ssm joined,
canopus joined,
ruoso joined,
mohae joined
20:35
andrewalker joined,
Jonis joined,
stmuk joined,
ChoHag joined,
vytas joined,
emdashcomma joined,
jast joined,
simcop2387 joined,
simcop2387 left,
simcop2387 joined,
shmibs joined,
kmwallio joined
20:36
ingy joined,
Guest36361 joined,
esh joined,
llfourn joined,
stux|RC-only joined,
raydiak joined,
m0ltar joined,
TheDir joined,
konobi_ joined,
itaipu joined
20:37
[ptc] joined,
firstdayonthejob joined,
pochi joined,
ringer1 joined,
jdv79 joined,
zostay joined
20:38
grondilu joined,
cgfbee joined,
hobbs joined,
solarbunny joined,
sivoais joined,
telex joined
20:39
f3ew joined,
awwaiid joined,
ranguard joined,
hobbs left,
hobbs joined,
Guest98586 is now known as masak,
jonadab joined
|
|||
masak | holy netsplit, Batman | 20:40 | |
20:40
xinming joined,
ggherdov joined
|
|||
masak | I like the thing someone said -- "nothing prepared me for the reality of Eric Brewer's CAP theorem like IRC netsplits" | 20:40 | |
20:41
lucs joined,
bob777 joined,
hanekomu joined
20:42
literal joined,
dj_goku_ joined,
broquaint joined,
john51 joined
20:43
noganex_ joined,
Xliff_ joined,
sunnavy joined,
notostraca joined,
djbkd_ joined
20:44
ggoebel joined,
rudi_s joined,
ponbiki joined,
pmurias_ left,
[particle] joined
20:45
luis left,
ribasushi left,
ponbiki is now known as Guest24694
|
|||
stmuk | ddos :( | 20:45 | |
20:45
krunen_ joined,
Timbus left,
[particle]1 left,
infina left,
jcallen joined
20:46
bartolin left,
felher left,
noganex left,
djbkd left,
sergot left,
cosimo left,
avuserow left,
TEttinger left,
awwaiid left,
TheDir left,
MilkmanD1n left
|
|||
El_Che_ | :( | 20:46 | |
20:46
rindolf joined,
remmie left,
avar left,
TimToady left,
obfusk left,
bjz_ left,
ambs_ left,
shadowpaste0 left,
a3r0_ left,
dsp__ left,
nemo left,
nadim left,
skaji_ left,
Upasaka_ left,
jonadab left,
notostraca is now known as TEttinger
|
|||
TEttinger | :( | 20:46 | |
20:47
nightfrog left,
yubimusubi left,
captain-1dequate left,
Xliff left,
woodruffw left,
yeltzooo9 left,
AlexDani` left,
mattp__ left,
jcallen_ left,
mattp_ joined,
ft joined,
nadim joined,
sergot joined
20:48
avar joined,
nemo joined,
Upasaka joined,
ambs joined,
obfusk joined,
TimToady joined,
bisectable6 joined,
spider-mario joined,
nemo is now known as Guest68793,
mst joined,
raydiak left,
mohae left
20:49
riatre joined,
zostay left,
Guest36361 left,
bjz joined
20:51
samcv_ joined,
bonsaikitten joined,
skaji joined,
nightfrog joined,
mohae joined,
Timbus joined,
camelia left,
woodruffw joined,
woodruffw left
20:52
emdashcomma left,
andrewalker left,
bisectable6_ left,
k-man__ left,
dj_goku left,
tbrowder left,
protium left,
ggherdov left,
cgfbee left,
canopus left,
xiaomiao left,
samcv left,
lichtkind left,
ilbot3 left,
riatre_ left,
dalek left,
mniip left,
melezhik joined,
canopus joined,
emdashcomma joined,
imcsk8 joined,
woodruffw joined,
TheDir joined,
jonadab joined,
luis` joined,
raydiak joined,
hobbs left,
solarbunny left,
yeltzooo joined
20:53
camelia joined,
ilbot3 joined,
mniip joined,
john51 left,
Praise- is now known as Praise,
andrewalker joined,
ribasushi joined,
bartolin joined
20:54
k-man__ joined,
mrsolo joined,
lichtkind joined,
cosimo joined
20:55
ChanServ sets mode: +v camelia,
BenGoldberg joined,
remmie joined,
captain-adequate joined
20:56
hobbs joined,
solarbunny joined,
protium joined,
cgfbee joined
20:57
Cabanossi joined,
smash joined
20:58
BuildTheRobots joined,
felher joined,
john51 joined,
timeless joined
20:59
shadowpaste joined
21:00
avuserow joined,
clkao joined
21:02
a3r0 joined,
Possum joined
21:03
cdg joined
21:04
nebuchadnezzar joined,
john51 left
21:05
dsp_ joined,
giraffe_ joined,
Xliff_ left
21:06
Xliff_ joined
21:09
MilkmanDan joined
21:13
awwaiid joined,
chansen_ joined
21:14
zostay joined,
ggherdov joined
21:15
pnu_ joined,
peteretep joined
21:17
vcv joined
|
|||
timotimo | :( | 21:17 | |
mst | stability will return to the kingdom soon enough | 21:18 | |
21:24
PotatoGim joined,
yoleaux joined
21:25
ChanServ sets mode: +v yoleaux,
girafe2 left
|
|||
masak | "ddos", aka "people can be such jerks sometimes" | 21:27 | |
21:28
john51 joined,
cdg left,
canopus left
21:29
giraffe_ left
21:30
tbrowder joined
21:31
labster joined,
[ptc] left,
giraffe_ joined
21:32
bob777 left,
camelia left
21:33
yoleaux left,
Cabanossi left,
lichtkind left,
bob777 joined,
perl6user joined,
richi235 joined
|
|||
perl6user | What is the fastest way to find out how many files are in a directory? | 21:33 | |
grondilu | including subdirectories? | 21:34 | |
perl6user | no just main directories | ||
21:34
canopus joined
|
|||
perl6user | just main directory* | 21:34 | |
BenGoldberg | my $cunt = +dir('dirname') should do it, I think. | 21:35 | |
masak | m: say +dir() | ||
21:35
Cabanossi joined
|
|||
BenGoldberg | Err, count! | 21:35 | |
grondilu | BenGoldberg++ typo of the day :) | ||
BenGoldberg grumbles at his stupid fingers. | |||
timotimo | that also counts folders as files | 21:36 | |
perl6user | It will work for me, thanks BenGoldberg | ||
BenGoldberg | Hmm, it looks like camelia is on the wrong side of the netsplit, or perhaps is offline. | 21:37 | |
21:37
lichtkind joined
|
|||
timotimo | it could be dir() is disallowed in the restricted setting anyway | 21:38 | |
grondilu | if you want regular files I think you can grep(* ~~ :f) | 21:39 | |
21:39
vike joined,
[ptc] joined,
scott joined
|
|||
scott | pretty easy to count only files, with dir(dirname).grep(*.f) | 21:39 | |
21:40
scott is now known as Guest77506
|
|||
timotimo | does it give you the .IO automatically? | 21:40 | |
grondilu | I first tried grep(:f) and thought that would work. | ||
21:40
camelia joined
|
|||
timotimo | nah, because that's a named parameter to the grep method | 21:40 | |
you'd have to put extra parens if you meant a Pair object | |||
and at that point *.f is shorter | |||
grondilu | indeed | ||
Guest77506 | timotimo: top-level dir does | 21:41 | |
21:41
b2gills joined
|
|||
Guest77506 | you could write dirname.IO.dir.grep(*.f) equivalently | 21:41 | |
21:41
ChanServ sets mode: +v camelia
|
|||
BenGoldberg | Or dirname.IO.dir.grep(:f(True)) | 21:42 | |
Guest77506 | by the way... why is is that Path is constructed by .IO instead of .Path? | ||
21:42
infina joined
|
|||
BenGoldberg | m: dir('.').say | 21:42 | |
camelia | rakudo-moar e8a61d: OUTPUT«(".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".bash_history".IO ".bashrc".IO "mbox".IO ".lesshst".IO "evalbot.log".IO ".cpan".IO "dalek-…» | ||
timotimo | neat. | ||
BenGoldberg | m: dir('.').&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«51» | ||
ugexe | m: dir.say | ||
camelia | rakudo-moar e8a61d: OUTPUT«(".cpanm".IO ".local".IO ".npm".IO ".perl6".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".bash_history".IO ".bashrc".IO "mbox".IO ".lesshst".IO "evalbot.log".IO ".cpan".IO "dalek-…» | ||
BenGoldberg | m: dir('.').grep(:f(True).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unable to parse expression in argument list; couldn't find final ')' at <tmp>:1------> 3dir('.').grep(:f(True).&[+].say7⏏5<EOL>» | ||
BenGoldberg | m: dir('.').grep(:f(True)).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«Cannot resolve caller grep(Seq: :f); none of these signatures match: ($: Bool:D $t, *%_) ($: Mu $t, *%_) in block <unit> at <tmp> line 1» | ||
timotimo | you still need extra parens | 21:43 | |
BenGoldberg | m: dir('.').grep((:f)).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«14» | ||
BenGoldberg | m: dir('.').grep((:d)).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«37» | ||
Guest77506 | that grep calls the keys as methods on the elements or what? | ||
ugexe | m: say +dir(test => *.IO.f) | 21:44 | |
camelia | rakudo-moar e8a61d: OUTPUT«14» | ||
Guest77506 | I see, it's smart matching, and I'm just unfamiliar with Pair smart matching | 21:45 | |
BenGoldberg | m: dir('.', :d).&[+].say | 21:46 | |
camelia | rakudo-moar e8a61d: OUTPUT«51» | ||
BenGoldberg | m: dir('.', :f).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«51» | ||
BenGoldberg | m: dir('.', *.say).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in block <unit> at <tmp> line 1» | ||
BenGoldberg | m: dir('.', none('.', '..')).&[+].say | ||
camelia | rakudo-moar e8a61d: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in block <unit> at <tmp> line 1» | ||
BenGoldberg | m: &dir.perl.say | 21:47 | |
camelia | rakudo-moar e8a61d: OUTPUT«sub dir (| is raw) { #`(Sub|58839432) ... }» | ||
timotimo | m: say <foo FOO fOo FoO>.grep((:uc(FOO))) | ||
camelia | rakudo-moar e8a61d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared name: FOO used at line 1» | ||
timotimo | m: say <foo FOO fOo FoO>.grep((:uc<FOO>)) | 21:48 | |
camelia | rakudo-moar e8a61d: OUTPUT«(foo FOO fOo FoO)» | ||
21:48
MilkmanD1n joined,
richi238 joined
|
|||
Guest77506 | does this kind of smart matching only list on single Pairs? | 21:49 | |
seems to fail with lists of pairs | |||
only work on* | |||
BenGoldberg | m: (!<foo FOO fOo FoO>, :uc<FOO>).grep((:uc<FOO>)).say | 21:50 | |
camelia | rakudo-moar e8a61d: OUTPUT«(False uc => FOO)» | ||
timotimo | only a single pair | ||
but you can make a junction of pairs | |||
no, wait | |||
21:50
chansen_ left,
literal left
|
|||
BenGoldberg | m: (|<foo FOO fOo FoO>, |:uc<FOO>).grep((:uc<FOO>)).say | 21:50 | |
camelia | rakudo-moar e8a61d: OUTPUT«(foo FOO fOo FoO uc => FOO)» | ||
timotimo | don't :) | ||
haha, that's cool :) | |||
Guest77506 | docs.perl6.org/type/Pair doesn't seem to specify smartmatch behaviour | ||
docs.perl6.org/language/operators#infix_~~ only says a little bit, but not Pair | |||
oh, I forgot ACCEPTS | |||
21:51
melezhik_ joined,
raydiak left
|
|||
Guest77506 | Pair doesn't list an ACCEPTS override either | 21:51 | |
what gives? | |||
21:51
dsp_ left
|
|||
Guest77506 | it's not in this list either docs.perl6.org/routine/ACCEPTS | 21:52 | |
21:52
wtw joined
|
|||
BenGoldberg | I'd expect ~~ to be a multi sub | 21:52 | |
timotimo | nope, it just calls the ACCEPTS method on the matcher | ||
21:52
Cabanossi left,
hobbs left,
solarbunny left,
vike left,
richi235 left,
perl6user left,
peteretep left,
MilkmanDan left,
nebuchadnezzar left,
avuserow left,
BuildTheRobots left,
cgfbee left,
cosimo left,
mrsolo left,
ilbot3 left,
imcsk8 left,
emdashcomma left,
melezhik left,
yeltzooo left,
luis` left
21:53
rjbs joined
|
|||
BenGoldberg | So there's probably a multi sub infix:<~~>( IO::Path, Pair ) somewhere. | 21:53 | |
I do notice that docs.perl6.org/type/IO$COLON$COLONPath says you can do ~~ with an IO::Path on the left and a pair on the right... | 21:54 | ||
21:54
rgrinberg joined
|
|||
timotimo | no, there is not | 21:54 | |
21:55
Cabanossi joined,
cosimo joined
|
|||
timotimo | a ~~ b is a very direct call to b.ACCEPTS(a) | 21:55 | |
BenGoldberg | Hmm... | ||
Guest77506 | there's no multi overload of the operator, but there should be an ACCEPTS methods defined on Pair somewhere | ||
21:55
vike joined
|
|||
Guest77506 | but it's not in the docs afaict | 21:55 | |
BenGoldberg | s: Pair, "ACCEPTS" | 21:56 | |
21:56
wtw left
|
|||
BenGoldberg | Sourcebaby's not online either (or on the wrong side of the netsplit) | 21:56 | |
21:57
profan joined
21:58
literal joined
21:59
canopus left,
rjbs left
22:00
awwaiid left
22:01
NeuralAnomaly left
22:03
nomore22 joined
|
|||
nomore22 | p6: for <a b c> <-> $word { ++$word.say } | 22:05 | |
camelia | rakudo-moar e8a61d: OUTPUT«Parameter '$word' expected a writable container, but got Str value in block <unit> at <tmp> line 1» | ||
22:05
ilbot3 joined,
wtw joined
22:07
infina left,
infina joined,
rgrinberg left,
Guest77506 left,
Guest77506 joined,
Guest77506 left,
Guest77506 joined,
Guest77506 left
22:09
mrsolo joined
22:10
samcv_ is now known as samcv
|
|||
timotimo | m: my @a = <a b c>; for @a <-> $word { ++$word.say } | 22:10 | |
camelia | rakudo-moar e8a61d: OUTPUT«aCannot resolve caller prefix:<++>(Bool); none of these signatures match: (Mu:D $a is rw) (Mu:U $a is rw) (Int:D $a is rw) (int $a is rw) (Bool $a is rw) (Num:D $a is rw) (Num:U $a is rw) (num $a is rw)…» | ||
timotimo | m: my @a = 1, 2, 3, 4; for @a <-> $word { ++$word.say } | ||
camelia | rakudo-moar e8a61d: OUTPUT«1Cannot resolve caller prefix:<++>(Bool); none of these signatures match: (Mu:D $a is rw) (Mu:U $a is rw) (Int:D $a is rw) (int $a is rw) (Bool $a is rw) (Num:D $a is rw) (Num:U $a is rw) (num $a is rw)…» | ||
timotimo | oh, haha | ||
m: my @a = <a b c>; for @a <-> $word { (++$word).say } | |||
camelia | rakudo-moar e8a61d: OUTPUT«bcd» | ||
timotimo | m: my @a = <a b c>; for @a <-> $word { ($word++).say }; say @a; | ||
camelia | rakudo-moar e8a61d: OUTPUT«abc[b c d]» | ||
22:11
dsp_ joined,
rjbs joined
22:12
bpmedley joined
22:13
Guest77506 joined,
raydiak joined,
chansen_ joined,
perl6user joined,
peteretep joined,
avuserow joined,
BuildTheRobots joined,
cgfbee joined,
yeltzooo joined,
luis` joined,
imcsk8 joined,
emdashcomma joined,
konobi_ is now known as konobi,
chansen_ left,
chansen_ joined,
Guest77506 left,
Guest77506 joined,
awwaiid joined
|
|||
gfldex | m: sub f(){ "foo" but role :: { method side-channel { "bar" } } }; my $a = f; say [$a.WHAT, $a, $a.side-channel] | 22:13 | |
camelia | rakudo-moar e8a61d: OUTPUT«[(Str+{<anon|79641184>}) foo bar]» | ||
22:14
hobbs joined,
solarbunny joined,
cgfbee left
|
|||
gfldex | m: enum E <A B>; sub f(){ "foo" but role :: { method E { E::A } } }; my $a = f; say $a.E | 22:15 | |
camelia | rakudo-moar e8a61d: OUTPUT«A» | ||
22:17
nadim left,
BuildTheRobots left
22:21
canopus joined
22:22
NeuralAnomaly joined
22:23
huggable left,
RabidGravy left,
huggable joined
|
|||
gfldex | m: enum E <A B>; my $a = 42 but E; dd $a.WHAT, $a ~~ E | 22:23 | |
camelia | rakudo-moar e8a61d: OUTPUT«Int+{E}Bool::False» | ||
22:23
buggable joined
|
|||
gfldex | is this a bug? | 22:24 | |
22:24
BuildTheRobots joined
|
|||
gfldex | m: role E {}; my $a = 42 but E; dd $a.WHAT, $a ~~ E | 22:25 | |
camelia | rakudo-moar e8a61d: OUTPUT«Int+{E}Bool::True» | ||
gfldex | m: class E {}; my $a = 42 but E; dd $a.WHAT, $a ~~ E | ||
camelia | rakudo-moar e8a61d: OUTPUT«Cannot mix in non-composable type E into object of type Int in block <unit> at <tmp> line 1» | ||
gfldex | i think it should either complain the same way then with class or just work | ||
m: class E {}; my $a = 42 but E.new; dd $a.WHAT, $a ~~ E | |||
camelia | rakudo-moar e8a61d: OUTPUT«Int+{<anon|73266432>}Bool::False» | ||
22:25
cgfbee joined
22:27
tailgate joined
22:35
BenGoldberg left
|
|||
grondilu | I don't think so. | 22:42 | |
m: my $str = "pi" but pi; say $str + 1; | |||
camelia | rakudo-moar e8a61d: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5pi' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
grondilu | oh wait, I thought that would work | 22:43 | |
nvm | 22:44 | ||
22:44
nomore22 left,
firstdayonthejob left
|
|||
grondilu | wait: | 22:45 | |
If you put something that is not a role on the right hand side of the | |||
"does" or "but" operators then an anonymous role will be auto-generated | |||
containing a single method that returns that value. | |||
^from S14 | |||
when you do $a but $someEnum; it creates an anonymous role, so it won't mach the initial type. | 22:46 | ||
zengargoyle | iirc, you need to somehow mark it an an Int. i'm assuming you want $str.Str ~~ 'pi'; $str.Int ~~ pi | 22:47 | |
grondilu | m: my $str = "pi" but pi; say $str.Num + 1; | ||
camelia | rakudo-moar e8a61d: OUTPUT«4.14159265358979» | ||
grondilu | indeed | ||
so my point was: | 22:48 | ||
m: my $str = "pi" but pi; say $str ~~ Num; # should be False | |||
camelia | rakudo-moar e8a61d: OUTPUT«False» | ||
22:49
rgrinberg joined
|
|||
grondilu | m: my $str = "pi" but pi; say $str.Rat | 22:49 | |
camelia | rakudo-moar e8a61d: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5pi' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
grondilu is a bit confused | |||
m: say pi.WHAT | 22:50 | ||
camelia | rakudo-moar e8a61d: OUTPUT«(Num)» | ||
grondilu | isn't pi defined as a Rat? | ||
zengargoyle | i did something like this in one of my modules but forget the details. $rv strings to matched thing, bools to found, ints to line-number | ||
grondilu checked in the core and no, it's defined as a Num. | |||
(which is totally fine of course) | 22:51 | ||
22:51
ilmari[m] joined
|
|||
grondilu | that being said, I'm slightly disappointed that ($ but 1) + 1 doesn't just give 2. | 22:52 | |
zengargoyle ponders π being a rational and possibly causing the universe to *plode | 22:53 | ||
grondilu | m: say ("" but 1) + 1 | 22:54 | |
camelia | rakudo-moar e8a61d: OUTPUT«1» | ||
grondilu | m: say ("foo!" but 1) + 1 | 22:55 | |
camelia | rakudo-moar e8a61d: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo!' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
grondilu | o_O | ||
Guest77506 | that's just the normal Str to Num parsing | ||
m: say +"" | |||
camelia | rakudo-moar e8a61d: OUTPUT«0» | ||
Xliff_ | Universe - $u; Multiverse - @u; Named Universes - %u; WTF - \u | ||
grondilu | I thought that did not existed in perl6 anymore. | ||
meh | 22:56 | ||
Xliff_ | Actually, s/Named Unviverses/Easy Access Multiverse/ | ||
Xliff_ just finished a novel series involving cross-time travel. | 22:57 | ||
22:59
rgrinberg left
|
|||
gfldex | m: enum E <A B>; say E.defined; | 23:00 | |
camelia | rakudo-moar e8a61d: OUTPUT«False» | ||
23:01
rgrinberg joined
|
|||
gfldex | m: enum E <A B>; sub f { "foo" but E::A }; dd f.E | 23:01 | |
camelia | rakudo-moar e8a61d: OUTPUT«E $val = E::A» | ||
23:04
chris2 left
|
|||
gfldex | m: enum E <A B>; sub f { "foo" but P::E::A }; dd f.E | 23:04 | |
camelia | rakudo-moar e8a61d: OUTPUT«Could not find symbol '&A' in sub f at <tmp> line 1 in block <unit> at <tmp> line 1Actually thrown at: in sub f at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
gfldex | m: enum E <A B>; sub f { "foo" but E::A }; dd f.E | ||
camelia | rakudo-moar e8a61d: OUTPUT«E $val = E::A» | ||
gfldex | m: package P { enum E <A B> }; sub f { "foo" but P::E::A }; dd f.E | 23:05 | |
camelia | rakudo-moar e8a61d: OUTPUT«E $val = E::A» | ||
23:07
chris2 joined
23:08
dalek joined,
ChanServ sets mode: +v dalek
23:10
Undercover joined,
SourceBaby joined
23:13
bisectable6 left,
benchable6 joined
23:14
committable6 joined,
bisectable6 joined
23:19
labster left
|
|||
perl6user | Is there any http server module like HTTP::Server::Simple that supports SSL currently? | 23:27 | |
23:30
labster joined
23:31
stevieb joined
23:36
pierrot joined
23:39
djbkd_ left
23:43
yoleaux joined,
ChanServ sets mode: +v yoleaux
23:51
silug_ is now known as silug
23:52
nbrown joined
23:53
nbrown left
23:54
tushar joined
23:56
itaipu left
|
|||
ugexe | it should be very little effort to swap in IO::Socke::SSL in place of IO::Socket::INET in HTTP::Server::Simple if you're feeling frisky | 23:56 | |
you could change $!socket to $.socket, so you can just pass in your own socket for instance | 23:58 |