[#71815] [Ruby trunk - Bug #11768] [Open] Add a polymorphic inline cache — tenderlove@...
Issue #11768 has been reported by Aaron Patterson.
tenderlove@ruby-lang.org wrote:
On Thu, Dec 03, 2015 at 10:51:08PM +0000, Eric Wong wrote:
Aaron Patterson <tenderlove@ruby-lang.org> wrote:
[#71818] [Ruby trunk - Feature #11769] [Open] optimize case / when for `nil` — tenderlove@...
Issue #11769 has been reported by Aaron Patterson.
tenderlove@ruby-lang.org wrote:
[#71931] [Ruby trunk - Feature #11786] [Open] [PATCH] micro-optimize case dispatch even harder — normalperson@...
Issue #11786 has been reported by Eric Wong.
Oops, I forgot to free the table when iseq is destroyed :x
On 2015/12/08 12:43, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2015/12/08 13:53, Eric Wong wrote:
[#72028] [Ruby trunk - Feature #11405] [Assigned] [PATCH] hash.c: minor speedups to int/fixnum keys — mame@...
Issue #11405 has been updated by Yusuke Endoh.
mame@ruby-lang.org wrote:
[#72045] Ruby 2.3.0-preview2 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 2.3.0-preview2.
Please add your optimizations before RC1.
SASADA Koichi <ko1@atdot.net> wrote:
On 2015/12/11 18:06, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#72069] [Ruby trunk - Feature #11405] [PATCH] hash.c: minor speedups to int/fixnum keys — mame@...
Issue #11405 has been updated by Yusuke Endoh.
[#72115] Re: [ruby-cvs:60264] duerst:r53112 (trunk): * enc/ebcdic.h: new dummy encoding EBCDIC-US — "U.NAKAMURA" <usa@...>
Hi,
On 2015/12/14 22:34, U.NAKAMURA wrote:
Hi,
[ruby-core:71773] [Ruby trunk - Feature #9098] Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
Issue #9098 has been updated by Nobuyoshi Nakada.
"8 spaces for tab stops" is not enough to make the spec.
When tabs and spaces are mixed, e.g., there are`"\t"*2+"2 tabs"` line and `" "*10+"10 spaces"` line, what should be expected?
1. dedent at the greatest indent column where all lines have a white space.
a tab which includes the column will remain, but spaces between previous tab stop and the column will be removed.
this is the implementation by @bjmllr, and results
`"\t"+"2 tabs"` line and `" "*2+"10 spaces"` line.
2. dedent at the greatest indent column exclusively tabs
a tab which includes the column will remain, and also spaces before the column will be removed.
this is like `kill-rectangle` of Emacs, and I've thought this, and results
`"\t"+"2 tabs"` line and `"10 spaces"` line.
3. expand tabs first
tabs are expanded first before dedent, and results
`" "*6+"2 tabs"` line and `"10 spaces"` line.
4. or, like Andrew M claims, dedent of byte-wise common parts can be an option, I think now.
----------------------------------------
Feature #9098: Indent heredoc against the left margin by default when "indented closing identifier" is turned on.
https://bugs.ruby-lang.org/issues/9098#change-55183
* Author: Prem Sichanugrist
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
tl;dr: I would like to port +String#strip_heredoc+ (http://api.rubyonrails.org/classes/String.html#method-i-strip_heredoc) from Rails and enable it on `<<-` heredoc.
Hi,
I've been using here document (heredoc) for a while, and I've found out that it's very annoying that the content is always treated as flushed left. Per syntax doc:
Note that the while the closing identifier may be indented, the content is
always treated as if it is flush left. If you indent the content those spaces
will appear in the output.
So, this is the current result if you use heredoc in Ruby:
class FancyHello
def self.hello
puts <<-README.inspect
Hello
World!
README
end
end
FancyHello.hello # => " Hello\n World!\n"
In Rails, the core team has implemented +String#strip_heredoc+, which handles this scenario by remove leading white spaces from the string. However, not many user know that Rails has that method, and instead doing this to get around it:
class FancyHello
def self.hello
puts <<-README.inspect
Hello
World!
README
end
end
FancyHello.hello # => "Hello\n World!\n"
I really think that we could do better on this by removing the leading white spaces, matching +String#strip_heredoc+ method.
So, after the change, I want to be able to do this, and get this result:
class FancyHello
def self.hello
puts <<-README.inspect
Hello
World!
README
end
end
FancyHello.hello # => "Hello\n World!\n"
Note: the behavior on `<<HEREDOC` will stay the same, as I feel like in that case you really want the input to be flushed left.
I'll write up a patch and submit it if you think this is a good idea. Please let me know any question or concern you may have.
Thank you,
Prem
---Files--------------------------------
dedent_heredoc.patch (12.8 KB)
--
https://bugs.ruby-lang.org/