freenode/#lisp - IRC Chatlog
Search
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.
11:02:00
jmercouris
I'm looking here at gentle introduction to symolic computation and they say you can only sharp-quote normal functions, can't do it for macro functions
11:02:00
minion
jmercouris, memo from flip214: if the image is uncompressed, the mmap() is quite fast. if it's compressed, larger images will take more time to run.
11:02:52
jmercouris
is this something that SBCL does not obey from the specification? is the author mistaken?
11:07:01
shka
jmercouris: don't count on doing that though, standard states that if is a special form and it is up to implementation to decide how to implement it
11:11:58
jmercouris
I always thought mapcar was a strange name, and it only just occured to me that we are mapping a function onto the car of each cons cell
11:13:55
jmercouris
ebzzry: I'm not there yet though, don't want to go down that rabbit hole just yet, first I would like to finish this book
11:15:31
jmercouris
I've already done PCL, and I've been doing some lisp programming for approximately a year now, but I felt there are so many gaps in my knowledge, decided to go back to basics from cover to cover
11:16:22
ebzzry
jmercouris: that’s ok. you’ll get a better appreciation of recursion in lisp with that book.
11:16:55
jmercouris
I intend to become much better at recursion, its been a weakness of mine for a long time
11:17:19
jmercouris
there are some exercises where I feel like I am wasting my time, but for the most part, it has been a very valuable experience
11:40:34
beach
jmercouris: You can use MACRO-FUNCTION to get to the function that a macro defines, but it has a strange signature, so you can't just FUNCALL it with the arguments to the macro.
11:43:56
jmercouris
"Determines whether symbol has a function definition as a macro in the specified environment. "
12:43:22
beach
I guess I can test the memory allocator by allocating and freeing random chunks and verifying after each operation how much total space is left on the heap.