»ö« 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.
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.
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
zengargoyle the slurpy only permits one hash (or array) at end. 00:34
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.
zengargoyle but it forces order to your parameters. 01:12
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
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
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
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...
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
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
grondilu as I said I vaguely recall jnthn showing it can be done and it was not very complicated. 02:17
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
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
awwaiid Just posted blog mentioning Perl 6, thelackthereof.org/TLT/2016.09.23/...he_Methods 03:32
SmokeMachine____ Hi! I am having this problem, but the module (i think) is in the right place... any suggestion? 04:20
SmokeMachine____ www.irccloud.com/pastebin/TCh2pnb9/ 04:20
salparadise SmokeMachine____: code causing the problem will help I think 04:20
SmokeMachine____ I have a module ProblemSolver on ./lib/ProblemSolver.pm6 and a ProblemSolver::State on ./lib/ProblemSolver/State.pm6 04:25
SmokeMachine____ and a test t/03-problem.t that does: use lib "lib"; use ProblemSolver; 04:26
SmokeMachine____ salparadise: ^^ 04:26
SmokeMachine____ ProblemSolver and ProblemSolver::State are classes... 04:26
SmokeMachine____ salparadise: ant idea? 04:27
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
SmokeMachine____ Looks that the problem is when I create a attribute with the use'd type as type 04:39
moritz_ SmokeMachine____: have you used ProblemSolver::State in ProblemSovler.pm? 08:17
dalek line-Perl5: a03cc7b | niner++ | lib/Inline/Perl5.pm6:
Faster and safer check to determine if we construct a subclass object
09:37
El_Che impressive netsplit 10:42
dalek c: 8dd339e | (Jan-Olof Hendig)++ | doc/Type/Range.pod6:
Added some more code examples plus some sundry stuff
11:00
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
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
bioduds_ oh, I think I got it 11:30
the outer { is useless 11:31
got it, thank guys
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
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
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
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
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 $
llfourn_ m: my %a = one => "two",three => "four"; for %a { .say } 12:58
camelia rakudo-moar 539a7d: OUTPUT«three => four␤one => two␤»
llfourn_ m: my $a := %( one => "two",three => "four"); for $a { .say }
camelia rakudo-moar 539a7d: OUTPUT«three => four␤one => 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«Pair␤Pair␤»
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␤»
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␤␤»
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
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 itself␤at <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
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.
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
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
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 side␤at <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
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 :)
masak greetings, #perl6 13:42
I see there was a netsplit storm here while I was away... :) 13:43
timotimo oh, i missed that 13:44
timotimo twitter.com/kelseyhightower/status...72/photo/1 - teehee 14:09
skids Hrm... COMPOSE{} is NYI? 15:00
Oh I guess that 15:03
's what the role body is anyway.
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
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
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
mst hmm, how does '.foo' on its own become a method call? (and more importantly, how do I produce such a thing ;) 17:37
scott mst: .foo with no receiver is short for $_.foo 17:40
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 $_
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
geekosaur I think you'd have to mutate the grammar to support that 17:45
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
mst where would I find docs on that? 17:48
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
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: ↑ ;)
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.
ugexe scott: you can't think of a reason to call sets of methods? 18:05
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«logger1␤logger2␤logger1␤»
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
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
xdxdxdxd why isn't this working: " get / ^ '/blog/' \d+ $ / => sub ($post) { ... } " 18:11
that is the get sub from Bailador btw 18:12
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
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
xdxdxdxd pastebin.com/XCSkvVLi does this help 18:31
ugexe thats not the full error message 18:32
AlexDaniel eh 18:52
AlexDaniel a bit stormy today 18:52
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?
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
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
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
gfldex m: enum E <A B>; sub f(){ "foo" but A }; put f(); 20:27
camelia rakudo-moar e8a61d: OUTPUT«foo␤» 20:32
masak holy netsplit, Batman 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:40
stmuk ddos :( 20:45
El_Che_ :( 20:46
TEttinger :( 20:46
timotimo :( 21:17
mst stability will return to the kingdom soon enough 21:18
masak "ddos", aka "people can be such jerks sometimes" 21:27
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
perl6user just main directory* 21:34
BenGoldberg my $cunt = +dir('dirname') should do it, I think. 21:35
masak m: say +dir()
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
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
scott pretty easy to count only files, with dir(dirname).grep(*.f) 21:39
timotimo does it give you the .IO automatically? 21:40
grondilu I first tried grep(:f) and thought that would work.
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
Guest77506 you could write dirname.IO.dir.grep(*.f) equivalently 21:41
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?
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)␤»
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
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
Guest77506 Pair doesn't list an ACCEPTS override either 21:51
what gives?
Guest77506 it's not in this list either docs.perl6.org/routine/ACCEPTS 21:52
BenGoldberg I'd expect ~~ to be a multi sub 21:52
timotimo nope, it just calls the ACCEPTS method on the matcher
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
timotimo no, there is not 21:54
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
Guest77506 but it's not in the docs afaict 21:55
BenGoldberg s: Pair, "ACCEPTS" 21:56
BenGoldberg Sourcebaby's not online either (or on the wrong side of the netsplit) 21:56
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␤␤»
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)␤…»
timotimo m: my @a = 1, 2, 3, 4; for @a <-> $word { ++$word.say }
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)␤…»
timotimo oh, haha
m: my @a = <a b c>; for @a <-> $word { (++$word).say }
camelia rakudo-moar e8a61d: OUTPUT«b␤c␤d␤»
timotimo m: my @a = <a b c>; for @a <-> $word { ($word++).say }; say @a;
camelia rakudo-moar e8a61d: OUTPUT«a␤b␤c␤[b c d]␤»
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]␤»
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␤»
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␤»
gfldex is this a bug? 22:24
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␤»
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 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
grondilu oh wait, I thought that would work 22:43
nvm 22:44
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␤»
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␤␤»
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
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 1␤␤Actually 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
gfldex m: enum E <A B>; say E.defined; 23:00
camelia rakudo-moar e8a61d: OUTPUT«False␤»
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␤»
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␤␤»
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␤»
perl6user Is there any http server module like HTTP::Server::Simple that supports SSL currently? 23:27
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