coalton-lang / coalton

Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.
https://coalton-lang.github.io/
MIT License
1.15k stars 70 forks source link

Defend inner reader #1114

Closed jbouwman closed 5 months ago

jbouwman commented 5 months ago

Prevent truncation of the form passed to eclector by user-level print length and level settings

Fixes #1053

stylewarning commented 5 months ago

Maybe with-standard-io-syntax?

jbouwman commented 5 months ago

oh, whoops, no -- with-standard-io-syntax blows away the readtable :|

edit: I'm not sure why it doesn't work; will investigate

jbouwman commented 5 months ago

oh, whoops, no -- with-standard-io-syntax blows away the readtable :|

edit: I'm not sure why it doesn't work; will investigate

with-standard-io-syntax sets package to :cl-user, which breaks the contract that the coalton-toplevel form's contents are written and then reread in whatever package is current. For instance, violating this loses the 'cl:gcd' etc. qualified symbols in library/math/integral.lisp and overrides them with their Coalton versions.

print-readably t borks -> syntax

print-circle nil breaks a weak test in tests/reader-tests

so the following would be ok:

  (let ((p *package*))
    (with-standard-io-syntax
      (let ((*package* p)
            (*print-circle* t)
            (*print-readably* nil))
        (prin1-to-string form)))))
stylewarning commented 5 months ago

@jbouwman Do you know why print-readably doesn't work with ->?