Hacker News new | ask | show | jobs
by kazinator 1106 days ago
In fact, the Racket dialect being discussed has a facility for this:

https://docs.racket-lang.org/web-server-internal/closure.htm...

It is correct that usually Lisps do not have a print-read consistency for every object, just objects that someone has decided to care about. Most Common Lisps are like this. However, note that many of them have image saving. Image saving traverses the heap and serializes every object. That includes lexical closures. Their code vector, environment vector(s): everything is traversed. It's just not a printed notation!

If some object isn't printable and someone wants it badly to be, it can be arranged somehow.

It boils down to pragmatics.

Foreign objects (FFI handles holding foreign pointers) are going to be tricky; you would need some hooking mechanism to try to do something meaningful.

Image saving already cannot do some things, like saving open network connections such that they come up connected in a restarted image.