Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRINT-OBJECT not used #444

Open
mmontone opened this issue Sep 1, 2022 · 0 comments
Open

PRINT-OBJECT not used #444

mmontone opened this issue Sep 1, 2022 · 0 comments

Comments

@mmontone
Copy link

mmontone commented Sep 1, 2022

PRINT-OBJECT is not used by WRITE family of functions.

Example:

CL-USER> (defclass person () 
... (firstname lastname))
#<standard-class PERSON>
CL-USER> (make-instance 'person)
#<instance PERSON (..) (..) >
CL-USER> (defmethod print-object ((person person) stream) 
... (print-unreadable-object (person stream :type t :identity t) 
... (format stream "A person")))
#<standard-method PRINT-OBJECT((PERSON PERSON) STREAM)>
CL-USER> (make-instance 'person)
#<instance PERSON (..) (..) >

Not super important, but I stumbled with this when looking at showing lambda-lists for function objects.
I wasn't able to fix the implementation, but changing the implementation of the WRITE has some effect.

mmontone added a commit to mmontone/jscl that referenced this issue Sep 1, 2022
When printing function objects, display its lambda-list.

This could be done via PRINT-OBJECT in theory, but PRINT-OBJECT is not
being dispatch from WRITE function. See issue jscl-project#444

Example of how functions are printed after this commit:

```
  CL-USER> #'prin1-to-string
  #<FUNCTION PRIN1-TO-STRING (FORM)>
  CL-USER> #'prin1
   <FUNCTION PRIN1 (FORM &OPTIONAL STREAM)>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants