Skip to content

Export ast-to-estree? #52

Description

@newhouseb

Hi,

I'd like to use eslisp to evaluate eslisp, so that I can do things like:

(eval (quote (+ 1 2 3)))

eval, of course, takes Javascript so I'd like a way to transform the estree (as returned by quote) to javascript. Looking at https://github.com/anko/eslisp/blob/master/src/index.ls, it appears that we might be able to export ast-to-estree such that something like

(eval (ast-to-estree (quote (+ 1 2 3))))

could work (edit: not quite, the AST used internally seems to be different from what quote returns). Another option would be to make compileOnce, etc default to this behavior if the input was an estree instead of a string.

What do you think?

Thanks,
Ben

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions