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.
11:52:55
jcowan
beach: The term "S-expression" seems to be incurably ambiguous: it can mean an internal representation or an external one. (The question of what these representations represent I leave to Kantians.)
12:06:04
hexology
maybe it's good to come up with an alternative term for the "internal" variety (hy calls it a "model"), then define terms unambiguously and adhere strictly to the distinction
12:06:41
hexology
i can't speak for lisp specifically, but i find that this is a useful communication technique in fields with confusing terminology. it's a local lexical binding but for language :)
12:09:37
random-nick
why would s-expression mean an internal representation? as far as I know those are called lists
12:11:05
_death
lisp terminology has been around for a long time, so a person who has been sufficiently exposed to it has a good sense of the channel transition matrix for practical block lengths
12:13:48
hayley
Using the definition "an S-expression is either an atom or a CONS cell ..." how is an "S-expression" different to, say, an "object"?
12:13:49
beach
I find it interesting that some people have opinions about pedagogy, yet instead of using those opinions to teach newbies about Common Lisp, they seem to wait until someone else does, only to complain about the pedagogical techniques used by that someone else.
12:16:52
hayley
Just asking, since a few days ago I got into a "discussion" which involved confusing internal and external representations, and the two "layers" of Lisp syntax, and would like to avoid having that experience again.
12:22:32
hayley
In particular, someone was trying to tell me that one could encode any data types using S-expressions (with just lists, symbols and numbers and such). They are correct, but they wrongly claimed it was specific to S-expressions; I don't think it is, because one would need their own "evaluator" of sorts to produce a graph of objects from the list structure read. One could do just the same with any other syntax.