notjack
2018-7-6 19:13:59

I’d like if built packages were installed by default


leif
2018-7-6 21:58:53

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


leif
2018-7-6 22:01:00

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.)


leif
2018-7-6 22:15:42

Or I guess a cleaner way to ask the question:


leif
2018-7-6 22:16:53

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?


leif
2018-7-6 22:17:10

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


mflatt
2018-7-6 22:22:15

Well, identifier-binding doesn’t give a relative path for a required 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.


mflatt
2018-7-6 22:22:23

I think you’re asking slightly the wrong question.


mflatt
2018-7-6 22:23:00

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


mflatt
2018-7-6 22:25:03

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.]


mflatt
2018-7-6 22:27:39

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.


mflatt
2018-7-6 22:29:02

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


mflatt
2018-7-6 22:31:01

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.


leif
2018-7-6 22:34:40

Mmm…that makes sense.


leif
2018-7-6 22:34:55

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