»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
ccc m: role Foo {has &op(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D);} 02:53
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in routine declarations is reserved (maybe use :() to declare a longname?)
at <tmp>:1
------> 3op(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D7⏏5);}
ccc m: role Foo {has &op:(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D);}
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb has &op
at <tmp>:1
------> 3:(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D)7⏏5;}
ccc so what's the syntax to constrain a callable attribute to have a particular signature?
m: role Foo {has &.op:(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D);} 02:57
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb has &.op
at <tmp>:1
------> 3:(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D)7⏏5;}
ccc m: role Foo {has &.op(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D);} 02:58
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb ::?CLASS
at <tmp>:1
------> 3role Foo {has &.op(::?CLASS:D7⏏5, ::?CLASS:D --> ::?CLASS:D);}
expecting any of:
pair value
ccc m: role Foo {has :(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D) &.op} 03:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed has
at <tmp>:1
------> 3role Foo {has7⏏5 :(::?CLASS:D, ::?CLASS:D --> ::?CLASS:D
ccc m: my &op:(Int, Int --> Int) 03:01
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb &op
at <tmp>:1
------> 3my &op:(Int, Int --> Int)7⏏5<EOL>
ccc m: my &op(Int, Int --> Int)
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in routine declarations is reserved (maybe use :() to declare a longname?)
at <tmp>:1
------> 3my &op(Int, Int --> Int7⏏5)
ccc m: my &op(Int, Int --> Int) 03:04
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in routine declarations is reserved (maybe use :() to declare a longname?)
at <tmp>:1
------> 3my &op(Int, Int --> Int7⏏5)
ccc m: my &op:(Int, Int --> Int)
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb &op
at <tmp>:1
------> 3my &op:(Int, Int --> Int)7⏏5<EOL>
ccc What's the syntax to constraint the signature of a Callable variable or class attribute? 03:05
Zoffix .tell ccc list binding with Capture on RHS. m: my (&op:(Int, Int --> Int)) := \(sub (Int, Int --> Int) {}) It's possible there's a simpler way, but I'm hitting a weird potential bug on. 03:38
yoleaux Zoffix: I'll pass your message to ccc.
Geth doc: 74cf14d539 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Blob.pod6
Align Blob.gist with latest propspec

POV: github.com/rakudo/rakudo/commit/cc2fcc9af2 Propspec: github.com/perl6/roast/commit/cef3...2c358fe405
03:49
synopsebot Link: doc.perl6.org/type/Blob
Xliff_ \o 04:00
Is there any way to log the parsing process when running perl6?
Xliff_ \o/ 06:09
I can get widget info out of GtkBuilder! :D
kensanata Is there a more idiomatic way of writing [ map { id => $_ }, @pages ] if I need [{id=>a}, {id=>b}, ...]? AlexDaniel at one point suggested X=> but I can't get that to work. 07:12
timotimo 07:25
m: my @pages = <a b c d e>; say "id" X=> @pages
camelia (id => a id => b id => c id => d id => e)
timotimo try this, please 07:26
kensanata timotimo: Thanks. When I try it in my code, it seems that I only get id => e, the last element. Actual code right now: %context<pages> = "id" X=> @pages; -- I guess the assignment changes something? 07:30
timotimo ah 07:31
kensanata Or maybe I'm just getting the first one? Let me check.
timotimo yes, you'll want to put the RHS in parenthesis
kensanata Hm, that appears to make no difference. 07:32
timotimo let's see
m: my %context; my @pages = <a b c d e>; %context<pages> = ("id" X=> @pages); say %context.perl 07:33
camelia {:pages($((:id("a"), :id("b"), :id("c"), :id("d"), :id("e")).Seq))}
timotimo ah, you wanted an array of them, too
especially since a .Seq will only let you iterate across it once
m: my %context; my @pages = <a b c d e>; %context<pages> = ["id" X=> @pages]; say %context.perl
camelia {:pages($[:id("a"), :id("b"), :id("c"), :id("d"), :id("e")])}
timotimo m: my %context; my @pages = <a b c d e>; %context<pages> = ["id" X=> @pages]<>; say %context.perl
camelia {:pages($[:id("a"), :id("b"), :id("c"), :id("d"), :id("e")])}
timotimo not sure if you can get rid of the scalar container around it
kensanata I'm not sure whether I actually need an array. The %context stuff is going to get used for Template::Mustache. 07:36
timotimo you'll surely want to at least .cache the Seq 07:37
kensanata I don't know about the internals of Template::Mustache. But if you're saying that the result would be brittle, then I do want an array. I don't know much about the differences between lists, arrays, and sequences. Normally it just works. :) 07:39
timotimo you can think of a sequence like an iterator, except the sequence actually contains an iterator inside of it
that means at least that after you've gone through the sequence once it'll not work any mor 07:40
kensanata I see. 07:41
jmerelo kensanata: and Arrays are immutable, while lists are not.
timotimo you got it reversed, jmerelo
jmerelo timotimo: I was afraid so. 07:42
timotimo: I always do. Thanks for pointing it out.
kensanata Well, I come at this from Emacs Lisp and Java, and there arrays and lists are very different. In Perl I often get the feeling that they are interchangeable until they're not. And I never know when it's going to hit me. 07:43
I still can't reproduce my problem in a small file. Perhaps that would help me avoid the same problem in the future.
m: my @pages = <a b c d e>; my %h; %h<x> = ("id" X=> @pages); say %h<x>; say %h<x>; 07:44
camelia (id => a id => b id => c id => d id => e)
(id => a id => b id => c id => d id => e)
kensanata So this looks good and yet it doesn't work in my real code. What do I need to change to reproduce the problem?
timotimo you're still getting only one result? 07:45
kensanata No, %context<pages> = ["id" X=> @pages] works. 07:46
I'm just trying to improve my understanding, now. :)
araraloren_ o| 07:47
timotimo o_
Geth doc/master: 5 commits pushed by (JJ Merelo)++ 07:48
jmerelo kensanata: maybe you can post a gist, or simply point out to the repo. If it works differently with big files, it might be a bug. 07:49
buggable New CPAN upload: Getopt-Advance-1.1.0.tar.gz by ALOREN modules.perl6.org/dist/Getopt::Adva...pan:ALOREN 07:57
Xliff_ \o/ 08:11
:D
=D
\o\ /o/ \o\ /o/
Self contained glade and Perl6 code! 08:12
github.com/Xliff/p6-GtkPlus/blob/m...-builder.t
timotimo ooh not bad 08:13
tadzik wow! 08:15
Xliff_ timotimo: Yeah. I plan on making your Cairo package a dependency. Just need to get to the point where I can start working on GDK 08:18
timotimo i see you have a script that generates code 08:19
maybe it'd be cool to have that in cairo, too
Xliff_ Also self contained styles: github.com/Xliff/p6-GtkPlus/blob/m...widget.css
timotimo if it even applies?
Xliff_ :> 08:19
Yes. It's just a skeleton generator. Get's me close without having to go through the drudgery. 08:20
timotimo oh, OK
Xliff_ Still need to find a way to insure control codes aren't applied when I extract data from $=pod 08:22
But it works.
jmerelo Xliff_: cool! Great job!
timotimo there's Pod::To::Text, maybe it could be made to have a really-only-text output mode 08:23
until then, Pod::Walker maybe?
Xliff_ I'll look into it when I run into a burning bridge.
jmerelo timotimo: that's sorely missing. Most Pod navigation is made pretty ad-hoc
Xliff_ I've gone through so many rounds of refactoring it's not funny.
timotimo :S 08:24
Xliff_ timotimo: You mean Pod::TreeWalker?
timotimo that must be the one
Xliff_ github.com/houseabsolute/perl6-Pod-TreeWalker
jmerelo timotimo, Xliff_ : I didn't know that one... 08:25
jmerelo Thanks 08:25
Xliff_ timotimo: Yeah, that looks like it will help. Kinda like dropping a kiloton bomb to kill a roach, though. 08:27
timotimo *shrug* :)
Xliff_ :) :s 08:28
timotimo you're using perl6 already :D
Xliff_ LOL
Good point.
It's suddenly disturbing to relize the yield isn't as important as the ease with which you can put things together. :P
The tricky part is figuring out how to replace the actual text. 08:31
Think something like this:
"<property name="Label">OK</property>" 08:32
So it's going to be more than just grabbing the text contents. For now. I guess I can always run a regex to lower case any characters that appear before a '<' 08:33
timotimo maybe you can use the verbatim tag around the whole thing, but ... meh 08:34
Xliff_ Was thinking that, but ... I agree. meh
Implementing a verbatim pod block might be easier. 08:35
timotimo or using a heredoc instead of pod
Xliff_ shudders.
timotimo if you put the heredoc into a sub, you can use it before you define it
Xliff_ Ooh! Good point.
I think I will make it so you can specify alternative methods for both. 08:36
Oh! YUP! 08:37
I already wrote that mechanism. :D
timotimo :D
Xliff_ my $a = GTK::Application.new( :ui($ui), :style($style) ); 08:38
Xliff_ LOL! Added a statusbar, but can't do it through glade. Changes should be available at the same link. 09:20
timotimo or you could interpret the control codes and turn them back into what their text would have been %) 09:25
er, i was scrolled up still
Xliff_ timotimo: LOL! I think I'm cool with using pod unless there's a conflict. 09:27
:)
And now I've also checked that you can add to a glade generated UI, after the fact! :D 09:28
timotimo have you considered using .WHY to store glade data? :P
Xliff_ ?!?
How would I do that?
timotimo well, putting the stuff into a declarator comment
m: say "gimme a newline"
camelia gimme a newline
Xliff_ Ooh! That's an idea.
Will look into that as an idea for Dialog code.
timotimo m: #| test␤sub do-it() { gimme-my-text }; sub gimme-my-text { say callframe(1).routine.WHY }; do-it 09:29
camelia No such method 'routine' for invocant of type 'CallFrame'
in sub gimme-my-text at <tmp> line 2
in sub do-it at <tmp> line 2
in block <unit> at <tmp> line 2
timotimo m: #| test␤sub do-it() { gimme-my-text }; sub gimme-my-text { say callframe(1).code.WHY }; do-it
camelia test
Xliff_ LOL
Can it do post and pre? 09:30
timotimo i do believe post and pre will just be combined for you by rakudo
Xliff_ m: #! test\n 09:31
camelia ( no output )
Xliff_ Hrm. I forget how to insert newlines in IRC> 09:32
m: #| test; sub whee { say "Whee!" }; #= tester 09:33
camelia ( no output )
Xliff_ m: #| test; sub whee { say "Whee!" }; #= tester; say &whee.WHY.leading;
camelia ( no output )
Xliff_ m: #| test; sub whee { say "Whee!" }; #= tester; whee;
camelia ( no output )
timotimo forgot a ne wline 09:34
Xliff_ Yeah. I don't know if this client can do it.
timotimo hold on
m: #| test; ␤ sub whee { say "Whee!" }; #= tester; ␤␤ whee;
camelia Whee!
timotimo m: #| test; ␤ sub whee { say "Whee!" }; #= tester; ␤␤ say &whee.WHY.leading;
camelia test;
timotimo m: #| test; ␤ sub whee { say "Whee!" }; #= tester; ␤␤ say &whee.WHY.trailing;
camelia tester;
Xliff_ Yeah. That's what I was looking for. 09:35
That might be useful! :)
timotimo cool
Xliff_ Hope that works for class definitions, too.
timotimo ought to
Geth doc: jonbeebe++ created pull request #2343:
Fixed links to :r, :w, and :x
10:01
Geth doc: ef1d282327 | (Jonathan Beebe)++ (committed using GitHub Web editor) | doc/Type/IO.pod6
Fixed links to :r, :w, and :x
10:05
doc: ac22b65682 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/IO.pod6
Merge pull request #2343 from jonbeebe/patch-1

Fixed links to :r, :w, and :x: Well spotted. Thanks.
synopsebot Link: doc.perl6.org/type/IO
Geth doc: a3be58359f | (JJ Merelo)++ | 2 files
Adds example to join

Which closes #2344. Also clarifies what is meant by "immutable" in the definition of Str.
10:16
Geth doc: 44a72d783f | (JJ Merelo)++ | doc/Type/List.pod6
Adds another example showing flattening slurpiness

As suggested by @ciavash. Refs #2344
11:04
synopsebot Link: doc.perl6.org/type/List
kensanata Sometimes I wonder whether I've made the right decision picking Template::Mustache instead of Template::Mojo. What do other people use, and why? 12:35
timotimo my current web application does its UI with React.js and just serves static files and json data ;) 12:48
ccc m: my &f:(Int, Int --> Int) 12:49
yoleaux 03:38Z <Zoffix> ccc: list binding with Capture on RHS. m: my (&op:(Int, Int --> Int)) := \(sub (Int, Int --> Int) {}) It's possible there's a simpler way, but I'm hitting a weird potential bug on.
03:41Z <Zoffix> ccc: for attributes, it'd probably be `where .signature ~~ :(…)`, but it's currently throwing a weird error R#2336 github.com/rakudo/rakudo/issues/2336
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb &f
at <tmp>:1
------> 3my &f:(Int, Int --> Int)7⏏5<EOL>
synopsebot R#2336 [open]: github.com/rakudo/rakudo/issues/2336 Weird error with subsetting Callable variables
ccc What's the syntax for constraining the signature of a callable variable/attribute ? 12:50
kensanata timotimo: Heh. :)
ccc m: my (&op:(Int, Int --> Int)) 12:51
camelia ( no output )
ccc m: my (&op:(Int, Int --> Int)) = sub (Int $a, Int $b --> Int) {$a + $b}; say op(3,2) 12:52
camelia No such method 'signature' for invocant of type 'Int'
in block <unit> at <tmp> line 1
ccc m: sub f(Int $a, Int $b --> Int) {$a + $b}; my (&op:(Int, Int --> Int) = &f; say op(3,2) 12:56
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3b}; my (&op:(Int, Int --> Int) = &f; say7⏏5 op(3,2)
ccc m: sub f(Int $a, Int $b --> Int) {$a + $b}; my (&op:(Int, Int --> Int)) = &f; say op(3,2)
camelia No such method 'signature' for invocant of type 'Int'
in block <unit> at <tmp> line 1
ccc Even in C I can constrain the signature of a function pointer. Why is it so darn hard in perl6? 12:57
So far, I can't tell if it's even possible. 12:58
pmurias Zoffix: what do you think about splitting some of the docs pages about complex topics into a tutorial and reference parts? 13:10
lizmat weekly: 6guts.wordpress.com/2018/09/29/eli...ed-guards/ 13:11
notable6 lizmat, Noted!
ccc Is it possible to constrain the signature of a callable variable or attribute?
If so, how? 13:12
m: sub foo (&c:(Int, Int -->Int)) {say c(3,2)}; foo(&div) 13:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
div used at line 1. Did you mean 'dir', 'die'?
lizmat ccc: something like: 13:17
m: subset IntSub of Sub where *.name.starts-with("internal-"); my IntSub $foo = sub internal-bar { }; my IntSub $bar = { } 13:18
camelia Type check failed in assignment to $bar; expected IntSub but got Hash (${})
in block <unit> at <tmp> line 1
lizmat m: subset IntSub of Sub where *.name.starts-with("internal-"); my IntSub $foo = sub internal-bar { }; my IntSub $bar = sub bar { }
camelia Type check failed in assignment to $bar; expected IntSub but got Sub (sub bar { #`(Sub|4891...)
in block <unit> at <tmp> line 1
timotimo camelia: the div operator's actual name is either &infix:<div> or shorter &[div]
oops
ccc: ^
ccc m: sub foo (&c:(Int, Int -->Int)) {say c(3,2)}; foo(&[div]) 13:19
camelia Constraint type check failed in binding to parameter '&c'; expected anonymous constraint to be met but got Sub+{is-pure}+{Precedence} (proto sub infix:<div>...)
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat I guess I misunderstood the question
ccc lizmat: no I was checking something else
Is it even possible to constrain a callable variable's signature, and if so how? 13:20
timotimo it should
ccc None of the modules installed seem to do it (by grepping for /my \&\w+/)
timotimo if not with that syntax, you should at least be able to put Callable[foo, bar] in front
greppable6: my Callable 13:21
greppable6 timotimo, 6 lines, 1 module: gist.github.com/5d505c1b7ba0aafdb6...127d929dca
timotimo yeah
ccc timotimo: okay I want a callable that takes 2 Ints and returns an Int in a variable. How do I say it? 13:22
pmurias m: say &infix:<div>.signature 13:24
camelia ($, $, *%)
pmurias ccc: ^^ a lot of the builtins have different signatures then you might expect, as they are extendable multi methods 13:25
timotimo OK, it seems like Callable[...] only really takes the return type as argument 13:26
ccc I want to do something like "my &op(Int, Int -->Int)" (the intuitive way to do it)
I tried subsetting without success 13:27
m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op &foo = sub (Int $a, Int $b --> Int) {$a + $b} 13:28
camelia Type check failed in assignment to &foo; expected Callable[Op] but got Sub+{Callable[Int]} (sub (Int $a, Int $b -...)
in block <unit> at <tmp> line 1
timotimo you've got it double 13:30
& already means callable
my Op &foo asks for a callable that returns a sub that fits Op
ccc timotimo: then what sigil do I use?
timotimo you need "my &foo is Callable" or "my Callable $foo"
i'll be afk for a bit 13:31
ccc m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op $foo = sub (Int $a, Int $b --> Int) {$a + $b}
camelia ( no output )
ccc timotimo: How do I call a scalar callable 13:32
jnthn $foo() 13:33
ccc m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op $foo = sub (Int $a, Int $b --> Int) {$a + $b}; say $foo(3,2)
camelia 5
ccc Yay!!
I better write that down somewhere it's not in the perl6 docs that I could find and I'll never remember it. 13:34
m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op $foo = sub (Int $a, Int $b --> Int) {$a div $b}; say $foo(3,2) 13:35
camelia 1
ccc m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op $foo = sub (Int $a, Int $b --> Int) {$a / $b}; say $foo(3,2) 13:36
camelia Type check failed for return value; expected Int but got Rat (1.5)
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
ccc m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op $foo = sub (Int $a, Int $b --> Int) {max($a,$b)}; say $foo(3,2) 13:37
camelia 3
ccc m: subset Op of Callable where .signature ~~ :(Int, Int --> Int); my Op $foo = sub (Num $a, Int $b --> Int) {max($a,$b)}; say $foo(3,2)
camelia Type check failed in assignment to $foo; expected Op but got Sub+{Callable[Int]} (sub (Num $a, Int $b -...)
in block <unit> at <tmp> line 1
ccc If I were going to update the perl6 docs to mention this, where should it be Callable, Signature, ...? 13:40
woolfy If anyone needs a picture of stuffed toy Camelia (or crocheted Camelia), go see my Flickr album: www.flickr.com/photos/wendyga/albu...3975955358 14:02
woolfy Or pictures of some Perl-swag: www.flickr.com/photos/wendyga/albu...1244380607 14:02
CIAvash I could not find any tests in roast for something like `join '|', <a b c>, 'd', 'e', 'f'`. Currently it flattens everything because `*@values` is used in the signature. If it's supposed to work like the join method maybe it shoud be `+@values`? 14:52
buggable New CPAN upload: AccountableBagHash-0.0.2.tar.gz by ELIZABETH modules.perl6.org/dist/AccountableB...:ELIZABETH 14:57
rindolf hi all 15:25
timotimo ohai 15:26
pmurias CIAvash: if you really want to check if roasts depends on something change it and run roast 15:44
xinming m: my @a = (0.125, 0.25, 0.375 ... *); @a[8].say; 16:26
camelia 1.125
xinming Is it possible to use the (0.125, 0.25, 0.375) kind of syntax to generate a list with specified length? 16:27
Let's say, I want @a = (.... ); But with @a[99] elements available, the @a[100] returns Any
moritz_ m: my @a = (0.125, 0.25, 0.375 ... *).head(100) 16:31
camelia ( no output )
moritz_ m: my @a = (0.125, 0.25, 0.375 ... *).head(100); say @a[99]; say @a[100]
camelia 12.5
(Any)
moritz_ xinming: like this?
xinming Thanks, the .head(..) is what I what.
Still need time to get used to the "method" thing in perl6. 16:32
kensanata I'm writing some Cro tests and I'd really like some XPath or Mojolicious-like CSS accessors. What would you suggest I do? 16:49
I guess I'm going to install XML::XPath because I don't know what the other thing is even called. :) 16:50
Hm. DOM::Tiny could be the thing I need! 16:52
pmurias stackoverflow-- # I can't comment on a post referencing the graal backend because I don't have enough brownie points :( 19:24
lizmat pmurias: perhaps I could do it for you ?
pmurias in stackoverflow.com/questions/524694...rk-online, re "which can in turn target JS", As far as I'm aware there are no plans for Graal to target JS, there are vague plan for it to target webassembly (ones it matures and gains extra features) but I'm not aware of an actual effort. 19:29
pmurias lizmat: would be great, I don't think I'll collect those brownie points any time soon ;) 19:38
lizmat pmurias: added 19:43
pmurias lizmat: thank you 19:53
pmurias wishes that Graal/Truffle could actually emit javascript as the truffle backend is a lot more fun ;)
leont 5 upvotes is all you need to comment :-) 20:05
leont Also, if you need someone with high reputation privileges (e.g. to protect a question) I can help out with that sort of thing. Not that I'm expecting that to happen soon 20:11
buggable New CPAN upload: App-Tasks-0.0.4.tar.gz by JMASLAK modules.perl6.org/dist/App::Tasks:cpan:JMASLAK 21:17
eggiar mm 21:19
I didn't find someone here 21:21
timotimo greetings eggiar
eggiar can you tell me how to use this :v 21:25
eggiar hmm 21:34
timotimo oh sorry 21:47
i was reading some stuff off the side and didn't look back 21:48
eggiar: what in particular do you need help with?
AlexDaniel re sin with rats and “I didn’t manage to program my way around this, but perhaps some of you know a solution?”, sure, any way to generate sin digits will do 21:54
maybe it's a good idea for a module
and maybe for benchmarks also
AlexDaniel though I guess continued fraction approach will explode in denominator, but there has to be a better way :) 21:56
AlexDaniel (this is about medium.com/@jcoterhals/perl-6-smal...8da055cfc4 ) 21:56
timotimo after a given point fall back to interpolation? :P
AlexDaniel interpolation? 21:58
I understand it was a joke but I don't get it :)
timotimo well, it doesn't give you real precision 22:00
Xliff_ If I have the arguments to a sub in an array, what's the easiest way to convert that array to something acceptable by positional arguments? 22:52
I thought @a.list would work, but it doesn't seem to be.
m: sub a($b, $c) { say $b; $say $c; }; my @a(1, 2); a(@a.list); 22:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$say' is not declared. Did you mean '&say'?
at <tmp>:1
------> 3sub a($b, $c) { say $b; 7⏏5$say $c; }; my @a(1, 2); a(@a.list);
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a(1, 2); a(@a.list);
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in array declarations is reserved
at <tmp>:1
------> 3($b, $c) { say $b; say $c; }; my @a(1, 27⏏5); a(@a.list);
expecting any of:
constraint
forma…
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a(1, 2); a(@a.List);
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in array declarations is reserved
at <tmp>:1
------> 3($b, $c) { say $b; say $c; }; my @a(1, 27⏏5); a(@a.List);
expecting any of:
constraint
forma…
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a(1, 2); &a(@a.list);
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in array declarations is reserved
at <tmp>:1
------> 3($b, $c) { say $b; say $c; }; my @a(1, 27⏏5); &a(@a.list);
expecting any of:
constraint
form…
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a=(1, 2); &a(@a.list);
camelia Too few positionals passed; expected 2 arguments but got 1
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a(1, 2); &a(@a.Seq); 22:54
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in array declarations is reserved
at <tmp>:1
------> 3($b, $c) { say $b; say $c; }; my @a(1, 27⏏5); &a(@a.Seq);
expecting any of:
constraint
forma…
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a(1, 2); &a(@a);
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in array declarations is reserved
at <tmp>:1
------> 3($b, $c) { say $b; say $c; }; my @a(1, 27⏏5); &a(@a);
expecting any of:
constraint
formal pa…
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a(1, 2); &a(@a.flat);
camelia 5===SORRY!5=== Error while compiling <tmp>
The () shape syntax in array declarations is reserved
at <tmp>:1
------> 3($b, $c) { say $b; say $c; }; my @a(1, 27⏏5); &a(@a.flat);
expecting any of:
constraint
form…
xinming What module is recommend to write http server in perl6? 22:59
xinming http::server::async seems no update for a year. Is it still maintained? 22:59
timotimo cro will take you very far, i'm sure
Xliff_: you need to *@a for it to become positionals
and you apparently got an earlier line back that was missing the = before my @a and (1, 2) 23:00
xinming I do use cro, But needs something really light weight. :-)
No need to be big in my case. 23:01
Xliff_ m: sub a($b, $c) { say $b; say $c; }; my @a=(1, 2); &a(*@a); 23:03
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3 { say $b; say $c; }; my @a=(1, 2); &a(*7⏏5@a);
expecting a…
Xliff_ OK, so the change has to be in the signature. 23:04
For some reason I thought I could convert the array to a list and do it that way.
timotimo sorry! 23:06
i told you completely the wrong thing
you actually need |@a
m: sub a($b, $c) { say $b; say $c; }; my @a=(1, 2); &a(|@a);
camelia 1
2
timotimo Xliff_: ^ 23:27