Project

General

Profile

Actions

Feature #13393

closed

New comment syntax

Feature #13393: New comment syntax

Added by nobu (Nobuyoshi Nakada) over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:80518]

Description

Now ruby has 2 comment syntax, #... and =begin..=end, but they are line-oriented both.
This is a proposal of a new, very visible, inline comment syntax.

Turning on highlight mode (i.e., \e[1m) starts a comment and turning off (i.e., \e[m) ends it.
This visualizes comments very much.

https://github.com/nobu/ruby/tree/feature/highlight-comment


Files

comment-ng.png (63.2 KB) comment-ng.png current version nobu (Nobuyoshi Nakada), 04/01/2017 07:09 AM
comment-ok.png (24.6 KB) comment-ok.png proposed version nobu (Nobuyoshi Nakada), 04/01/2017 07:10 AM

Updated by normalperson (Eric Wong) over 8 years ago Actions #1 [ruby-core:80519]

wrote:

Turning on highlight mode (i.e., \e[1m) starts a comment and turning off (i.e., \e[m) ends it.
This visualizes comments very much.

+1 Please commit ASAP. This speeds up the parser 300% and load
times on my app decreased by 41%. There is also huge memory
savings, too!

Updated by ko1 (Koichi Sasada) over 8 years ago Actions #2 [ruby-core:80520]

We should use such syntax for literal syntax such as frozen one (with blue color).

Updated by shevegen (Robert A. Heiler) over 8 years ago Actions #3 [ruby-core:80521]

I like colours. Even on first april so I have to take it almost literally as a real proposal.
(Actually after waking up, I forgot which day it was; the Assignee set here helped me
understand the proposal. :D )

It's one of the few things I like about cmake - while autoconf makes it more convenient for
people to adapt their project via readable commandline-switches (as opposed to cmake -D
something such as -DCMAKE_INSTALL_PREFIX= versus configure --prefix= ), the default colours
used by cmake are IMO quite nice.

Updated by stomar (Marcus Stollsteimer) over 8 years ago Actions #4 [ruby-core:80524]

I'd like to see colors allowed in method names. In the long run, all "bang methods" could be replaced by "red methods", to even better visually signal their dangerousness.

But I guess this would probably go beyond the scope of this feature request, so I will prepare a separate ticket...

Updated by nobu (Nobuyoshi Nakada) over 8 years ago Actions #5 [ruby-core:80525]

ko1 (Koichi Sasada) wrote:

We should use such syntax for literal syntax such as frozen one (with blue color).

OK, updated.

Updated by nobu (Nobuyoshi Nakada) over 8 years ago Actions #6

  • Status changed from Open to Rejected
Actions

Also available in: PDF Atom