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

Implement cl object methods for Emacs interop #204

Open
8 tasks
Fuco1 opened this issue Feb 23, 2023 · 0 comments
Open
8 tasks

Implement cl object methods for Emacs interop #204

Fuco1 opened this issue Feb 23, 2023 · 0 comments

Comments

@Fuco1
Copy link
Member

Fuco1 commented Feb 23, 2023

Each Elsa object should have two printing methods:

  • one to serialize the object, in a way that this can be read back to reconstruct the object => object-write. Slots can have overriding printers via :printer property

  • one to print the object in a human readable way (for debugger etc). We will always use the #<class some-readable-representation> format. => cl-print-object. For a class hierarchy when reasonable we can use top-level class, since this does not need to be readable back into lisp.

  • some classes might have specialised methods, for example elsa-type needs serialization in a elsa-make-type compatible form (rather than a string?), and elsa-form should be able to turn into a lisp form.

  • use eieio-override-prin1 as printer for object types so there is no useless indent

  • rename elsa-tostring to elsa-to-string

  • elsa-type

    • elsa-type-describe -> maybe return a form instead, which could then be turned into a string. So this would return lisp forms string (symbol) or (list string) which could be (format "%s" x).
    • cl-print-object => #<elsa-type string> or #<elsa-type (list string)> => single implementation for type using the "description" to print the actual type.
    • object-write => (elsa-type-string) or (elsa-type-list :item-type (elsa-type-string))
  • elsa-form

    • elsa-form-print -> we already have elsa-form-to-lisp which can then be turned into string
    • cl-print-object => #<elsa-form :foo> or #<elsa-form (list :list 1) => single implementation for all the forms with just a prefix #<elsa-form.
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

1 participant