Hello,
I'm new to Lisp and my previous programming experience was mostly C, Perl and shell scripts. I'm still heavily influenced by it so please bear with me.
So: Is there a way to define a macro which constructs a function name when given a list of symbols? I'd like to call it like this:
Thank you in advance.
I'm new to Lisp and my previous programming experience was mostly C, Perl and shell scripts. I'm still heavily influenced by it so please bear with me.
So: Is there a way to define a macro which constructs a function name when given a list of symbols? I'd like to call it like this:
(do-expand-functions '(first second third fourth fifth) '(a b c) (list foo bar baz quux))
and get as a result
(progn
(do-function-a-first foo)
(do-function-a-second foo)
(do-function-a-third foo)
(do-function-a-fourth foo)
(do-function-a-fifth foo)
(do-function-b-first bar)
(do-function-b-second bar)
.
.
.
(do-function-c-fifth quux))
How do I construct the do-function-* names? Once I get past that the rest is easy. Is there a common idiom for this kind of things? If I were using Bash I'd probably sayfor I in a b c; do
for J in first second third; do
for K in foo bar baz quux; do
eval do_function_${I}_${J} $K
done
done
done
although it's not quite the same.Thank you in advance.