Project

General

Profile

Actions

Feature #9070

open

Introduce `---` as synonym of `end` keyword

Added by alexeymuranov (Alexey Muranov) over 7 years ago. Updated over 7 years ago.

Status:
Open
Priority:
Normal
Target version:
-
[ruby-core:58120]

Description

=begin
This is just an idea: introduce "(({---}))" as synonym of "(({end}))" keyword.

It is a bit easier to type and to read, and makes whitespace insensitive language look as if it follows off-side rule. Compare:

class Person
attr_reader :name, :age
def initialize(name, age)
@name, @age = name, age
---
def <=>(person) # the comparison operator for sorting
age <=> person.age
---
def to_s
"#{name} (#{age})"
---


class Person
attr_reader :name, :age
def initialize(name, age)
@name, @age = name, age
end
def <=>(person) # the comparison operator for sorting
age <=> person.age
end
def to_s
"#{name} (#{age})"
end
end

=end

Actions

Also available in: Atom PDF