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
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:d2J0riBEKr35rdeJe5cbLA]
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 -

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: 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 -
Show
Assembla Importer added a comment - stu said: [file:aGvvlSCmWr35fseJe5cbCb]
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 -

richhickey said: second thoughts here

Show
Assembla Importer added a comment - richhickey said: second thoughts here
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)
Stuart Halloway made changes -
Field Original Value New Value
Assignee Stuart Halloway [ stu ]
Stuart Halloway made changes -
Reporter Assembla Importer [ importer ]
Priority Blocker [ 1 ]
Approval Test Vetted
Aaron Bedra made changes -
Priority Blocker [ 1 ] Major [ 3 ]
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.
Stuart Halloway made changes -
Waiting On richhickey
Rich Hickey made changes -
Waiting On richhickey stu
Christopher Redinger made changes -
Fix Version/s Backlog [ 10035 ]
Fix Version/s Release.Next [ 10038 ]
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.
Stuart Halloway made changes -
Status In Progress [ 3 ] Closed [ 6 ]
Fix Version/s Backlog [ 10035 ]
Resolution Declined [ 2 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: