Project

General

Profile

Actions

Feature #9070

open

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

Added by alexeymuranov (Alexey Muranov) over 10 years ago. Updated 21 days ago.

Status:
Assigned
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

Like0
Like0Like0Like0Like0Like0