Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sym"..." string macro for making Symbols #32707

Closed
wants to merge 1 commit into from
Closed

Conversation

andyferris
Copy link
Member

A new non-standard string literal using sym_str macro to construct Symbols. Supports interpolation.

This is the sibling PR of #32408, and is the product of the South-West Brisbane (Australia) edition of JuliaCon Hackathon 2019.

Some examples:

julia> sym"a"
:a

julia> sym"a#"
sym"a#"

julia> i = 10
10

julia> sym"a_$i"
:a_10

Co-authored-by: Chris Foster chris42f@gmail.com

@andyferris andyferris requested a review from JeffBezanson July 27, 2019 13:19
A new non-standard string literal using `sym_str` macro to construct `Symbol`s. Supports interpolation.

Co-authored-by: Chris Foster <chris42f@gmail.com>
@andyferris
Copy link
Member Author

c.f. #32408 (comment)

@andyferris andyferris added display and printing Aesthetics and correctness of printed representations of objects. feature Indicates new feature / enhancement requests julep Julia Enhancement Proposal and removed julep Julia Enhancement Proposal labels Jul 27, 2019
@JeffBezanson
Copy link
Member

This can already be done with Symbol("a"), so it's not super necessary (though we need to be able to constant fold that). We more urgently need a syntax for non-quoted non-standard symbols.

@KristofferC
Copy link
Member

We more urgently need a syntax for non-quoted non-standard symbols.

We have that with var now. It seems the Symbol("") constructor is perhaps enough for the other use case.

@giordano giordano deleted the ajf/sym_str branch May 13, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects. feature Indicates new feature / enhancement requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants