Cipherd@lemmy.ml to Programmer Humor@programming.dev · 2 days agofunctionslemmy.mlimagemessage-square112fedilinkarrow-up1568arrow-down18file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1560arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 2 days agomessage-square112fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareJankatarch@lemmy.worldlinkfedilinkarrow-up2·edit-224 hours agoIsn’t it more like foo(){…} -> (define foo (lambda ())) tbf?
minus-squarestammi@feddit.orglinkfedilinkarrow-up1·20 hours agoIn clojure it’s (def (fn [])) or short (defn []).
minus-squareSlurpingPus@lemmy.worldlinkfedilinkarrow-up1·edit-224 hours 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.