Code Red > AutoLISP (Vanilla / Visual)

Legal defun name

(1/3) > >>

Mark:
What is not legal in a function name?

DEFUN C:FUNC ( Legal )
DEFUN C:<space>FUNC (legal)?
DEFUN C:_FUNC (legal)?
DEFUN C:1FUNC ( illegal )
more ...

Kerry:

--- Code: ---(defun C:1FUNC () (princ "Works for me") (princ))
--- End code ---

Kerry:

--- Code: ---(defun C:<space>FUNC () (princ "C:<space>FUNC Works for me") (princ))
--- End code ---


--- Code: ---(defun C: FUNC () (princ "C: FUNC Ooooopssss") (princ))
--- End code ---
; error: bad DEFUN syntax: (C: FUNC nil (PRINC "C: FUNC Ooooopssss") (PRINC))

I enjoy your sense of humour :-)

Mark:

--- Quote from: Kerry Brown on December 10, 2005, 09:37:10 PM ---
--- Code: ---(defun C:1FUNC () (princ "Works for me") (princ))
--- End code ---

--- End quote ---

I thought a function name that started with a number was illegal.  :?

Kerry:
It is in some languages, but not lisp.
Similarly - + etc prefix is illegal in some languages.

I remember when playing with SharpLisp <Lisp to C++ ARX> there was fun with what was acceptable.
I regularly used a minus as function name divider prior to that .. changed to all underscore or PascalCase after, cause it didn't cause hassles.

Navigation

[0] Message Index

[#] Next page

Go to full version