Clojure

record multimethod

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Approval:
    Vetted

Description

non-reflective dynamic creation of defrecord instances via a multimethod

Activity

Hide
Stuart Halloway added a comment -

Old ticket. Goal was accomplished via factory fns and literals.

Show
Stuart Halloway added a comment - Old ticket. Goal was accomplished via factory fns and literals.
Hide
Stuart Halloway added a comment -

Rich: updated design proposal at http://dev.clojure.org/display/design/defrecord+improvements. Please provide feedback there and then mark this as waiting on me.

Show
Stuart Halloway added a comment - Rich: updated design proposal at http://dev.clojure.org/display/design/defrecord+improvements. Please provide feedback there and then mark this as waiting on me.
Hide
Assembla Importer added a comment -

stu said: Updating tickets (#370, #366, #374)

Show
Assembla Importer added a comment - stu said: Updating tickets (#370, #366, #374)
Hide
Assembla Importer added a comment -

richhickey said: second thoughts here

Show
Assembla Importer added a comment - richhickey said: second thoughts here
Hide
Assembla Importer added a comment -

stu said: second patch subsumes first and incorporates Rich's feedback. print/read moved to separate ticket #374

Show
Assembla Importer added a comment - stu said: second patch subsumes first and incorporates Rich's feedback. print/read moved to separate ticket #374
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:aGvvlSCmWr35fseJe5cbCb]
Hide
Assembla Importer added a comment -

stu said: I was thinking that record might often get apply-ed. Do we need a function and a macro?

Show
Assembla Importer added a comment - stu said: I was thinking that record might often get apply-ed. Do we need a function and a macro?
Hide
Assembla Importer added a comment -

richhickey said: how about record-implementation-detail-multimethod?

Inside emit-record-factory-method, how about:

  • using :keys destructuring for fields
  • no need for apply on dissoc - it takes multiple keys

Also, you might want to make record itself a macro, so you can flow metadata to the created record:

^{:my "meta"}(record ::Foo :a 1 :b 2)

This will be useful since this will likely become at least the print-dup form for records

Show
Assembla Importer added a comment - richhickey said: how about record-implementation-detail-multimethod? Inside emit-record-factory-method, how about:
  • using :keys destructuring for fields
  • no need for apply on dissoc - it takes multiple keys
Also, you might want to make record itself a macro, so you can flow metadata to the created record: ^{:my "meta"}(record ::Foo :a 1 :b 2) This will be useful since this will likely become at least the print-dup form for records
Hide
Assembla Importer added a comment -

stu said: Questions:

  • I don't like that create-record is public in core. Change its name? Throw in another namespace?
Show
Assembla Importer added a comment - stu said: Questions:
  • I don't like that create-record is public in core. Change its name? Throw in another namespace?
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:d2J0riBEKr35rdeJe5cbLA]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: