Can someone explain the design decisions behind Autolisp / visual lisp for me?

I wonder if anyone can explain the rationale for the design of the following autolisp / visual lisp functions? For me, they seem to fly before the accepted software practice ... am I missing something?

  • All variables are global by default (i.e. if they are not placed after /in function arguments)
  • Reading / writing data from autocad requires putting the material in the list of associations with a large number of magic numbers. 10means x / y coordinates, 90means the length of the coordinate list, 63means color, etc. Ok, you can save them in some constants, but this will mean even more global variables, and the use of magic numbers is recommended in the documentation.
  • Lisp is a functional-style language that encourages programming through iteration recursion, but tail recursion is not a visual lisp optimized poster, leading to terrible call stacks, unless of course you are iterating. But the loop syntax is very restrictive; for example, you cannot break out of a loop or return a value from a loop unless you add some flag to the termination condition. Result, ugly code.
  • As a rule, you are forced to declare variables all over the place that fly before functional programming - so why use a functional (-ish) language?
+5
source share
3 answers

Lisp - , . Scheme Clojure . Lisp, , Elisp, . CL , DSL (Scheme dialects do, Lisps , "Lisp" ).

, , AutoLisp - 1986 XLISP ( 1983).

, , , . , , - , , , , , 80-. , , .

Autolisp/Visual Lisp , , , , , , /, .

+6

, AutoLisp - XLisp ( , XLisp 1.0 (. C2).

XLisp 1.0 - 1- lisp ( ) .

+3

, , . - IMO:

  • " vars ". , CL, ( setq)? - , , n- .

  • " " - DXF, , , , , ACAD ( , ). . , "", , "" ? AutoLISP 1992 . LISP , - AutoLISP ( , VBA- 1990- , ).

  • (while (not done) ...) . , , , CL Haskell ( - Haskell - ?).

  • " ", . , - . ? .

In fact, AutoLISP's biggest stumbling block is its dynamic IMO name resolution, but just as it was in Xlisp, only a few years after Scheme first appeared. Then it was also his immutable data warehouse, but it was done mainly for ease of implementation and to prevent too much confusion and, therefore, issues from the user base, I think.

+2
source

All Articles