Command: (load "phi")
; error: LOAD failed: "phi"
Command: (* phi 2)
; error: bad argument type: numberp: nil
Command: (* (phi) 2)
; error: no function definition: PHI
Command: PHI 1.61803
my acaddoc.lsp has this in it..... (defun c:phi () (/ (+ 1 (sqrt 5)) 2))
am scratching head as to why i cant times it by two.. or three, or ....
which part of code did i write wrong? did it on fly. seems to me, that i
should simply be able to
:: (* phi 2) (times phi by two)
I think the problem is that you haven't set a variable to hold the real
number. The function returns the value, but only when you run it, and I
don't think you can run it when it's a term in another function. Try running
(defun c:phunction ( / ) (setq phi (/ (+ 1 (sqrt 5)) 2)))
Now you can summon the vaule stored in phi from other functions during the
drawing session. I also think it's a problem to have the function and the
variable have the same name. If you want to use the value of phi in other
functions, name this function something else.