TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: d2010 on October 30, 2021, 01:07:37 AM

Title: [LISP] How to inject LET from clojure
Post by: d2010 on October 30, 2021, 01:07:37 AM
I found inside clojure the function LET
How to transform the LET.clojure to LET.AutoLisp?

  (let [[x1 y1 x2 y2] (if steep [y1 x1 y2 x2] [x1 y1 x2 y2])]
      (let [[x1 y1 x2 y2] (if (> x1 x2) [x2 y2 x1 y1] [x1 y1 x2 y2])]
   );end-let
  );end-let

Code: [Select]
(defun  Letacad(variable-list values / $rr)
  (setq $rr "Here is AutoLisp.R14 or VisualLisp")
.......................
AlwaysRetrun x1)

Eg. (Letacad "x1 y1 x2 y2" (list 1 2 3 4))   OR
      (Letacad "x1,y1,x2,y2" (list 5 6 7 8))  OR
      (Letacad "x1,y1,x2,y2",nil)  -- ALL the variabiles set nil

 ???

The clojure is powered by Java(c). So I believe the all UsersAutoLisper~s  must known BasicallyClojure!!!
Title: Re: [LISP] How to inject LET from clojure
Post by: gile on October 30, 2021, 02:57:39 AM
Hi,
Have a look at this challenge (http://www.theswamp.org/index.php?topic=26792.0).
Title: Re: [LISP] How to inject LET from clojure
Post by: baitang36 on October 31, 2021, 10:51:49 AM
In fact, vl.arx provides a function let. However, it is an undisclosed function. It can only be used in FAS, not in LSP. I wrote a small program that can be used after loading. But I don't know how to use this function.