lisp2arx
Visual Programming for AutoLisp
Mathématiques en programmation Lisp..
doc2cpp,doc2lsp, sld2lsp, bmp2dcl,
free__GifCcapture for all-CAD'platforms..
(defun let-e (a b / f)
(eval (list 'defun 'f (mapcar 'car a) b))
(eval (cons f (mapcar 'cadr a)))
)
;;Bya=ElpanovEvgeniy
(defun let-e1 (a b)
(eval (cons (eval (list 'lambda (mapcar 'car a) b)) (mapcar 'cadr a)))
)
(let-e '((x 3)) '(+ x (* x 10))) ;;==> 33
(setq x 5) (+ (let-e '((x 3)) '(+ x (* x 10))) x) ;;==> 38
(setq x 2 y 4) (let-e '((x 3) (y (+ x 2))) '(* x y)) ;;==> 12
Comvert list of Variabile to Strings
Code:
_$ (setq lst '(A B C ))
(A B C)
_$ (mapcar 'vl-prin1-to-string lst)
("A" "B" "C")
Code:
(mapcar 'set '(a b c d) '(1 2 3 4))(set (read "ab") 1)
(setq i 1)
(repeat 4 (princ (eval (read (strcat "SYM" (itoa i))))) (setq i (1+ i ))(princ "\n")
Is it possible to run a loop where I setq concatenated symbol names? Basically, loop through to (setq sym1 [expr]), (setq sym2 [expr]), (setq sym3 [expr])
Code:
Command: (setq q3 (list (list 'a 'b 'c) (princ "A1=") (princ 'a)))
A1=A((A B C) "A1=" A)
Command: (q3 1)
; error: too few arguments
Command: (q3 1 2 3)
1
The programming Language AutoLisp, have too many problem/s. No exists anymore Jobs with Visual-Lisp because the *.VLx, this format do not keep the original-copyright/s of author/s. ----------- Even , other programmers steal the source.lisp (idem C# or Java) then the original=author is not preserved.? (e.g The russian hacker or Chinese can decompile C# or Delphi Bds) :whistling: The big-big-problem inside eMarket for programming Languages, these can not blocked the "original-Author inside .Fas". :idea: The eMarket= eBay or Amazon.com
Code:
;;Set C with default value if missing
(setq q3 (list (list 'a 'b 'c) (princ "A1=") (princ 'a)))
Command: (setq q3 (subst (list 'a 'b) (car q3) q3))
((A B) "A1=" A)
Command: (q3 1 2 3)
; error: too many arguments
Command: (q3 1 2)
1
Command: (setq a1 '(a b / c))
(A B / C)
(setq q5 (list (list 'a 'b '/ 'c) (princ "A1=") (princ 'a)))
Command: (setq q5 (list (list 'a 'b '/ 'c) (princ "A1=") (princ 'a)))
A1=A((A B / C) "A1=" A)
Command: (q5 1 2)
1
Command: (q5 1 2 3)
; error: too many arguments
Command: (setq [ 1)
1
Command: (princ [)
11
(Defun Illegal-Variable-Names( / $rr) (Alert "I guess I never studied this before (in 40 years), but I stumbled on AutoLisp disliking a variable named "
Code:
(SNvalid sym_name [flag])
Command: (snvalid "hocus-pocus")
T
Command: (snvalid "hocus pocus")
T
Command: (snvalid "hocus%pocus")
T
The following examples assume EXTNAMES is set to 0:
Command: (snvalid "hocus-pocus")
T
Command: (snvalid "hocus pocus")
nil
Command: (snvalid "hocus%pocus")
nil
The following example includes a vertical bar in the symbol table name:
Command: (snvalid "hocus|pocus")
nil
Excerpt from Acad 2013 'AutoLISP Developer's Guide' (the last pdf version) pp. 10
Symbols and Variables AutoLISP uses symbols to refer to data. Symbol names are not case sensitive and may consist of any sequence of alphanumeric and notation characters, except the following: Characters restricted from symbol names ( (Open Parenthesis) ) (Close Parenthesis) . (Period) ' (Apostrophe) " (Quote Symbol) ; (Semicolon) A symbol name cannot consist only of numeric characters