»ö« 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:16
zacts joined,
zacts left
00:22
aborazmeh left
00:31
pecastro left
00:32
w_richard_w joined
00:37
MikeyG left
00:38
MikeyG joined
00:39
lgtaube left
00:40
lgtaube joined
00:48
xiaoyafeng joined
01:05
MasterDuke joined,
MasterDuke left,
MasterDuke joined
01:13
squashable6 left
01:16
squashable6 joined,
ChanServ sets mode: +v squashable6
01:20
kurahaupo_ joined
01:22
kurahaupo left
01:36
lucasb left
01:42
kurahaupo_ left,
kurahaupo joined
|
|||
Xliff_ | m: my @a = ^9; say @a[^4]; say @a[*] | 01:44 | |
evalable6 | (0 1 2 3) (0 1 2 3 4 5 6 7 8) |
||
Xliff_ | m: my @a = ^9; say @a[^4]; say @a[*-1] | ||
evalable6 | (0 1 2 3) 8 |
||
01:46
AlexDaniel left
01:56
fake_space_whale left
01:59
a__park joined
02:01
bakedb left
02:02
a__park left
02:03
Manifest0 left
02:05
Manifest0 joined
02:06
zacts joined,
fudje joined
02:07
fudje left
02:09
fake_space_whale joined
02:18
netrino_ left
02:25
zacts left
02:34
Manifest0 left
02:38
ctilmes1 left
02:39
Manifest0 joined
|
|||
Xliff_ | m: my @a = ^9; say @a[ ^4 ]; | 02:50 | |
evalable6 | (0 1 2 3) | ||
Xliff_ | m: my $a = 2; my @a = ^9; say @a[ ^(2 * 2) ]; | ||
evalable6 | (0 1 2 3) | ||
03:39
evalable6 left
03:40
evalable6 joined
03:51
Manifest0 left
03:58
Manifest0 joined
|
|||
Xliff_ | m: my %a = ( a=>1, b=>2, 3=>3 ); for %a.keys { with %a{$_} { .say }; } | 04:12 | |
evalable6 | 2 3 1 |
||
04:20
Manifest0 left
04:25
Manifest0 joined
04:27
uzl joined,
jaldhar joined
|
|||
uzl | m: class A { has $.val; method Str { 'µ' ~ $!val } }; multi sub infix:<+>(A $lhs, A $rhs) { $lhs.val + $rhs.val }; (A.new(:12val) + A.new(:23val)).put; A.new(:12val).put | 04:31 | |
evalable6 | 35 µ12 |
||
uzl | How would I overload an operator (e.g., +) for a class in the same manner as Str? | 04:33 | |
Is using the multi operator-type:<OP>(T $lhs, T $rhs) { } syntax the right way to do it whenever operators are being overloaded instead of methods (e.g., Str, Num, etc.)? | 04:36 | ||
04:37
jmerelo joined
|
|||
uzl | ... the `multi operator-type:<OP>(T $lhs, T $rhs) { }` syntax ... | 04:37 | |
04:42
Manifest0 left
04:43
uzl left
04:45
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
04:47
sauvin joined
04:50
Manifest0 joined
05:06
jaldhar left
05:07
jaldhar joined
05:08
fake_space_whale left
05:09
random_yanek left,
random_yanek joined
05:13
kurahaupo_ joined
05:16
kurahaupo left
05:22
kurahaupo_ left
05:23
kurahaupo joined
05:34
robertle left
05:50
Manifest0 left
05:53
|Sno| left
05:56
Manifest0 joined
05:58
w_richard_w left
06:04
w_richard_w joined
06:32
bakedb joined
06:35
abraxxa joined
06:36
abraxxa left,
abraxxa joined
06:38
domidumont joined
06:42
abraxxa left
06:43
abraxxa joined
06:54
xiaoyafeng left
07:01
arkaitz joined
07:02
w_richard_w left
07:12
patrickb joined
|
|||
lizmat_ | weekly: blogs.perl.org/users/brian_d_foy/20...sting.html | 07:17 | |
notable6 | lizmat_, Noted! | ||
07:17
lizmat_ is now known as lizmat
07:24
arkaitz left
07:33
lasse joined
07:40
zakharyas joined
07:54
ufobat joined
|
|||
ufobat | good morning :D | 07:54 | |
07:55
jjmerelo joined
07:57
jmerelo left
|
|||
lizmat | ufobat o/ | 07:58 | |
08:01
lookatme_q joined
08:11
w_richard_w joined
08:17
lookatme_q left
08:22
w_richard_w left
08:29
gregf_ joined,
sena_kun joined
08:31
kensanata joined
08:33
rindolf joined
08:34
robertle joined
|
|||
kawaii | o/ | 08:36 | |
patrickb | o/ | 08:38 | |
nebuchadnezzar | Hello | 08:42 | |
Am I the only one unable to access perl6.org websites ? | |||
lizmat | nebuchadnezzar: www.reddit.com/r/perl6/comments/bf...ains_seem/ | 08:43 | |
please use perl6.wakelift.de/ for now | 08:44 | ||
nebuchadnezzar | thanks a lot | 08:45 | |
08:47
demanuel joined
08:53
cono joined
|
|||
cono | does any1 know what is going on with perl6.org ? | 08:55 | |
nebuchadnezzar | cono: as lizmat just said to me www.reddit.com/r/perl6/comments/bf...ains_seem/ | 08:56 | |
cono: please use perl6.wakelift.de/ for now | |||
08:57
lucs_ is now known as lucs
08:58
dakkar joined
|
|||
cono | got it, thanks! | 08:58 | |
09:03
gregf_ left
|
|||
patrickb | sena_kun: Have you seen my openapi-schema-validate PRs? | 09:07 | |
kawaii: Some days ago I mixed you and sena_kun up, that's why I pinged you about those PRs. Sorry about that. | 09:08 | ||
09:08
gregf_ joined
|
|||
sena_kun | patrickb, not yet... oh, I somehow missed it, sorry... | 09:08 | |
patrickb | sena_kun: Never mind. | 09:09 | |
sena_kun | patrickb, merged, bumped the version too. thank you! | 09:10 | |
kawaii | no problem :) | ||
09:12
rba joined
09:13
abraxxa left
09:14
sono__ left
09:16
abraxxa joined
09:19
jjmerelo left
09:23
fatguy joined
|
|||
rba | Hi all. I would volunteer to bring perl6.org and it's subdomains back online. Who is on it? | 09:25 | |
lizmat | moritz is on it | 09:26 | |
09:30
rindolf left
09:33
rindolf joined
09:35
jjmerelo joined
09:41
pecastro joined
10:21
jjmerelo left
10:32
domidumont left
10:47
mowcat joined
10:59
Manifest0 left,
patrickb left
11:06
Manifest0 joined
11:33
Manifest0 left
11:36
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:37
arkaitz joined
11:38
arkaitz left,
Manifest0 joined
11:40
zakharyas left
11:43
mowcat left
11:44
lasse left
11:48
patrickb joined
12:03
BrassLantern joined,
BrassLantern left,
BrassLantern joined
12:05
BrassLantern left
12:07
BrassLantern joined
12:09
BrassLantern left
12:21
domidumont joined
12:32
zakharyas joined
12:38
Peter_R left
12:46
abraxxa left
12:49
abraxxa joined,
abraxxa left
12:50
abraxxa joined
13:04
matias joined,
eaterof left
13:05
eater joined
|
|||
lizmat | could someone respond to twitter.com/GwenDragonTek/status/1...8538600448 ? | 13:20 | |
13:28
jaldhar left,
jaldhar joined
13:31
lizmat left
|
|||
El_Che | lgtaube: done | 13:31 | |
lizmat: done | 13:32 | ||
.tell lizmat done (twitter) | |||
yoleaux | El_Che: I'll pass your message to lizmat. | ||
elcaro | m: my $b = Blob.new() but role :: { } | ||
evalable6 | (exit code 1) This REPR cannot change type in block <unit> at /tmp/LaqPCIuQu5 line 1 |
||
13:32
netrino joined
|
|||
elcaro | How come Blobs/Bufs can't do roles | 13:33 | |
? | |||
13:33
matias left
13:34
lizmat joined
13:35
matias joined
13:40
MilkmanDan left
13:41
casdr joined,
lizmat left,
lizmat joined
13:42
MilkmanDan joined
13:43
aborazmeh left
|
|||
jnthn | elcaro: Because they're represented in memory as an array, not an object, and so they can't store additional attributes | 13:47 | |
13:52
kurahaupo_ joined
13:54
kurahaupo left
14:00
skids joined
|
|||
elcaro | jnthn: thanks. i'll just put it in a class instead. | 14:02 | |
14:03
holyghost joined
|
|||
lizmat | El_Che++ | 14:03 | |
yoleaux | 13:32Z <El_Che> lizmat: done (twitter) | ||
14:03
domidumont left
14:04
ravenousmoose left
14:12
domidumont joined
14:14
AlexDaniel joined
14:18
ayerhart joined
14:19
uzl joined
|
|||
holyghost | hail. I'm on netbsd, I hope I will be of use if I compile perl6 and put in Xn::Y modules on CPAN | 14:24 | |
lizmat | and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2019/04/23/...ster-down/ | 14:28 | |
holyghost | wordpress++ | ||
14:30
lizmat left
|
|||
patrickb | .tell lizmat The four slots are for GSoC, not GSoD | 14:32 | |
yoleaux | patrickb: I'll pass your message to lizmat. | ||
14:33
lizmat joined,
robertle left
14:34
zacts joined
|
|||
patrickb | lizmat: Also loads of '- by' in the Twitter section | 14:35 | |
14:35
robertle joined
|
|||
lizmat | patrickb++ # fixed | 14:36 | |
yoleaux | 14:32Z <patrickb> lizmat: The four slots are for GSoC, not GSoD | ||
lizmat | patrickb: what was it you said before that | ||
patrickb: ah duh | |||
holyghost | I'm a bit drunk but it seems to have compiled, now installing zef pkgs | 14:40 | |
14:41
fake_space_whale joined
14:44
zacts left
14:49
demanuel left
14:54
ravenousmoose joined,
mowcat joined
14:57
Sgeo joined
14:58
Sgeo_ left
14:59
Sgeo left
15:00
Sgeo_ joined
15:02
uzl left
|
|||
sena_kun | lizmat, "Modern programming language by ." misses `八雲アナグラ` as nickname | 15:03 | |
lizmat | sena_kun++ # fixed | 15:04 | |
15:06
kurahaupo_ left
15:08
domidumont left
|
|||
holyghost | So I guess since the sites are down, that zef does not update mirrors ... ? | 15:09 | |
sena_kun | there is a delay of 6 miutes. :( | 15:10 | |
holyghost | ok, zef cannot find SDL2::Raw | ||
15:12
domidumont joined
|
|||
holyghost | MoarVM panic: Unable to allocate memory for callback closure | 15:19 | |
sena_kun also sees a lot of "Perl&nnbsp;6" in this weekly <- lizmat | |||
holyghost | looks like a bug on google, I'll try to fix tomorrow | 15:21 | |
15:22
holyghost is now known as holyghost[afk]
|
|||
timotimo | holyghost[afk]: could be an infinite recursion | 15:24 | |
15:24
rba_ joined
15:26
rba left
|
|||
holyghost[afk] | I'll check | 15:27 | |
Seems to happen only when I do not enter a perl6 file argument | 15:29 | ||
15:29
holyghost[afk] is now known as holyghost
|
|||
holyghost | For the rest 2018.10 is fine on netbsd | 15:30 | |
I couldn't get a similar version as the sites are down | |||
Coolness, I can hack somewhat tomorrow :-) | |||
lizmat | sena_kun++ # fixed, I think | 15:31 | |
15:31
rba joined
|
|||
guifa | Is there a shorthanded way to do with @foo { for @_ { … } } ? | 15:32 | |
sena_kun | lizmat, now it's safe. \o/ Thanks a lot for all your efforts! | ||
guifa | Just for @foo { … } will sometimes get an Any value that the with @foo protects against | ||
holyghost | lizmat++ | 15:33 | |
I'; going to drink something now I think, I'm too tired of this morning's trip | 15:34 | ||
15:34
rba_ left
15:36
patrickb left
15:41
kensanata left
|
|||
guifa | lizmat: interesting to see your comment on the Fluent ycombinator post. Don’t forget that I have a mostly working port of for P6 :-) It’ll be totally finished once I get the date stuff worked out for Intl::CLDR | 15:43 | |
15:44
fatguy left
|
|||
lizmat | guifa: please remind me which response that was? | 15:44 | |
guifa | news.ycombinator.com/item?id=19680662 | grep ‘lizmat’ | 15:45 | |
15:45
khisanth_ left
|
|||
timotimo | wouldn't it be funny if it'd actually literally accept |grep"foobar" in the url and DWYM | 15:49 | |
lizmat | guifa: ah, that one, :-) | ||
guifa | timotimo: I bet someone has made a browser extension for that | 15:52 | |
15:53
Altai-man_ joined
15:54
sena_kun left
15:57
filoteo_ joined
15:59
khisanth_ joined
16:03
zacts joined
16:05
fake_space_whale left
16:07
zakharyas left
16:08
jaldhar left
|
|||
filoteo_ | how to determine graphème width, for terminal use ? | 16:10 | |
lizmat | filoteo_: I think that's very implementation dependent, but like to be proven wrong | 16:11 | |
afaik, each manufacturer has freedom as to how to implement rendering | 16:12 | ||
filoteo_ | ascii=1, cjk=2, many math syms=2 chars some 3, and ancient script rare graphème like 5 or 6 | ||
timotimo | there is an "east asian width" property that is interesting for some cases, but it probably won't do much for emoji and such | ||
and yeah, the terminal itself has to have its own implementation, and you better not get it wrong :) :) | |||
(you most probably will) | |||
guifa | Do you mean number of columns displayed in the terminal or number of code points used to compose it? | ||
filoteo_ | the number of columns on the terminal | 16:13 | |
like ⌬ I get two how many you get ? | 16:14 | ||
guifa | That should be both font and terminal dependent. I’m not sure if there’s actually a way to calculate it without knowing a lot about the environment | ||
filoteo_ | then ⨌ I get 3 and 𒁏 get 7 or so, how about you how does it show in your terminal ? | 16:15 | |
guifa | GOogling around I found that there’s a POSIX function wcswidth that might be of help | 16:16 | |
16:17
robertle left
|
|||
guifa | That might not be a bad module for someone to make. There is a P5 implementation | 16:17 | |
guifa is afk& | |||
filoteo_ | that's the oldy widechar func, I am suspicious of it | ||
not to mention some (common) terminal render such ༽ overspread upper and lower term lines | 16:18 | ||
lizmat | yeah, that seems very pre-Unicode :-) | 16:19 | |
filoteo_ | I have yet to hear about row-width, and I supect some east-asian script have it more common | 16:20 | |
like tibetan stacking letters | |||
and probably other languages, like at least 10 millions people | |||
some terminal seems to fit them, but they become way too small for proper readability | 16:21 | ||
nebuchadnezzar | erf, I can't remember where I read an article speaking about the first fail with Object Oriented Programming which is it's name, it should be Message Oriented Programming. I'm sure I read it on a perl6 blog but I missed to save and annotate the link :-( | 16:22 | |
filoteo_ | I think Alan Kay @nebuchadnezzar | 16:26 | |
recently read about it and was sorry or something like that | 16:27 | ||
may be he had smalltalk in mind, not sure what he thought | |||
jnthn | nebuchadnezzar: Maybe wiki.c2.com/?AlanKayOnMessaging is what you're looking for | 16:28 | |
16:33
Manifest0 left
16:37
vrurg left
16:38
vrurg joined,
Manifest0 joined
16:39
lucasb joined
|
|||
lucasb | o/ | 16:55 | |
New module is "Command::Despatch" with an E, in the weekly :) | |||
AlexDaniel | AAAAAAAA! | 16:59 | |
lucasb: iirc it's a valid British spelling, but it bothers me a lot :) | 17:01 | ||
lucasb | it reminds me the name of that popular song... Despatchito! :D | ||
AlexDaniel | perfect name for a module | 17:02 | |
17:02
lizmat left
17:03
lizmat joined
17:07
[Sno] joined
17:17
filoteo_ left
17:18
zacts left
17:24
lichtkind joined
17:27
dakkar left
17:32
sauvin left
|
|||
kawaii | AlexDaniel, lucasb: I'm glad that my module caused just the right amount of discomfort :) | 17:33 | |
17:34
domidumont left
17:40
zacts joined
17:41
domidumont joined
17:44
abraxxa left
|
|||
lichtkind | does anybody know whats with perl6.org? | 17:44 | |
17:44
abraxxa joined
|
|||
Altai-man_ | lichtkind, twitter.com/perl6org/status/1119234204221562882 <- | 17:44 | |
lichtkind | thank you | 17:45 | |
17:46
domidumont left
|
|||
lucs | nebuchadnezzar: Could this be the blog post you saw?: 6guts.wordpress.com/2016/11/25/per...ood-thing/ | 17:46 | |
(even if it isn't , it's worth a read, eh) | 17:47 | ||
17:50
abraxxa left,
abraxxa joined
17:51
buffet joined
|
|||
woolfy | Back online, thanks to Dan Wright of The Perl Foundation: perl6.org/ www.perl6.org/ docs.perl6.org/ | 18:02 | |
It's not the link to the original server, but to the temporary (new?) server. | 18:04 | ||
Altai-man_ | \o/ | 18:07 | |
woolfy | I mean, the dns has been changed by Dan Wright, and it is now pointing to the new server. | ||
Altai-man_ feels we need to get a bunch of people to discuss&implement improvements to the infrastructure | 18:09 | ||
s/get/gather/ | |||
AlexDaniel | Altai-man_: yes and github.com/perl6/problem-solving/issues/9 | 18:13 | |
Altai-man_ | AlexDaniel, great! Thanks for the link | ||
AlexDaniel, isn't it focused on security rather than reliability? | 18:14 | ||
AlexDaniel | Altai-man_: well, if a hacker downs a server then suddenly it's reliability :) | 18:15 | |
Altai-man_: but yes, it's a slightly different ticket, but maybe a proper solution should consider security too | |||
18:20
matias left
|
|||
guifa | filoteo: do you have an example of a CLI program that is row-height aware? | 18:29 | |
err filoteo_ | |||
18:31
matias joined
18:32
telex left
18:34
telex joined
|
|||
tony-o_ | what do you mean by row-height aware? | 18:35 | |
18:39
Black_Ribbon joined,
abraxxa left
18:40
abraxxa joined
|
|||
tony-o_ | there is this: linux.die.net/man/3/getmaxyx - coupled with font info might give row height | 18:42 | |
or close | |||
18:49
Altai-man_ is now known as sena_kun
18:57
abraxxa left
18:58
robertle joined,
abraxxa joined
19:01
zacts left
|
|||
discord6 | <Tyler (Aearnus)> Cheers woolfy! | 19:20 | |
19:26
abraxxa left
19:28
Manifest0 left
|
|||
guifa | tony-o: filoteo_ was looking for a way to know how wide (in columns) or high (in rows) a given character would appear when printed to a terminal. I don’t think anyone has done anything with height-awareness as most terminals these days can handle LTR and RTF text, but assume horizontal text that is 1-em tall. | 19:28 | |
19:30
abraxxa joined
19:36
Manifest0 joined
19:43
Manifest0 left
19:47
Manifest0 joined
19:57
epony left
19:58
epony joined
20:08
lookatme_q joined
|
|||
japhb | guifa: That's my understanding as well, but I'd love to be proven wrong, because I find terminal font sizing to be *wildly* variable between operating systems and terminal rendering libraries. Which makes writing libraries like Terminal::Print a pain. | 20:11 | |
(Right now Terminal::Print is relatively low level, so tries not to actively break layout that higher layers get right, but it also does not attempt to guess the width of characters or do any auto-layout.) | 20:12 | ||
guifa | japhb: I think the only solution would basically involve a entire rewrite of how terminals work (at least to assume that horizontal characters could be > 1 em tall or vertical characters could be >1em wide) | 20:13 | |
If you have a string of horizontal text, and one character is 2 high, does it overwrite the char above or below to fit? And if that one above or below is two high, does the “left over” get deleted or stay partially visible (despite not being an independent character that can be selected) | 20:14 | ||
timotimo | may want to have a quick look at arcan :3 | 20:15 | |
japhb | guifa: The answer to all of those I think is "it depends". :-( | 20:16 | |
timotimo: This thing? github.com/letoram/arcan | 20:18 | ||
timotimo | that's the one | ||
i'm impressed by its approach | |||
but i haven't had the opportunity to actually dig in | |||
20:18
abraxxa left
|
|||
timotimo | you know | 20:19 | |
there's hundreds of dozens of millions of nopastes/pastebin services | |||
but i don't think there's a tailbin yet? | |||
guifa | Right. It would probably require unicode characters to get a new property and I don’t think that’s one they’d be too inclined to add because the answer might depend on whether it’s in a vertical or horizontal context, for instance. | ||
timotimo | i.e. you point a growing file at the site using some tool and others could watch it grow in their web browser or by curling or whatever | 20:20 | |
20:20
molaf joined
|
|||
guifa doesn’t know why he never made a hash pretty print sub until today. | 20:24 | ||
timotimo | have you seen Data::Dump::Tree? | 20:26 | |
it's super pretty | |||
guifa | d’oh. Thankfully I didn’t spend too much time on mine ha | 20:29 | |
I had just been using dd which wasn’t prettified | 20:30 | ||
20:33
Sgeo__ joined
|
|||
timotimo | aye, dd just uses .perl | 20:34 | |
20:37
Sgeo_ left,
robertle left
20:39
mowcat left
|
|||
guifa | can custom control flow operators only be done with slangs or can they be defined with regular subs? | 20:39 | |
20:41
ilbelkyr_ left
|
|||
gfldex | guifa: it depends. What do you want to do? | 20:42 | |
20:45
ilbelkyr joined
|
|||
guifa | gfldex: a with/for combination. The XML method .elements returns (Any) if there aren’t matching children, which if you say for $xml.elements(:tag<matchesnothing>) { … } you still get a single run of the loop because the Any scalar then gets coerced into a list with a single element: the type obejct Any | 20:46 | |
Can protect against that be doing with $xml.elements(…) { for @_ { … } } but… that’s fugly | |||
especially if you have to nest it once or twice | |||
I could write a wrapper function that captures the Any return and passes Nil instead, but I’d need to do that on a per-method basis, or if I write it more generally, then I’d have an extra sub call: for nil-if-any( $xml.elements(…) ) { … } which is only marginally nicer looking | 20:49 | ||
sena_kun | m: my $a = (Any); for $a.grep(*.defined) { .say } | ||
evalable6 | |||
gfldex | guifa: if you want a keyword followed by a container and a block, like with `for`, you have to create a slang. | ||
you could guard it with a multi sub that does the tranform you need | 20:50 | ||
sena_kun | probably the easiest option without creating a specific and ugly bycicle with slangs/patching | ||
m: my $a = (Any); for $a.grep(so *) { .say } | |||
evalable6 | |||
sena_kun | and not so type-heavy, and doesn't add a level of indentation | 20:51 | |
s/type/typing/ | |||
20:52
molaf left
|
|||
sena_kun | guifa, what do you think about ^? | 20:53 | |
guifa | the .grep(so *) I think would be the cleanest. I hadn’t thought of that for some reason | ||
sena_kun | :) | ||
gfldex | m: my \e = (Any,); multi sub guard((Any,)) { () }; multi sub guard(\a) { \a }; for guard(e) { say "run!" } | 20:56 | |
evalable6 | |||
gfldex | guifa: ^^^ A better name as guard for guard would be better. | ||
Also you could guard against other nasties by adding more multies. | 20:59 | ||
Or just wrap the bloody thing. :) | 21:00 | ||
guifa | Haha. I know. All of this would have been solved if the XML returned Nil for inexistant matches | 21:01 | |
nebuchadnezzar | lucs: thanks, it was that post from jnthn :-D | ||
guifa | Actually, that is probably a good general question that I might make on SO as well for more general audience | 21:02 | |
gfldex | guifa: it has to return Empty. Nil will iterate once. | ||
guifa | Huh, weird. In my tests for Nil { } didn’t iterate | 21:03 | |
gfldex | if it is bound, it will | ||
guifa | But weird … now it is | ||
nebuchadnezzar | jnthn: thanks for sourcing the Alan's quote you did in 6guts.wordpress.com/2016/11/25/per...ood-thing/ :-D | ||
guifa | But actually that is a more general Q that I ought to probably post on SO for the more general audience | 21:04 | |
nebuchadnezzar | hmm, interesting, as a non english native I was wondering if it was “thanks for sourcing the quote you did” or “thanks for sourcing the quote you made” | ||
lucs | nebuchadnezzar: Apparently, he didn't recognize it when you mentioned it :) | ||
guifa | When should a sub/method return (Any) and when should it return Nil? Because both seem to get used in similar ways. | ||
sena_kun | Nil when there is nothing, `(Any)` when there is a single element of something and it is not initialized | 21:05 | |
nebuchadnezzar | lucs: but he gave me the source of the quote: “I’m sorry that I long ago coined the term “objects” for this topic because it gets many people to focus on the lesser idea. The big idea is “messaging”…” | ||
timotimo | i would actually return Empty instead of Nil | ||
gfldex | m: sub nilish() { Nil }; for nilish() { say 'oi‽' } | ||
evalable6 | oi‽ | ||
timotimo | when there's nothing | ||
lucs | nebuchadnezzar: it took me a while to find, I knew I'd read something like that in the past but couldn't remember where. | ||
timotimo | guifa: .grep(so *) will not do what you mean | ||
m: say so * | |||
evalable6 | { ... } | ||
lucs | nebuchadnezzar: Yeah, Alan Kay. | ||
timotimo | oh | ||
apparently it will. okay never mind! :) | |||
sena_kun | timotimo, yes, that's an option too... then what about Nil? :) | 21:06 | |
timotimo | Nil can be returned when you want the "returns a container to its default value" semantics | ||
i think Nil is a sensible return value for when you're expecting to get an element, but it's not there ("not in list") | |||
and Empty is for when you expect a list, but there are no elements to give back | |||
guifa | So basically, use Empty as the list-y Nil | 21:07 | |
21:08
sena_kun left
|
|||
guifa | I’m going to post it on SO later if anyone wants to ellaborate on it | 21:09 | |
21:14
matias left
|
|||
nebuchadnezzar | lucs: jnthn: thanks, I could made my answer on #mastodon ;-) | 21:18 | |
21:18
_jrjsmrtn joined
|
|||
nebuchadnezzar | lucs++ | 21:18 | |
jnthn++ | |||
21:19
__jrjsmrtn__ left,
skids left
|
|||
lucs | nebuchadnezzar: Hey, you're welcome | 21:20 | |
21:33
zacts joined
|
|||
gfldex | m: sub return-a-list( --> List:D ) { Nil }; for return-a-list() { say 'Should this happen?' } | 21:38 | |
evalable6 | Should this happen? | ||
gfldex | guifa: please note ^^^ | ||
22:05
zacts left
22:08
nekomune_ joined,
nekomune left
22:10
nekomune_ left
22:16
nekomune joined
|
|||
kawaii | does anyone know why when I use my Test datasouce I get an array and why when I use my DBI one I get a nested array? 🤔 | 22:20 | |
github.com/kawaii/p6-pokeapi/blob/...pm6#L8-L17 | |||
github.com/kawaii/p6-pokeapi/blob/....pm6#L5-L8 | |||
the DBI one is literally pulling `["default", "alolan"]` from the database field | 22:21 | ||
yet I end up with something like `[[default alolan]]` | |||
a nested array, when the Test datasource takes `my @forms = <default alolan mega altered>;` and gives me the correct answer of `Array @forms = ["default", "alolan", "mega", "altered"]` | 22:22 | ||
timotimo | it's from-json's fault | 22:27 | |
it returns the result itemized | |||
you can my @forms = from-json($query.row)<> | |||
.list should also work instead of <> | |||
kawaii | hey that fixed the nesting! | 22:29 | |
`[default alolan]` isn't quite right still | |||
timotimo | probably just the .gist instead of the .perl | 22:31 | |
kawaii | ah you | 22:32 | |
were right | |||
`Array $forms = $["default", "alolan"]` :) | |||
Juerd | "Only isolated underscores are allowed inside numbers" | 22:47 | |
Why is that? This seems oddly specific... | 22:48 | ||
22:48
lucasb left
23:03
Sgeo__ left
23:05
Sgeo joined
23:11
rindolf left
23:15
ufobat_ joined
23:17
ufobat left,
sena_kun joined
23:19
Praise- joined,
Praise- left,
Praise- joined,
Praise left
23:21
rba_ joined
23:23
thundergnat left
23:24
rba_ left
23:25
rba_ joined,
rba_ left
23:26
rba_ joined,
rba_ left,
rba_ joined,
rba_ left,
rba_ joined
23:28
rba_ left
23:36
rba_ joined
23:38
pecastro left
23:39
AlexDani` joined
23:41
AlexDaniel left
23:42
rba_ left
23:48
rba_ joined
23:52
TimToady_ is now known as TimToady,
TimToady left,
TimToady joined,
cpan-p6 left
23:53
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
23:56
sena_kun left
23:58
rba_ left,
rba_ joined
23:59
rba_ left
|