freenode/#lisp - IRC Chatlog
Search
18:03:27
ecraven
which part of the CLHS should I look at to understand when a redefinition of a function is allowed? (interactively via SLIME on a running image)
18:04:45
anamorphic
genhash and annoyingly register-test-designator throws an error if a designator is already registered. Is there any reason why it couldn't provide a restart? I know it's a CDR2 an all, so had wondered if it's a spec thing
18:08:27
ecraven
well, can I just redefine existing any function in any package at any time, and it will work?
18:10:53
djeis[m]
On some implementations redefining functions in the CL packages triggers an error, and by the spec the consequences of those redefinitions are undefined. Otherwise, technically, yes.
18:11:25
ecraven
so if an implementation inlines some functions, it has to take care to recompile everything depending on a function if it is redefined?
18:12:36
djeis[m]
And those functions still can be redefined, you just have to recompile everything which uses those functions for the update to propogate.
18:13:34
djeis[m]
It's a bit of a pedantic distinction, but I'd say an important one- redefinition means something very specific in the case of functions, and it doesn't include things like inlined functions.
18:14:38
djeis[m]
The same thing is true of macros, really- if you redefine a macro you still have to recompile everything which uses the macro.
18:16:40
djeis[m]
Another place where that shows up is when you use 'func vs #'func. Redefinition updates the symbol, so if you call 'func it'll get updated. #'func, on the other hand, captures the actual function object and that does not get modified in-place.
18:28:14
p_l
Automatic recompile of inlining functions requires a who-calls database and most implementations don't provide one