🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
00:16
stoned75 left
00:18
pecastro left,
cpan-raku left
00:19
cpan-raku joined,
cpan-raku left,
cpan-raku joined
00:45
mowcat left
00:47
SQuoll left
00:50
shadowpaste joined
|
|||
Doc_Holliwood | m: say [X] (1..10) xx 2 | 00:57 | |
camelia | ((1 1) (1 2) (1 3) (1 4) (1 5) (1 6) (1 7) (1 8) (1 9) (1 10) (2 1) (2 2) (2 3) (2 4) (2 5) (2 6) (2 7) (2 8) (2 9) (2 10) (3 1) (3 2) (3 3) (3 4) (3 5) (3 6) (3 7) (3 8) (3 9) (3 10) (4 1) (4 2) (4 3) (4 4) (4 5) (4 6) (4 7) (4 8) (4 9) (4 10) (5 1) … | ||
Doc_Holliwood | nice | ||
01:03
cooper left
01:04
cooper joined
01:13
lucasb left,
sena_kun joined
01:15
Altai-man_ left
01:17
SQuoll joined
01:26
wildtrees left
01:33
Doc_Holliwood left
01:36
markong left
01:48
SQuoll left
02:04
SQuoll joined
02:09
SQuoll left
02:10
SQuoll joined
02:13
Altai-man_ joined
02:14
orinthe left
02:15
sena_kun left
02:16
SQuoll left
02:17
orinthe joined,
aborazmeh left
02:21
orinthe4 joined
02:22
orinthe left,
orinthe4 is now known as orinthe
02:23
SQuoll joined
02:26
orinthe left
02:28
SQuoll left
02:29
orinthe joined
02:34
SQuoll joined
02:35
orinthe2 joined
02:36
orinthe left,
orinthe2 is now known as orinthe
02:39
SQuoll left
02:42
orinthe1 joined,
orinthe left,
orinthe1 is now known as orinthe
02:45
SQuoll joined
02:46
aborazmeh joined,
aborazmeh left,
aborazmeh joined
03:01
Manifest0 left
03:02
aborazmeh left,
Manifest0 joined,
molaf left
03:15
molaf joined
04:13
sena_kun joined
04:15
Altai-man_ left
04:25
molaf left
04:48
wamba joined
04:54
Sgeo__ left
04:55
Sgeo joined
05:49
wamba left
06:04
sauvin joined
06:10
stoned75 joined
06:13
Altai-man_ joined
06:15
sena_kun left
06:42
wamba joined
06:44
sno left
07:13
sno joined
07:20
rindolf joined
07:21
SQuoll left
07:27
SQuoll joined
07:31
xinming_ joined
07:32
xinming left
07:39
stoned75 left
07:40
finanalyst joined
07:46
theovdh joined
07:56
finanalyst left,
ensamvarg left
08:14
sena_kun joined
08:15
Altai-man_ left
08:16
wamba left,
wamba joined
08:17
xelxebar_ joined
08:18
xelxebar left
08:30
dakkar joined
09:03
wamba left
09:19
wamba joined
09:32
Black_Ribbon left
09:37
rindolf left
09:39
finanalyst joined
09:40
domidumont joined,
finanalyst left
09:41
rindolf joined,
finanalyst joined
09:46
chloekek joined
|
|||
chloekek | p6: say @@@@@@@@@@@@@@@@[] | 09:46 | |
camelia | [] | ||
09:57
pecastro joined
09:58
finanalyst left
10:04
abraxxa joined
10:06
abraxxa left
10:07
abraxxa joined,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
10:08
abraxxa left,
abraxxa joined
10:09
abraxxa left,
abraxxa joined,
abraxxa left
10:10
abraxxa joined
10:12
Altai-man_ joined
10:15
sena_kun left,
Doc_Holliwood joined
10:18
abraxxa left,
abraxxa joined
10:24
abraxxa left
|
|||
SmokeMachine | chloekek: I’ve worked on a company that had a proprietary template language that looks just like that… @ meant to loop from a local variable. To loop through a outter scope variable, you add another @… so, to loop throwgh a variable called bla from 5 scopes out, you would do: @@@@@@bla. The record I’ve seen was 16 @s… :P | 10:24 | |
10:25
abraxxa joined
|
|||
chloekek | Me too but the syntax wasn’t @@@ but $-1, $-2 etc | 10:28 | |
It’s all gone now, loop variables are introduced explicitly, e.g. “map $a as $b using 1 + $b” to increment each list element of $a. | |||
SmokeMachine | on that case, being bla = 1,2,3; ,`<% a <% b <% c @bla%>%>%>` would print `a b c 1 c 2 c 3`, and `<% a <% b <% c @@@bla%>%>%>` would print `a b c 1 a b c 2 a b c 3` if I remember it well | 10:31 | |
chloekek | That reminds me, I have to test Template::Classic against latest Rakudo. | 10:32 | |
SmokeMachine | I think that was the reson I felt Cro::WebApp::Template so familiar (just the @, not the scope thing...) | ||
chloekek | And fix the XSS vulnerability lol. | 10:33 | |
jnthn | Cro::WebApp::Template is as in to lexical scoping as the rest of Raku really :) | 10:37 | |
If you define a template sub inside of another template sub, it's only visible inside of the inner one, just like Raku subs, for example | 10:38 | ||
10:40
domidumont left
10:44
MasterDuke left,
aborazmeh left
10:46
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
kawaii | Good morning #raku :) | 10:57 | |
lizmat | kawaii o/ | 10:58 | |
kawaii | I have a program I'm working on that sends json to a remote API. I'm finding that my code is getting quite cluttered with these hashes however - so I wanted to move them out to something like `embed-templates/filename.json` and so something like `my %payload = slurp(from-json('templates/file.json));` www.irccloud.com/pastebin/pGtxOFCy/ | 11:07 | |
but my %payloads contain variables I need to enumerate | |||
Is there any way I can store my embeds as these templates, slurp them into a hash, enumerate the variables, before they are reserialized as json and sent to the remote API? | |||
chloekek | Do you have to store the templates as JSON? You could make a normal Raku module for each template, each defining a subroutine. Then you get the templates out of your main code but you can still use variables. | 11:09 | |
kawaii | they don't need to be json no, I just chose that because they are already basically json anyway :) but I think your idea is probably best | 11:12 | |
11:13
hahainternet left
11:15
aborazmeh left
11:16
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:17
markong joined
|
|||
tbrowder | hi, #raku people | 11:25 | |
so far i've not been able to find doc examples of defining an operator for a class. any special things to watch out for? | 11:28 | ||
11:31
aborazmeh left
|
|||
Doc_Holliwood | m: class foo { has $.baz = 1; }; multi sub infix:<+>(foo $a, foo $b) { $a.baz + $b.baz }; say foo.new + foo.new | 11:32 | |
camelia | 2 | ||
Doc_Holliwood | tbrowder: like that? | ||
lizmat | tbrowder: feels like a useful question to ask on SO | 11:34 | |
11:35
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:37
margeas joined
11:41
markong left
11:57
wamba left
11:58
markoong joined
11:59
margeas left
12:10
aborazmeh left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
12:13
sena_kun joined
12:15
Altai-man_ left,
aborazmeh left
|
|||
SmokeMachine | jnthn: I just meant the way of looping using the @… not the scoping... | 12:17 | |
chloekek | p6: my $s = 'a'; $s x= 10; say $s; | 12:19 | |
camelia | aaaaaaaaaa | ||
tbrowder | thnx, that's clear. but how about oper types like *= | 12:36 | |
chloekek | m: class foo { has $.baz = 1; }; multi sub infix:<+>(foo $a, foo $b) { $a.baz + $b.baz }; my $x = foo.new; $x += foo.new; say $x | 12:37 | |
camelia | 2 | ||
tbrowder | hm, ok, thanks! | ||
12:37
Xliff joined
12:38
hahainternet joined
|
|||
chloekek | p6: my @xs = 3, 1, 2, 0; say @xs[@xs]; | 12:42 | |
camelia | (0 1 2 3) | ||
chloekek | p6: my @xs = (^10).pick(*); say @xs[@xs]; | 12:43 | |
camelia | (0 1 6 2 4 5 3 7 8 9) | ||
chloekek | p6: my @xs = (^20).pick(*); say @xs[@xs]; | ||
camelia | (7 13 0 5 16 11 6 12 19 9 4 1 14 3 2 18 17 10 8 15) | ||
13:05
Doc_Holliwood left
|
|||
tbrowder | the interestingb | 13:46 | |
chloekek | Try again. | 13:47 | |
tbrowder | interesting thing i forgot about is the class opers aren't defined inside the class as i now remember is the same as in c++ | 13:48 | |
chloekek | Multi works better for commutativity. :) | ||
tbrowder | thnx | 13:49 | |
chloekek | So you can define both a + b and b + a if a and b are of different types. | ||
tbrowder | roger! | 13:50 | |
13:52
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
Voldenet | m: :0("what") | 13:52 | |
camelia | Cannot convert string to number: base-0 number must begin with valid digits or '.' in '3:0<⏏5what>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
Voldenet | what is "base-0 number" | 13:53 | |
lizmat | :-) | ||
m: :37("what") | |||
camelia | Cannot convert string to number: Cannot convert radix of 37 (max 36) in '3:37<⏏5what>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
lizmat | Voldenet: is that clearer ? | ||
Voldenet | It sure is, i'm just puzzled by base-0 here ¯\_(ツ)_/¯ | 13:54 | |
m: :-1("") | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Bogus statement at <tmp>:1 ------> 3:7⏏5-1("") expecting any of: colon pair |
||
lizmat | m: :0("0") | 13:55 | |
camelia | Cannot convert string to number: base-0 number must begin with valid digits or '.' in '3:0<⏏050>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
lizmat | m: :0(".0") | ||
camelia | Cannot convert string to number: base-0 number must begin with valid digits or '.' in '3:0<⏏5.0>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
lizmat | Voldenet: suggestions for better error message ? | 13:56 | |
Voldenet | "0 is not valid base" | 13:57 | |
technically it's a number accepting empty set as symbols, but practically there's no string that would work with it | 13:58 | ||
lizmat | so like the message for 37 ? | ||
Voldenet | Exactly | 13:59 | |
lizmat | m: say :0("") | ||
camelia | Cannot convert string to number: base-0 number must begin with valid digits or '.' in '3:0<⏏5>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
lizmat | m: say :2("") | ||
camelia | Cannot convert string to number: base-2 number must begin with valid digits or '.' in '3:2<⏏5>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
lizmat | afk for a bit& | ||
chloekek | p6: say :1("00000") | 14:02 | |
camelia | 0 | ||
chloekek | p6: say :1("11111") | 14:03 | |
camelia | Cannot convert string to number: base-1 number must begin with valid digits or '.' in '3:1<⏏0511111>' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
14:10
aborazmeh left
14:12
Altai-man_ joined
14:15
mowcat joined,
sena_kun left
|
|||
Altreus | Can a role define a stub attribute? I tried has $.attr = ... | 14:16 | |
oh I suppose I can make it a method | |||
but then all the methods will be the same :D | |||
The implementations all have has $.real = slack { ... }, where slack is from Object::Delayed | |||
Apart from assignment, is this identical to method real { slack { ... } }? | 14:17 | ||
eh ... with state | |||
14:28
pmurias joined
|
|||
pmurias | nine: pong | 14:28 | |
tellable6 | hey pmurias, you have a message: gist.github.com/91b627eef8b2fa285f...045c62fbeb | ||
pmurias | nine: I'm a bit sleep deprived at the moment so my memory isn't working properly, will get more sleep and I'll try to work on it | 14:32 | |
Geth | doc: a50643bf60 | (Claudio Ramirez)++ | doc/Language/testing.pod6 perl6 -> raku |
14:33 | |
linkable6 | Link: docs.raku.org/language/testing | ||
14:50
Actualeyes joined
14:56
molaf joined
15:00
shlomif joined
15:01
rindolf left
15:05
domidumont joined,
shlomif2 joined
15:08
shlomif left
15:09
Xliff left,
shlomif2 is now known as rindolf
15:10
wamba joined
15:26
pmurias left
15:28
pmurias joined
15:30
rindolf left
|
|||
tbrowder | m: :2<1> | 15:32 | |
camelia | WARNINGS for <tmp>: Useless use of constant integer :2<1> in sink context (line 1) |
||
tbrowder | m: say :2<2> | 15:33 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Cannot convert string to number: malformed base-2 number in '3⏏052' (indicated by ⏏) at <tmp>:1 ------> 3say :2<2>7⏏5<EOL> |
||
tbrowder | m: say :2<0101> | ||
camelia | 5 | ||
15:34
rindolf joined
|
|||
tbrowder | m: say :3<10> | 15:35 | |
camelia | 3 | ||
tbrowder | m: say :3<4> | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Cannot convert string to number: malformed base-3 number in '3⏏054' (indicated by ⏏) at <tmp>:1 ------> 3say :3<4>7⏏5<EOL> |
||
tbrowder | m: say :16<abcdef> | 15:36 | |
camelia | 11259375 | ||
tbrowder | m: say :63<Z> | 15:38 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Radix 63 out of range (allowed: 2..36) at <tmp>:1 ------> 3say :63<Z>7⏏5<EOL> |
||
tbrowder | say :36<Z> | ||
evalable6 | 35 | ||
tbrowder | say :36<z> | 15:39 | |
evalable6 | 35 | ||
15:43
pmurias left
15:47
rindolf left
15:48
rindolf joined
15:49
rindolf left
|
|||
nine | pmurias: github.com/niner/Inline-Perl5/comp...ned_blocks | 15:49 | |
tellable6 | nine, I'll pass your message to pmurias | ||
15:56
finanalyst joined
15:57
caterfxo left
|
|||
rypervenche | I see the following line in a Cro example, but I notice that if I hit ^C, the block of code will be run each time. How can I get it so it only does it once? Surround it with a once block? react whenever signal(SIGINT) { | 16:08 | |
16:08
orinthe left
|
|||
lizmat | react whenever signal(SIGINT) { exit 1 } ?? | 16:08 | |
when you create a signal supply on SIGINT, ^C will not exit the program anymore | 16:09 | ||
16:09
markoong left
|
|||
rypervenche | I'm imagining a scenario in say a backup script. If you want to kill the backup midway, you'd want to clean up the mess and unmount drives. You wouldn't want it to run that code more than once. | 16:10 | |
lizmat | so, whenever signal(SIGINT) { clean up mess; unmount drives; exit 1 } | ||
16:11
markoong joined
16:13
sena_kun joined
|
|||
rypervenche | Let's say it's a large directory that is being deleted and you hit ^C several times in a panic. It would try to delete it multiple times, and I'd probably need to write some checks into my functions to unmount (already done, but this is more the principal of the matter). I feel like it would be smart to force the code to only be run once, no? | 16:13 | |
16:15
Altai-man_ left
16:16
domidumont left,
orinthe joined
|
|||
rypervenche | It looks like "once" does do the trick. | 16:16 | |
16:17
Doc_Holliwood joined
|
|||
timotimo | you can use a .head to only get the first event from the signal supply | 16:17 | |
signal supplies are full supplies, so you can do whatever you want with them | |||
rypervenche | Ahh, I was trying .first >< | ||
timotimo | also, untapping a signal supply will (should) disengage the signal "override" | ||
so a second ctrl-c in that case would terminate the program | 16:18 | ||
lizmat | which may *not* be what you want ? | ||
if it is cleaning up, I mean ? | |||
timotimo | right | ||
rypervenche | Oh, yes, it just kills it when I do that. | 16:19 | |
timotimo | you can of course have a variable inside your react block that counts how often the signal has triggered and only do something the first time | ||
rypervenche | Is a once block a bad way to do this? | ||
jnthn | rypervenche: A whenever block in a given react block will not run more than once at a time | 16:20 | |
In fact, any whenever across the react will not | |||
That's part of the concurrency control rules | |||
rypervenche | Only if I use given? | 16:22 | |
16:22
sftp left
|
|||
rypervenche | Is is currently what I'm testing with: gist.github.com/rypervenche/7bdbf2...c4b9c529fd | 16:25 | |
jnthn | Hm, this is odd... | 16:26 | |
I wonder if the signal supply claims its serial but actually is not at all... | 16:27 | ||
16:27
rindolf joined
|
|||
jnthn | Yes, it is. Workaround: add a second `whenever` that never completes and then it works right | 16:27 | |
react { whenever signal(SIGINT) { say "got sigint"; my $i++ for ^100_000_000; exit 1 }; whenever Promise.in(100000000) { } } | 16:28 | ||
If I have that, for example, then I only see "got sigint" once no matter how many times I press ctrl+c | |||
But we should really fix whatever's wrong so you don't need that other whenever to force it to do the concurrency control... | 16:29 | ||
m: say signal(SIGINT).serial | |||
camelia | False | ||
jnthn | m: say signal(SIGINT).serialize | ||
camelia | Supply.new | ||
jnthn | m: say signal(SIGINT).serialize.zerial | ||
camelia | No such method 'zerial' for invocant of type 'Supply'. Did you mean 'serial'? in block <unit> at <tmp> line 1 |
||
jnthn | m: say signal(SIGINT).serialize.serial | ||
camelia | True | ||
jnthn | m: say signal(SIGINT).sane | ||
camelia | No such method 'sane' for invocant of type 'Supply'. Did you mean any of these? any can none one in block <unit> at <tmp> line 1 |
||
jnthn | m: say signal(SIGINT).sanitized | ||
camelia | No such method 'sanitized' for invocant of type 'Supply'. Did you mean 'sanitize'? in block <unit> at <tmp> line 1 |
||
jnthn | grr, forgot what it's called, but anyway, something is certainly wrong | ||
Better workaround: just call .serialize on it: | 16:31 | ||
react { whenever signal(SIGINT).serialize { say "got sigint"; my $i++ for ^10_000_000; exit 1 } } | |||
So somewhere we're forgetting to do that | |||
rypervenche | Nice. That works nicely. | ||
jnthn | Please can you make an issue about needing to add that? | 16:34 | |
rypervenche | m: say signal(SIGINT).sanitize | ||
camelia | Supply.new | ||
rypervenche | I can, yes. Although I'm not certain of the wording necessary. I'll put that it's not serialized then? | 16:35 | |
jnthn | Yes | ||
rypervenche | All right. Will do. | ||
jnthn | Thanks! | 16:36 | |
rypervenche | Is the problem here with the signal or the react/whenever | 16:37 | |
jnthn | react/whenever has a special case for when there's precisely one whenever | 16:39 | |
And it'll be something wrong with that | |||
It should check .serial and call .serialize, but clearly is not | 16:40 | ||
lizmat | hmmm... Supply.serialize does not appear to be documented | ||
16:40
theovdh left
|
|||
lizmat | jnthn: so the problem is with react /whenever, not with how signal sets up its Supply ? | 16:40 | |
16:41
rindolf left
|
|||
jnthn | lizmat: yes | 16:41 | |
lizmat | m: dd signal(SIGINT).serial # sure ? | 16:42 | |
camelia | Bool::False | ||
16:42
orinthe left
|
|||
uzl[m] | m: my @a := Array.new; dd @a | 16:43 | |
camelia | Array element = [] | ||
uzl[m] | m: my @a := Array[Int].new; dd @a | ||
camelia | Array[Int].new() | ||
16:43
orinthe joined
|
|||
uzl[m] | m: my @a := Array[Int].new(:2shape); dd @a | 16:43 | |
camelia | Array[Int].new(:shape(2,), [Int, Int]) | ||
uzl[m] | m: my Int @a := Array[Int].new(:2shape); dd @a | 16:44 | |
camelia | Type check failed in binding; expected Positional[Int] but got Array[Int] (Array[Int].new(:shape(2,), [Int...) in block <unit> at <tmp> line 1 |
||
uzl[m] | m: my Int @a := Array[Int].new(); dd @a | ||
camelia | Array[Int].new() | ||
uzl[m] | m: my Int @a := Array[Int].new(:2shape); dd @a | 16:45 | |
camelia | Type check failed in binding; expected Positional[Int] but got Array[Int] (Array[Int].new(:shape(2,), [Int...) in block <unit> at <tmp> line 1 |
||
uzl[m] | ^ Why the above typecheck error when binding a typed shaped array to a typed @-sigiled variable? | ||
jnthn | m: say Array[Int].new(:2shape).^roles | 16:46 | |
camelia | ((Shaped1Array) (ShapedArray) (ShapedArrayCommon) (Array::TypedArray[Int]) (Positional[Int]) (Positional) (Iterable)) | ||
jnthn | m: say Array[Int].new(:2shape) ~~ Positional[Int] | 16:47 | |
camelia | False | ||
jnthn | o.O | ||
It's right there in the roles list... | |||
rypervenche | I submitted the issue. github.com/rakudo/rakudo/issues/3547 I apologize if any of the wording is off. | ||
jnthn | uzl[m]: I don't know, but it should, and it even thinks it should going by the .^roles output... | 16:48 | |
committable6: all say Array[Int].new(:2shape) ~~ Positional[Int] | |||
committable6 | jnthn, gist.github.com/feef596723f9fd99f1...642f4fe8f0 | 16:49 | |
jnthn | Wow, borken just in time for christmas, huh... | 16:50 | |
bisectable6: 2015.11 2015.12 say Array[Int].new(:2shape) ~~ Positional[Int] | |||
bisectable6 | jnthn, Using old=2015.11 new=2015.12 in an attempt to do what you mean | ||
jnthn, Bisecting by output (old=2015.11 new=2015.12) because on both starting points the exit code is 0 | |||
jnthn | That...was precisely what I meant, how did you want me to tell you? :P | ||
bisectable6 | jnthn, bisect log: gist.github.com/7e8140b35f474be73f...e9a7c8e8aa | ||
jnthn, (2015-11-26) github.com/rakudo/rakudo/commit/13...4a50579a1c | |||
kawaii | Hello! :) day 3 of learning how promises work - I have this section of my code: gist.githubusercontent.com/kawaii/...voteban.p6 | ||
I'm getting a 'blah' in my console as expected, but the whenever block after that doesn't seem to run | 16:51 | ||
(it did previosly run when I was testing that code on it's own) | |||
16:51
rindolf joined
16:53
Doc_Holliwood left
|
|||
uzl[m] | jnthn: So probably a bug? | 16:53 | |
jnthn | uzl[m]: Looks like | 16:54 | |
uzl[m] | Ok | 16:55 | |
16:58
markoong left
16:59
chloekek left,
Doc_Holliwood joined
17:00
markoong joined,
jmerelo joined
17:13
sno left
17:16
markoong left,
markong joined
17:20
orinthe left
17:26
aborazmeh joined,
aborazmeh left,
aborazmeh joined
17:28
markoong joined
17:31
sftp joined
17:33
markong left
17:38
dakkar left
17:43
wamba left
17:51
aborazmeh left
17:55
regreg_ left
17:57
regreg joined
18:01
pecastro left
18:09
Doc_Holliwood left
18:12
markong joined
18:13
Altai-man_ joined
18:15
sena_kun left
18:16
markoong left
18:25
cfa joined
|
|||
cfa | o/ | 18:25 | |
18:26
Doc_Holliwood joined
18:27
sauvin left
|
|||
Geth | doc: cfa++ created pull request #3261: Learn a couple more words. |
18:32 | |
18:37
stoned75 joined
|
|||
Geth | doc: 3cb7b27591 | cfa++ | xt/words.pws Learn a couple more words. |
18:47 | |
doc: 7a3b34dc46 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | xt/words.pws Merge pull request #3261 from cfa/master Learn a couple more words. |
|||
18:52
ufobat_ joined
18:56
ufobat__ left
19:00
aluaces left
19:02
stoned75 left
19:08
markong left
19:09
markong joined
19:11
pecastro joined
19:12
Actualeyes left
19:14
aborazmeh joined,
aborazmeh left,
aborazmeh joined
19:24
aborazmeh left,
stoned75 joined
19:29
aluaces joined
19:41
jmerelo left
19:43
sno joined
19:51
molaf left,
stoned75 left
19:57
aindilis left
19:59
aindilis joined
20:13
sena_kun joined
20:15
Altai-man_ left
20:21
wamba joined
20:40
stoned75 joined
20:42
chloekek joined
20:43
Black_Ribbon joined
20:44
MasterDuke joined
20:45
caterfxo joined
21:01
caterfxo left,
caterfxo joined
21:11
caterfxo left,
caterfxo joined
21:15
rindolf left
21:18
aborazmeh joined,
aborazmeh left,
aborazmeh joined
21:25
molaf joined
21:49
lichtkind joined
22:02
wamba left
22:13
Altai-man_ joined
22:15
sena_kun left
22:16
chloekek left
22:17
Doc_Holliwood left
22:18
abraxxa left
22:19
aborazmeh left,
abraxxa joined
22:38
markoong joined,
cpan-raku left
22:39
markong left,
cpan-raku joined,
cpan-raku left,
cpan-raku joined
22:42
mowcat left
22:46
molaf left
22:49
SQuoll left
22:56
SQuoll joined
|
|||
rypervenche | Is there a way to have an optional defined named parameter in a subroutine signature? Like: Str:D :q(:$query) | 23:02 | |
23:04
SQuoll left
|
|||
lizmat | rypervenche: you can if you give it a default value | 23:06 | |
m: sub a(Str:D :$a) { dd $a }; a # no default value | |||
camelia | Parameter '$a' of routine 'a' must be an object instance of type 'Str', not a type object of type 'Str'. Did you forget a '.new'? in sub a at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
lizmat | m: sub a(Str:D :$a = "foo") { dd $a }; a # ok with default value | 23:07 | |
camelia | "foo" | ||
rypervenche | I'm using this to pass a string via the command line. If it doesn't have a string, I'd like it run by itself. I've got a "with" statement doing different things if it is defined or not. | 23:11 | |
I guess the :D is unnecessary because of that, but I was curious to know it it were possible or not. | |||
Since it passes in (Str) if I don't put anything. I wonder if that's what happens with all optional parameters... | 23:12 | ||
Yep, it is. Ok, that answers my question I guess. | 23:13 | ||
23:20
Actualeyes joined
23:32
wildtrees joined
23:34
SQuoll joined
23:36
Actualeyes left
23:38
Actualeyes joined,
SQuoll left
23:45
SQuoll joined
23:46
aborazmeh joined,
aborazmeh left,
aborazmeh joined
23:54
regreg left
|
|||
Geth | ¦ problem-solving: AlexDaniel assigned to jnthn Issue Abandoned modules, deceased authors, etc. (Raku Community Modules) github.com/Raku/problem-solving/issues/168 | 23:58 |