Cipherd@lemmy.ml to Programmer Humor@programming.dev · 18 days agofunctionslemmy.mlimagemessage-square88linkfedilinkarrow-up1645arrow-down10file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1645arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 18 days agomessage-square88linkfedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareJankatarch@lemmy.worldlinkfedilinkarrow-up2·edit-217 days agoIsn’t it more like foo(){…} -> (define foo (lambda ())) tbf?
minus-square[object Object]@lemmy.worldlinkfedilinkarrow-up2·edit-217 days 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.
minus-squarestammi@feddit.orglinkfedilinkarrow-up2·17 days agoIn clojure it’s (def (fn [])) or short (defn []).
Isn’t it more like
foo(){…}->(define foo (lambda ()))tbf?
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.
In clojure it’s (def (fn [])) or short (defn []).