Code Select
(defun create-symbol (str)
(intern (string-upcase str)) )
(defmacro create-functions (group-name)
(let ((f1 (create-symbol
(format nil "~a~a" group-name 1)))
(f2 (create-symbol
(format nil "~a~a" group-name 2))) )
`(progn
(defun ,f1 (arg) (+ arg 1))
(defun ,f2 (arg) (+ arg 2)) ) ) )
if you call:
(create-functions foo)
it generates
(defun foo1 (arg) (+ arg 1)) and
(defun foo2 (arg) (+ arg 2))
Can you do something similar in newLisp??
Code Select