🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
tbrowder__ m: sub a {1,1}; a 11:42
camelia ( no output )
lizmat m: sub a {1,1}; dd a
camelia (1, 1)
tbrowder__ m: sub a{1,2}; say a
camelia (1 2)
tbrowder__ m: sub b{[1,2]}; say b 11:43
camelia [1 2]
tbrowder__ m: sub c{(1,2)}; say c 11:45
camelia (1 2)
lizmat () don't create a list, the comma does
hence no difference between returning (1,2) and 1,2 11:46
tbrowder__ m: my $a = (1,2); my $b = [1,2]; say $a.WHAT; say $b.WHAT
camelia (List)
(Array)
Nemokosch m: 1,2 andthen .array.say 11:47
Raku eval Exit code: 1 No such method 'array' for invocant of type 'List'. Did you mean 'Array'? in block <unit> at main.raku line 1
Nemokosch hm, maybe there is only .Array indeed
uh, [...] is a bit more magical than this 11:49
but eventually that also just "enforces array context" on an Iterable
that's why [[[1]]] is exactly the same as [1]
tbrowder__ my problem is that [] and () do not satisfy the "is-deeply" test, but still debugging, maybe i'll try plain "is"... 13:17
my bad, disregard, but i do have a long-standing gripe about tests "is", "is-deeply" and probably others 13:22
if i do a simple test like "is 1, 2" where 1 is "got" and 2 is "expected" 13:24
i get a failure message with results in the REVERSE order which hurts my brain 13:25
error msg something like "expected: blah; got: bluh" 13:26
makes debugging much harder for my aging synapses
i should have entered an issue and a PR long ago 13:27
ugexe the first argument to `is` is the expected 15:28
which then matches the order of the error message mentioning expected first 15:29
as for which argument should come first... depends on which language you are using. In Go you usually have expected first, in perls Test::More 'is' has the actual first. the bad news is all tests written implicitly or explicitly are using the first argument to mean 'expected'. 15:31
so i don't think changing it is something that is on the table 15:32
[Coke] docs.raku.org/type/Test#sub_is says the first arg is "got", not "expected" 15:37
I imagine the ask would be to change the error diagnostic output 15:38
ugexe lol yeah i dunno how i read that backwards 15:46
[Coke] changing the diag output is easy peasy but probably breaks roast. 15:47
ugexe the spirit of the roast tests written that check diag output don't seem to be concerned with the format of the output, just that the output contains certain elements (although they test for those elements in a way that depends on the format of the next) 15:50
[Coke] ... maybe easier if we add in an internal helper sub.
ugexe s/next/text/
[Coke] Yup, I think if 'use Test' tests *do* care about it now, it's correct to update them to just check that the content exists.
I personally don't mind the existing order in either case. 15:51
Nemokosch it's good to see some interest wrt how roast needs to be interpreted 15:56
tonyo rf: what was the name of your web framework? 17:44
lizmat Humming-Bird ? 17:45
tonyo yes ty
rf lizmat++ 21:23
tonyo: Sorry been the busiest week of my life I swear :P
tbrowder__ wrt to my gripe, a named arg or env var would help me if it's too tough otherwise 22:23