Comments and Headers
Please post comments to discussion thread
The first place I would like to start is comments.
I have adopted a standard where all of my lisp libraries and routines have a file header and function header comments.
The file header includes
1.) My name and year for copyright
2.) A disclaimer prohibiting unauthorized use
3.) An abstract that describes what is the purpose of the file or library
4.) The command line functions with descriptions (alphabetically) including hot key assignments
5.) The general functions with descriptions
6.) Version or last modified date
The function headers include
1.) Function Description
The functions are alphabetical (although I let the hot keys supersede their respective functions)
I use a noun first verb last function name to help organize the functions together when alphabetical.
I will talk more about function and variable naming.
So be honest how many of you actually take the time to create a LISP file header?
Code:
;___________________________________________________________________________________________________________|
;
; Written By: Peter Jamtgaard copyright 2017 All Rights Reserved
;___________________________________________________________________________________________________________|
;
; Any use by unauthorized person or business is strictly prohibited.
;___________________________________________________________________________________________________________|
;
; Abstract: This routine will display an alert dialog with the words "Hello World" in it.
;___________________________________________________________________________________________________________|
;
; Command Line Function Header List
;___________________________________________________________________________________________________________|
; Function and Description
;* C:HW
;* Command Line Function (or hot key) to display Hello World Dialog
;* C:HelloWorld
;* Command Line Function to display Hello World Dialog
;___________________________________________________________________________________________________________|
;
; General Function Header List
;___________________________________________________________________________________________________________|
; Function, Arguments and Description
;* (DialogAlertHelloWorld)
;* Function to Display an Alert box with the words "Hello World"
;___________________________________________________________________________________________________________|
;
; Include Libraries List
;___________________________________________________________________________________________________________|
;* None
;___________________________________________________________________________________________________________|
;
; Include Data File List
;___________________________________________________________________________________________________________|
;* None
;___________________________________________________________________________________________________________|
;
; Include Dialog Control Language File List
;___________________________________________________________________________________________________________|
;* None
;$ End Header
;___________________________________________________________________________________________________________|
___________________________________________________________________________________________________________|
;
; Command Line Functions
;___________________________________________________________________________________________________________|
;
; Command Line Function to display Hello World Dialog
;___________________________________________________________________________________________________________|
(defun C:HW ()(C:HelloWorld))
(defun C:HelloWorld ()(DialogAlertHelloWorld))
;___________________________________________________________________________________________________________|
;
; Function to display Hello World Dialog in Alert Dialog Box
;___________________________________________________________________________________________________________|
(defun DialogAlertHelloWorld ()(Alert "Hello World"))
;___________________________________________________________________________________________________________|
;___________________________________________________________________________________________________________|
(princ "!")
(vl-load-com)