Slang:Date

Slang adding date literals to source

Slang::Date

A Slang for Raku that adds support for literal dates in ISO-8601 style.

Examples

Replaces the ISO String with a QAST node that generates a call to Date.new...;

my $a = 2023-01-13;
say "Happy Friday the 13th" if  $a.day-of-week == 5;

Invalid dates will error out as expected:

my $b = 2023-01-99;
Day out of range. Is: 99, should be in 1..31
  in block <unit> at -e line 1

Notes

Requires a 4 digit year, 2 digit month, and 2 digit day.

Slang:Date v0.1.0

Slang adding date literals to source

Authors

  • Will Coleda

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Slang::Date

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.