Arc Forumnew | comments | leaders | submitlogin
2 points by evanrmurphy 5252 days ago | link | parent

Would someone mind being more explicit about how it doesn't work? After dotting the outer definition's rest parameter as well so that the first line reads,

  (mac def-func (func-name . func-body)
it seems to be working for me:

  arc> (def-func 1+1 (+ 1 1))
  #<procedure: 1+1>
  arc> (1+1 nil)
  2
If you're interested, here's a version of your macro with a few things cleaned up (some changes only subjectively better):

  (mac def-func (name . body)
    (w/uniq (first rest)
      `(def ,name (,first . ,rest)
         ,@body)))


1 point by ylando 5252 days ago | link

It don't work with jarc16, it don't work with arc3. What is your version of arc?

-----

1 point by evanrmurphy 5252 days ago | link

arc3.1. So did you get an error message on trying

  (def-func 1+1 (+ 1 1))
or what? Did you dot the func-body rest parameter as well?

-----

1 point by ylando 5252 days ago | link

It works on arc3.1.

-----