freenode/#shirakumo - IRC Chatlog
Search
13:33:55
phoe
Shinmera: I have a question about Ubiquitous. Do you have any means to enforce type checks within it?
13:34:22
phoe
For example, I'd like to say that the configuration at (:foo :bar :baz) must be of type (or string symbol).
13:34:56
phoe
It should be an error to try to set anything else there, and the value retrieved from that field must always be of that type.
13:35:39
Shinmera
Well you'd also need to answer the question of what happens when it's uninitialised.
13:36:02
phoe
From docstring for VALUE: "The secondary return value is a boolean depicting whether the field could be found."
13:37:38
Shinmera
Sure but it's not certain whether those semantics make sense when you have a constraint on the type that's being stored there. An error would be more logical, but that would break the protocol.
13:38:15
Shinmera
Either way, what you can do is change AUGMENT to use a custom class that "knows" where it is in the tree and add a check to (SETF FIELD)
13:38:26
Shinmera
Changing AUGMENT is kinda iffy though if Ubiquitous is used by anything that isn't yours.
13:39:17
Shinmera
that does the lookup of the tree in a db that stores the type constraints and checks that way.
13:39:53
Shinmera
In order for ubiquitous to be more generally extensible the protocol would need to be rewritten.
14:30:40
Shinmera
Did I say six new libraries? I meant seven, of course. https://github.com/Shinmera/multiposter
14:30:40
Colleen
github.com/Shinmera/multipo... Website (HTML), Title: GitHub - Shinmera/multiposter: Small application to post to multiple services simultaneously