[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74325] [Ruby trunk Feature#12173] `Time#till_now`
From:
andrew@...
Date:
2016-03-15 04:54:50 UTC
List:
ruby-core #74325
Issue #12173 has been updated by Andrew Vit.
Tsuyoshi Sawada wrote:
> That is a homonym (as well as a homograph) of the word in question.
I also think "till" is the traditional spelling ("till the cows come home") and I've seen
the apostrophe 'til used more frequently (USA/Canada) in modern writing but I still
prefer "until" anyway.
For reference, ActiveSupport also defines similar methods for numeric classes:
http://api.rubyonrails.org/classes/ActiveSupport/Duration.html#method-i-until
(These are the inverse receiver/types of the proposed method.)
----------------------------------------
Feature #12173: `Time#till_now`
https://bugs.ruby-lang.org/issues/12173#change-57446
* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
It is very frequent to have a time instance:
~~~RUBY
t = Time.now
~~~
and then after some operations, do:
~~~RUBY
Time.now - t
~~~
I propose `Time#till_now`, which is equivalent to:
~~~RUBY
class Time
def till_now; self.class.now - self end
end
~~~
and similar methods can perhaps be defined on `Date` and `DateTime` classes as well. Another candidate for the method name is `until_now`.
Then we can do:
~~~RUBY
t = Time.now
# some heavy operation
puts "It took #{t.till_now} secs."
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>