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

Lisp challenge

Name: Anonymous 2014-09-13 7:11

Lisp macros can do anything, they say. But can they do typeclasses?
For the purpose of feasibility study, I'll simplify the challenge, of course. It will go like this:

Implement the form mappend such that

(mappend 2 3)

expands to

(+ 2 3)

and

(mappend "arst" "neio")

expands to

(concatenate 'string "arst" "neio")

(the above code is in Common Lisp, but you're free to use any Lisp and substitute the corresponding forms from that Lisp).

The expansion must happen no later than compile-time, with no runtime overhead.

Feel free to use Typed Racket, Shen, Arc, Clojure or any other Lisp.

Name: Anonymous 2014-09-14 4:32

>>11
Yeah, you deluded yourself so far that you think >>8's code looks pretty or elegant.

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