Project

General

Profile

Actions

Bug #5393

closed

some style fixes in enum.c docs

Added by bt (Bernd Homuth) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
-
Backport:
[ruby-core:39886]

Description

There isn't much consistency in the docs when it comes to blocks. So I decided to go with the style that is most often used: {|obj| block }
No spaces, only around the block.

I can fix the other classes as well but before I do this let me know if this is the preferred style.

What about multiline blocks? They tend to look ugly. Curly braces everywhere and never ending chains.
See https://github.com/ruby/ruby/blob/trunk/enum.c#L2359-2364


Files

Updated by drbrain (Eric Hodel) over 12 years ago

  • Category set to doc
  • Target version changed from 1.9.3 to 2.0.0

Updated by drbrain (Eric Hodel) over 12 years ago

=begin
I would prefer spaces for both the arguments and the block like ((|{ |args| block }|)) as it seems to be the modern style over no space between the curly-brace and the pipe like ((|{|args| block }|)) as it seems to older.

If you submit just a patch for enum.c I can give you better feedback for future clean-ups.
=end

Updated by bt (Bernd Homuth) over 12 years ago

oh, I added a patch file but that must have gone awol. Sorry for that. I'll repost as soon as I changed styles later today.

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • ruby -v changed from ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] to -

Hi,

(11/10/04 8:28), Eric Hodel wrote:

I would prefer spaces for both the arguments and the block like
((|{ |args| block }|)) as it seems to be the modern style over no
space between the curly-brace and the pipe like ((|{|args| block}|))
as it seems to older.

Oops, you call me an old man ;-)
Is it in fashion these days, boy?

--
Nobu Nakada

Updated by drbrain (Eric Hodel) over 12 years ago

orz

Nobu, I don't mean to make you feel old, but the extra space is the fashion for us young people. :)

Do you think this patch is OK?

Actions #7

Updated by drbrain (Eric Hodel) over 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33480.
b, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • enum.c: Reformat block args to a single standard, { |args| ... }.
    Patch by b t. [Ruby 1.9 - Bug #5393]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0