Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-09-24

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 wamba joined #perl6
00:11 * grondilu doubts it's possible
00:11 bioduds_ it compiles
00:11 bioduds_ and asks for the input
00:11 * grondilu looks in S19
00:12 bioduds_ Usage:   ef8a4da32a.pl [--kv=<Associative>]
00:12 bioduds_ but I can't seem to find the correct input syntax on the command line
00:12 * zengargoyle thinks there's a getopt-ish module.  always found MAIN args to be *really* hard for anything but basic strind/bool type things.
00:12 * grondilu does not find any occurrence of C<:%> in S19
00:15 grondilu sub MAIN( *%options ) {...} does work
00:15 grondilu and it might be what you wanted to do
00:16 grondilu 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 '@'.
00:16 bioduds_ grondilu : how would it be called on the command line?
00:16 grondilu perl6 prog.p6 -foo=bar -pi=3.14
00:16 grondilu it's not a named h
00:16 grondilu %
00:18 grondilu 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:19 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.
00:20 grondilu (unless you have multiple candidates, of course)
00:20 bioduds_ cool, this works for me
00:21 * grondilu is glad he could help
00:23 bioduds_ thanks, man
00:23 bioduds_ :)
00:24 bioduds_ if you find out later if and how naming the parameter on the MAIN could work, please tell me
00:26 grondilu I keep doubting it's possible.
00:27 grondilu 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. :)
00:28 grondilu how MAIN works should be the main subject of a perl6 man page.
00:28 grondilu wait, scrap that.
00:28 zengargoyle with a bunch of practical-ish examples.
00:29 * 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
00:30 bioduds_ anyhow, since this here sub MAIN( *%kv, Str :$new ) { is working
00:30 bioduds_ then it does what I need
00:30 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:31 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.
00:31 zengargoyle yeah, that.
00:31 * grondilu is always happy when he can use the verb "transcend" in a sentence :)
00:32 bioduds_ surely, only one hash set so to speak can be captured by this approach
00:33 bioduds_ but it gives a lot of room actually, doesn't it?
00:33 grondilu I don't follow you
00:34 zengargoyle the slurpy only permits one hash (or array) at end.
00:37 tushar joined #perl6
00:41 * 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 zengargoyle otherwise we'd be able to call any P6 sub with and array of strings and have it work. :)
00:50 grondilu also, doesn't the correct syntax for a long parameter name in shell requires two and not just one dash?
00:51 grondilu like $ dothis --with-parameter=the-parameter
00:51 grondilu and $ dothat -x=2
00:51 zengargoyle yeah, and Bool have some weird --\name for the false case.
00:52 zengargoyle just took a quick peek at perl6-all-modules and found no MAIN that use anything other than :$
00:52 * grondilu is not surprised
00:52 grondilu anything else would require some form of marshallization, shouldn't it?
00:53 grondilu 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.
00:54 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:55 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:56 grondilu meh, that happened often for me.
00:56 grondilu I mean like, unacceptably often.
00:56 bioduds_ being able to *%kv is awesome enough
00:56 bioduds_ opens up a bunch of opportunities
00:56 bioduds_ im already using it
00:56 bioduds_ :)
00:57 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; } }
00:58 bioduds_ 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.
00:58 bioduds_ cause in my case here, im building a key=>value NoSQL system
00:59 bioduds_ so the parameters are actually the key and the value to be searched
00:59 bioduds_ so, they are not actually options
00:59 grondilu does sub MAIN (*%kv, Str :$op) {...} behaved as you expected?  I'm a bit surprised it's even legal.
00:59 bioduds_ yes, perfectly
01:00 bioduds_ now I can do search for name="Some Name" op="eq"
01:00 bioduds_ and search rate="4.3" op="gt"
01:00 bioduds_ works fine
01:00 grondilu m: sub (*%h, :$foo) { say %h.perl }(foo => "bar")
01:00 camelia rakudo-moar 8aa0aa: OUTPUT«{:foo("bar")}␤»
01:01 grondilu m: sub (*%h, :$foo) { say %h.perl, " and ", $foo }(foo => "bar")
01:01 camelia rakudo-moar 8aa0aa: OUTPUT«{:foo("bar")} and bar␤»
01:01 grondilu hum... so the argument ends up in both parameters.  That's slightly weird.
01:02 zengargoyle how many 'op'?
01:05 bioduds_ a few
01:05 zengargoyle m: sub (:$foo, *%h) { say %h.perl, " and ", $foo }(foo => "bar")
01:05 camelia rakudo-moar 8aa0aa: OUTPUT«{} and bar␤»
01:05 bioduds_ eq, lt, gt, lte, gte
01:05 bioduds_ for starters
01:05 zengargoyle slurpy should go at end i think.
01:06 zengargoyle but makes op need to be first i think.
01:06 bioduds_ what do you mean?
01:06 bioduds_ sorry, didn't quite catch what you're trying to say
01:08 zengargoyle m: sub (:$foo, *%h) { say %h.perl, " and ", $foo }(foo => "bar", foo => "baz")
01:08 camelia rakudo-moar 8aa0aa: OUTPUT«{} and baz␤»
01:09 zengargoyle pondering collison when op is a name for a parameter and a poddible key in kv....
01:09 bioduds_ oh, yes
01:09 bioduds_ correct
01:10 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";
01:10 zengargoyle don't seem to work that way. :P
01:10 bioduds_ with sub MAIN( *%kv, Operator :$op ) {
01:11 zengargoyle yeah, or i was thinking earlier of multi sub MAIN('eq', ...) multi sub MAIN('lt', ...)
01:11 zengargoyle sorta sub-command like.
01:12 Actualeyes joined #perl6
01:12 zengargoyle but it forces order to your parameters.
01:13 pierre_ joined #perl6
01:13 bioduds_ yes
01:13 * zengargoyle loves to have a multi sub MAIN('test') in progs.
01:13 bioduds_ declarative programming to the rescue! :D
01:16 * grondilu would rather write it multi sub MAIN(:$test!)
01:16 grondilu so that it's called as $ perl6 prog --test
01:17 mst I like my perl5 solution
01:17 mst where if it's a module, it loads, and if it's a script, iut runs
01:17 mst see http://p3rl.org/App::opan
01:18 mst (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.
01:20 zengargoyle just another sub.
01:20 * grondilu tries.  Indeed, just an other sub.
01:21 zengargoyle i wonder about multi dispatch tho with :$test!
01:21 zengargoyle vs *@args or somesuch
01:22 mst |c is your friend
01:22 zengargoyle always wins?
01:23 bioduds_ how would I go about checking if some string meets my subset?
01:23 bioduds_ i mean, introspection
01:23 zengargoyle $str ~~ subset
01:23 zengargoyle ?
01:24 bioduds_ ok, this
01:24 bioduds_ thanks
01:24 zengargoyle just guess, if is don't work file a LTA bug. :P
01:24 bioduds_ unless ($key ~~ Operator) { get-json( WHERE => $key, EQUALS => $value, op => $op ); } }
01:25 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 scott part of my shell prompt*
01:26 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
01:26 scott 20 lines of uncomplicated code
01:26 zengargoyle maybe not.
01:27 scott this is the script https://gist.github.com/solson/c​28d547b5d3445f2a04cc5ed905dc099
01:28 scott 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
01:28 bioduds_ great
01:28 bioduds_ zengargoyle : also, as you pointed, sub MAIN( Operator :$op, *%kv ) { instead of sub MAIN( *%kv, Operator :$op ) {
01:29 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
01:30 scott (which is dominated by parsing)
01:31 zengargoyle yeah, not sure if 'use Foo;Foo::run' is faster than just 'Foo' for 20 lines or not...
01:32 scott it'd be cool if standalone scripts could get precompiled like modules do
01:33 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.
01:33 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:34 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...
01:34 scott grondilu: I'll try it
01:34 canopus joined #perl6
01:35 scott grondilu: seems to have no effect, at least when running `perl6 format-duration.p6`
01:36 grondilu indeed
01:36 scott actually, it had an effect in that MAIN wasn't executed anymore, but parsing was still slow each time
01:36 grondilu well, I tried.
01:37 grondilu a module should execute MAIN though, if called as a program.
01:38 grondilu shouldn't it?
01:39 zengargoyle i would suspect not
01:41 grondilu scott: maybe you can compile it with --target=moar or something
01:46 scott that gets me https://gist.github.com/solson/1​e801aef7c33540eaeb32fa75645c63c
01:46 grondilu I don't recall the exact syntax.  jnthn once showed me but I forgot.
01:46 grondilu I do remember it is possible though.
01:46 zengargoyle maybe that changed when things started going into compunitrepos instead of fs.
01:46 zengargoyle or try morevm...
01:46 TEttinger joined #perl6
01:47 grondilu --target=mast do work but it'd be silly to use that.
01:50 zengargoyle --target=mbc --output=file.mbc works....
01:51 zengargoyle 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
01:52 grondilu nope
01:55 scott zengargoyle: yeah, that worked for me
01:56 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 :)
01:57 grondilu $ cat $(which perl6)
01:57 scott I managed to get moarvm to segfault attempting that
01:58 grondilu oh yeah I forgot you want to feed it with bytecode
01:59 grondilu do $ moar --help, I think it tells you to use --dump
01:59 grondilu oh no, sorry
02:01 zengargoyle Unhandled exception: Could not look up the container config for 'rakudo_scalar'
02:02 grondilu yeah, got the same
02:10 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.
02:11 zengargoyle like some ld stage...
02:12 noganex joined #perl6
02:17 grondilu as I said I vaguely recall jnthn showing it can be done and it was not very complicated.
02:18 BenGoldberg joined #perl6
02:18 grondilu though it's possible I'm confusing things
02:20 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:32 scott thanks for looking into it
02:33 * zengargoyle squirrel!
02:34 johnjohn101 joined #perl6
02:34 johnjohn101 hi perl6
02:34 zengargoyle it's odd that it's BOOTSTRAP.moarvm where the error pops up.
02:36 zengargoyle i'm sorta miff'd that my simple test doesn't work. :P
02:42 zengargoyle turning 'perl6 test.p6' into 'nqp test.nqp' into 'moar test.mbp' into just './test' is a worthy progression.
02:49 samcv_ joined #perl6
03:12 kaare_ joined #perl6
03:14 pierre_ joined #perl6
03:32 awwaiid Just posted blog mentioning Perl 6, https://thelackthereof.org/TL​T/2016.09.23/All_The_Methods
03:37 luis` joined #perl6
03:37 kst` joined #perl6
03:37 noganex_ joined #perl6
03:37 djbkd_ joined #perl6
03:37 zhmylove joined #perl6
03:37 Xliff_ joined #perl6
03:37 mohae_ joined #perl6
03:37 setty2 joined #perl6
03:37 cpage__ joined #perl6
03:37 pyrimidine joined #perl6
03:37 kmwallio joined #perl6
03:37 ringer1 joined #perl6
03:37 mattp__ joined #perl6
03:37 Sgeo_ joined #perl6
03:37 lizmat_ joined #perl6
03:37 labster1 joined #perl6
03:37 inokenty1 joined #perl6
03:37 committable6_ joined #perl6
03:37 bisectable6_ joined #perl6
03:37 dalek joined #perl6
03:37 pdcawley_ joined #perl6
03:37 Timbus joined #perl6
03:37 perigrin_ joined #perl6
03:37 leego joined #perl6
03:37 Jonis_ joined #perl6
03:37 nebuchad` joined #perl6
03:37 dj_goku_ joined #perl6
03:37 kaare__ joined #perl6
03:37 krunen__ joined #perl6
03:37 DarthGandalf joined #perl6
03:37 dj_goku_ joined #perl6
03:37 erdic_ joined #perl6
03:37 sjn_ joined #perl6
03:38 TEttinger joined #perl6
03:38 _notbenh joined #perl6
03:38 awwaiid joined #perl6
03:38 profan_ joined #perl6
03:38 BinGOs_ joined #perl6
03:38 masak joined #perl6
03:38 vcv_ joined #perl6
03:38 facetious joined #perl6
03:38 cxreg2 joined #perl6
03:38 dylanwh joined #perl6
03:38 sjohnsen joined #perl6
03:38 sftp joined #perl6
03:38 markk joined #perl6
03:38 woolfy joined #perl6
03:38 chee joined #perl6
03:38 cosimo_ joined #perl6
03:38 BooK_ joined #perl6
03:38 bhm_ joined #perl6
03:38 nemo joined #perl6
03:38 broquaint joined #perl6
03:38 obfusk joined #perl6
03:38 avuserow joined #perl6
03:38 aindilis` joined #perl6
03:38 camelia joined #perl6
03:38 TimToady joined #perl6
03:38 simcop2387_ joined #perl6
03:38 simcop2387 joined #perl6
03:38 nightfrog joined #perl6
03:38 canopus joined #perl6
03:38 AlexDaniel joined #perl6
03:38 sergot joined #perl6
03:39 [Coke]_ joined #perl6
03:39 spider-mario joined #perl6
03:39 zoosha joined #perl6
03:39 Praise joined #perl6
03:39 Praise joined #perl6
03:39 ilogger2_ joined #perl6
03:39 AndyBotwin joined #perl6
03:39 AndyBotwin joined #perl6
03:39 KotH_ joined #perl6
03:39 perlpilot joined #perl6
03:39 a3r0 joined #perl6
03:39 orevdiabl joined #perl6
03:39 ponbiki joined #perl6
03:39 mspo_ joined #perl6
03:39 richi238 joined #perl6
03:40 amalia_ joined #perl6
03:40 telex joined #perl6
03:40 pochi joined #perl6
03:40 Guest71143 joined #perl6
03:40 ggoebel_ joined #perl6
03:40 [particle] joined #perl6
03:41 arnsholt_ joined #perl6
03:41 Khisanth joined #perl6
03:42 john51 joined #perl6
03:42 grondilu joined #perl6
03:42 Grrrr joined #perl6
03:42 edenc_ joined #perl6
03:43 sivoais joined #perl6
03:43 pierrot joined #perl6
03:43 wtw joined #perl6
03:43 mst_ joined #perl6
03:43 tinita joined #perl6
03:43 Upasaka joined #perl6
03:43 Celelibi_ joined #perl6
03:44 decent joined #perl6
03:44 woodruffw joined #perl6
03:48 grondilu_ joined #perl6
03:52 ilbot3 joined #perl6
03:52 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:52 john51 joined #perl6
03:52 ft joined #perl6
03:53 sunnavy joined #perl6
03:54 rmmm joined #perl6
03:54 raydiak joined #perl6
03:55 ingy joined #perl6
03:55 giraffe_ joined #perl6
03:55 masak_ joined #perl6
03:55 dsp_ joined #perl6
03:55 shadowpaste joined #perl6
03:56 grondilu_ left #perl6
03:56 sivoais joined #perl6
03:57 lizmat joined #perl6
03:57 Actualeyes joined #perl6
03:58 richi235 joined #perl6
03:58 dj_goku joined #perl6
03:58 dj_goku joined #perl6
03:59 garu joined #perl6
04:00 bartolin joined #perl6
04:03 pochi joined #perl6
04:03 telex joined #perl6
04:05 ggherdov joined #perl6
04:10 w4and0er96 joined #perl6
04:11 BuildTheRobots joined #perl6
04:14 timeless joined #perl6
04:20 [particle] joined #perl6
04:20 ringer1 joined #perl6
04:20 SmokeMachine____ Hi! I am having this problem, but the module (i think) is in the right place... any suggestion?
04:20 mohae_ joined #perl6
04:20 NeuralAnomaly_ joined #perl6
04:20 huggable_ joined #perl6
04:20 SmokeMachine____ https://www.irccloud.com/pastebin/TCh2pnb9/
04:20 [ptc]_ joined #perl6
04:20 garu_ joined #perl6
04:20 Actualeyes1 joined #perl6
04:20 nemo_ joined #perl6
04:20 Spot__ joined #perl6
04:20 Spot__ joined #perl6
04:20 SourceBaby joined #perl6
04:20 vcv joined #perl6
04:20 breinbaas joined #perl6
04:20 bob777 joined #perl6
04:20 Woodi_ joined #perl6
04:20 ingy joined #perl6
04:20 atacama joined #perl6
04:20 salparadise SmokeMachine____: code causing the problem will help I think
04:20 erdic joined #perl6
04:21 beatdown_ joined #perl6
04:21 Gothmog_ joined #perl6
04:21 DANtheBEASTman joined #perl6
04:21 vytas-local_ joined #perl6
04:21 sftp joined #perl6
04:21 Juerd joined #perl6
04:21 Sgeo joined #perl6
04:21 jcallen joined #perl6
04:21 poisonby joined #perl6
04:22 camelia joined #perl6
04:22 spider-mario joined #perl6
04:22 cgfbee joined #perl6
04:22 richi235 joined #perl6
04:22 inokenty joined #perl6
04:23 kmwallio joined #perl6
04:23 pochi joined #perl6
04:23 Unavowed joined #perl6
04:24 giraffe_ joined #perl6
04:25 john51 joined #perl6
04:25 SmokeMachine____ I have a module ProblemSolver on ./lib/ProblemSolver.pm6 and a ProblemSolver::State on ./lib/ProblemSolver/State.pm6
04:25 petercommand joined #perl6
04:25 markk joined #perl6
04:26 abruanese joined #perl6
04:26 SmokeMachine____ and a test t/03-problem.t that does: use lib "lib"; use ProblemSolver;
04:26 imcsk8 joined #perl6
04:26 huf joined #perl6
04:26 SmokeMachine____ salparadise: ^^
04:26 simcop2387 joined #perl6
04:26 SmokeMachine____ ProblemSolver and ProblemSolver::State are classes...
04:27 [Coke] joined #perl6
04:27 SmokeMachine____ salparadise: ant idea?
04:27 arnsholt joined #perl6
04:27 MilkmanDan joined #perl6
04:27 masak_ joined #perl6
04:27 japhb joined #perl6
04:27 pierrot joined #perl6
04:27 Khisanth joined #perl6
04:28 eyck joined #perl6
04:28 cosimo joined #perl6
04:28 sivoais joined #perl6
04:29 ggherdov joined #perl6
04:30 salparadise not really, more code, is ProblemSolver something you wrote?
04:30 SmokeMachine____ https://www.irccloud.com/pastebin/0ERDdoJc/
04:30 SmokeMachine____ yes, I did write ProblemSolver and ProblemSolver::State
04:33 clkao joined #perl6
04:34 Util joined #perl6
04:34 infina joined #perl6
04:34 timeless joined #perl6
04:35 w4and0er96 joined #perl6
04:35 john51 joined #perl6
04:36 wtw_ joined #perl6
04:36 Cabanossi joined #perl6
04:39 SmokeMachine____ Looks that the problem is when I create a attribute with the use'd type as type
04:41 holyghost joined #perl6
04:47 baest_ joined #perl6
04:52 baest joined #perl6
05:02 cbk_ joined #perl6
05:05 cpage_ joined #perl6
05:16 pierre_ joined #perl6
05:17 melezhik joined #perl6
05:38 pierre_ joined #perl6
05:50 grondilu joined #perl6
05:56 yoleaux joined #perl6
05:59 wamba joined #perl6
06:01 kurahaupo joined #perl6
06:11 ufobat joined #perl6
06:30 andrzejku joined #perl6
06:52 Matthew[m] joined #perl6
07:05 darutoko joined #perl6
07:32 firstdayonthejob joined #perl6
07:35 edenc joined #perl6
07:35 BuildTheRobots joined #perl6
07:35 jnap_ joined #perl6
07:35 PotatoGim joined #perl6
07:35 kipd joined #perl6
07:35 Peter_R joined #perl6
07:35 damnlie joined #perl6
07:35 jsimonet joined #perl6
07:35 albongo joined #perl6
07:35 avalenn joined #perl6
07:35 isacloud joined #perl6
07:35 DrParis joined #perl6
07:35 kipd joined #perl6
07:35 PotatoGim joined #perl6
07:35 jnap_ joined #perl6
07:35 BuildTheRobots joined #perl6
07:36 espadrine joined #perl6
07:41 BuildTheRobots joined #perl6
07:45 PotatoGim joined #perl6
07:52 andrzejku joined #perl6
07:55 RabidGravy joined #perl6
08:05 cyphase joined #perl6
08:07 andrzejku joined #perl6
08:10 cpage_ joined #perl6
08:10 FROGGS joined #perl6
08:14 breinbaas joined #perl6
08:17 moritz_ SmokeMachine____: have you used ProblemSolver::State in ProblemSovler.pm?
08:18 cyphase joined #perl6
08:25 [particle] joined #perl6
08:39 BinGOs joined #perl6
08:41 domidumont joined #perl6
08:45 cyphase joined #perl6
08:46 domidumont1 joined #perl6
08:47 andrzejku joined #perl6
08:48 ka joined #perl6
09:04 eliasr joined #perl6
09:08 bpmedley joined #perl6
09:10 labster joined #perl6
09:25 hanekomu joined #perl6
09:29 hanekomu joined #perl6
09:32 canopus joined #perl6
09:32 Ven_ joined #perl6
09:37 Ven_ joined #perl6
09:37 dalek Inline-Perl5: a03cc7b | niner++ | lib/Inline/Perl5.pm6:
09:37 dalek Inline-Perl5: Faster and safer check to determine if we construct a subclass object
09:37 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/a03cc7b8b9
09:38 nebuchadnezzar joined #perl6
09:51 Ven__ joined #perl6
10:08 setty1 joined #perl6
10:11 yqt joined #perl6
10:13 nadim_ joined #perl6
10:23 ocbtec joined #perl6
10:35 imcsk8 joined #perl6
10:38 wamba joined #perl6
10:42 El_Che impressive netsplit
11:00 dalek doc: 8dd339e | (Jan-Olof Hendig)++ | doc/Type/Range.pod6:
11:00 dalek doc: Added some more code examples plus some sundry stuff
11:00 dalek doc: review: https://github.com/perl6/doc/commit/8dd339edf7
11:08 Actualeyes joined #perl6
11:14 bioduds_ hey guys
11:14 bioduds_ 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=>"-" ) },                   "ti
11:15 psch m: my %h = foo => { bar => 1, baz => 2 }; say %h<foo><bar>
11:15 camelia rakudo-moar 539a7d: OUTPUT«1␤»
11:16 psch bioduds_: no, it's not, because you're assigning a one-item list to a hash
11:16 psch m: my %h = { a => 1 }
11:16 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>␤»
11:16 psch m: my %h = { a => { b => 2 } }
11:16 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>␤»
11:16 psch oh, no, my private test was just weird
11:16 psch bioduds_: do you get an error from the compiler?  or just that warning
11:16 psch ?
11:17 psch bioduds_: because in general we try to make the compiler make sense when it says something :)
11:23 domidumont joined #perl6
11:23 bioduds_ warning I guess
11:23 bioduds_ 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
11:24 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)␤»
11:24 psch m: my @a = [ 1, 2, 3 ]; say @a.elems
11:24 camelia rakudo-moar 539a7d: OUTPUT«3␤»
11:26 dalek doc: 3ad38ad | (Jan-Olof Hendig)++ | doc/Type/Str.pod6:
11:26 dalek doc: Added blurb in docs for split that specifying a negative limit does not produce any meaningful result.
11:26 dalek doc: review: https://github.com/perl6/doc/commit/3ad38ad682
11:27 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:28 psch bioduds_: { } is a hash composer, it composes a hash
11:28 psch bioduds_: a hash assignment means you're assigning to a hash
11:29 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
11:29 bioduds_ oh, I think I get it, so how would be the non-useless syntax?
11:29 psch leave out the outer-most hash composer
11:30 rindolf joined #perl6
11:30 CIAvash joined #perl6
11:30 bioduds_ oh, I think I got it
11:31 bioduds_ the outer { is useless
11:31 bioduds_ got it, thank guys
11:32 ka joined #perl6
11:32 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" => { "
11:32 bioduds_ great
11:32 scott joined #perl6
11:32 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:34 Ven_ joined #perl6
11:36 Ven_ joined #perl6
11:38 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:40 SmokeMachine____ moritz_: yes
11:41 mst joined #perl6
11:55 infina joined #perl6
11:56 ka joined #perl6
12:08 ka joined #perl6
12:20 sammers joined #perl6
12:30 dayangkun joined #perl6
12:36 rindolf joined #perl6
12:36 bstamour joined #perl6
12:40 dayangkun joined #perl6
12:44 pmurias joined #perl6
12:47 Zoffix joined #perl6
12:48 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 Zoffix m: $_ = 42; dd { a => $_ } # case in point
12:48 camelia rakudo-moar 539a7d: OUTPUT«-> ;; $_? is raw { #`(Block|57555136) ... }␤»
12:49 Zoffix scott, also, you don't need any parentheses at all. my %h = a => 1, b => 2; works
12:49 Zoffix m: my %h = a => 1, b => 2;
12:49 camelia rakudo-moar 539a7d: ( no output )
12:49 Zoffix m: my %h = a => 1, b => 2; dd %h
12:49 camelia rakudo-moar 539a7d: OUTPUT«Hash %h = {:a(1), :b(2)}␤»
12:49 scott heh, I was just messing with cases involving that {} confusion
12:49 Zoffix m: my %h = :1a, :2b; dd %h
12:49 camelia rakudo-moar 539a7d: OUTPUT«Hash %h = {:a(1), :b(2)}␤»
12:50 scott for multiline hashes, it seems nicer to have a delimiter around it
12:50 Zoffix .oO( Death to parentheses! )
12:50 scott the semicolon looks really awkward when there is no delimiter
12:51 scott on a line by itself, or taking a place where a trailing comma should be
12:55 scott 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:57 pierre_ joined #perl6
12:57 llfourn_ scott: you don't really need the 'Hash' in the second one if you want it to be like the first
12:57 llfourn_ also % will behave differently in for loops to $
12:57 ilbot3 joined #perl6
12:57 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
12:58 llfourn_ m: my %a = one => "two",three => "four"; for %a { .say }
12:58 camelia rakudo-moar 539a7d: OUTPUT«three => four␤one => two␤»
12:58 llfourn_ m: my $a := %( one => "two",three => "four"); for $a { .say }
12:58 camelia rakudo-moar 539a7d: OUTPUT«three => four␤one => two␤»
12:58 llfourn_ oh maybe I'm wrong about that
12:58 llfourn_ m: my $a := %( one => "two",three => "four"); for $a { .^name.say }
12:58 camelia rakudo-moar 539a7d: OUTPUT«Pair␤Pair␤»
12:59 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 }
12:59 camelia rakudo-moar 539a7d: OUTPUT«Hash␤»
12:59 Zoffix left #perl6
12:59 llfourn_ oh you're right that's the difference
12:59 llfourn_ so the container type determines loop behaviour rather than the sigil
12:59 llfourn_ good to know :)
13:00 scott basically I'm trying to find out if I can reduce all sigils to special cases of $ to help my mental model
13:01 llfourn_ I think sigils still affect assignment
13:01 llfourn_ like when you use '=' rather than ':='
13:01 scott '=' seems to depend again on the container, not the sigil
13:02 scott 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
13:02 camelia rakudo-moar 539a7d: OUTPUT«[one two three]␤»
13:02 llfourn_ m: my Array $a = <one two three>; say $a
13:02 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␤␤»
13:02 scott right, that's not the case I am referring to
13:03 scott 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
13:03 camelia rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    three used at line 1␤    two used at line 1␤␤»
13:03 llfourn_ m: my Array $a := [<one two three>]; $a = <one two three>; say $a # :S
13:03 camelia rakudo-moar 539a7d: OUTPUT«Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
13:04 scott interesting
13:04 scott I'm unsure what makes @a mutable and $a not when their .VARs are both Array
13:04 llfourn_ you can have @a immuteable as well
13:04 rindolf joined #perl6
13:04 scott can you make that $a mutable?
13:05 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␤␤»
13:05 scott oh
13:05 llfourn_ it will be mutable if we just assign to an array
13:05 llfourn_ m: my $a = [<one two three>; $a = <four>; say $a
13:05 camelia rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use variable $a in declaration to initialize itself␤at <tmp>:1␤------> 3my $a = [<one two three>; $7⏏5a = <four>; say $a␤    expecting any of:␤        term␤»
13:06 llfourn_ m: my $a = [<one two three>]; $a = <four>; say $a; #ek
13:06 camelia rakudo-moar 539a7d: OUTPUT«four␤»
13:06 llfourn_ but as sson as you := you get the container fo the RHS
13:06 llfourn_ which is immuteable above
13:07 llfourn_ of the*
13:07 scott m: my $a = [<one two three>]; say $a.VAR.WHAT
13:07 camelia rakudo-moar 539a7d: OUTPUT«(Scalar)␤»
13:08 scott m: my @a = <one two three>; say @a.VAR.WHAT
13:08 camelia rakudo-moar 539a7d: OUTPUT«(Array)␤»
13:08 scott m: my $a := [<one two three>]; say $a.VAR.WHAT # this is what I meant, rather
13:08 camelia rakudo-moar 539a7d: OUTPUT«(Array)␤»
13:08 scott I'm curious what makes one mutable and the other not
13:08 scott if you compare, say, my $a = 42 and my $a := 42, one is Scalar and the other is Int
13:08 scott and the Scalar container makes the former mutale
13:08 scott mutable*
13:09 llfourn_ right. you can't assign the second one for the same reason you can't do '42 = 3'
13:10 llfourn_ you can't do [<one two three>] = [<four>] either
13:10 llfourn_ so the LHS needs to be writeable
13:13 scott hmm, the $h example was writeable because %(:1a, :2b) is writeable
13:13 scott but @(1, 2, 3) returns List, not Array
13:14 scott 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?
13:14 camelia rakudo-moar 539a7d: ( no output )
13:15 llfourn_ m: my $a := @(1,2,3); say $a.^name;
13:15 camelia rakudo-moar 539a7d: OUTPUT«List␤»
13:15 llfourn_ hmm I didn't know whtat
13:15 llfourn_ that*
13:15 scott your example with the indexing mutates a container element, not the array
13:16 scott m: my $a := [<one two three>]; push $a, "four"
13:16 camelia rakudo-moar 539a7d: ( no output )
13:16 scott hmm, it is writeable?
13:16 llfourn_ so Array,Hash - elements are writable. List,Map elements are not.
13:17 ilbelkyr joined #perl6
13:17 scott I still don't get what makes @a assignable
13:17 timotimo awwaiid: i like your latest blog post :)
13:17 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
13:18 scott llfourn_: right
13:18 scott immutable is a bit of a misleading descriptor when you can add, remove, and mutate elements
13:19 grondilu joined #perl6
13:19 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.
13:19 gfldex is there a way to import symbols from a package into the current scope?
13:19 timotimo m: (1, 2, 3, 4)[0].VAR.WHAT.say; [1, 2, 3, 4][0].VAR.WHAT.say;
13:19 camelia rakudo-moar 539a7d: OUTPUT«(Int)␤(Scalar)␤»
13:19 scott timotimo: sure, that explains one of the things in my list (mutating) but not the rest
13:20 timotimo i haven't backlogged yet :)
13:20 scott you can also push to an "immutable" array
13:20 llfourn_ scott: all arrays are mutable
13:20 grondilu m: (my $ := [])[0] = pi
13:20 camelia rakudo-moar 539a7d: ( no output )
13:20 llfourn_ the variable that contains the array object may not be
13:21 timotimo ah
13:21 timotimo we differentiate on the syntax level between listy assignment and itemy assignment
13:21 timotimo that's a thing that tripped me up a few times
13:22 scott llfourn_: I'm looking for confirmation of that distinction
13:22 scott with scalars it's obvious, like Scalar vs Int
13:22 scott normally a $ variable is bound to a Scalar container
13:22 grondilu [] is a scalar container
13:22 scott but so far I haven't been able to observe the container of a @ variable
13:23 scott it just shows up as Array
13:23 scott but assigning to an Array elsewhere fails
13:23 grondilu $@
13:23 llfourn_ hmm I'm not sure how you introspect the difference
13:23 * grondilu stops trying to disrupt the conversation :)
13:24 timotimo m: my $foo := [<one two three>]; @$foo = <nein nein nein>; say $foo.perl
13:24 camelia rakudo-moar 539a7d: OUTPUT«["nein", "nein", "nein"]␤»
13:24 timotimo m: my $foo := [<one two three>]; $foo = <nein nein nein>; say $foo.perl
13:24 camelia rakudo-moar 539a7d: OUTPUT«Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
13:24 llfourn_ hmmm i didn't know you could do that
13:25 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
13:25 timotimo "op" as in nqp::thething
13:25 llfourn_ mmm pretty handy :)
13:26 scott what makes @$foo different from $foo? is there any type of thing I can call on it?
13:26 scott all the .WHATs and .VAR.WHATs are the same
13:26 timotimo it's just a thing the parser does
13:26 timotimo i.e. it's not about the type, it's about the source code itself
13:27 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
13:27 llfourn_ m: my $foo; @$foo := <one two three> # eh?
13:27 camelia rakudo-moar 539a7d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3my $foo; @$foo := <one two three> # eh?7⏏5<EOL>␤»
13:27 llfourn_ m: my $foo; @$foo = <one two three>
13:27 camelia rakudo-moar 539a7d: OUTPUT«Cannot modify an immutable Any␤  in block <unit> at <tmp> line 1␤␤»
13:28 timotimo scott: correct
13:28 scott confirmed my own question in the repl
13:28 scott I assumed it was like @$foo returned a new type of thing, and then we assigned to that
13:28 scott timotimo: are there good docs on this?
13:29 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
13:29 llfourn_ it's pretty tricky tbh :)
13:29 scott hard to see what justifies the complexity a lot of the time
13:29 andrzejku joined #perl6
13:30 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
13:30 llfourn_ m: my %h; my $a := %h<one>; say %h; %a = "foo"; say %h
13:30 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␤»
13:31 llfourn_ m: my %h; my $a := %h<one>; say %h; $a = "foo"; say %h
13:31 camelia rakudo-moar 539a7d: OUTPUT«{}␤{one => foo}␤»
13:31 timotimo that's definitely a tricky part, yes
13:31 timotimo but also incredibly useful
13:32 llfourn_ I am no use at exlpaining it but I also can verify the distinction between variables and containers is very useful.
13:35 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!
13:35 dogbert17 moritz: are you out there?
13:36 scott thanks for the discussion, all. 'night
13:36 timotimo gnite scott
13:36 llfourn_ night :)
13:38 rgrinberg joined #perl6
13:42 masak greetings, #perl6
13:42 masak I see there was a netsplit storm here while I was away... :)
13:43 kaare joined #perl6
13:44 timotimo oh, i missed that
13:47 rgrinberg joined #perl6
14:01 MilkmanDan joined #perl6
14:05 skids joined #perl6
14:09 timotimo https://twitter.com/kelseyhightower​/status/530797723596111872/photo/1  -  teehee
14:18 tushar joined #perl6
14:30 Guest94548 joined #perl6
14:40 AlexDaniel joined #perl6
14:41 rindolf joined #perl6
14:47 ka joined #perl6
14:52 BenGoldberg joined #perl6
14:52 Xliff__ joined #perl6
14:56 domidumont joined #perl6
15:00 skids Hrm... COMPOSE{} is NYI?
15:03 skids Oh I guess that
15:03 skids 's what the role body is anyway.
15:07 rgrinberg joined #perl6
15:09 Ven_ joined #perl6
15:35 firstdayonthejob joined #perl6
15:37 scott haha, once I realized what `@a[*-1]` was really doing, I came up with `@a[*/2]` and @`a[$x mod *]`
15:38 scott the latter of which is something that has come up in real stuff I've written
15:38 scott cleanest modular indexing I've seen
15:39 itaipu joined #perl6
15:39 timotimo i've used * div 2, * * 3 div 4 and * div 4 in the past to get percentiles on a sorted array
15:39 timotimo you can even put them into a list inside the same [foo]
15:40 scott yeah, nice
15:40 Ven_ joined #perl6
15:41 AlexDaniel m: say ‘foo bar’ ~~ / foo { False } /
15:41 camelia rakudo-moar 362349: OUTPUT«「foo」␤»
15:41 timotimo you mean <?{ False }>
15:41 timotimo alternatively <!> is a token that never matches
15:41 AlexDaniel timotimo: I did not even ask a question yet
15:41 AlexDaniel timotimo: thank you
15:41 timotimo well ... :)
15:41 AlexDaniel <?{}> is what I needed
15:42 psch or <!{}>, maybe
15:42 timotimo <{ }> will let you interpolate the string result of code as a piece of regex
15:48 Ven_ joined #perl6
15:53 Ven_ joined #perl6
15:56 khw joined #perl6
16:00 wamba joined #perl6
16:02 Ven_ joined #perl6
16:24 domidumont joined #perl6
16:36 tushar joined #perl6
16:37 Ven_ joined #perl6
16:41 zakharyas joined #perl6
16:41 girafe joined #perl6
17:00 lichtkind__ joined #perl6
17:02 Ven_ joined #perl6
17:03 girafe joined #perl6
17:15 Ven_ joined #perl6
17:19 andrzejku joined #perl6
17:32 Ven_ joined #perl6
17:37 mst hmm, how does '.foo' on its own become a method call? (and more importantly, how do I produce such a thing ;)
17:37 RabidGravy joined #perl6
17:40 scott mst: .foo with no receiver is short for $_.foo
17:40 mst scott: yes
17:40 mst scott: how
17:41 scott mst: it's just part of the grammar. I'm not sure I understand the question
17:42 mst ok, so, I can define a postfix operator .* and $foo.* will work fine
17:43 mst I'm wondering how I annotate or otherwise mess with it
17:43 mst to be able to default to $_
17:44 geekosaur you shouldn't have to, it's built into the grammar
17:44 mst ...
17:45 geekosaur oh, I see, you want a not-a-method that looks like a method call
17:45 benchable6 joined #perl6
17:45 committable6 joined #perl6
17:45 geekosaur I think you'd have to mutate the grammar to support that
17:45 bisectable6 joined #perl6
17:46 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
17:47 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 #perl6
17:48 mst where would I find docs on that?
17:48 benchable6 joined #perl6
17:48 bisectable6 joined #perl6
17:49 committable6 joined #perl6
17:49 geekosaur (also I would disrecommend .* because of the special method syntax https://docs.perl6.org/language/operators#postfix_.*
17:49 scott by the way, why are there methods for calling all methods?
17:50 scott err, operators*
17:51 timotimo mst: it might be enough to define a term that uses CALLER::<$_> for its invocant
17:52 timotimo m: sub term:<.notamethod> { CALLER::<$_>.say }; $_ = "hello mst"; .notamethod
17:52 camelia rakudo-moar e4e823: OUTPUT«hello mst␤»
17:52 timotimo mst: that tickle your fancy? :)
17:52 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)
17:52 timotimo ah, geekosaur suggested the term already
17:53 mst that would do the trick, excellent
17:54 geekosaur I guess at the moment the only documentation for those is http://design.perl6.org/S02.​html#Grammatical_Categories
17:56 dalek whateverable: 5b9ca5d | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (4 files):
17:56 dalek whateverable: Use Sift4 to allow typos in bot names
17:56 dalek whateverable:
17:56 dalek whateverable: For example, it will now allow you to type “omitable6”.
17:56 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/5b9ca5de83
17:56 AlexDaniel omitable6: HEAD say 42
17:56 committable6 AlexDaniel, ¦«HEAD»: 42
17:56 AlexDaniel bsicetable6: exit 42
17:56 bisectable6 AlexDaniel, On both starting points (old=2015.12 new=376b5f4) the exit code is 42 and the output is identical as well
17:56 bisectable6 AlexDaniel, Output on both points:
17:56 AlexDaniel jnthn: ↑ ;)
17:58 labster joined #perl6
17:59 AlexDaniel .tell Zoffix IRC::Client and Perl 6 are amazing. See http://irclog.perlgeek.de/p​erl6/2016-09-24#i_13272146
17:59 yoleaux AlexDaniel: I'll pass your message to Zoffix.
18:00 Ven_ joined #perl6
18:05 ugexe scott: you can't think of a reason to call sets of methods?
18:06 xdxdxdxd joined #perl6
18:06 xdxdxdxd How do I check if a variable is an int
18:06 timotimo do you mean Int or native int?
18:07 timotimo also, do you mean "is defined to hold" or "currently holds"?
18:07 xdxdxdxd if I did ' my $a = 1 ' and ' my $b = "hello" '
18:07 xdxdxdxd $a would be int
18:07 xdxdxdxd and $b wouldn't
18:07 xdxdxdxd how would I check that
18:07 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
18:07 camelia rakudo-moar e4e823: OUTPUT«logger1␤logger2␤logger1␤»
18:07 geekosaur Int, not int
18:08 timotimo xdxdxdxd: smart match ought to help with that. say $a ~~ Int; say $b ~~ Int
18:08 geekosaur $a ~~ Int
18:08 xdxdxdxd ah
18:08 xdxdxdxd didn't know you could do that with ~~
18:08 timotimo ~~ does a lot of things, one of them is type checking
18:09 FROGGS does somebody now of a Perl [5|6] Samba/CIFS server that actually works?
18:10 scott ugexe: I can't think of a reason to call sets of methods with the same name on a single object
18:10 scott ugexe: seems aggressively niche for an operator
18:10 scott ugexe: I was wondering if there was some really common pattern I overlooked
18:10 ugexe i just showed one
18:11 ocbtec joined #perl6
18:11 xdxdxdxd why isn't this working: " get / ^ '/blog/' \d+ $ / => sub ($post) { ... } "
18:12 xdxdxdxd that is the get sub from Bailador btw
18:16 ugexe think outside the inheritance box
18:17 scott I rarely think of inheritance at all
18:17 scott OOP's not really my thing
18:19 xdxdxdxd how do I fix it lol
18:19 xdxdxdxd I get too many positionals passed
18:23 MasterDuke joined #perl6
18:24 ugexe if you want someone to debug these things you need to give them more to work with
18:24 ugexe m: sub get($pos) { }; get / ^ "/blog/" \d+ $ / => sub ($post) { ... }
18:24 camelia rakudo-moar e4e823: ( no output )
18:25 ugexe because the line you posted works. so you are leaving out a bunch of neccesary context
18:26 geekosaur full source and full error message to an appropriate pastebin is usually a good idea
18:31 xdxdxdxd http://pastebin.com/XCSkvVLi does this help
18:31 zhmylove joined #perl6
18:32 Ven_ joined #perl6
18:32 ugexe thats not the full error message
19:10 ilbot3 joined #perl6
19:10 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
19:10 domm1 joined #perl6
19:10 raydiak joined #perl6
19:10 shadowpaste joined #perl6
19:10 bartolin joined #perl6
19:10 lichtkind joined #perl6
19:10 akiym joined #perl6
19:11 bjz joined #perl6
19:11 xdbr joined #perl6
19:11 [Coke] joined #perl6
19:11 simcop2387 joined #perl6
19:11 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:12 silug_ joined #perl6
19:12 ingy joined #perl6
19:12 hoelzro joined #perl6
19:12 m0ltar joined #perl6
19:13 mtj_ joined #perl6
19:13 xinming joined #perl6
19:13 wamba joined #perl6
19:13 cgfbee joined #perl6
19:13 lucs joined #perl6
19:14 k-man_ joined #perl6
19:14 ruoso joined #perl6
19:14 john51 joined #perl6
19:14 Woodi joined #perl6
19:15 RabidGravy joined #perl6
19:15 MilkmanDan joined #perl6
19:16 clkao joined #perl6
19:16 jstimpfle joined #perl6
19:16 jkva joined #perl6
19:16 camelia joined #perl6
19:16 gensym joined #perl6
19:17 stmuk_ joined #perl6
19:17 emdashcomma joined #perl6
19:17 mniip joined #perl6
19:17 pmurias joined #perl6
19:17 Gothmog_ joined #perl6
19:18 sunnavy joined #perl6
19:18 awwaiid joined #perl6
19:18 ambs joined #perl6
19:18 dalek doc: 426d4e2 | (Zoffix Znet)++ | doc/Language/typesystem.pod6:
19:18 dalek doc: where clauses smartmatch so we don't need to smartmatch the smartmatch
19:18 dalek doc:
19:18 dalek doc: Also... smartmatch
19:18 dalek doc: review: https://github.com/perl6/doc/commit/426d4e2808
19:18 Possum joined #perl6
19:18 peteretep joined #perl6
19:19 tbrowder joined #perl6
19:19 ssm joined #perl6
19:19 eyck joined #perl6
19:19 Khisanth joined #perl6
19:19 ringer1 joined #perl6
19:19 FROGGS joined #perl6
19:20 BuildTheRobots joined #perl6
19:20 gypsydave5 joined #perl6
19:20 PotatoGim joined #perl6
19:20 zoosha joined #perl6
19:20 telex joined #perl6
19:21 dj_goku_ joined #perl6
19:21 dj_goku_ joined #perl6
19:22 sergot joined #perl6
19:22 telex joined #perl6
19:22 esh joined #perl6
19:23 a3r0 joined #perl6
19:23 Praise joined #perl6
19:23 Praise joined #perl6
19:24 stux|RC-only joined #perl6
19:24 olinkl joined #perl6
19:25 tailgate joined #perl6
19:25 Jonis joined #perl6
19:25 w4and0er96 joined #perl6
19:25 notbenh_ joined #perl6
19:26 ggherdov joined #perl6
19:27 mithaldu_ joined #perl6
19:28 Lucas_One joined #perl6
19:28 eliasr joined #perl6
19:28 darutoko joined #perl6
19:28 sftp joined #perl6
19:29 Guest53008 joined #perl6
19:29 CIAvash joined #perl6
19:29 SmokeMachine____ joined #perl6
19:29 mindos joined #perl6
19:30 konobi_ joined #perl6
19:30 abruanese joined #perl6
19:30 jcallen joined #perl6
19:30 markk joined #perl6
19:30 hanekomu joined #perl6
19:30 timeless joined #perl6
19:30 ChoHag joined #perl6
19:31 pmurias joined #perl6
19:32 nebuchadnezzar joined #perl6
19:34 infina joined #perl6
19:34 sivoais joined #perl6
19:35 smash joined #perl6
19:35 mrsolo joined #perl6
19:35 Zoffix__ joined #perl6
19:36 Xliff_ joined #perl6
19:36 noganex joined #perl6
19:36 mohae_ joined #perl6
19:37 djbkd joined #perl6
19:37 dogbert2 joined #perl6
19:37 kst```` joined #perl6
19:37 bob778 joined #perl6
19:37 [particle]1 joined #perl6
19:38 user10 joined #perl6
19:38 cpage_ joined #perl6
19:38 nadim_ joined #perl6
19:39 obfusk_ joined #perl6
19:40 ShimmerFairy joined #perl6
19:40 itaipu joined #perl6
19:40 El_Che joined #perl6
19:40 garu joined #perl6
19:40 dsp_ joined #perl6
19:40 captain-adequate joined #perl6
19:40 Unavowed joined #perl6
19:40 mattp_ joined #perl6
19:42 ufobat joined #perl6
19:43 rudi_s joined #perl6
19:45 TEttinger joined #perl6
19:45 Timbus joined #perl6
19:45 m0ltar joined #perl6
19:46 bartolin joined #perl6
19:48 eliasr joined #perl6
19:49 imcsk8 joined #perl6
19:49 zhmylove joined #perl6
19:50 protium joined #perl6
19:51 ruoso joined #perl6
19:51 noganex_ joined #perl6
19:51 djbkd_ joined #perl6
19:51 Zoffix__ joined #perl6
19:51 xiaomiao joined #perl6
19:52 [particle] joined #perl6
19:52 ugexe joined #perl6
19:53 mohae joined #perl6
19:53 user10 joined #perl6
19:54 zoosha_ joined #perl6
19:54 vytas joined #perl6
19:54 lucs joined #perl6
19:54 andrewalker joined #perl6
19:55 konobi joined #perl6
19:56 chris2 joined #perl6
19:57 skaji joined #perl6
19:57 zacts joined #perl6
20:02 melezhik joined #perl6
20:03 jcallen joined #perl6
20:03 mniip joined #perl6
20:04 Upasaka joined #perl6
20:04 gensym joined #perl6
20:04 Praise- joined #perl6
20:04 Praise- joined #perl6
20:04 mst joined #perl6
20:05 captain-adequate joined #perl6
20:05 krunen joined #perl6
20:05 bob777 joined #perl6
20:05 nightfrog joined #perl6
20:05 dogbert2 joined #perl6
20:05 sivoais joined #perl6
20:06 esh joined #perl6
20:06 markk joined #perl6
20:06 emdashcomma joined #perl6
20:06 freeze joined #perl6
20:06 lichtkind joined #perl6
20:07 FROGGS joined #perl6
20:07 gypsydave5 joined #perl6
20:07 Gothmog joined #perl6
20:07 awwaiid joined #perl6
20:07 ShimmerFairy joined #perl6
20:08 ambs joined #perl6
20:08 cpage_ joined #perl6
20:08 psch joined #perl6
20:08 f3ew joined #perl6
20:09 giraffe_ joined #perl6
20:09 eyck joined #perl6
20:09 dj_goku joined #perl6
20:09 dj_goku joined #perl6
20:10 Jonis joined #perl6
20:11 garu joined #perl6
20:32 ilbot3 joined #perl6
20:32 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
20:32 chris2 joined #perl6
20:32 gabiruh_ joined #perl6
20:32 zoosha_ joined #perl6
20:32 camelia joined #perl6
20:32 leego joined #perl6
20:32 gfldex m: enum E <A B>; sub f(){ "foo" but A }; put f();
20:32 El_Che_ joined #perl6
20:32 gensym joined #perl6
20:32 NeuralAnomaly joined #perl6
20:32 huggable joined #perl6
20:32 mtj_ joined #perl6
20:32 eyck joined #perl6
20:32 NeuralAnomaly joined #perl6
20:32 pmurias_ joined #perl6
20:32 remmie joined #perl6
20:32 Ulti joined #perl6
20:32 camelia rakudo-moar e8a61d: OUTPUT«foo␤»
20:33 khw joined #perl6
20:33 protium joined #perl6
20:33 zhmylove joined #perl6
20:33 RabidGravy joined #perl6
20:33 lichtkind joined #perl6
20:33 eythian joined #perl6
20:33 abruanese joined #perl6
20:33 [Coke] joined #perl6
20:33 samcv joined #perl6
20:33 xiaomiao joined #perl6
20:33 girafe2 joined #perl6
20:33 tbrowder joined #perl6
20:33 dj_goku joined #perl6
20:33 dj_goku joined #perl6
20:34 Gothmog joined #perl6
20:34 zengargoyle joined #perl6
20:34 k-man__ joined #perl6
20:34 eliasr joined #perl6
20:34 akiym joined #perl6
20:34 Khisanth joined #perl6
20:34 Woodi joined #perl6
20:34 ShimmerFairy joined #perl6
20:34 ssm joined #perl6
20:34 canopus joined #perl6
20:34 ruoso joined #perl6
20:34 mohae joined #perl6
20:34 andrewalker joined #perl6
20:35 Jonis joined #perl6
20:35 stmuk joined #perl6
20:35 ChoHag joined #perl6
20:35 vytas joined #perl6
20:35 emdashcomma joined #perl6
20:35 jast joined #perl6
20:35 simcop2387 joined #perl6
20:35 simcop2387 joined #perl6
20:35 shmibs joined #perl6
20:35 kmwallio joined #perl6
20:36 ingy joined #perl6
20:36 Guest36361 joined #perl6
20:36 esh joined #perl6
20:36 llfourn joined #perl6
20:36 stux|RC-only joined #perl6
20:36 raydiak joined #perl6
20:36 m0ltar joined #perl6
20:36 TheDir joined #perl6
20:36 konobi_ joined #perl6
20:36 itaipu joined #perl6
20:37 [ptc] joined #perl6
20:37 firstdayonthejob joined #perl6
20:37 pochi joined #perl6
20:37 ringer1 joined #perl6
20:37 jdv79 joined #perl6
20:37 zostay joined #perl6
20:38 grondilu joined #perl6
20:38 cgfbee joined #perl6
20:38 hobbs joined #perl6
20:38 solarbunny joined #perl6
20:38 sivoais joined #perl6
20:38 telex joined #perl6
20:39 f3ew joined #perl6
20:39 awwaiid joined #perl6
20:39 ranguard joined #perl6
20:39 hobbs joined #perl6
20:39 jonadab joined #perl6
20:40 masak holy netsplit, Batman
20:40 xinming joined #perl6
20:40 ggherdov joined #perl6
20:40 masak I like the thing someone said -- "nothing prepared me for the reality of Eric Brewer's CAP theorem like IRC netsplits"
20:41 lucs joined #perl6
20:41 bob777 joined #perl6
20:41 hanekomu joined #perl6
20:53 ilbot3 joined #perl6
20:53 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
20:53 mniip joined #perl6
20:53 andrewalker joined #perl6
20:53 ribasushi joined #perl6
20:53 bartolin joined #perl6
20:54 k-man__ joined #perl6
20:54 mrsolo joined #perl6
20:54 lichtkind joined #perl6
20:54 cosimo joined #perl6
20:55 BenGoldberg joined #perl6
20:55 remmie joined #perl6
20:55 captain-adequate joined #perl6
20:56 hobbs joined #perl6
20:56 solarbunny joined #perl6
20:56 protium joined #perl6
20:56 cgfbee joined #perl6
20:57 Cabanossi joined #perl6
20:57 smash joined #perl6
20:58 BuildTheRobots joined #perl6
20:58 felher joined #perl6
20:58 john51 joined #perl6
20:58 timeless joined #perl6
20:59 shadowpaste joined #perl6
21:00 avuserow joined #perl6
21:00 clkao joined #perl6
21:02 a3r0 joined #perl6
21:02 Possum joined #perl6
21:03 cdg joined #perl6
21:04 nebuchadnezzar joined #perl6
21:05 dsp_ joined #perl6
21:05 giraffe_ joined #perl6
21:06 Xliff_ joined #perl6
21:09 MilkmanDan joined #perl6
21:13 awwaiid joined #perl6
21:13 chansen_ joined #perl6
21:14 zostay joined #perl6
21:14 ggherdov joined #perl6
21:15 pnu_ joined #perl6
21:15 peteretep joined #perl6
21:17 vcv joined #perl6
21:17 timotimo :(
21:18 mst stability will return to the kingdom soon enough
21:24 PotatoGim joined #perl6
21:24 yoleaux joined #perl6
21:27 masak "ddos", aka "people can be such jerks sometimes"
21:28 john51 joined #perl6
21:30 tbrowder joined #perl6
21:31 labster joined #perl6
21:31 giraffe_ joined #perl6
21:33 bob777 joined #perl6
21:33 perl6user joined #perl6
21:33 richi235 joined #perl6
21:33 perl6user What is the fastest way to find out how many files are in a directory?
21:34 grondilu including subdirectories?
21:34 perl6user no just main directories
21:34 canopus joined #perl6
21:34 perl6user just main directory*
21:35 BenGoldberg my $cunt = +dir('dirname') should do it, I think.
21:35 masak m: say +dir()
21:35 Cabanossi joined #perl6
21:35 BenGoldberg Err, count!
21:35 grondilu BenGoldberg++ typo of the day :)
21:35 * BenGoldberg grumbles at his stupid fingers.
21:36 timotimo that also counts folders as files
21:36 perl6user It will work for me, thanks BenGoldberg
21:37 BenGoldberg Hmm, it looks like camelia is on the wrong side of the netsplit, or perhaps is offline.
21:37 lichtkind joined #perl6
21:38 timotimo it could be dir() is disallowed in the restricted setting anyway
21:39 grondilu if you want regular files I think you can grep(* ~~ :f)
21:39 vike joined #perl6
21:39 [ptc] joined #perl6
21:39 scott joined #perl6
21:39 scott pretty easy to count only files, with dir(dirname).grep(*.f)
21:40 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 #perl6
21:40 timotimo nah, because that's a named parameter to the grep method
21:40 timotimo you'd have to put extra parens if you meant a Pair object
21:40 timotimo and at that point *.f is shorter
21:40 grondilu indeed
21:40 Guest77506 timotimo: top-level dir does
21:41 b2gills joined #perl6
21:41 Guest77506 you could write dirname.IO.dir.grep(*.f) equivalently
21:42 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 #perl6
21:42 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-…»
22:05 ilbot3 joined #perl6
22:05 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
22:05 wtw joined #perl6
22:07 infina joined #perl6
22:07 Guest77506 joined #perl6
22:07 Guest77506 joined #perl6
22:09 mrsolo joined #perl6
22:10 timotimo m: my @a = <a b c>; for @a <-> $word { ++$word.say }
22:10 camelia rakudo-moar e8a61d: OUTPUT«a␤Cannot 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)␤…»
22:10 timotimo m: my @a = 1, 2, 3, 4; for @a <-> $word { ++$word.say }
22:10 camelia rakudo-moar e8a61d: OUTPUT«1␤Cannot 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)␤…»
22:10 timotimo oh, haha
22:10 timotimo m: my @a = <a b c>; for @a <-> $word { (++$word).say }
22:10 camelia rakudo-moar e8a61d: OUTPUT«b␤c␤d␤»
22:10 timotimo m: my @a = <a b c>; for @a <-> $word { ($word++).say }; say @a;
22:10 camelia rakudo-moar e8a61d: OUTPUT«a␤b␤c␤[b c d]␤»
22:11 dsp_ joined #perl6
22:11 rjbs joined #perl6
22:12 bpmedley joined #perl6
22:13 Guest77506 joined #perl6
22:13 raydiak joined #perl6
22:13 chansen_ joined #perl6
22:13 perl6user joined #perl6
22:13 peteretep joined #perl6
22:13 avuserow joined #perl6
22:13 BuildTheRobots joined #perl6
22:13 cgfbee joined #perl6
22:13 yeltzooo joined #perl6
22:13 luis` joined #perl6
22:13 imcsk8 joined #perl6
22:13 emdashcomma joined #perl6
22:13 chansen_ joined #perl6
22:13 Guest77506 joined #perl6
22:13 awwaiid joined #perl6
22:13 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 #perl6
22:14 solarbunny joined #perl6
22:15 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:21 canopus joined #perl6
22:22 NeuralAnomaly joined #perl6
22:23 huggable joined #perl6
22:23 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 #perl6
22:24 gfldex is this a bug?
22:24 BuildTheRobots joined #perl6
22:25 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␤»
22:25 gfldex m: class E {}; my $a = 42 but E; dd $a.WHAT, $a ~~ E
22:25 camelia rakudo-moar e8a61d: OUTPUT«Cannot mix in non-composable type E into object of type Int␤  in block <unit> at <tmp> line 1␤␤»
22:25 gfldex i think it should either complain the same way then with class or just work
22:25 gfldex m: class E {}; my $a = 42 but E.new; dd $a.WHAT, $a ~~ E
22:25 camelia rakudo-moar e8a61d: OUTPUT«Int+{<anon|73266432>}␤Bool::False␤»
22:25 cgfbee joined #perl6
22:27 tailgate joined #perl6
22:42 grondilu I don't think so.
22:42 grondilu m: my $str = "pi" but pi; say $str + 1;
22:42 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 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:43 grondilu oh wait, I thought that would work
22:44 grondilu nvm
22:45 grondilu wait:
22:45 grondilu If you put something that is not a role on the right hand side of the
22:45 grondilu "does" or "but" operators then an anonymous role will be auto-generated
22:45 grondilu containing a single method that returns that value.
22:45 grondilu ^from S14
22:46 grondilu when you do $a but $someEnum; it creates an anonymous role, so it won't mach the initial type.
22:47 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;
22:47 camelia rakudo-moar e8a61d: OUTPUT«4.14159265358979␤»
22:47 grondilu indeed
22:48 grondilu so my point was:
22:48 grondilu m: my $str = "pi" but pi; say $str ~~ Num;  # should be False
22:48 camelia rakudo-moar e8a61d: OUTPUT«False␤»
22:49 rgrinberg joined #perl6
22:49 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 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:49 * grondilu is a bit confused
22:50 grondilu m: say pi.WHAT
22:50 camelia rakudo-moar e8a61d: OUTPUT«(Num)␤»
22:50 grondilu isn't pi defined as a Rat?
22:50 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
22:50 * grondilu checked in the core and no, it's defined as a Num.
22:51 grondilu (which is totally fine of course)
22:51 ilmari[m] joined #perl6
22:52 grondilu that being said, I'm slightly disappointed that ($ but 1) + 1 doesn't just give 2.
22:53 * zengargoyle ponders π being a rational and possibly causing the universe to *plode
22:54 grondilu m: say ("" but 1) + 1
22:54 camelia rakudo-moar e8a61d: OUTPUT«1␤»
22:54 grondilu m: say ("foo!" but 1) + 1
22:54 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 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:55 grondilu o_O
22:55 Guest77506 that's just the normal Str to Num parsing
22:55 Guest77506 m: say +""
22:55 camelia rakudo-moar e8a61d: OUTPUT«0␤»
22:55 Xliff_ Universe - $u; Multiverse - @u; Named Universes - %u; WTF - \u
22:55 grondilu I thought that did not existed in perl6 anymore.
22:56 grondilu meh
22:56 Xliff_ Actually, s/Named Unviverses/Easy Access Multiverse/
22:57 * Xliff_ just finished a novel series involving cross-time travel.
23:00 gfldex m: enum E <A B>; say E.defined;
23:00 camelia rakudo-moar e8a61d: OUTPUT«False␤»
23:01 rgrinberg joined #perl6
23:01 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 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 1␤␤Actually thrown at:␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
23:04 gfldex m: enum E <A B>; sub f { "foo" but E::A }; dd f.E
23:04 camelia rakudo-moar e8a61d: OUTPUT«E $val = E::A␤»
23:05 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 #perl6
23:08 dalek joined #perl6
23:09 Undercover joined #perl6
23:10 SourceBaby joined #perl6
23:13 benchable6 joined #perl6
23:13 committable6 joined #perl6
23:14 bisectable6 joined #perl6
23:27 perl6user Is there any http server module like HTTP::Server::Simple that supports SSL currently?
23:30 labster joined #perl6
23:31 stevieb joined #perl6
23:35 pierrot joined #perl6
23:43 yoleaux joined #perl6
23:52 nbrown joined #perl6
23:54 tushar joined #perl6
23:56 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:58 ugexe you could change $!socket to $.socket, so you can just pass in your own socket for instance

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo