Arc Forumnew | comments | leaders | submitlogin
defmacro mac?
2 points by schtog 5834 days ago | 7 comments
is it possible to rewrite the dumbass long defmacro in common lisp to mac as in Arc? i mean hey lisp the programmable programming language. or defmacro is something to fundamental to the language to be redefined?


4 points by almkglor 5834 days ago | link

I'd assume it'd be something a little like the following:

  (defmacro mac (&rest body)
    `(defmacro ,@body))

-----

1 point by schtog 5834 days ago | link

and so:

  (defmacro def (&rest body)
    `(defun ,@body))

and there will be no sideffects of this?

-----

1 point by cooldude127 5834 days ago | link

except you wont be able to use arc's cool dotted list syntax for arguments. instead of

  (def my-fun (a . rest)
    ...)
you have to use CL's &rest syntax

  (def my-fun (a &rest rest)
    ...)

-----

1 point by schtog 5833 days ago | link

but using def and mac with these definitions:

  (defmacro mac (&rest body)
	  `(defmacro ,@body))

  (defmacro def (&rest body)
	  `(defun ,@body))

is EXACTLY the same as writing defmacro and defun?

-----

1 point by cchooper 5833 days ago | link

yep

-----

1 point by wfarr 5834 days ago | link

Personally (and this may well just be me) I prefer the latter.

-----

1 point by dreish 5833 days ago | link

What does it buy you, other than four more steps toward carpal-tunnel syndrome?

-----