[CLJ-864] defrecord positional arity factory fn should have an inline version that calls the record constructor Created: 26/Oct/11 Updated: 04/Dec/13
defrecord positional arity factory fn should have an inline version that calls the record constructor
|Comment by Gary Fredericks [ 26/May/13 3:39 PM ]|
I had the idea recently that the factory fn was useful partly for being a redefinable var, e.g. that you could wrap with contracts or anything else. This idea would preclude that.
It makes sense though if the only purpose of ->Foo is to avoid having to :import something.
|Comment by Kevin Downey [ 13/Aug/13 4:04 PM ]|
interesting, that is a good point
|Comment by Gary Fredericks [ 04/Dec/13 7:21 AM ]|
Another thought – using the factory fns rather than constructors directly gives you a little bit of protection against code-reloading issues, does it not? I don't think I understand the code reloading issues in great detail, so I'm not confident about this. My assumption is that the compiled code refers to vars rather than classes.