Author Topic: Did you know, lambda, increase speed of Lisp?  (Read 972 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Bull Frog
  • Posts: 326
Did you know, lambda, increase speed of Lisp?
« on: April 08, 2022, 03:39:45 AM »
Exists the both sources in AutoLisp?
(one-source. with Lambda) <> (two-source. without Lambda)
How to calculate the speed of both of sources.lisp?>
C++ link,
Code - Auto/Visual Lisp: [Select]
  1. (defun tmti_trpunct_interung_inainte(/ rr sc sf ds fc m x1 y1 x2 y2 u1 u2 u3 x0 y0 i s c a eps d0 dI cpui)
  2.    (setq;|a49738|;
  3.          cpui (js_ldc21 "0x4BD9:C073" (list  1002))
  4.          sc 8.0
  5.          sf 1.0
  6.          ss 3.6
  7.          ds 45.057
  8.          x1 554536.5758
  9.          y1 336204.4503
  10.          x2 554514.7322
  11.          y2 336165.0425
  12.          x0 554547.6233
  13.          y0 336174.9609
  14.          c 0
  15.          fc "tmti_trpunct_interung_inainte") (setq;|a49954|;
  16.          dI (js_ldc21 "0x3B85:C074" (list  fc))) (princ "\ndI=") (princ dI) (js_ldc21 "0x4975:C075" (list )) (setq;|a50014|; d0 0.0
  17.          eps d0) (setq;|a50044|;
  18.          i 0) (setq;|a50060|;
  19.          i (start_dialog)) (while (>  i 0) (progn  (setq;|a50134|;
  20.          r nil
  21.          a "Punct de sprijin:") (if (=  i 1) (setq;|a50182|;
  22.          r (js_ldc21 "0xA3DF:C076" (list  a)))) (if (=  i 2) (setq;|a50222|;
  23.          r (js_ldc21 "0xA3DF:C077" (list  a)))) (if (=  i 3) (setq;|a50262|;
  24.          r (js_ldc21 "0xA3DF:C078" (list  "Punct de trasat:")))) (js_ldc21 "0x7BEE:C079" (list  i r)) (princ "\nFC=") (princ fc) (princ "\n1.i=") (princ i) (princ "\ndi=") (princ dI) (if (js_ldc21 "0xD364:C080" (list  fc dI)) (progn  (js_ldc21 "0x4975:C081" (list )) (setq;|a50422|;
  25.          i (start_dialog))) (setq;|a50446|;
  26.          i (- 1))) (princ "\n2.i=") (princ i)) (unload_dialog dI)) i)
  27. (defun tmti_trpunct_interung_inainte_p(i r / )
  28.    (if (/= r nil) (progn  (if (=  i 1) (setq;|a52013|;
  29.          x1 (car r)
  30.          y1 (js_ldc21 "0xB118:C082" (list  r)))) (if (=  i 2) (setq;|a52081|;
  31.          x2 (car r)
  32.          y2 (js_ldc21 "0xB118:C083" (list  r)))) (if (=  i 3) (setq;|a52149|;
  33.          x0 (car r)
  34.          y0 (js_ldc21 "0xB118:C084" (list  r)))))) )
  35. (defun tmti_trpunct_interung_inainte_st ( / rr a i)
  36.    (foreach i (list "x1" "y1" "x2" "y2" "x0" "y0") (js_ldc21 "0xD518:C085" (list  i "000000.0000"))) (foreach i (list "sc" "sf" "ss" "m" "u1" "u2" "u0" "eps") (js_ldc21 "0xD518:C086" (list  i "0.0"))) (foreach i (list "d10" "d20" "d12") (js_ldc21 "0xD518:C087" (list  i ""))) (setq;|a54418|; ds 0.0 ss ds sf ss sc sf y0 sc x0 y0 y2 x0 x2 y2 y1 x2 x1 y1
  37.          s x1)
  38. )
  39. (defun tmti_trpunct_interung_inainte_s( / rr r )
  40.    (setq;|a58901|;
  41.          a (list "sc" "sf" "ss" "x1" "y1" "x2" "y2" "x0" "y0")) (foreach c a (action_tile c (strcat "(if (< 0 (atof $value)) (setq " c " (atof $value)))"))) (setq;|a59057|;
  42.          i 0) (action_tile "pp1" "(done_dialog 1)") (action_tile "pp2" "(done_dialog 2)") (action_tile "pp0" "(done_dialog 3)") (action_tile "st" "(tmti_trpunct_interung_inainte_st)") (js_ldc21 "0xD518:C088" (list  "x1" (rtos x1 2 4))) (js_ldc21 "0xD518:C090" (list  "y1" (rtos y1 2 4))) (js_ldc21 "0xD518:C092" (list  "x2" (rtos x2 2 4))) (js_ldc21 "0xD518:C094" (list  "y2" (rtos y2 2 4))) (js_ldc21 "0xD518:C096" (list  "x0" (rtos x0 2 4))) (js_ldc21 "0xD518:C098" (list  "y0" (rtos y0 2 4))) (js_ldc21 "0xD518:C100" (list  "sc" (rtos sc 2 4))) (js_ldc21 "0xD518:C102" (list  "sf" (rtos sf 2 4))) (js_ldc21 "0xD518:C104" (list  "ss" (rtos ss 2 4))) (action_tile "calc" (strcat "(" fc "_calc x0 y0 x1 y1 x2 y2)")) (action_tile "amp" "(tmti_tr_ung_precrid d0 eps)") (action_tile "0" "(done_dialog 0)") (js_ldc21 "0xD1A5:C106" (list  0 0 1 nil nil "imagine" "L:/0User/Lib/tmti_trpunct_interung_inainte.sld" (- 15))) )
  43. (defun tmti_trpunct_interung_inainte_setu(i v / rr q)
  44.    (setq;|a60384|;
  45.          i (itoa i)) (js_ldc21 "0xD518:C107" (list  (strcat "u" i) (strcat "Unghiul U" i "= " (rtos v 2 4) "g"))))
  46. (defun tmti_trpunct_interung_inainte_calc ( x0 y0 x1 y1 x2 y2 / rr M e2 a u1 u2 u0 d1 d2 i a j d0)
  47.    (setq;|a68546|;
  48.          s (- (js_ldc21 "0x74CE:C109" (list  sc 2)) (js_ldc21 "0x74CE:C110" (list  ss 2)) (js_ldc21 "0x74CE:C111" (list  sf 2)))) (if (>  s 0.0) (progn  (setq;|a68710|;
  49.          s (sqrt s)
  50.          j (js_ldc21 "0x4CB7:C112" (list  (list (list x0 y0) (list x1 y1) (list x2 y2))))
  51.          d0 (nth 1 j)
  52.          d1 (nth 1 d0)
  53.          d2 (nth 2 d0)
  54.          d0 (nth 0 d0)
  55.          u0 (nth 1 j)
  56.          u1 (js_ldc21 "0x99AD:C113" (list  (nth 1 u0)))
  57.          u2 (js_ldc21 "0x99AD:C114" (list  (nth 2 u0)))
  58.          u0 (js_ldc21 "0x99AD:C115" (list  (nth 0 u0)))
  59.          M (/ (+ (* (sin u1) (sin u1)) (* (sin u2) (sin u2))) (js_ldc21 "0x74CE:C116" (list  (sin u0) 4)))) (setq;|a69190|;
  60.          u0 (js_ldc21 "0xA92F:C117" (list  u0))
  61.          u1 (js_ldc21 "0xA92F:C118" (list  u1))
  62.          u2 (js_ldc21 "0xA92F:C119" (list  u2))
  63.          j (- 1)
  64.          s (js_ldc21 "0x0B30:C120" (list  s))
  65.          e2 (* d0 (sqrt M) pi)) (if (js_ldc21 "0x0E92:C121" (list  d2)) (setq;|a69352|;
  66.          eps "eroare impartire cu 0") (setq;|a69372|;
  67.          e2 (/ (* s 2000.0) e2)
  68.          eps (strcat "Abaterea std. de trasare a unghiurilor=" (js_ldc21 "0x270B:C122" (list  e2 2 1)) "cc"))) (js_ldc21 "0xD518:C123" (list  "d12" (strcat "[AB]=" (rtos d0 2 4)))) (js_ldc21 "0xD518:C125" (list  "d10" (strcat "[AC]=" (rtos d2 2 4)))) (js_ldc21 "0xD518:C127" (list  "d20" (strcat "[BC]=" (rtos d1 2 4)))) (setq;|a69646|;
  69.          a (list u0 u1 u2)) (foreach i a (js_ldc21 "0xA765:C129" (list  (setq j (1+ j)) i))) (setq;|a69732|;
  70.          a (js_ldc21 "0x98BE:C130" (list  "u0"))
  71.          a (strcat a " Control: Suma=" (js_ldc21 "0x270B:C131" (list  (+ u0 u1 u2) 2 4)))) (js_ldc21 "0xD518:C132" (list  "u0" a)) (js_ldc21 "0xD518:C133" (list  "m" (strcat "Modul M=" (rtos M 2 4)))) (js_ldc21 "0xD518:C135" (list  "eps" eps)) (setq;|a69932|;
  72.          eps e2) (princ (strcat "\nAbaterea std.intersectie=" (js_ldc21 "0x270B:C136" (list  s 2 1)) "cc"))) (js_ldc21 "0x6E00:C137" (list  "Eroare Abaterea std.intersectie rezulta negativa"))))
  73.  ;;{$E}
  74.  
« Last Edit: May 02, 2022, 04:49:43 PM by d2010 »

baitang36

  • Bull Frog
  • Posts: 213
Re: Did you know, lambda, increase speed of Lisp?
« Reply #1 on: April 10, 2022, 08:03:37 PM »
You paste the source code and everyone plays together

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: Did you know, lambda, increase speed of Lisp?
« Reply #2 on: April 11, 2022, 01:29:47 AM »
Exists the both sources in AutoLisp?
(one-source. with Lambda) <> (two-source. without Lambda)

Can you elaborate. I have never heard of a LISP dialect (or any other functional language) without lambda expressions.
« Last Edit: April 11, 2022, 01:53:47 AM by gile »
Speaking English as a French Frog