Project

General

Profile

Feature #12963

?string longer than one char

Added by nobu (Nobuyoshi Nakada) about 2 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
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

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

History

Updated by matz (Yukihiro Matsumoto) about 2 years ago

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

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.

#2

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

Updated by shyouhei (Shyouhei Urabe) about 2 years ago

  • Status changed from Feedback to Rejected

No use case so far.

Also available in: Atom PDF