libera/#commonlisp - IRC Chatlog
Search
15:22:57
beach
nij-: Of course, you are somewhat out of luck, because BOUNDP doesn't really tell you what you want. There is some annoyingly ambiguous language in the standard. Sometimes "bound" means "has a value", and sometimes it means "has a binding that may have no value".
15:24:22
beach
Like if you do (DEFVAR XYZ) and then (BOUNDP 'XYZ) you get NIL. Yet, XYZ is a variable.
15:25:43
jmes
Is there a way to shadow a binding with a symbol-macro whose expansion references the original binding? e.g. this is what I want to do, but it exhausts the control stack: (let ((a 1)) (symbol-macrolet ((a (1+ a))) ...))
15:26:07
White_Flame
a really silly way is to do packagename:<tab> and see everything that is earmuffed with asterisks :-P
15:27:31
Shinmera
(definitions:find-definitions *package* :type 'definitions:special-variable) will give you whatever variables are accessible in the current package.
15:28:10
beach
jmes: How about something like (let ((a 1)) (symbol-macrolet ((mumble a)) (symbol-macrolet ((a (1+ mumble))))))
15:32:55
Bike
symbol macros just expand in the same context, so if the original variable appears in the expansion it will just be expanded again
15:36:06
jmes
Bike: yeah, so what I've learned is if a symbol-macro expansion has its own symbol inside it then the stack goes boom, sadly.
15:56:00
Bike
of course, for something like 1+ there's no need to refer to the actual binding, so (let ((mumble a)) (symbol-macrolet ((a (1+ mumble))) ...)) would work, but maybe you want it as an actual place
17:30:06
pjb
jmes: (let ((a 1)) (flet ((get-a () a)) (symbol-macrolet ((a (1+ (get-a)))) a))) #| --> 2 |#
18:45:22
NotThatRPG
Having a momentary memory lapse: isn't there a library that offers a `partition-if` function? If so, could someone point me at it?