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

Feature requests #2

Open
atgreen opened this issue Jan 16, 2023 · 1 comment
Open

Feature requests #2

atgreen opened this issue Jan 16, 2023 · 1 comment

Comments

@atgreen
Copy link

atgreen commented Jan 16, 2023

Thank you for this great library! I'm using it in a transpiler project where I'm creating CL code and don't want to worry about formatting during codegen.

A couple of feature requests:

  • It would be nice if there was a way to set the max line width, and have indenter introduce new lines when appropriate.

  • It would be nice if load-templates was exported, as I want to feed it new templates , but not from a file. This is a minor thing, as I can always use (indentify::load-templates +my-templates+).

@yitzchak
Copy link
Owner

Added a commit to export load-templates.

Inserting additional newlines is probably beyond the capabilities of this library. It doesn't actually parse the code, so it would probably have a hard time deciding how to structure a lisp form.

For that you would need to parse the code and pretty print it. The stock pretty printer won't be able to print comments since those are not retained by the reader. To do that you'd need an extension to the pretty printer that could skip/print items that were read into an AST. I have done this as a "proof of concept" using Eclector and my in-progress pretty printer Inravina (which I am writing for SICL and maybe Clasp). It can be loaded extrinsically so eventually you could do something like this outside of the Lisp implementation's pretty printer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants