Project

General

Profile

Feature #8765

Literal for symbol with interpolation

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

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

Also available in: Atom PDF