I wonder can anyone explain the design rationale behind the following features of autolisp / visual lisp? To me they seem to fly in the face of accepted software practice ... am I missing something?
/
in the function arguments)10
means x/y coordinates, 90
means length of the coordinate list, 63
means colour, etc. Ok you could store these in some constants but that would mean yet more globals, and the documentation encourages you to use the magic numbers directly.AutoLISP in AutoCAD offers functions for interactive data entry, processing and access to the AutoCAD drawing database ( DWG ). VisualLISP (originally "Vital LISP ") was added to AutoCAD in the versions R14 (as an add-on) and 2000 (integrated).
There is only one Lisp system in AutoCAD, so AutoLISP is just a subset of its functionality, not a separate implementation these days. Common Lisp (usually abbreviated as CL) is the name of the current mainstream Lisp programming language, not related to AutoCAD in any way.
It was incorporated into AutoCAD 2000 released in March 1999, as a replacement for AutoLISP. Since then, Autodesk has ceased major enhancements to Visual LISP and focused more effort on VBA and . NET, and C++.
Lisp isn't a language, it's a group of sometimes surprisingly different languages. Scheme and Clojure are the functional members of the family. Common Lisp, and the more specialized breeds like Elisp aren't particularly functional and don't inherently encourage functional programming or recursion. CL in fact includes a very flexible object system, an extremely flexible iteration DSL, and doesn't guarantee optimized tail calls (Scheme dialects do, but not Lisps in general; that's the pitfall in thinking of "Lisp" as a single language).
Now that we have that cleared up, AutoLisp is an implementation from 1986 based on an early version of XLISP (the earliest of which was published in 1983).
The reason that it might fly in the face of currently accepted programming practice is that it predates currently accepted programming practice. Another thing to keep in mind is that the cheapest netbook available today is several hundred times more powerful than what a programmer could expect to have access to back in the mid 80s. Meaning that even if a given feature was accepted to be excellent, CPU or memory constraints may have prevented its implementation in a commercial language.
I've never programmed in Autolisp/Visual Lisp specifically, and the stuff you cite sounds bloody annoying, but it may have had some performance/memory advantage that justified it at the time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With