Hi,
I'm reading Graham's explanation (from _ANSI Common Lisp_) on macro
characters and I have a question about one of his statement.
Graham writes that "Functions and hash tables can't be written out
and read back in, and this read-macro ensures that users will have
no illusions on this point" (131). However, I have made usage of
read in one of my programs to read something of this form from a
text file (described in a previous thread):
(define-label 'foo "quux")
and use it as a Lisp object. I have only used the elements of
this list in my program--I haven't actually used it as a function in
the sense that define-label was called, but I know that if I were to
compile my file and define "define-label" in my program, this call
could be interpreted to actually invoke my definition of
"define-label". I'm sure that Graham's statement is correct, I'd
just like to know how I misunderstood him this time :).
Thanks a lot!
--
Jordan Katz <····@underlevel.net> | Mind the gap
In article <··············@underlevel.underlevel.net>, Jordan Katz wrote:
>
> I'm reading Graham's explanation (from _ANSI Common Lisp_) on macro
> characters and I have a question about one of his statement.
>
> Graham writes that "Functions and hash tables can't be written out
> and read back in, and this read-macro ensures that users will have
> no illusions on this point" (131). However, I have made usage of
> read in one of my programs to read something of this form from a
> text file (described in a previous thread):
>
> (define-label 'foo "quux")
>
> and use it as a Lisp object. I have only used the elements of
> this list in my program--I haven't actually used it as a function in
> the sense that define-label was called, but I know that if I were to
> compile my file and define "define-label" in my program, this call
> could be interpreted to actually invoke my definition of
> "define-label". I'm sure that Graham's statement is correct, I'd
> just like to know how I misunderstood him this time :).
I guess what he means is that this works:
(read-from-string (prin1-to-string '(foo bar)))
but this doesn't:
(read-from-string (prin1-to-string #'car))
nor does this:
(read-from-string (prin1-to-string (make-hash-table)))
Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."
PGP key ID 0x42B32FC9