Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2020 in all areas

  1. Customization
    2 points
  2. Frequently, after a topographic survey, I have to prove the obtained area of a Lot of Land. This lisp creates a table with the analytical method of the Gauss's area formula. I do not need absolute precision, but logically (owing to rounding) by increasing decimal units you can get a result as close to the real one. It is still to be completed, but I never have time to finish it. You can change the nonsense I wrote in English AreaG.LSP
    1 point
  3. Assuming (setq block-list '(("A-old" . 1) ("B-old" . 1) ("C-old" . 1) ("D-old" . 1) ("E-old" . 1) ("F-old" . 1) ("G-old" . 1) ("H-old" . 1))) (setq compare-list '((rgt "A-old" "A-new") (rgt "C-old" "C-new") (rgt "K-old" "K-new") (rgt "E-old" "E-new") (rgt "D-old" "D-new") (rgt "H-old" "H-new"))) Then the inelegant (mapcar '(lambda (x) (cons (cadr (assoc (car x) (mapcar 'cdr compare-list))) (cdr x))) (vl-remove-if-not '(lambda (x) (vl-position (car x) (mapcar 'cadr compare-list))) block-list)) produces the desired result
    1 point
  4. I'm not quite sure what you mean though. The function I wrote above should return the desired result
    1 point
  5. Why is "D-new" not included in the result?
    1 point
  6. (defun ts ( / l1 l2) ;; Your lists (setq l1 '(("A-old" . 1) ("B-old" . 1) ("C-old" . 1) ("D-old" . 1) ("E-old" . 1) ("F-old" . 1) ("G-old" . 1) ("H-old" . 1))) (setq l2 '((rgt "A-old" "A-new") (rgt "C-old" "C-new") (rgt "K-old" "K-new") (rgt "E-old" "E-new") (rgt "D-old" "D-new") (rgt "H-old" "H-new"))) ;; Routine (vl-remove nil (mapcar '(lambda (x / asc) (if (setq asc (assoc (cadr x) l1)) (cons (caddr x) (cdr asc)) ) ) l2 ) ) )
    1 point
  7. If RGT is a function, then maybe you'd want to let us know what (rgt "A-old" "A-New") would evaluate to? Or show us what the function rgt does?
    1 point
  8. Glad we could help. Tell us, what is rgt shown on your list?
    1 point
×
×
  • Create New...