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

Executable XML users challenge

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-08 5:01

provide any LISP macro with clear explanation of its structure and function
that is :
1.concise (max 10 lines)
2.does not have a C equivalent(at least not anything above 100 lines)
3.does not use any libraries or imported complex functions which are not in C
If you provide an exact explanation/commentary on what it does i'll try to make a C solution which
is equivalent to LISP one. If i fail to do so, LISP wins, if i provide a solution you can make another macro.
If all examples in the thread are provide with C equivalents, LISP loses.

Name: Anonymous 2011-12-08 13:26

1. lambda can't be done without heap allocation and some kind of non-trivial memory model. See
http://en.wikipedia.org/wiki/Funarg_problem
http://www.paulgraham.com/accgen.html
so stop posting your preprocessor garbage


2. but that has nothing to do with macros. Here's an idea: add monads to C. https://github.com/richhickey/clojure-contrib/blob/78ee9b3e64c5ac6082fb223fc79292175e8e4f0c/src/main/clojure/clojure/contrib/monads.clj#L51

Even just picking a single Monad for C would be hard, to say the least for generalizing the design pattern. Take Maybe for instance. Write a macro that makes it so that if any assignment in a block resolves to NULL, the whole block immediately returns NULL (and the other statements are not even evaluated.)

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