Issue #8765 has been updated by sawa (Tsuyoshi Sawada).


=begin
There are `:" "` and `:'  '` notations, whose existence indicate that symbol literals with and without interpolation are used. A typical use case for symbol literal is to create symbols from a list of words with a common prefix. For example, you may have a list of words

    %w[foo bar baz]

and may want to create out of it a list of symbols with a common prefix:

    %i[my_foo my_bar my_baz]

which, by the proposed syntax, can be created as:

    %w[foo bar baz].map{|w| %S"my_#{w}"}

=end
----------------------------------------
Feature #8765: Literal for symbol with interpolation
https://bugs.ruby-lang.org/issues/8765#change-41070

Author: sawa (Tsuyoshi Sawada)
Status: Feedback
Priority: Normal
Assignee: 
Category: 
Target version: 


=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


-- 
http://bugs.ruby-lang.org/