Just find a defun, eval it via C-u C-M-x and you'll get breakpoint at the defun entry.
defun
How to use defun in a sentence. Live example sentences for defun pulled from indexed public discussions.
Editorial note
Just find a defun, eval it via C-u C-M-x and you'll get breakpoint at the defun entry.
Quick take
Just find a defun, eval it via C-u C-M-x and you'll get breakpoint at the defun entry.
Example sentences
TXR Lisp: @(do (macro-time (defun abc-proc (n) ^(defun,n () (pprinl ',n)))) (defmacro abc-procs (.
I've seen implicit rules about top-level expression being implicitely wrapped in parens you one can write defun fact (n) (cond..
Maybe interchangeable is not the right word here (defun edible.in.large.amounts?
At least in the variants of lisp I've used, defining a function would be done using defun, not define, so yeah, probably.
'(1 2 3) is just like [1,2,3] (defun x (a b c...)...) defines a function x(a,b,c).
YC + all of YC's internal applications, there are 738 calls to def (= CL defun) and 187 calls to mac (= CL defmacro).
I'm used to Lisps, where def/defun/define/defn imply internment.
(defun normalize-probabilities (probabilities) (mapcar (lambda (x) (- 1 x)) probabilities)) Ok.
With lcons, I we can make a fibonacci function quite similarly to how you might do it in Haskell: (defun fib2 (a b) (lcons a (fib2 b (+ a b)))) We call this as (fib 1 1) and it gives us a lazy list.
Doesn't look like anything more than a sexp reader; very limited (I am guessing a 1-2 day hack.) All it has are: atom, eq, car, cdr, cons, cond, lambda, define (for variables!) and defun.
If you want to run on more than one Lisp, it's trivial: (defun spawn (name fn) #+ccl (ccl:process-run-function name fn) #+lispworks (mp:process-run-function name nil fn) #+sbcl (sb-thread:make-thread fn:name name)) I wouldn't use CL as a do-everything language either, but it's typically a superb place to be if you're trying to do anything complex.
Quote examples
Should we return a thunk?): (defun unless (condition branch) (if condition nil (branch)));; Works (unless keep (lambda () (delete-file "foo.txt"))) - Implement a macro system.
(defn hello [] (println "hello world")) (hello);; in Clojure (defun hello () (format t "hello world")) (hello);; in Common Lisp.
(defun cc () "Secrets File" (interactive) (find-file "/home/ajross/.cc.gpg")) Launch with "M-x cc" (which is simple enough) or bind to a keystroke.
Frequently asked questions
Short answers drawn from the clearest meanings and examples for this word.
How do you use defun in a sentence?
Just find a defun, eval it via C-u C-M-x and you'll get breakpoint at the defun entry.