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

capmacro doesn't capture subsequent macros #33

Closed
egasimus opened this issue Nov 3, 2015 · 2 comments
Closed

capmacro doesn't capture subsequent macros #33

egasimus opened this issue Nov 3, 2015 · 2 comments

Comments

@egasimus
Copy link

egasimus commented Nov 3, 2015

This code:

(capmacro Var (lambda (val)
  (return `((require "observ") ,val))))

(capmacro Arr (lambda ()
  (var args (Array.prototype.slice.call arguments 0))
  (return `((require "observ-array") (array ,@args)))))

(capmacro Obj (lambda ()
  (var args (Array.prototype.slice.call arguments 0))
  (return `((require "observ-struct") (object ,@args)))))

(Obj "results" (Arr (Var (Obj "foo" "bar"))))

compiles to:

require('observ-struct')({ 'results': require('observ-array')([require('observ')(Arr(Obj('foo', 'bar')))]) });

rather than:

require('observ-struct')({ 'results': require('observ-array')([require('observ')(require('observ-array')[(require('observ-struct')({ 'foo': 'bar'})]))]) });

What do I do?

@egasimus egasimus changed the title capmacro doesn't work for subsequent macros capmacro doesn't capture subsequent macros Nov 3, 2015
@vendethiel
Copy link

seems to be a duplicate of #27

@anko
Copy link
Owner

anko commented Nov 6, 2015

Yep, as @vendethiel says, this is a different manifestation of the same undelying problem as #27.

I'm almost done with a big rework of the macro API, which will eliminate this problem, among others. Watch #27 for updates.

@anko anko closed this as completed Nov 6, 2015
@anko anko added the duplicate label Nov 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants