specter icon indicating copy to clipboard operation
specter copied to clipboard

Make a utility to generate paths for record fields that use optimized access

Open nathanmarz opened this issue 9 years ago • 1 comments

e.g.

(defrecord Foo [a b])
(define-record-field-paths Foo)

This would generate paths Foo-a-path and Foo-b-path. The select code path would use direct field access rather than do a keyword lookup to achieve a performance improvement.

nathanmarz avatar Dec 16 '15 20:12 nathanmarz

Since paths can now be compiled in-line, I would suggest instead writing a macro that can be used in-line for a specific field of a record. e.g.

(select [ALL (record-nav Foo a)] [(->Foo 1 2)])
=> [1]

aengelberg avatar Jun 21 '16 17:06 aengelberg