Perl 6 is now Raku! Go to #raku and #raku-dev | OLD irc logs of this channel: colabti.org/irclogger/irclogger_log/perl6
Set by AlexDaniel on 14 November 2019.
fluca1978 in my MAIN I would like to accept an optional year value made by four digits, so I thougth this could do the trick sub MAIN( Int :year? where { $_ ~~ / \d ** 4 / || die 'Year must be of four digits!' } ) 08:25
however, this prevents the $year to be optional...
suggestions?
I found it: where { ! .defined || $_ ~~ / \d ** 4 / || die 'Year must be of four digits!' } 08:37
see <docs.raku.org/type/Signature#index...clause> section 'Constraining optional arguments' 08:38
pistacchio Hi, How do I use Django ORM to retrieve a list of ORM Objects grouped by one or more fields and have back only the first record of each group given an arbitrary "order by" clause? 09:40