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-16 21:28

>>15
Haskell from my point of view offers only one advantages:
writing very terse code using built-in function composition.
Disadvantages:
1.Hard to read other people code, cryptic functions
requires frequent reference of operator/function usage
2.Garbage Collection, high memory use
3.slow speed in general:compiler doesn't optimize much
4.hard to optimize(due high level overhead & laziness)
5.for a high-level language, strings and IO are rather primitive& hard to use,so UnsafeIO is used
6.no macros.lacks easy metaprogramming
7.strict typing model: requires workarounds(like UnsafeIO) for real code.

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