[#63592] [ruby-trunk - Bug #10009] IO operation is 10x slower in multi-thread environment — normalperson@...
Issue #10009 has been updated by Eric Wong.
3 messages
2014/07/08
[#63682] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/13
[#63703] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/14
[#63743] [ruby-trunk - Bug #10037] Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make — ngotogenome@...
Issue #10037 has been updated by Naohisa Goto.
3 messages
2014/07/15
[#64136] Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb — "Jeffrey 'jf' Lim" <jfs.world@...>
As per subject.
4 messages
2014/07/31
[#64138] Re: Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb
— "Jeffrey 'jf' Lim" <jfs.world@...>
2014/07/31
On Thu, Jul 31, 2014 at 6:03 PM, Jeffrey 'jf' Lim <jfs.world@gmail.com>
[ruby-core:63751] [ruby-trunk - Feature #10040] [Open] `%d` and `%t` shorthands for `Date.new(*args)` and `Time.new(*args)`
From:
nathan.f77@...
Date:
2014-07-15 20:30:23 UTC
List:
ruby-core #63751
Issue #10040 has been reported by Nathan Broadbent.
----------------------------------------
Feature #10040: `%d` and `%t` shorthands for `Date.new(*args)` and `Time.new(*args)`
https://bugs.ruby-lang.org/issues/10040
* Author: Nathan Broadbent
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
----------------------------------------
I'm working on a Ruby application where we have to deal with a lot of dates and times, especially in our test suite. We currently have a couple thousand cases of `Date.new(...)`, and I'm finding the syntax to be a little unwieldy.
What do you think about the following shorthand suggestions?
%d(2014, 7, 15) # Equivalent to: Date.new(2014, 7, 15)
%t(2014, 7, 15, 12, 58, 45) # Equivalent to: Time.new(2014, 7, 15, 12, 58, 45)
I added commas because I think the syntax should also support variables:
year = 2014
month = 7
%d(year, month, 15) # Equivalent to: Date.new(year, month, 15)
I understand that this will operate a bit differently to `%w` and `%i`, but I think that supporting variable evaluation would be a lot more useful.
An alternative proposal would be to add `[]` methods to `Date` and `Time`, so that we could call:
Date[2014, 7, 15]
Time[2014, 7, 15, 12, 58, 43]
This would be still be a little shorter and nicer to use. Please let me know if you would like me to open a feature ticket for `Date.[]` and `Time.[]` methods, instead.
Please let me know your thoughts. Would you find a shorter date/time syntax useful?
--
https://bugs.ruby-lang.org/