Cipherd@lemmy.ml to Programmer Humor@programming.dev · 1 month agofunctionslemmy.mlimagemessage-square119fedilinkarrow-up1638arrow-down19file-textcross-posted to: [email protected]
arrow-up1629arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 1 month agomessage-square119fedilinkfile-textcross-posted to: [email protected]
minus-squareJankatarch@lemmy.worldlinkfedilinkarrow-up2·edit-21 month agoIsn’t it more like foo(){…} -> (define foo (lambda ())) tbf?
minus-squarestammi@feddit.orglinkfedilinkarrow-up2·1 month agoIn clojure it’s (def (fn [])) or short (defn []).
minus-square[object Object]@lemmy.worldlinkfedilinkarrow-up1·edit-21 month agoIn Emacs Lisp, you use one of these two: (defun funcname (arg1 arg2) (+ arg1 arg2)) (lambda (arg1 arg2) (+ arg1 arg2)) — with the latter typically being an argument to another function or macro.
Isn’t it more like
foo(){…}->(define foo (lambda ()))tbf?
In clojure it’s (def (fn [])) or short (defn []).
In Emacs Lisp, you use one of these two:
(defun funcname (arg1 arg2) (+ arg1 arg2))(lambda (arg1 arg2) (+ arg1 arg2))— with the latter typically being an argument to another function or macro.