Project

General

Profile

Actions

Feature #20405

open

Inline comments

Added by nobu (Nobuyoshi Nakada) about 1 year ago. Updated 19 days ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:117392]

Description

I propose a new inline comment syntax.

p (| This is a comment (| and nested one |) /:|) (:|) #=> :|

Updated by vo.x (Vit Ondruch) about 1 year ago

I like this proposal. But there are other possibilities, such as:

(: This is comment :)

That would just underline Ruby as a "happy" language. Of course variants such as (-: ... :-) or even (o: ... :o) could even extend the expressiveness of comments

Updated by nobu (Nobuyoshi Nakada) about 1 year ago

vo.x (Vit Ondruch) wrote in #note-1:

I like this proposal. But there are other possibilities, such as:

(: This is comment :)

Thank you for the comment, but you may know (: can conflict existing code.
The reason I selected (| is that /:|) is used as Matz's face (no beard version).

Updated by matheusrich (Matheus Richard) about 1 year ago · Edited

I think, unironically, this could be a nice addition. Maybe with a syntax closer to the current comments?

p #= This is a comment #= and nested one =# =# :| # => :|

Updated by pabloh (Pablo Herrero) 10 months ago

This could be particularly useful for projects like rbs-inline.

Updated by make_now_just (Hiroya Fujinami) 19 days ago

I'd propose (= ... =) for inline comments because Ruby already has =begin and =end syntax and it seems to relate to that.

p (= ^..^ =) :nyan

Also, I believe that (= ... =) does not break the current syntax.

Updated by nobu (Nobuyoshi Nakada) 19 days ago · Edited

make_now_just (Hiroya Fujinami) wrote in #note-5:

p (= ^..^ =) :nyan

Cool.

Actions

Also available in: Atom PDF

Like4
Like0Like0Like0Like0Like2Like0