Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Poor man's enum in spec about timezone #31

Open
masak opened this Issue · 0 comments

1 participant

@masak
Owner
<masak> "C<:timezone> is a callable object that takes a C<DateTime> to convert and a C<Bool> that specifies the 
        direction of the conversion: to UTC if true, from UTC if false."
<masak> two things. first: huh?

I actually read this completely wrong the first time. I thought it said that the object should be both a callable and a Bool at the same time. But no; it says that the callable expects two positional parameters.

<masak> second: does this feel like a poor man's enum to someone else?
<masak> the C<Bool> thing.
<moritz> we already have a fitting enum, no?
<moritz> nr: say 'a' cmp 'b'
<p6eval> rakudo 87ad7c, niecza v24-26-g713c785: OUTPUT«Increase␤»
<masak> moritz: no, Increase is not fitting, because this enum is meant to convey "from UTC" or "to UTC", ether of 
        which may be either increasing or decreasing depending on which side of Greenwich you happen to be.

Still, an enumeration should be easy enough to create for this. Its two values could be called fromUTC and toUTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.