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

deftem #14

Open
Kerrigan29a opened this issue Jul 22, 2016 · 0 comments
Open

deftem #14

Kerrigan29a opened this issue Jul 22, 2016 · 0 comments

Comments

@Kerrigan29a
Copy link

I'm trying to run this code from anarki

(= templates2* (table))

(mac deftem2 (tem . fields)
  (withs (name (carif tem) includes (if (acons tem) (cdr tem)))
    `(= (templates2* ',name)
        (+ (mappend templates2* ',(rev includes))
           (list ,@(map (fn ((k v)) `(list ',k (fn () ,v)))
                        (pair fields)))))))

(deftem2 point2d x y)

and I'm getting

Syntax error : (fn ((k v)) (cons (quote list) (cons (cons (quote quote) (cons k (quote nil))) (cons (cons (quote fn) (cons (quote nil) (cons v (quote nil)))) (quote nil)))))
error in expression:
    (deftem2 point2d x y)

But if I execute it in Try ARC it runs well

arc> (= templates2* (table))
#hash()
arc> (mac deftem2 (tem . fields)
  (withs (name (carif tem) includes (if (acons tem) (cdr tem)))
    `(= (templates2* ',name)
        (+ (mappend templates2* ',(rev includes))
           (list ,@(map (fn ((k v)) `(list ',k (fn () ,v)))
                        (pair fields)))))))
#(tagged mac #<procedure: deftem2>)
arc> (deftem2 point2d x y)
((x #<procedure: gs968>))
arc> (deftem2 '(point3d point2d) z)
((z #<procedure: gs972>))
arc>  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant