freenode/lisp - IRC Chatlog
Search
19:01:07
Bike
the printing is done in the cl-user package, and without print-escape or print-readably so there should be no symbol prefix in the text
19:02:25
Bike
(defpackage "CL-TEST" (:use)) (write 'cl-test::foo :escape nil :readably nil) => FOO here
19:04:35
kpoeck
(with-standard-io-syntax (write-to-string foo :readably nil :case :upcase :escape nil))
19:09:32
Bike
(with-standard-io-syntax (write (list 'cl-test::foo (cl-test::make-foo)) :escape nil :readably nil :case :upcase)) prints (FOO #S(CL-TEST::FOO)) in my clasp
19:10:38
phoe
maybe let us start from the beginning - is the test testing what is mentioned in the spec
19:11:42
phoe
When the symbol is printed, if it is in the KEYWORD package, then it is printed with a preceding colon; otherwise, if it is accessible in the current package, it is printed without any package prefix; otherwise, it is printed with a package prefix.
19:11:49
Bike
clasp uses prin1 to print the class name, so it overrides the escape setting from outside
19:12:47
phoe
(write-to-string (cl-test::make-blah) :readably nil :case :upcase :escape nil) ;=> "#S(BLAH)"
19:14:44
Bike
i don't see anything saying it's printed abnormally, and if printed the same as everything else there shouldn't be a prefix.
19:14:59
phoe
once again: https://gitlab.common-lisp.net/ansi-test/ansi-test/blob/master/printer/print-structure.lsp#L22
19:15:19
Bike
well you said (write-to-string (cl-test::make-blah) :readably nil :case :upcase :escape nil) ;=> "#S(BLAH)"
19:15:32
Bike
that's not what i'm seeing on clasp or sbcl. presumably ccl's method doesn't prin1 in the same way
19:16:02
Bike
ccl doesn't seem to have a print-object method on structure-object, so i dunno where that would be defined
19:23:44
Bike
i guess? i'm not sure why the structure class name would be treated ddifferently, is all
19:26:08
phoe
because otherwise READ would read a symbol in the current package which is CL-USER which fails the test
19:26:43
Bike
listen. sbcl treats the structure class name specially. it uses prin1 to print it, so the outside readability and escape settings are discarded.
19:28:11
phoe
and I don't feel like forcing to let Paul dig up his memories from fifteen years ago again
19:29:32
phoe
22.1.3.3.1 says, When the symbol is printed, if it is in the KEYWORD package, then it is printed with a preceding colon; otherwise, if it is accessible in the current package, it is printed without any package prefix; otherwise, it is printed with a package prefix.
19:30:50
phoe
A symbol that is apparently uninterned is printed preceded by ``#:'' if *print-gensym* is true and printer escaping is enabled; if *print-gensym* is false or printer escaping is disabled, then the symbol is printed without a prefix, as if it were in the current package.
19:30:58
phoe
the part "if *print-gensym* is false or printer escaping is disabled, then the symbol is printed without a prefix, as if it were in the current package. "
19:31:13
phoe
does "the symbol" mean the symbol being printed, or that gensym that was just mentioned
19:32:29
phoe
since I think it means the gensym that was just mentioned, being on the same paragraph and all
19:33:47
Bike
none of that stuff should matter. the second sentence of 22.1.3.3 says the rest of the section doesn't apply unless printer escaping is enabled
19:34:31
phoe
why the hell does the test require that a symbol read with standard IO syntax be in CL-TEST package and not in CL-USER
19:36:35
Bike
like i said, i don't see anything saying the structure class name is necessarily printed with the prefix.
19:38:34
kpoeck
My last input: In 22.1.3.3 Printing Symbols it says ...The remainder of Section 22.1.3.3 applies only when printer escaping is enabled
19:40:16
Bike
well, i don't know, it might be ok to print the prefix for the structure class name, i just don't see anything saying it HAS to
19:41:53
kpoeck
so for me the solution is to change the test to: (assert (or (eq (car vals) 'print-struct-1) (eq (car vals) 'cl-user::'print-struct-1)))
19:43:12
kpoeck
(assert (or (eq (car vals) 'print-struct-1) (eq (car vals) 'cl-user::print-struct-1)))
19:58:44
kpoeck
(let ((symbol (car vals))) (assert (and (string-equal (symbol-name (car vals)) "print-struct-1") (or (eql (symbol-package symbol) (find-package :cl-user)) (eql (symbol-package symbol)(find-package :cl-test))))))
5:15:35
no-defun-allowed
I looked at https://irclog.tymoon.eu/freenode/%23lisp?from=2018-11-26T00%3A14%3A11&to=2019-11-26T12%3A14%3A11&search=Lisp%20System%20Implementation&by#
5:22:04
anlsh
Thanks! Seems like the discussion hasn't been extensive, so I'll have to try to catch beach sometime
5:34:25
ebrasca
aeth: I have installed sbcl on my talos II, but I can't make it work with multithreading.