Kowal Posted April 5, 2022 Share Posted April 5, 2022 How to pass a function to a function according to the example: (defun pass (fn a b) ??? ) (pass '+ 2 3) return 5 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 5, 2022 Share Posted April 5, 2022 Like this. (defun pass (fn a b) (fn a b) ) (pass + 2 3) 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 6, 2022 Share Posted April 6, 2022 Maybe like this for points. (setq p2 (mapcar '+ p1 (list X Y Z))) ; add values x 0.0 0.0 0.0 Y 0.0 etc (setq pt3 (mapcar '+ pt1 pt2) ) ; adds 2 points together (setq pt3 (mapcar '(lambda (x) (/ x 2.0)) pt3) ; divide by 2 (setq mp (mapcar '* (mapcar '+ p1 p3) '(0.5 0.5 0.5))) ; mid point for 2 points 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.