Project

General

Profile

Actions

Feature #20405

open

Inline comments

Added by nobu (Nobuyoshi Nakada) 8 months ago. Updated 5 months 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) 8 months 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) 8 months 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) 7 months 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) 5 months ago

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

Actions

Also available in: Atom PDF

Like3
Like0Like0Like0Like0