Quantcast
Viewing latest article 3
Browse Latest Browse All 3

Lisp - How to call a function within another function?

I am trying to call the following function:

(defun c:Add ()    (setq a (getint "Enter a number to add 2 to it"))    (setq a (+ a 2)))

Inside this LOOPER function:

(defun LOOPER (func)    ;repeats 'func' until user enters 'no'    (setq dummy "w")    (while dummy        (func) ;this is obviously the problem        (setq order (getstring "\nContinue? (Y or N):"))        (if (or (= order "N") (= order "n")) (setq dummy nil))    ))   

Like this:

(defun c:Adder ()    (LOOPER (c:Add)))

How do I get around the fact that func is undefined in LOOPER function?


Viewing latest article 3
Browse Latest Browse All 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>