Lisp allow the operator before the arguments
(setq p2 (getpoint "\nPick starting point:")
p3 (getpoint "\nPick Ending point:")
p4 (getreal "\nEnter Spacing:"))
dist1 (/ (distance p2 p3) p4); The operator / for divisio , shall be before any argument or operand
);end setq
see it
from
http://ronleigh.info/autolisp/afude01.htmFunction
Definitions
1
- Mathematics+ ..... Adds
(+ 2 3) returns 5
(+ 4 5.6 -2) returns 7.6
After (setq a 20 b 9)
(+ a b) returns 29
- ..... Subtracts
(- 9 7) returns 2
(- 8 4 0.5) returns 3.5
After (setq a 20 b 9)
(- a b) returns 11
(- b a) returns -11
(- a) returns -20. When only one argument is supplied, its value
is subtracted from 0, switching the sign of any number.
* ..... Multiplies
(* 6 7) returns 42
(* 2 -3 1.5) returns -9.0
After (setq a 3 b 4.5)
(* a b) returns 13.5
(* a a) returns 9
/ ..... Divides
(/ 12 6) returns 2
(/ 11 6) returns 1 (Division using only integers ignores any
remainder. Beware of "integer division.")
(/ 11 6.0) returns 1.833333
(/ 12 3 2) returns 2
(/ 12 -2.0) returns -6.0