Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added installed transaction functions using :db/ident and :db/fn semantics #185

Closed
wants to merge 1 commit into from

Conversation

@refset
Copy link
Contributor

refset commented Oct 30, 2016

The existing approach uses function references with :db.fn/call which meant I couldn't trivially serialise (using transit/write) tx-data before expansion into datoms, so I created this alternative which should also enable some interesting new patterns for function modularity. I appreciate it's probably not "native" enough to be accepted as-is, but what do you think? Do you see a better way?

@tonsky

This comment has been minimized.

Copy link
Owner

tonsky commented Oct 30, 2016

Interesting idea! I think, this should be done a little more in line with how Datomic works. E.g. using :db/ident for function name (keyword), :db/fn for actual function value (IFn) and [<ident> & <args>] syntax for calling it in a transaction. Do you mind making these changes?

@refset

This comment has been minimized.

Copy link
Contributor Author

refset commented Oct 30, 2016

Okay I think I've just about managed it! How does that look?

Note that a key benefit of this functionality is the ability to trivially serialise transaction maps which contain transaction functions (a challenging constraint of the existing option).

@refset refset changed the title Added :db.dbfn/call for installed transaction functions Added installed transaction functions using :db/ident and :db/fn semantics Nov 1, 2016
@tonsky tonsky force-pushed the tonsky:master branch 3 times, most recently from ada9497 to 130e06f Apr 9, 2017
@refset refset closed this Feb 21, 2018
@refset refset force-pushed the refset:master branch from fb01154 to d45ddf6 Feb 21, 2018
@refset

This comment has been minimized.

Copy link
Contributor Author

refset commented Feb 21, 2018

Sorry, I inadvertently (automatically!) closed this when trying to sort out the branches in my fork. I'd be happy to try to rebase these changes sometime.

@refset refset reopened this Feb 21, 2018
@refset refset force-pushed the refset:master branch from fb01154 to d86e0b1 Oct 8, 2018
@refset refset force-pushed the refset:master branch from d86e0b1 to 14d2bef Oct 8, 2018
tonsky added a commit that referenced this pull request Dec 7, 2018
@tonsky tonsky closed this in 34c122e Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.