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

Macro-writing challenge

Name: Anonymous 2016-01-16 13:19

Write a macro check-arguments-non-nil to be used in function definitions, that would expand to assertion about every argument being non-nil.
The intended usage of this macro:

(defun foo (a b c d)
(check-arguments-non-nil)
foo-body)


This should expand to:

(defun foo (a b c d)
(assert (and (not (null a)) (not (null b)) (not (null c)) (not (null d)))
(a b c d)
"Null argument in FOO")
foo-body)


The macro must work whatever the number and names of the function parameters.

Name: Anonymous 2016-01-22 17:03

>>58
However some small parts of "awesome Lisp power", could be introduced in form of _TokenOf() which doesn't require embedding Lisps in C preprocessor.
Its basically extending https://en.wikipedia.org/wiki/The_lexer_hack to feed back tokens of evaluated C constant expression(or unevaluated tokens if evaluation stops),like C++ constexpr but more powerful due being at earlier stage of source processing.

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