libera/#commonlisp - IRC Chatlog
Search
7:30:46
beach
From the glossary, we learn that a "function designator" is either a function object or a symbol.
7:33:29
beach
#'<name> is taken by READ to be a reader macro, so READ returns (FUNCTION <name>) whereas '<name> is taken by read to be a different reader macro so READ returns (QUOTE <name>).
8:13:29
beach
rendar: READ turns a sequence of characters into a data structure in memory that we call an S-expression. An S-expression is either an atom or a CONS cell containing an S-expression it its CAR slot and another S-expression in its CDR slot.
8:13:51
beach
rendar: The evaluator does not handle sequences of characters, but these S-expressions.
8:30:14
beach
Yes, you can say that. It creates a CONS cell that contains its first argument in the CAR slot and its second argument in the CDR slot.
8:33:37
beach
I mentioned what READ does, because the other day, from what you said, it seemed that you were mixing up reading and evaluation.
8:50:57
pve
Hi, do any of the commonly used utility libraries (e.g. alexandria) provide this utility, perhaps under a different name?
9:00:32
pjb
pve: it could be just (define-namespace recipe), the variable name could be a gensym too. Otherwise no, it's not a general enough concept.
9:02:35
pve
pjb: ok thanks, I included the variable name because I think I prefer defvar here, so existing entries won't be clobbered if the form is re-evaluated
9:04:06
pve
although I didn't give it much thought yet.. your gensym idea is good, so I might do that
9:24:33
pjb
the advantage of using a gensym here (or make-symbol), is that since the variable name is not interned, it cannot be used outside of the code generated by the macro, so you're safe from interferences or side-effects from outside.
9:29:43
pve
yes I see, but just to be clear: re-evaluating that will effectively erase existing entries?
9:31:40
kakuhen
depends on what you're invoking; defvar will assign to a dynamic variable if it's unbound, otherwise it doesn't change the binding
9:31:58
kakuhen
defparameter has the opposite behavior: always assigns a given initial value to a dynamic variable
9:42:16
pjb
pve: alternatively, you could store the hash-table in the symbol-plist of the name of the namespace.