»ö« 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. |
|||
00:00
AlexDaniel left
|
|||
hythm_ | right :) | 00:00 | |
00:07
entonian joined,
hythm_ left
00:11
entonian left,
japhb joined
00:24
w_richard_w joined
00:25
guifa joined
00:28
w_richard_w left
|
|||
Kaiepi | evalable6, say \x10000..\x1FFFD | 00:31 | |
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/H0QMSP9bi0 Undeclared routines: x10000 used at line 1 x1FFFD used at line 1 |
||
Kaiepi | evalable6, / <[\x10000..\x1FFFD]> / | 00:32 | |
evalable6 | |||
Kaiepi | odd | ||
i can't use Cro::Uri on HEAD because i get this error: | 00:33 | ||
===SORRY!=== Error while compiling /home/morfent/Documents/p6-PSBot/site#sources/C1872F8D5E3D16ECE82926420495D80ACBBB20C8 (Cro::Uri) | |||
Illegal range endpoint in regex: | |||
\x10000..\x1FFFD | |||
also when i run the repl, i get this error: | 00:34 | ||
bastille% perl6 | |||
I ran into a problem while trying to set up Linenoise: Unhandled exception: Wrong number of arguments passed; expected 1..1, but got 1 | |||
i'd make an issue but i'm not sure what exactly the problem is | |||
00:38
vrurg left
00:44
Xliff joined
|
|||
Xliff | \o | 00:44 | |
m: for 0…2 { LAST { say $_ + 1 }; .say } | 00:45 | ||
camelia | 0 1 2 3 |
||
Xliff | my ($a, @a) = (0); @a = 0…3; $a = @a; say $a | 00:47 | |
evalable6 | [0 1 2 3] | ||
00:49
vrurg joined
00:58
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
Kaiepi | evalable6, 1..1 | 01:00 | |
evalable6 | WARNINGS for /tmp/FSWNHucAfX: Useless use of ".." in expression "1..1" in sink context (line 1) |
||
Kaiepi | evalable6, say 1..1 | ||
evalable6 | 1..1 | ||
01:01
_isomorphismes joined
|
|||
Kaiepi | this hangs on the repl | 01:01 | |
evalable6, say $*VM.version | 01:02 | ||
evalable6 | v2018.12.45.ga.9.d.02578.a | ||
Kaiepi | never mind, everything hangs on the repl | 01:03 | |
01:05
_isomorphismes left
01:10
roguelazer joined
|
|||
guifa | I can't for the life of me seem to find it right now. What's the way to catch method calls on an object for methods that don't exist? | 01:19 | |
sena_kun | hmm, catch like in catch an exception or catch as override with some default one? | 01:20 | |
guifa | the latter | 01:21 | |
sena_kun | sigh. no idea then, sorry. | ||
guifa | For some strange reason, the method in an extended action isn't getting called, even though the extended grammar is definitely matching it. Trying to figure out what's going on =\ | 01:22 | |
lookatme_q | check out the FALLBACK method | ||
01:26
atroxaper left
|
|||
guifa | lookatme_q: bingo, thanks! Sadly, didn't end up working (I mean, the FALLBACK did, just not working to help solve the issue lol) | 01:29 | |
01:44
markoong left
|
|||
guifa | OMG I'm the biggest idiot. A missing comma that didn't get caught by the compiler | 01:47 | |
Xliff | We've all been there, guifa | 01:51 | |
El_Che | Commas are important: "OMG I'm the biggest, idiot". | 01:53 | |
less friendly :) | |||
guifa | Touché, El_Che, touché | 01:54 | |
El_Che | :) | ||
guifa | This BF interpreter is seriously starting to fucking with my head. But I'll be damned if it's not going to be the coolest one ever hahahaha | 01:55 | |
01:56
zachk left
02:02
Actualeyes joined
|
|||
guifa | Things like MONKEY-TYPING will be limited to the file that includes them, yeah? | 02:03 | |
02:07
jme` joined
|
|||
Xliff | Yeah. | 02:07 | |
MONKEY-TYPING can even be limited to the specific block. | 02:08 | ||
El_Che: You should get a stand-up show, buddy. ;) | |||
guifa | I'm going to show how new BF commands can be added by both augment and creating new grammar/action classes based off of the original, wanted to make sure MONKEY-TYPING wouldn't potentially allow things in other programs that it shouldn't. | 02:10 | |
02:16
molaf left,
MasterDuke joined,
MasterDuke left,
MasterDuke joined
02:28
molaf joined
02:35
sena_kun left
02:48
Sgeo_ left
02:49
cpan-p6_ left
02:50
cpan-p6 joined
02:51
Sgeo joined
02:52
aborazmeh left
03:02
_isomorphismes joined
03:11
ferreira left
03:20
saki joined,
saki left
03:29
saki joined
03:30
saki left
03:44
ufobat__ joined
03:48
ufobat_ left
03:56
aborazmeh joined,
aborazmeh left,
aborazmeh joined
04:00
w17t left
04:17
aindilis left
04:24
ferreira joined
04:33
guifa left
04:36
aindilis joined
04:38
Sgeo left,
Sgeo joined,
molaf left
04:55
ferreira left
04:59
aborazmeh left
05:04
veesh joined
05:06
veesh left
05:08
ferreira joined
05:11
Actualeyes left
05:25
roguelazer left
05:30
ferreira left
05:35
w17t joined
05:36
mowcat left
05:46
w_richard_w joined
05:47
w_richard_w left
05:57
curan joined
06:08
ravenousmoose joined,
ravenousmoose is now known as ravenousmoose[aw
06:09
ravenousmoose[aw left
06:12
robertle joined
06:19
jmerelo joined
06:29
cpan-p6 left
06:30
cpan-p6 joined
06:32
cpan-p6__ joined
06:36
cpan-p6__ left
|
|||
Geth | doc: f2303e9fdb | (JJ Merelo)++ | html/.htaccess Changes rewrite rule to avoid encoding This goes towards fixing #935. I'll reopen it if it does not, I can't test it locally. Anyway, this is a hack that should probably be avoided at all costs. If we can't provide a meaningful page, we should simply eliminate it from the graph. I leave this issue open until that is fixed. |
06:47 | |
ufobat__ | .tell alex-daniel done. it's deleted | 06:55 | |
yoleaux | ufobat__: I'll pass your message to alex-daniel. | ||
06:57
w17t left
06:58
domidumont joined,
ufobat__ is now known as ufobat
07:00
w17t joined
07:04
AlexDaniel joined
07:12
ufobat left
07:15
_isomorphismes left
|
|||
AlexDaniel | . | 07:19 | |
07:21
ufobat joined
|
|||
AlexDaniel | ufobat: I think you should have received something to confirm the transfer | 07:22 | |
07:33
sno left
|
|||
ufobat | AlexDaniel++ | 07:33 | |
done | |||
AlexDaniel | also github++ because this currently redirects: github.com/zoffixznet/perl6-Temp-Path | 07:34 | |
even though it was transferred to perl6-community-modules, then to me, and then to you :) | |||
had to transfer it to myself because github doesn't allow transferring from an org to a personal account that is not yours… weird stuff | |||
these redirects btw are not guaranteed to work for a long time, but usually they do :) | 07:35 | ||
ufobat | funny | ||
i am going to fix it, ill put in on cpan | |||
07:36
sno joined,
ravenousmoose_ joined
|
|||
ufobat | btw, i've got an question, all all the perl6-community-modules to be taken from someone? like a place where orphaned modules lie? | 07:36 | |
if so maybe that whould be written down somewhere | |||
jmerelo | ufobat: I think it is... | 07:40 | |
07:40
jmerelo left
07:50
xinming joined
|
|||
AlexDaniel | ufobat: that's my understanding, but I'm not sure what the original goals for that org were | 07:51 | |
08:09
patrickb joined
08:11
dct joined
|
|||
ufobat | should we add this in the github organisation description? | 08:19 | |
AlexDaniel | ufobat: yes, like what exactly? | 08:24 | |
moritz | the original plan for perl6-community-modules was to have a convenient space where people could put modules where they didn't mind unmoderated contributions from the community | 08:25 | |
"I've put this code up, but if you want to improve it, go ahead" | |||
ufobat | "shelter for orphaned modules, please considder taking maintainership for one of the them" | ||
unmoderated contribution.. vs PR | 08:26 | ||
because contribution on GH is rather easy | |||
AlexDaniel | moritz: yeah, that sounds nice… but I don't think it works | 08:27 | |
moritz | AlexDaniel: agreed | ||
ufobat | i think it just encourages "oh someone else will look after it" | ||
like the coffee maschine at work ;) | |||
AlexDaniel | ufobat: fwiw I don't think we should add is-true and is-so at the same time | 08:29 | |
ufobat: one of them should go in, for sure, because `is $expr, *.so` is horrible :) | 08:30 | ||
ufobat | then choose one form :) | ||
moritz | wait, what are you trying to do? | 08:31 | |
AlexDaniel | moritz: github.com/perl6-community-modules...-458854262 | ||
08:31
TeamBlast joined
|
|||
AlexDaniel | oops, not that commment specifically, but the whole PR | 08:31 | |
ufobat | issue 8 and 18 seem to be duplicates, and i've implemented both, but one are just an alias (more or less) | 08:32 | |
moritz | you know that Test.pm6 uses "ok" and "nok" for the boolean tests? | ||
AlexDaniel | yes | ||
ufobat | moritz, it's testo, its the hot new shit :p | ||
AlexDaniel | ufobat: I think Zoffix forgot about the first ticket and accidentally created a new one | ||
moritz | just thought you might take some naming suggestions from established modules :) | 08:33 | |
ufobat | i am happy with test, i dont need(like) testo, but one of zoffix other modules use Testo and do boolean tests with is $expression, *.not | ||
and if the tests fail you're compeltly confused by the message that gets generated | |||
moritz | that's... brain-twisty :D | ||
ufobat | i want to fix this issue, with adding is-so/is-true | ||
so is-so / is-not vs is-true / is-false? | 08:35 | ||
moritz | how about just naming them true and false? | ||
"is-true" suggests "=== True" to me | |||
and doesn't suggest that there is some kind of coercion to Bool going on | 08:36 | ||
ufobat | otoh: `is` in Test doesn't suggest that there is stringification going on either | 08:37 | |
you could also still call them `ok` or `nok` | 08:38 | ||
I dont have the Testo-mindset, i don't care | 08:39 | ||
if i need to pick i'd say for all tests something like `is-so-and-so` or `does-so-and-so` because it reads as if you're checking for something | 08:44 | ||
08:44
rindolf joined
|
|||
ufobat | .tell jmerelo i've got some questions, ping me if you have time :-) | 08:47 | |
yoleaux | ufobat: I'll pass your message to jmerelo. | ||
ravenousmoose_ | As someone entirely new to Perl(6) and its community, I'm oddly surprised at the lack of emacs support. Am I missing something, or is there only perl6-mode/perl6-flycheck for the very basics of editor support? | 08:51 | |
I don't mind if the community sees no use in autocompletion/documentation support for any/all editors; I was simply wondering :-) | 08:53 | ||
08:55
zakharyas joined
|
|||
ufobat | i am using emacs as well, and I am just not qualified to improve things :( | 09:00 | |
09:05
dct left
09:11
scimon joined
|
|||
ravenousmoose_ | ufobat: I feel the same way. I'm not familiar enough with either perl6 or emacs itself to improve on the current situation, but was wondering if it was any better than it seemed so far | 09:11 | |
Guess not, I'll make do with the actual documentation and just fiddling around then :) | 09:12 | ||
ufobat | there are other IDEs of course | ||
09:13
dakkar joined
|
|||
ravenousmoose_ | Yes, sure, and by no means am I an emacs zealot or anything, but I try to incorporate as much of my development work into emacs where I can | 09:14 | |
09:26
ravenousmoose joined
10:03
domidumont1 joined
|
|||
ufobat | is there any convention for verions of modules? i usually have something like 1.0.3 but Temp::Path does 1.001006 | 10:05 | |
10:05
kensanata joined
10:06
domidumont left
10:11
reach_satori left
|
|||
cpan-p6 | New module released to CPAN! Temp-Path (1.001007) by 03UFOBAT | 10:20 | |
AlexDaniel | ravenousmoose_: maybe see github.com/perl6/user-experience/issues/19 | 10:27 | |
ravenousmoose_: in my opinion, perl6-mode is pretty good at what it is | |||
ravenousmoose_: yes, it's not IDE-like, but at least the highlighting is right | 10:28 | ||
ravenousmoose_: in spacemacs there's a layer for perl 6 which is a bit better, I think: github.com/CodingSolo/spacemacs/co...f7ef8b815a | 10:29 | ||
ok, that's a wrong link, but github.com/syl20bnr/spacemacs/commit/bb7e304e | 10:30 | ||
there was no new spacemacs release in more than a year, so it's still not quite there… | 10:31 | ||
but if you use spacemacs from develop branch then it should be fine | |||
ravenousmoose | AlexDaniel: I use my own config, but that did remind me I could use universal-ctags for some form of completion | 10:32 | |
Thanks for the heads-up, didn't think to check in with Spacemacs' layers if there was something | 10:33 | ||
10:45
reach_satori joined
10:56
ravenousmoose is now known as ravenousmoose[aw,
ravenousmoose[aw left
11:20
ChoHag left
11:21
ravenousmoose joined
11:32
ChoHag joined
|
|||
ufobat | ravenousmoose_, if your ctags work pls tell me :-) i am intersted in that | 11:34 | |
11:42
oftl joined
11:45
dogbert2_ joined
11:51
ravenousmoose left
11:52
ravenousmoose joined,
robertle_ joined
11:58
robertle_ left
11:59
AlexDaniel left
12:00
robertle_ joined
12:05
leont joined
|
|||
cpan-p6 | New module released to CPAN! App-Platform (0.4.3) by 03KAJI | 12:07 | |
12:08
zakharyas left
12:17
reach_satori left,
reach_satori joined
12:24
robertle_ left
12:27
markoong joined
12:36
sena_kun joined
12:57
leont left
13:01
domidumont joined
13:02
patrickb left
13:03
domidumont1 left
13:09
aborazmeh joined,
aborazmeh left,
aborazmeh joined
13:10
reach_satori left
13:14
kensanata left
13:19
ravenousmoose left
13:22
patrickb joined
13:26
ravenousmoose joined
|
|||
tyil | there's an bridge between Freenode's #perl6-discord and the Discord Raku community for those looking to test it out | 13:28 | |
if its stable for a week, and people here aren't against it, I'd like to bridge the discord community to this channel | 13:29 | ||
13:30
zakharyas joined
13:36
w17t left
|
|||
cono | tyil: what is the link for discord? | 13:51 | |
tyil | give me a sec, it was posted to Reddit | ||
discord.gg/gg2a3T6 | 13:52 | ||
cono: ^ | |||
cono | thank you | ||
cpan-p6 | New module released to CPAN! Cro-WebSocket (0.8.0.1) by 03JNTHN | 13:55 | |
13:57
ChoHag left
14:01
mowcat joined
14:06
patrickb left,
aborazmeh left
14:12
aborazmeh joined,
aborazmeh left,
aborazmeh joined
14:23
aborazmeh left
|
|||
SmokeMachine | m: class CX::A does X::Control {}; CONTROL { when CX::A { .resume } }; CX::A.new.throw | 14:25 | |
camelia | Cannot find method 'sink': no method cache and no .^find_method in block <unit> at <tmp> line 1 |
||
SmokeMachine | Is that expected? | ||
14:32
Juerd left
14:33
Juerd joined
|
|||
moritz | not really | 14:36 | |
14:41
molaf joined
|
|||
ufobat | can i declare a subset to cover the :U case as well? | 14:42 | |
m: subset T of Str where * ~~ any("a", "b"); sub a(T :$t) { say $t }; sub b(T :$t) { a(:$t) }; b() | |||
camelia | Constraint type check failed in binding to parameter '$t'; expected T but got Str (Str) in sub b at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
14:42
patrickb joined
|
|||
ufobat | m: subset T of Str where * ~~ any("a", "b"); sub a(Str :$t) { say $t }; sub b(Str :$t) { a(:$t) }; b() | 14:42 | |
camelia | (Str) | ||
ufobat | or class type | ||
MasterDuke | ufobat: fwiw, i think `subset T of Str where * ~~ any("a", "b");` could be `subset T of Str where "a"|"b";` | 14:46 | |
14:48
Sgeo_ joined
14:50
Sgeo left
14:53
skids joined
15:01
macadee joined
15:04
ravenousmoose left,
macadee left
15:05
ravenousmoose joined
15:14
ChoHag joined
15:16
domidumont1 joined
15:17
w17t joined
15:18
dogbert2_ left
15:19
domidumont left
15:20
wi15ht joined
15:23
w17t left
15:26
leont joined
15:28
domidumont joined
15:31
domidumont1 left
15:41
reach_satori joined
15:46
curan left
15:55
jme` left
16:00
patrickb left
16:04
ravenousmoose left
16:11
hans_ joined
|
|||
hans_ | rakudo: say "Hello y'all!" | 16:12 | |
camelia | Hello y'all! | ||
16:12
hans_ left
16:21
ferreira1 joined
16:27
ferreira2 joined
16:29
ferreira1 left
16:30
cfa joined
|
|||
cfa | 👋🏽 | 16:30 | |
16:34
patrickb joined
|
|||
cfa | { .a = <a b>; .b = <a b>; .&dd } given class { has $.a = SetHash.new; has $.b is rw = SetHash.new }.new; | 16:34 | |
evalable6 | <anon|1>.new(a => SetHash.new("b","a"), b => $("a", "b")) | ||
cfa | that strikes me as a trap (store vs. assign on ro vs. rw method [or sub]) | 16:35 | |
thoughts? | |||
m: for (BagHash, MixHash, SetHash) -> $h { { .a = <a b>; .b = <a b>; .&dd } given class { has $.a = $h.new; has $.b is rw = $h.new }.new } | |||
camelia | <anon|1>.new(a => ("b"=>1,"a"=>1).BagHash, b => $("a", "b")) <anon|1>.new(a => ("a"=>1,"b"=>1).MixHash, b => $("a", "b")) <anon|1>.new(a => SetHash.new("b","a"), b => $("a", "b")) |
||
cfa | same deal for all these mutable collections | 16:36 | |
the subtler version is actually: | 16:37 | ||
m: { .a = <a b>.SetHash; .b = <a b>.SetHash; .&dd } given class { has $.a = SetHash.new; has $.b is rw = SetHash.new }.new; | |||
camelia | <anon|1>.new(a => SetHash.new(SetHash.new("a","b")), b => SetHash.new("a","b")) | ||
16:38
jmerelo joined
|
|||
cfa | hi jmerelo | 16:39 | |
16:41
ravenousmoose joined
|
|||
jmerelo | cfa: hi! | 16:41 | |
yoleaux | 08:47Z <ufobat> jmerelo: i've got some questions, ping me if you have time :-) | ||
jmerelo | .tell ufobat I'm back! | 16:42 | |
yoleaux | jmerelo: I'll pass your message to ufobat. | ||
16:42
ravenousmoose_ left
16:52
pmurias joined
|
|||
pmurias | jnthn: do we do anything crafty with .WHO when loading modules? | 16:59 | |
jnthn: modules put stuff in it during loading times right? but it then seems to gets overriden somehow | 17:00 | ||
17:02
AlexDaniel joined
|
|||
jnthn | pmurias: Yes. :) | 17:02 | |
pmurias: Grep for resolve_repossession_conflicts | |||
pmurias | jnthn: thank you, completely forgot about it and was getting super confused | 17:06 | |
17:17
scimon left
17:18
ravenousmoose left
|
|||
ufobat | jmerelo, i am busy now, sorry :( maybe later | 17:19 | |
yoleaux | 16:42Z <jmerelo> ufobat: I'm back! | ||
17:19
melezhik joined
|
|||
melezhik | Hi! What is the simplest way to define class constructor? | 17:20 | |
AlexDaniel | melezhik: it depends, but a lot of the times TWEAK is the answer | 17:21 | |
it's not for creating your own constructor, but maybe that's not exactly what you need :) | |||
melezhik | yeah, AlexDaniel: probably is what I am looking for . Actually I need just class initializer | 17:22 | |
not even constructor | |||
but tweak probably ok too | |||
jmerelo | ufobat: no problem, wherever. | ||
17:28
ravenousmoose joined
17:32
ravenousmoose left
17:34
dakkar left
17:35
pmurias left
17:36
gfldex left
17:37
gfldex joined
17:40
pmurias joined
17:43
domidumont left
17:54
mowcat left
17:55
kawaii joined
18:11
gfldex left
18:16
zachk joined
18:20
zachk left,
zachk joined
|
|||
lucs | I'd like to pass a junction as a function argument, for example foo(1|2), but it turns out that that invokes foo(1), then foo(2). | 18:32 | |
Can it be done somehow? | |||
jmerelo | lucs: what's the signature of the function? | ||
lucs | jmerelo: I think that's what I'm trying to figure out :) | ||
jmerelo | m: sub foo( Junction $j ) { $j }; say foo( 1|2 ) | 18:33 | |
camelia | any(1, 2) | ||
jmerelo | ^^^ | ||
lucs | D'oh! | ||
Thanks :) | |||
jmerelo | lucs: my pleasure :-) | ||
lucs | Um, could the signature specify for example "a junction of Int"? | 18:34 | |
pmurias | jnthn: with just a 'use SomeModule' (from a precompiled piece of code) there shouldn't be any conflicts just repossession? | 18:35 | |
jmerelo | lucs: you can use a where clause | 18:37 | |
lucs | jmerelo: Trying... | 18:38 | |
m: sub foo( Junction $j where all($j) ~~ Int ) { $j }; say foo( 1|'a' ) # No cigar, but is it close? | 18:44 | ||
camelia | any(1, a) | ||
jmerelo | m: say all(3,'a') ~~ Int | 18:45 | |
camelia | False | ||
jmerelo | m: my $j = 3|'a'; say all($j) ~~ Int | ||
camelia | True | ||
jmerelo | m: my $j = 3|'a'; say all(|$j) ~~ Int | ||
camelia | This type (Junction) does not support elems in block <unit> at <tmp> line 1 |
||
jmerelo | m: my $j = 3|'a'; say $j; say all(|$j) ~~ Int | 18:46 | |
camelia | any(3, a) This type (Junction) does not support elems in block <unit> at <tmp> line 1 |
||
jmerelo | m: my $j = 3|'a'; say $j; say all($j); say all($j) ~~ Int | ||
camelia | any(3, a) all(any(3, a)) True |
||
jmerelo | m: my $j = 3|'a'; say $j; say all($j); say $j ~~ Int | 18:47 | |
camelia | any(3, a) all(any(3, a)) True |
||
jmerelo | lucs: you need to "all" an "any" | ||
jnthn | pmurias: I think that's right | ||
jmerelo | m: my $j = 3|'a'; say $j; say all($j); say $j == Int | 18:48 | |
camelia | any(3, a) Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'? in block <unit> at <tmp> line 1 all(any(3, a)) |
||
lucs | jmerelo: Now that you mention it, I think what I really need is "&" junction. | 18:49 | |
jmerelo | lucs: maybe try StackOverflow? Can't think offhand how to fix it... | ||
lucs | jmerelo: OK, thanks for the ideas, I'll keep trying. | 18:51 | |
jmerelo | lucs++ | 18:53 | |
18:56
john_parr left
18:58
pecastro joined
|
|||
pmurias | ' | 19:01 | |
sorry | |||
cfa | any thoughts on the trap i mentioned earlier? | ||
19:02
pmurias left
19:06
pmurias joined
|
|||
lucs | jmerelo: You know what, coercing the output, in addition to making sense, does what I need: | 19:13 | |
m: sub foo( Junction $j where all($j) ~~ Int ) { so $j == 2 }; say foo( 1|2|'a' ) | |||
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
lucs | m: sub foo( Junction $j where all($j) ~~ Int ) { so $j == 2 }; say foo( 1|3 ) | 19:14 | |
camelia | False | ||
lucs | m: sub foo( Junction $j where all($j) ~~ Int ) { so $j == 2 }; say foo( 1|2 ) | ||
camelia | True | ||
lucs | Also, looks like 'where $j ==' is sufficient (instead of 'where all($j) ==') | 19:16 | |
Er, ~~, not ==. | |||
cfa | you could do $j ~~ 2 instead of so $j == 2 too, i think? | 19:17 | |
m: say 1|3 ~~ 2; 1|2 ~~ 2; | 19:18 | ||
camelia | False | ||
cfa | m: say 1|3 ~~ 2; say 1|2 ~~ 2; | ||
camelia | False True |
||
lucs | Yep, thanks. | ||
19:21
ravenousmoose joined
19:23
masak left
19:25
masak joined
19:27
melezhik left
|
|||
cfa | lucs: i don't think your type constraint it doing what you intend though | 19:31 | |
m: all(1|2).say | |||
camelia | all(any(1, 2)) | ||
cfa | note that's all of any | 19:32 | |
m: say 'a'|'b'|'c' ~~ Int; say 'a'|'b'|'c'|1 ~~ Int; say all('a'|'b'|'c'|1) ~~ Int; | |||
camelia | False True True |
||
cfa | note the second and third statements are both true | ||
lucs | Hmm... | 19:34 | |
Ah, so the error I got when I had 'a' up there was occurring when the == operation was being attempted then, right? | 19:36 | ||
cfa | yeah, | 19:37 | |
m: 'a' == 2 | |||
camelia | WARNINGS for <tmp>: Useless use of "==" in expression "'a' == 2" in sink context (line 1) Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
lucs | Right | ||
19:37
Sgeo__ joined
|
|||
lucs | I'll just forget about the signature for now -- it would have been nice to have, for code documenting reasons, but I'm not too worried about passing in the wrong type of arguments. | 19:39 | |
(I'll forget about the constraint part of the signature that is) | 19:40 | ||
19:40
Sgeo_ left
|
|||
lucs | Heh, turns out foo(1|2) is fine when the signature specifies that the argument is a Junction, but what if I sometimes want to have a "one-element junction", like foo(42). | 19:48 | |
I think I can do foo(42|Any), is that the way to go? | 19:49 | ||
MasterDuke | lucs: just another multi candidate | 19:50 | |
? | |||
19:51
zakharyas left
|
|||
lucs | Hmm... | 19:51 | |
Can I do that without having to clone the whole function body? | 19:53 | ||
tobs | m: multi f (Junction $j) { say $j }; multi f ($x) { samewith any($x) }; f(1|2); f(2) | 19:55 | |
camelia | any(1, 2) any(2) |
||
tobs | lucs: ^ although you have to decide which kind of junction a single thing should become | ||
moritz | if you want to accept either a junction or any single value, use Mu as the type constraint | ||
lucs | So many ideas, it's great :) | 19:57 | |
20:01
jmerelo left
|
|||
lucs | tobs, moritz: both techniques work, thanks. | 20:02 | |
MasterDuke: Thanks to you too :) | 20:03 | ||
moritz | my pleasure | 20:11 | |
20:27
pmurias left,
reach_satori left,
reach_satori joined
20:29
wi15ht left
20:30
pmurias joined
20:33
shlomif joined
|
|||
MasterDuke | np | 20:38 | |
20:54
dant joined,
rindolf left
20:56
dct joined
20:57
ravenousmoose left,
leont left
20:58
shlomif is now known as rindolf
21:01
dct left,
pmurias left
21:03
drolax joined,
rindolf left
21:07
dataangel joined
21:08
rindolf joined
21:11
john_parr joined
|
|||
dant | Is there a collection of useful p6 grammars? I often rewrite simple grammars for df output, /etc/hosts, git logs, etc. I'd prefer to contibute to an existing effort rather than duplicate it. | 21:11 | |
21:16
Sgeo joined
21:17
Sgeo__ left
|
|||
sena_kun | I don't think there is one, but you can factor it out in a module and publish one. | 21:21 | |
lizmat | dant: modules.perl6.org/search/?q=Grammar # perhaps a good start | ||
21:22
pmurias joined
21:26
dustinm` left
21:27
dustinm` joined
21:34
aindilis` joined,
aindilis left
|
|||
cpan-p6 | New module released to CPAN! Lumberjack-Application (0.0.7) by 03JSTOWE | 21:49 | |
21:51
jast left
21:58
aindilis` left
21:59
aindilis joined
22:01
kensanata joined
22:04
cpan-p6_ joined
22:08
cpan-p6 left
22:13
ravenousmoose joined
22:14
ravenousmoose is now known as ravenousmoose[aw,
pmurias left
22:15
ravenousmoose[aw left,
pmurias joined
22:16
pmurias left
22:17
gfldex joined
22:34
skids left
22:38
drolax left
|
|||
Geth | gtk-simple: 94036201c7 | (David Warring)++ | 2 files bump CI Rakudo baseline for deps |
22:46 | |
22:53
kensanata left
22:55
rindolf left
23:11
leont joined
23:40
molaf left
23:59
pecastro left
|