Comments (3)
So I'm an admitted newbie here, but it seems if you had a function that you were memo-izing
(where you checked the values of argument and returned a pre-computed result) then one way of doing this would involve redefining the global function each time it is used to "hard bake" the calculated value already. This seems efficient in time, if definitely not in space.
Or am I missing some crucial insight ?
from loving-common-lisp.
Why would you want to do that? If the function retrieves a value from a variable, you don't need to redefine the function. If you put the value as data into the function, then it would make even less sense.
Doubly nested DEFUNs are in Lisp not used. I've never seen it used. DEFUN is for defining top-level functions at the top-level. FLET and LABELS is for defining local lexical functions.
Singly nested DEFUNs inside LETs for closures are also a bad style. Creating global closures at load time is not that great as a tool.
from loving-common-lisp.
Thanks lispm, that is a valid point. It is an old habit of mine in both Scheme and Common Lisp to "hide" local functions inside the function that uses them.
from loving-common-lisp.
Related Issues (8)
- double-args looks useless as a macro... HOT 1
- note that the code is not working HOT 1
- knowledgebooks_nlp.lisp code duplication HOT 1
- error trying to (ql:quickload "spacy")
- missing test.dat file HOT 1
- Attempting to load spacy-py4cl with quicklisp HOT 1
- error when running (ql:quickload :clsql-postgresql) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loving-common-lisp.