Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from Instant to Date in Rakudo #2653

Closed
p6rt opened this issue Feb 26, 2012 · 5 comments
Closed

Conversion from Instant to Date in Rakudo #2653

p6rt opened this issue Feb 26, 2012 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 26, 2012

Migrated from rt.perl.org#111356 (status was 'resolved')

Searchable as RT111356$

@p6rt
Copy link
Author

p6rt commented Feb 26, 2012

From @masak

<gfldex> there are a few things missing in Temporal, though
<gfldex> like Date.new(now);
<gfldex> you have to do Date.new(DateTime.now)
<masak> how about Date.today?
<masak> if it's missing, that's an omission :)
<masak> yeah, I want Date.today. that makes perfect sense.
<masak> nom​: say Date.today
<p6eval> nom 9d39e8​: OUTPUT«2012-02-26␤»
<masak> oh! there it is! :)
<masak> we could add Date.now as a synonym, but that feels only half-important.
<gfldex> nom​: say Date.new(now);
<p6eval> nom 9d39e8​: OUTPUT«Default constructor only takes named arguments [...]
<masak> nom​: say Date(now)
<p6eval> nom 9d39e8​: OUTPUT«Method 'Date' not found for invocant of
class 'Instant' [...]
<masak> arguably that should work.
* masak submits rakudobug
<jnthn> masak​: You implement method postcircumfix​:<( )> in Date.
<masak> ooh
<jnthn> I'm pretty sure I already wired up that case :)

@p6rt
Copy link
Author

p6rt commented Aug 10, 2014

From @perlpilot

On Sun Feb 26 09​:00​:11 2012, masak wrote​:

<gfldex> there are a few things missing in Temporal, though
<gfldex> like Date.new(now);
<gfldex> you have to do Date.new(DateTime.now)
<masak> how about Date.today?
<masak> if it's missing, that's an omission :)
<masak> yeah, I want Date.today. that makes perfect sense.
<masak> nom​: say Date.today
<p6eval> nom 9d39e8​: OUTPUT«2012-02-26␤»
<masak> oh! there it is! :)
<masak> we could add Date.now as a synonym, but that feels only half-
important.
<gfldex> nom​: say Date.new(now);
<p6eval> nom 9d39e8​: OUTPUT«Default constructor only takes named
arguments [...]
<masak> nom​: say Date(now)
<p6eval> nom 9d39e8​: OUTPUT«Method 'Date' not found for invocant of
class 'Instant' [...]
<masak> arguably that should work.
* masak submits rakudobug
<jnthn> masak​: You implement method postcircumfix​:<( )> in Date.
<masak> ooh
<jnthn> I'm pretty sure I already wired up that case :)

See rakudo/rakudo@b86a152

Not sure we should have a postcircumfix on Date when we can easily get what we want from .new()

-Scott

@p6rt
Copy link
Author

p6rt commented Aug 10, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 11, 2014

From @masak

Yeah, I'm not sure either.

// Carl

On Sun, Aug 10, 2014 at 7​:27 AM, Jonathan Scott Duff via RT
<perl6-bugs-followup@​perl.org> wrote​:

On Sun Feb 26 09​:00​:11 2012, masak wrote​:

<gfldex> there are a few things missing in Temporal, though
<gfldex> like Date.new(now);
<gfldex> you have to do Date.new(DateTime.now)
<masak> how about Date.today?
<masak> if it's missing, that's an omission :)
<masak> yeah, I want Date.today. that makes perfect sense.
<masak> nom​: say Date.today
<p6eval> nom 9d39e8​: OUTPUT«2012-02-26␤»
<masak> oh! there it is! :)
<masak> we could add Date.now as a synonym, but that feels only half-
important.
<gfldex> nom​: say Date.new(now);
<p6eval> nom 9d39e8​: OUTPUT«Default constructor only takes named
arguments [...]
<masak> nom​: say Date(now)
<p6eval> nom 9d39e8​: OUTPUT«Method 'Date' not found for invocant of
class 'Instant' [...]
<masak> arguably that should work.
* masak submits rakudobug
<jnthn> masak​: You implement method postcircumfix​:<( )> in Date.
<masak> ooh
<jnthn> I'm pretty sure I already wired up that case :)

See rakudo/rakudo@b86a152

Not sure we should have a postcircumfix on Date when we can easily get what we want from .new()

-Scott

@p6rt p6rt closed this as completed Apr 7, 2016
@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

@diakopter - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Todo label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant