Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge

Name: Anonymous 2014-07-16 18:35

Write a macro that, given a term of code, transforms all the calls to the function FOO in that term, and only those calls, into calls to function BAR with the same arguments.
Language: Common Lisp or Scheme.

Name: Anonymous 2014-07-17 19:43

>>25
That is not a solution, because it not only replaces calls to FOO in the original term, but also in the expansions of other macros. E.g. if there exists the macro

(defmacro zoo (k) (foo k))

and our code term contains the s-exp

(zoo k)

then your erroneous solution will modify what (zoo k) will expand into, which is a malign side effect. Anything that is not a call to FOO must be untouched.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List