(defun cb:...)
helloi'm starting with autocad lisp
i've learnd that you start a routine with
(defun c:name ....)
but now i've found a program that start with
(defun cb:hdis (/ld)
this comes back with the variables
if (= (type cb:ld) 'str
i understand the meanig of this code exept what te cb: means
can someone tell me what's the difference between defun c: and defun cb: By analogy to this article, I have written article on use of a code from a forum in Russian, where has a little expanded the description.
As I not so well know English, therefore I will take advantage of machine translation. I hope, it will be clear, and if is not present, me will correct.
In your case it is function and it needs to be caused so: (cb:hdis) I believe I've seen that lisp before. "cb:" doesnt actually do anything. That code is just a function. if you were to type in "hdis" as a command it wouldnt do anything. but if you were to use it like this (cb:hdis) it would run. Why they named it that way is unknown to me but im sure they had their reasons. Too little too late it seems. Good description VVA Nice once VVA, but, yes, I believe its just irresponsible function naming...
I wouldn't bet on it... I do this all the time. Useful for identification.
I agree.I use function name prefixes all of the time.My preference is to use an underscore delimiter , but a colon is just as valid.My $0.02-David
You mean using the function syntax as a prefix for sub_routines - I suppose its good for reference, but the function begins with a c..: I suppose it could confuse the LISP novice... Possibly, but still nothing wrong with it. I do this sometimes within the same file. Say my file (and main function is named) CHTXT - i might name my internal functions things like:
(defun chtxt:myfunc ()(blah_blah))
Of course, like David says, just my 2¢.
页:
[1]