freenode/#lisp - IRC Chatlog
Search
21:51:57
makomo
well, anyway, this achieves my goal of using ONCE-ONLY directly, without any rewriting or reinventing the macro
23:27:44
oni-on-ion
literally just reading about 'when-bind' and some very similar examples in On Lisp, pp.94 section 7.6
23:33:09
oni-on-ion
sorry it was jackdaniel who posted this article earlier but i just came across it now from the wild. i thought it was somewhat related to ONCE-ONLY that was being discussed here
1:36:13
kristof
I have stumbled onto something quite accidentally that I read about exactly once in an erik naggum flamewar and I would like to know where in the spec this particular behavior is described
1:37:34
kristof
(defvar variable-name) (defun function-name (variable-name) ;;body) will *bind* variable-name to the value
1:39:35
kristof
I just chose to eschew the naming conventions today and immediately discovered why there are naming conventions
1:40:07
Bike
"When used in a proclamation, a special declaration specifier applies to all bindings as well as to all references of the mentioned variables."
1:42:40
aeth
There are so many fun ways to avoid globals. You can create a closure by putting one or more defuns in a top-level let, for instance. Or you could create a macro that tracks what you want to track.
1:44:04
kristof
I do like globals. They're in the language, and special bindings are unique among all the lexically scoped languages that they deserve to be understood and used.
1:44:08
aeth
This is one way I avoided having a global variable via a macro: (let (... (version (if (fboundp name) (multiple-value-bind (value version) (funcall (fdefinition name)) (declare (ignore value)) (if (and version (integerp version)) (incf version) 1)) 0))) ...)
1:45:16
kristof
I was actually using a defvar in this case to specify a dynamically scoped value that I just didn't want to pass as an argument. I find that valuable
1:46:03
aeth
That does make sense, but I find that the things that make sense as special variables usually already exist (things like *standard-output*)
1:48:00
Bike
if you declare a variable special _locally_, and then bind it again in that extent, that binding will be lexical, so no need for a declaration
4:22:28
Bike
try (find-class name nil). if you get a class, you can use it as a specializer for methods
4:26:51
didi`
Hum, SBCL must do something interesting with the order of slots of a struct, because changing the order of the slots and redefining the struct freaks out the compiler.
4:28:31
Bike
in sbcl's case it means anything using parts of the structure definition will need to be recompiled
8:12:16
knobo
I've made a live-reload prototype for clack. It works for files, but now I want to add support for reload when I recompile a function.
8:16:26
knobo
Like, if it is possible to trace the function call tree when an url is accessed, and send update to the browser when any of those functions are recompiled.
8:27:05
knobo
Maybe use some xref functionality, but I still don't know how to hook that in to the compiler.
8:31:09
blep-on-external
like you're given the request object and the response object and you have to parse them and all tha
8:45:05
knobo
blep-on-external: but nobody uses only clack. Most people would use somthing on top. For example caveman.