Arc Forumnew | comments | leaders | submitlogin
4 points by waterhouse 5157 days ago | link | parent

Niiiiice. Seems you can do this with tables, too.

  arc> (eval `(+ 1 2))
  3
  arc> (eval `(,+ 1 2))
  Error: "Bad object in expression #<procedure:+>"
  arc> (eval `(',+ 1 2))
  3
  arc> (eval `((obj a 1) 'a))
  1
  arc> (eval `(,(obj a 1) 'a))
  Error: "Bad object in expression #hash((a . 1))"
  arc> (eval `(',(obj a 1) 'a))
  1
Probably any object will work. Seems we can cross this one off the list:

  ; compromises in this implementation: 
  ; no objs in code
  --arc.arc
...or, at least, we have a workaround. Ideally you wouldn't need to quote it at all.


3 points by jazzdev 5157 days ago | link

Ideally you wouldn't need to quote it at all.

It works in Jarc without quoting.

  Jarc> (eval `(,+ 1 2))
  3
  Jarc> (eval `(,(obj a 1) 'a))
  1
Not intentional. Just a side-effect of the way Jarc evals objects. Everything except cons, sym and string evals to itself.

-----