Project

General

Profile

Actions

Feature #12963

closed

?string longer than one char

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

Status:
Rejected
Target version:
-
[ruby-core:78233]

Description

Now Symbol as keyword argument is often used, but a space is required between the label and the symbol literal.

x.round(half: :up)

Or using a String argument,

x.round(half:"up")

Both don't feel nice to me.

How about longer string literal by ?xxx, which is currently restricted to just one character?

x.round(half:?up)

patch: https://github.com/nobu/ruby/tree/feature/q-string


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #12978: Symbol after keywordRejectedActions

Updated by matz (Yukihiro Matsumoto) over 7 years ago

  • Status changed from Open to Feedback
  • Assignee set to matz (Yukihiro Matsumoto)

Since ?up gives a string "up", it cannot be a replacement for :up symbol.
If someone come up with an use-case for this multi-character ? string literal, I will reinvestigate.

Matz.

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Status changed from Feedback to Rejected

No use case so far.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0