🦋 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.
raku-bridge <stu002> Are there ways to embed mathematical expressions (e.g. LaTeX) inside pod6 text? I can go some way towards this with Unicode math characters, but expressions generally need something richer. 04:20
Doc_Holliwood m: say ().min 08:00
camelia Inf
Doc_Holliwood why the heck is that Infinity? 08:01
just got bitten by it 08:04
m: my @A = (7, 8, 3, 12, 10);
say gather for 1 .. +@A-1 -> $i { take @A[ 0..$i-1 ].grep( * < @A[$i] ).min };
camelia ( no output )
Doc_Holliwood the heck? that says (7 Inf 3 3) on my computer
Doc_Holliwood m: my @A = (7, 8, 3, 12, 10); say gather for 1 .. +@A-1 -> $i { take @A[ 0..$i-1 ].grep( * < @A[$i] ).min }; 08:07
camelia (7 Inf 3 3)
Doc_Holliwood see? I expected Nil there, or something else that's falsy 08:08
but not Inf
JJMerelo m: my @a = 1,2; .say for @a, |@a 08:19
camelia [1 2]
1
2
JJMerelo m: my @a = 1,2; .say for $[@a, |@a ]
camelia [[1 2] 1 2]
JJMerelo m: my @a = 1; .say for [@a ] 08:32
camelia 1
JJMerelo m: my @a = 1,2; .say for [@a ]
camelia 1
2
JJMerelo m: my @a = 1,2; .say for [[@a ]]
camelia 1
2
JJMerelo m: my @a = 1,2; .say for ([@a]) 08:37
camelia 1
2
JJMerelo m: my @a = 1,2; .say for ((@a))
camelia 1
2
JJMerelo m: my @a = 1,2; .say for @a, 08:38
camelia [1 2]
JJMerelo m: my @a = 1,2; .say for @a,;
camelia [1 2]
JJMerelo m: my @a = 1,2; .say for [@a,]; 08:43
camelia [1 2]
JJMerelo m: my @a = 1,2; .say for [[[@a,]]]; 08:44
camelia [1 2]
JJMerelo m: my @a = 1,2; .say for $[[[@a,]]];
camelia [[1 2]]
Geth doc: 3a7cee5649 | (JJ Merelo)++ | doc/Language/list.pod6
Clarifying single argument rule

Deletes a confusing explanation based on iterators refs #3268 and adds an example to clarify also #600
08:50
doc: df50cbd622 | (JJ Merelo)++ | doc/Language/list.pod6
More clarifications and examples for single argument rule

Hope this finally closes #3268 and closes #600, since it includes links to all relevant documents, and shows exceptions.
linkable6 Link: docs.raku.org/language/list
linkable6 DOC#3268 [closed]: github.com/Raku/doc/issues/3268 [RFE][docs] The documentation about the single argument role is confusing
DOC#600 [closed]: github.com/Raku/doc/issues/600 [docs] Explanation of the "Single Arg Rule"
ab5tract .tell JJMerelo post is (finally) scheduled for tomorrow :D 09:52
tellable6 ab5tract, I'll pass your message to JJMerelo
ab5tract .tell JJMerelo can't wait to read what you think!
tellable6 ab5tract, I'll pass your message to JJMerelo
JJMerelo ab5tract thanks! Checking it. 10:08
tellable6 2020-08-10T09:52:14Z #raku <ab5tract> JJMerelo post is (finally) scheduled for tomorrow :D
2020-08-10T09:52:32Z #raku <ab5tract> JJMerelo can't wait to read what you think!
codesections m: run <ls ..> 10:38
camelia camelia
geth
larry
moritz
nine
timo
zoffix
codesections m: dd '../camelia'.IO.parent 10:39
camelia IO::Path.new("../../camelia", :SPEC(IO::Spec::Unix), :CWD("/home/camelia"))
codesections Isn't ^^^^ a bug? The parent of `../camelia` should be `..`, right? not `../../camelia` 10:40
Oh, maybe that's what the docs mean by saying «the returned parent is the physical and not the logical parent of symlinked directories». I'd read that, but didn't realize it applied to `..` 10:41
m: dd '../camelia'.IO.resolve.parent 10:43
camelia IO::Path.new("/home", :SPEC(IO::Spec::Unix), :CWD("/"))
codesections That's better
nevermind
guifa stu002: I don’t think so. I would honestly personally use a code block, I think, if it got extremely complicated, and make it ASCII art style 12:04
lizmat And another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/08/10/2020-...ey-please/ 12:31
codesections m: class A {has $b}; say A.^methods(:local) 12:34
camelia (BUILDALL)
lizmat m: class A {has $.b}; say A.^methods(:local) 12:35
camelia (b Submethod+{is-hidden-from-backtrace}.new)
lizmat hmmm... why did BUILDALL disappear here 12:36
codesections I was curious about why BUILDALL appeared at all with a `:local` filter 12:38
jnthn Well, most immediately because one is generated per class 12:39
I'm suspecting there's an optimized path when there's nothing to build, and it isn't marked with is-hidden-from-backtrace 12:40
codesections Do you think it should be marked with is-hidden-from-backtrace? Or maybe is-implementation-detail? I'm currently working on a project to scan the docs for methods that show up via introspection but that aren't documented, and that script currently says BUILDALL is missing from 181 types :D 12:44
(Obviously it's easy to exclude it from the script. But that got me thinking about whether BUILDALL _is_ a :local method) 12:45
jnthn I think it should be consistently marked that way 12:51
m: class A {has $.b}; say A.^methods(:local)>>.name
camelia (b BUILDALL)
jnthn Notice that BUILDALL *is* here, just rendered differently due to the mixin 12:52
codesections Right. But you're saying that's a bug? Because it should be consistently marked with is-impelemetation-detail?
(which I know is new) 12:53
jnthn I'm not saying anything about is-implementation-detail at the moment, just the (rather easier) point about is-hidden-from-backtrace
Granted the generated empty method would never show up in a backtrace 'cus it does nothing... :) 12:54
codesections Oh, ok. I didn't realize that is-hidden-from-backtrace is easier than is-implementation-detail.
Does is-hidden-from-backtrace keep it out of ^methods(:local) or just from the backtrace 12:55
jnthn Just from the backtrace
codesections Well, if you think/decide that built-in types should have BUILDALL methods marked with is-implementation-detail, I'd be happy to work on a PR marking them. I am not to the point where I can substantively hack on Rakudo, but I could add marker traits :) 12:57
jnthn I'm not immediately sure if it's in the spirit of `is implementation-detail`, but it feels rightish
guifa lizmat++ 13:31
oddp Oh yeah, it's weekly time! Thanks again! 14:19
khoguan I tried to install p6doc by `zef --force-test install p6doc`. At the end, it said, ===> Installing: p6doc:ver<1.006.d>:auth<perl6>4 bin/ scripts [lwp-get.p6 lwp-download.p6 pod2onepage Extractor.raku] installed to:/usr/local/Cellar/rakudo/2020.07/share/perl6/site/bin 14:31
why is there no p6doc in the rakudo/2020.07/share/perl6/site/bin? 14:32
jdv79 the docs have BUILD-ALL. weird. 14:50
rir Hello Rakuelists. Question X: Can I get a memory-locationish of a Int? Y-ed: How to explain immutability to a beginnerish? 16:07
^ How to demonstrate. 16:09
rypervenche rir: Hi there. Someone will answer you soonish. :) It might be a little bit, depending on how busy everyone is. 16:10
timotimo rakudo has .WHERE which will do that, though memory location of objects will change in moarvm, because it has a generational semispace-copying nursery-and-old-gen GC 16:11
there is a cache for small integers, too, which can confuse things a little
rypervenche m: say 5.WHERE; 16:12
camelia 140711122320384
rockxloose m: say 666.WHY; 16:13
camelia No documentation available for type 'Int'. Perhaps it can be found at
docs.raku.org/type/Int
»
16:13
demostanis Is the right way to find a value from multiple keys in a hash is by doing: for %hash { if $_ eq 'hello'|'world" { say $_ } }; Or is there a shorter way? I feel like Raku has many features but I'm missing some. 16:19
tellable6 2020-08-09T17:21:56Z #raku <melezhik> demostanis: "sparrowfile ... isn't being fetched from an untrusted somewhere else" - correct
timotimo "a" value from multiple keys?
you want to find keys at which the hash has the desired value? 16:20
m: my %foo = <one bloop two bleep three hello four noway five yesway six world seven hello>; .keys.say for %foo.grep(*.value eq 'hello' | 'world') 16:21
camelia (six)
(three)
(seven)
timotimo m: my %foo = <one bloop two bleep three hello four noway five yesway six world seven hello>; .key.say for %foo.grep(*.value eq 'hello' | 'world')
camelia seven
six
three
rypervenche rir: As for immutability, it basically means that "it can't be changed/updated". A simple example would be with a list (immutable) and an array (mutable)
demostanis Yep, 'a', I forgot to add a 'last'
I only want one value
timotimo ah
demostanis Thanks, that's what I was looking for
timotimo m: my %foo = <one bloop two bleep three hello four noway five yesway six world seven hello>; .say for %foo.first(*.value eq 'hello' | 'world')
camelia seven => hello
demostanis Does the Whatever operator creates a subroutine? 16:22
timotimo basically, yeah
rir @timotimo: If nothing is happening in a REPL, I would think the mem-object would not move. ?? And though the concept is apt for constants, I think the key to understanding is more with vars and mem-locations, containers, identifiers, boxing, and the thing/value itself. (I'm getting 'boxing' for Sather, IIRC.)
rypervenche m: my @list := (1,2); say @list.WHAT; @list[0] = 10;
camelia (List)
Cannot modify an immutable List ((1 2))
in block <unit> at <tmp> line 1
rypervenche m: my @array = (1,2); say @array.WHAT; @array[0] = 10;
camelia (Array)
timotimo rir: i'm not sure i understand; if your program is doing absolutely nothing, things shouldn't move 16:24
demostanis WhateverCode is Code is Callable {} 16:24
rir timotimo: I'm new enough with Raku, that I wanted to be sure before I demostrate; my kid is reading a python book that basicly says "This is an immutable, which means it can't be changed. This is how you change this ...". He is confused, I just wanted to be doubly sure. Thanks. rypervenche, thanks. 16:30
guifa loves it when peopel write standards documents and hand wave how stuff should be calculated 16:35
GMT time formatting is given by a time pattern, but then in their examples, the time pattern is shortened as if by magic 16:36
ldv87 Hi !!!! 16:58
someone knows how to do a basic auth with the package WWW 16:59
??
i want to use the option that i use on the linux terminal
curl -u $apikey: www.something.com 17:00
rypervenche You might want to look into HTTP::UserAgent. 17:01
ldv87 Hi rypervenche!!! 17:02
i see already but i don't understand how what i need of it lol
for the page that i want to use 17:03
dont have a user and password, only a single key 17:04
my command is very simple 17:05
curl -u $apikey: api.planet.com/data/v1/item-types/...73008_0f4a
where apykey has to be replaced with a string
demostanis HTTP auth works with headers. So you simply need to specify 'Authorization' header. It can easily be done with WWW, 17:11
say get "api.planet.com/...", Authorization => $api-key 17:12
ldv87: ^ 17:13
ldv87 :O
demostanis weekly 17:22
What bot manages it?
timotimo "notable" 17:24
demostanis Thanks
demostanis Sadly HubToDate isn't in Rakudo Weekly :( 17:25
timotimo lizmat mentioned it isn't in the ecosystem 17:27
did you add it to the meta list on the ecosystem repo, or upload it to cpan? 17:28
demostanis Not yet, but I think I'm gonna try to do it today. How do I specify in the META.json a list of commands to execute to properly install HubToDate? 17:33
demostanis Also, when did lizmat mentioned it isn't in the ecosystem? I don't see anything in IRC logs 17:36
Oh ok, in #raku-dev... 17:40
lizmat demostanis: if it's not in the ecosystem, it is invisible 17:46
will mention it next week when it is!
demostanis Ok, thanks, but for HubToDate to install properly, it needs to run scripts as root
to copy rules into /usr/share/hubtodate/rules, set permissions, create configuration files... 17:47
demostanis Is there a way to specify that in the META6.json> 17:47
?
demostanis lizmat: ^ ? 17:51
rypervenche Are there plans to change the META6.json filename? 17:56
codesections There's something with containerization that I'm still not quite getting my head around. 17:56
Why does the first list below flatten, but the second doesn't?
m: my @a = [1, 2, 3]; my @b = [4, 5, 6]; (@a, @b).flat
camelia ( no output )
codesections er
m: say my @a = [1, 2, 3]; my @b = [4, 5, 6]; (@a, @b).flat # first 17:57
camelia [1 2 3]
codesections m: say my %h = a => [1, 2, 3], b => [4, 5, 6]; %h.values.flat; #second
camelia {a => [1 2 3], b => [4 5 6]}
codesections err, say in the wrong place.grr 17:58
m: my %h = a => [1, 2, 3], b => [4, 5, 6]; say %h.values.flat; #second
camelia ([1 2 3] [4 5 6])
CIAvash m: my @a = [1, 2, 3]; my @b = [4, 5, 6]; say [@a, @b].flat # the difference, I think 18:12
camelia ([1 2 3] [4 5 6])
codesections Hmm, but `[@a, @b]` creates an Array of Arrays. `%h.values` creates a Seq of Arrays. 18:17
m: my @a = [1, 2, 3]; my @b = [4, 5, 6]; say Seq(@a, @b).flat
camelia (1 2 3 4 5 6)
CIAvash m: my @a = [1, 2, 3]; my @b = [4, 5, 6]; say [@a, @b].Seq.flat 18:18
camelia ([1 2 3] [4 5 6])
CIAvash probably it depends on how the seq is created
CIAvash m: my @a = [1, 2, 3]; my @b = [4, 5, 6]; say (@a.item, @b.item).flat 18:19
camelia ([1 2 3] [4 5 6])
demostanis lizmat: I'm not sure that HubToDate would fit in the p6c ecosystem, it isn't a module meant to be used in one's code, but more like a program for anyone to use, even people without much experience with Raku. It would however fit well in Rakudo Weekly as it's written in Raku. 18:25
El_Che I don't think there is something wrong with offering apps through p6p
META6.json knows how t handle script files 18:26
demostanis How do I handle script files in META6.json? And how can I tell it must be installed as root? 18:28
El_Che root you can't control
demostanis It won't work without root
El_Che and with sudo? 18:29
demostanis Yeah, sudo is to get root. What if the user uses doas? 18:30
I can have in my script something checking if uid is 0. But zef would already have downloaded files.
El_Che there a several ways to run as run, so just install it, and document it needs root rights 18:31
(and leave to the the user)
(and exit with a clear message if you encounter ownership problems)
jdv79 why would META6.json change? 18:32
El_Che add your script in a bin/ directory
demostanis How do I handle scripts anyway?
El_Che docs.raku.org/language/modules#Basic_structure
put them in bin in your tree 18:33
demostanis It's not a module, it's a shell script 18:33
El_Che and I guess you could use "provides"
is there should be some examples in the ecosystem 18:36
demostanis It requires to run a shell script as root to create folders and copy default rules. It has a Raku script in bin/ folder to run the CLI
jdv79 probably resources would be teh place to put non-raku files
El_Che modules.raku.org/dist/Bailador:cpa...6.json#L88 18:37
resources there
Provides here: github.com/jnthn/p6-app-installerm...6.json#L13 18:38
demostanis Oh ok, thanks.. But Zef won't execute the shell script in 'resources'? 18:40
El_Che execute?
demostanis It needs to execute a shell script
El_Che at install time?
demostanis Yes 18:41
jdv79 its not like rpm or apt or whatever - zef operates without system privs
El_Che docs.raku.org/language/modules#Pre...the_module
have a look at "If your module requires extra processing"
however, if your app does weird stuff at install time it will get banned by everyone with some security sense 18:42
demostanis jdv79: I know, I was recommended to put it in the ecosystem, knowing it may not work
It just copies files without overwritting
El_Che to system locations? 18:43
if that's the plan: don't 18:44
demostanis So I don't put it in the ecosystem??
El_Che if it just needs a location, it can be copied to ~/.raku
if you copy to system locations, don't release it until you fix it
demostanis It musn't be placed to user directory 18:45
El_Che claim a directory in /opt or /usr/local if you want a global install
but don't touch system dirs
jdv79 why not a user dir? 18:47
demostanis It will install software as root, using user-provided commands. If anyone but root can write to files (thus changing the commands which will be ran), that's a security issue
jdv79 now i'm curious what this "thing" is
demostanis github.com/demostanis/hubtodate 18:48
El_Che so, the user can't change files he himself installed 18:49
I don't see much the security problem there, unless it's no a user run service/program but a system one
in that case deb/rpm/docker would be a better fit 18:50
e.g. if I want to run hubtodate on my laptop as the only user (with the files in my home), what is the risk there
jdv79 just skimming it - there is nothing that requires root per se. many frameworks/apps/tools have multiple locations that can be used for fs/config stuff 18:51
El_Che what bit needs root?
lizmat demostanis: App::Mi6 is an app with similar characteristics, and it lives in the ecosystem? 18:52
afk again&
El_Che my 2c: whatever your app does, if it doesn't really needs root for a very valid reason, people won't even try the app 18:53
I know I wouldn't
demostanis El_Che: What you're telling is as if /etc/apt/sources.list could be placed in user directory 18:54
El_Che I am telling you that there is no way I would let an app touch apt config 18:55
demostanis My app doesn't touch apt config
El_Che /etc/apt/sources.list ?
demostanis and apps can't touch apt config because it's root-owned 18:56
Same for HubToDate
El_Che you don't want to write to /etc/apt/sources.list, just read it?
by default is 664, so world readable
jdv79 you don't need root during install but you could require it at runtime so you can call apt/rpm/etc... 18:57
demostanis No that was a comparison...
My app doesn't call apt
jdv79 dpkg, whatever
El_Che ok, not being difficult, just missing the root part
demostanis Using dpkg depends on the user 18:58
El_Che ok, you use dpkg
jdv79 github.com/demostanis/hubtodate/bl...xample#L23 for instance is about runtime, not installation of hubtodate
El_Che what jdv79 says
jdv79 you could jsut install it and it'll be painfully clear, if your error handling is good, what happened:)
El_Che or use sudo as a failback 18:59
(and be clear why you're asking)
rypervenche jdv79: What the "why would META6.json change" to me? If so, I was just curious if there were plans on removing the 6 from it or if that would just be one of those historical things that stays around. 18:59
thundergnat m: my %h = a => [1, 2, 3], b => [4, 5, 6]; say %h<a b>».Slip.flat; 19:00
camelia (1 2 3 4 5 6)
[Coke] I would expect that we eventually allow META.json but I think there's no rush
tellable6 2020-08-05T10:23:48Z #raku <tbrowder> Thundergnat thanks for auto-abbreviate on rosettacode.org
jdv79 but point is - install of hubtodate itself requiring root and poking about the fs like root just for it's own needs seems like a bad idea
[Coke] anyone report any issues on rakudo.org website lately?
jdv79 raku is still v6 is it not?
thundergnat .tell tbrowder Glad Rosettacode was useful for you. There's a lot of interesting code on there (and some not so good too... ) 19:01
tellable6 thundergnat, I'll pass your message to tbrowder
demostanis HubToDate has its rules folder root-owned and with mode 600 so that a malware can't change them and replace 'install = ...' in rules by a malware which will then execute as root
jdv79 sounds like the sec is a bit too wide there 19:02
[Coke] jdv79: right, but I wouldn't expect us to change the number in the META file going forward (it was "as opposed to 5"), so we don't need to track 7,8,9, etc. and I think it makes sense to eliminate the # if we're not trying to say "not 5"
demostanis Also it needs to be run as root because it may be run inside a crontab, where user can't be prompted for his password 19:03
jdv79 idk, like El_Che said, if a raku module asked me for root to install it - eh, i'd likely not
demostanis Ok so I put it to the ecosystem then?
jdv79 [Coke]: i guess... iirc it was partly to differentiate it from the perl META.json file 19:04
at least at pause i believe 19:05
El_Che demostanis: personally I would keep your code base simple, add a good readme and provide a dockerfile of how you think the app/service should be run
jdv79 yup
demostanis There's a Dockerfile already 19:06
and the README is good
and the Dockerfile runs as ROOT
El_Che demostanis: I use podman, so they don't run as root on my laptop 19:07
the app *thinks* it runs as root though
jdv79 i guess its kinda like the Perl6 -> Raku, we could do it but its not like the old will ever be deprecated. maybe...
wrt to the subdir at cpan i was referring
El_Che demostanis: I think that with me and jdv79 you found a tough audience :)
rypervenche I imagine it might never be deprecated. I just like consistency, and so far Raku has been doing a great job at creating consistency, especially with regards to the name change. 19:15
jdv79 what would it be chagned to?
rypervenche I imagine META.json would be fine.
jdv79 not without breaking hge cpan ecosystem 19:16
jdv79 if it was to be renamed to META.json then an alternative "this is raku" flag would have to be devised for raku dists 19:17
right now, the presence of that file is the sole flag at pause 19:18
Grinnz that can be adjusted (and I did promise to look into that at some point) 19:19
jdv79 maybe looking at the contents of hte meta file
Grinnz the sole flag *should* be the Perl6/Raku subdir
as it is for metacpan et al
jdv79 it used to be. but soemone thought it was a good idea to subvert that.
in pause, specifically
jdv79 perhaps, though it might cause more grief than its worth, we could pair the subdir rename with tne meta file rename 19:23
Grinnz no need to pair anything. pause can recognize both, as other things do 19:23
the switch can be made at one's leisure subsequently
jdv79 i'm not sure using META.json is a great idea cause then we lose the ability to detect, and possible repair, a raku dist not uploaded under Perl6 or Raku 19:31
Grinnz belt and suspenders is certainly a good policy, and there's really no reason to stick to that naming to begin with 19:32
but that's a bikeshed for you all to have ;) 19:33
jdv79 rypervenche: need a better name!:) 19:36
rypervenche That would work too :) I'm probably the least qualified to help with that though. There are so many things I wish I could help with, but I still have a lot to learn about the language, community, and ecosystem. 19:42
demostanis lizmat: Is there still chance I can appear on Rakudo Weekly even if my project isn't on p6c ecosystem? 19:43
jdv79 rypervenche: i'll try to remember 19:49
i was planning on looking at "eco stuff" more deeply soonish 19:50
codesections m: [].Set.raku.say; Set.new.raku.say 20:18
camelia set()
Set.new()
codesections These two empty sets ^^^ have different `raku` print representations. Are they actually different, or do they just happen to print differently? 20:19
(`eqv` returns True)
timotimo sourceable6: Set.new.raku 20:23
sourceable6 timotimo, github.com/rakudo/rakudo/blob/a849...u.pm6#L818
timotimo sourceable6: set().raku 20:24
sourceable6 timotimo, github.com/rakudo/rakudo/blob/a849...u.pm6#L818
timotimo d'oh
of course 20:26
sourceable6: set().perl
sourceable6 timotimo, github.com/rakudo/rakudo/blob/a849...Mu.pm6#L14
timotimo sourceable6: Set.new().perl 20:27
sourceable6 timotimo, github.com/rakudo/rakudo/blob/a849...Mu.pm6#L14
timotimo excuse?
AlexDaniel` sourceable6: Set.new().perl() 20:28
sourceable6 AlexDaniel`, github.com/rakudo/rakudo/blob/a849...Mu.pm6#L15
cpan-raku New module released to CPAN! HTML::Canvas (0.0.9) by 03WARRINGD 20:37
rypervenche Is it possible to use prompt or get and have the result be used directly in a sub? Or will have have to assign the result of prompt/get to a variable and then pass it to a sub so I can then have it check that the signature is correct? 20:42
moritz you can absolutely do something like sub square(Int() $x) { $x * $x }; say square prompt 'Number to square: '; 20:47
note that in this case, I made the argument to sub square coerce to Int
probably not really necessary, since prompt uses val() on its return value, so it'd retuern an IntStr anyway 20:48
rypervenche Oh, very interesting. 20:49
guifa that type of chaining is one of the reasons I love intelligently designed function names 20:55
guifa being able to string along a semi intelligible phrase 20:55
rypervenche Is it possible to divide every element of an array by 100? Possibly using >> 22:08
I guess a map would do what I want. 22:13
lizmat m: my @a = ^10; @a >>/=>> 100; dd @a 22:14
camelia Array @a = [0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09]
lizmat rypervenche ^^
rypervenche Oooh, thanks. 22:19
rypervenche How might I get a subset like: subset NonnegativeRat of Rat where * ≥ 0; but also accept UInt. Is that possible to do in the same subset? 23:39
rypervenche Hmm, I think I was able to get what I wanted with: subset NonnegativeRat of Numeric where { ($_ ~~ UInt or $_ ~~ Rat) and $_ > 0 }; 23:52
Is there a shorter/more idiomatic way of doing this?