Skip to content

Write sexps in Common Lisp format #24

Description

@marnen

Current situation

This gem has several Reader modules, in order to parse sexps with different syntaxes (Scheme, Common Lisp, SPARQL). However, it only has one Generator module, which doesn't work all that well for writing expressions that are to be parsed in a Common Lisp environment.

For example, we can read nil syntaxes for both Scheme and Common Lisp:

irb(main):017:0> SXP::Reader::Scheme.read '#n'
=> nil
irb(main):019:0> SXP::Reader::CommonLisp.read 'nil'
=> nil

...but we can't easily write a Ruby nil in a CLisp-friendly way:

irb(main):027:0> SXP::Generator.string(nil).chomp
=> "#n"

Proposed solution

It would be great to have Generator modules for the different syntaxes, perhaps something like this:

irb(main):027:0> SXP::Generator::Scheme.string(nil).chomp
=> "#n"
irb(main):028:0> SXP::Generator::CommonLisp.string(nil).chomp
=> "nil"

If this looks like something worthwhile, I can try implementing it and making a pull request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions