Clojure

defrecord positional arity factory fn should have an inline version that calls the record constructor

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

defrecord positional arity factory fn should have an inline version that calls the record constructor

Activity

Hide
Gary Fredericks added a comment -

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.

Show
Gary Fredericks added a comment - 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.
Hide
Kevin Downey added a comment -

interesting, that is a good point

Show
Kevin Downey added a comment - interesting, that is a good point
Alex Miller made changes -
Field Original Value New Value
Labels defrecord
Hide
Gary Fredericks added a comment -

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.

Show
Gary Fredericks added a comment - 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.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: