Project

General

Profile

Actions

Feature #8765

closed

Literal for symbol with interpolation

Added by sawa (Tsuyoshi Sawada) over 10 years ago. Updated over 10 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:56513]

Description

=begin
I propose a symbol literal %S with interpolation

foo = 3
%s{#{foo}} # => :"\#{foo}"
%S{#{foo}} # => :"3"

The conventional :"" literal looks as if it is a unary operator to a string. Since there are both %q and %Q literals for string, I don't see any reason why symbols only have %s.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0