admin
Administrator
Din: Bucharest
Inregistrat: acum 14 ani
Postari: 518
|
|
Code:
(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 |
Code:
(defun Setf (listvar / $rr item)
(foreach item listvar
(set (read (car item)) (cadr item)))
)
(setq n 10 winhelp "You need more import CommonLisp inside VLide?")
(Setq declare (list (list "mmax" 0) (list "j" 0)
(list "ipow" (expt n 2))
(list "pow" 0) (list "wtemp" 0.0) (list "wr" 0.0) (list "wpr" 0.0)
(list "prev" 0) (list "wpi" 0.0) (list "wi" 0.0) (list "theta" 0.0)
(list "tempr" 0.0) (list "tempi" 0.0) (list "wrs" 0.0) (list "wis" 0.0)))
(setf declare) |
_______________________________________
|
|