
I’d like if built packages were installed by default

@mflatt Is there any way to get the serialize library to use module path indexes rather than full module paths?

Like, if I have (serializable-struct foo ())
(serialize (foo))
But then I move the file with the serialized foo, I won’t be able to deserialize it, even if I moved the file containing the serialized foo
instance, relative to the file containing the foo
definition.)

Or I guess a cleaner way to ask the question:

Why does the third element returned from identifier-binding
give a relative path if its an identifier required from a separate module, but gives an absolute path if the identifier is defined in ‘this’ module?

(Provided that ‘this’ module is actually saved, otherwise it’s obviously going to be a symbol. :slightly_smiling_face: )

Well, identifier-binding
doesn’t give a relative path for a require
d binding; it gives a module-path index that has a relative path combined with another one that refers to the enclosing module, perhaps as an absolute path, and that reflecting the require
form relative to the enclosing module.

I think you’re asking slightly the wrong question.

I think the question is: “is there a way to make serialized data relative?”

There’s a mismatch between your view of serialized data, which lives in a file that might be relative to some other files, and the current deserialize
view of serialized data, where the serialized data isn’t particularly stored in a file. [strike this: But we could imagine that deserialize
pays attention to current-load-relative-directory
to interpret serialized data as relative to other file.]

You can take serialized data, which has embedded paths, and set current-write-relative-directory
while writing the data with fasl-write
. Then, set current-load-relative-directory
while reading the data with fasl-read
.

Ah, no… it’s not a path in the serialized data, but a file
module path.

Ok, so go back to: Add an option to serialize
to make paths relative to current-write-relative-directory
, and then make deserialize
use current-load-relative-directory
for relative paths. I think that would be the right change.

Mmm…that makes sense.

Thanks. I’ll see what I can do and submit another PR. Thanks. :slightly_smiling_face: