Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Late binding
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Late binding in Lisp=== In [[Lisp (programming language)|Lisp]], late bound global function calls are efficiently looked up at runtime via a [[Symbol (programming)|symbol]]'s function cell. These function bindings are mutable. Example using an interactive [[Clozure CL|Clozure Common Lisp]] session: <syntaxhighlight lang="Lisp"> ? (defun foo () (bar pi)) ; a still undefined function BAR gets called ;Compiler warnings : ; In FOO: Undefined function BAR FOO ? (defun bar (x) ; now we define it (* x 2)) BAR ? (foo) ; calling foo and it uses the recent definition of BAR 6.283185307179586D0 ? (defun bar (x) ; now we redefine BAR (* x 1000)) BAR ? (foo) ; FOO now calls the new function, there is no need to recompile/link/load FOO 3141.592653589793D0 ? (type-of 'bar) ; BAR is a symbol SYMBOL ? (symbol-function 'bar) ; the symbol BAR has a function binding #<Compiled-function BAR #x302000D1B21F> </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)