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

Quote, Quasi-Quote, and Vector support missing #16

Closed
ghost opened this issue Mar 4, 2017 · 3 comments
Closed

Quote, Quasi-Quote, and Vector support missing #16

ghost opened this issue Mar 4, 2017 · 3 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Mar 4, 2017

The S-Expression parser works fine for simple S-Expressions,
but one can't parse quoted expressions ('hello) or quasi-quoted expressions using it,
also vectors (#(hello)) are not supported.

I understand, that they aren't part of the real bare bone S-Expression thing,
but they are supported by a big majority of LISPs out there.

Implementing them directly would break compatibility, but they could be implemented using a special flag.

SXP.read "(hello 'quoted #(world))", [:vector, :quote]     #=> [:hello, [:quote, :quoted], [:vector, :world]]
@ghost ghost closed this as completed Mar 4, 2017
@ghost ghost reopened this Mar 4, 2017
@gkellogg
Copy link
Collaborator

gkellogg commented Mar 4, 2017

The gem supports different readers with differences in supported syntax. You may want to consider a new reader to support your needs, unless you feel that the "scheme" reader, say, should,do this natively. Pull requests welcome.

@ghost
Copy link
Author

ghost commented Mar 4, 2017

I will look into the source code an probably formulate the pull request if I find it.
It's just, that this is part of lisp, just like strings and numbers are.

@gkellogg gkellogg added the enhancement New feature or request label Dec 6, 2021
@gkellogg
Copy link
Collaborator

This is fully supported now, although not using the default Basic reader, but with the Common Lisp reader. This makes use of the Ruby standard Vector class and round-trips.

SXP::Reader::CommonLisp.read "(hello 'quoted #(world))"
  # => [:hello, [:quote, :quoted], Vector[:world]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant