Commit graph

355 commits

Author SHA1 Message Date
Nathan Marz
fcb5e013d4 fixed inline precompilation of inline sets in paths, fix bug leading to wrong params order during inline precompilation, change select/transform operations to be macros and move code around accordingly, rename previous versions of select/transform functions with * added 2016-05-22 08:57:53 -04:00
Nathan Marz
cdcdbbbaa4 clean up terminology – defpath -> defnav, path -> nav, fixed-pathed-path -> fixed-pathed-nav, variable-pathed-path -> variable-pathed-nav, StructurePath -> Navigator (breaking changes) 2016-05-21 15:54:07 -04:00
Nathan Marz
c567045fb5 better conditional checking of cached value 2016-05-21 10:08:50 -04:00
Nathan Marz
c2fa922717 automatically factor anonymous functions with pred, 20% more effient cache strategy, more efficient hot path, added ability with must-cache-paths to error when a path can't be cached and get detailed information why 2016-05-21 09:44:20 -04:00
Nathan Marz
d3a462aa06 initial impl working for basic use cases 2016-05-20 16:57:53 -04:00
Nathan Marz
1d77d295fa minor refactoring of ATOM and update changelog 2016-05-08 15:55:45 -04:00
Rakesh
c280b40b12 renamed atompath to ATOM 2016-05-08 23:39:14 +05:30
Rakesh
7b33c93132 Added path to navigate to atom value 2016-05-07 22:40:21 +05:30
Nathan Marz
03f6a12baa fix must select 2016-05-05 14:59:25 -04:00
Nathan Marz
3602a08e5d docstring for view 2016-05-05 14:29:20 -04:00
Nathan Marz
b4b2200377 added must navigator 2016-05-05 14:24:57 -04:00
Nathan Marz
f5c5284ae1 add docstrings to zippers 2016-04-25 17:47:10 -04:00
Nathan Marz
48ad46d5e5 add zipper/PREV 2016-04-24 16:54:07 -04:00
Nathan Marz
9a3a19bb9b add NODE-SEQ, find-first, and NEXT-WALK 2016-04-24 16:49:45 -04:00
Nathan Marz
96d5e94a5b fix zipper navigation to stop navigating when right/left/up/down/next navigate nowhere 2016-04-24 13:03:29 -04:00
Nathan Marz
a4e1f1267b zippers working in cljs 2016-04-24 11:10:55 -04:00
Nathan Marz
70523ac38f add zipper tests 2016-04-24 11:03:52 -04:00
Nathan Marz
747b080909 added INNER-RIGHT and INNER-LEFT 2016-04-24 10:42:19 -04:00
Nathan Marz
b68d59ca90 Merge branch 'zipper' 2016-04-23 13:30:15 -04:00
Nathan Marz
a9aafc3eb8 clean up terminology usage by replacing selector with navigator or path as appropriate 2016-04-21 10:59:35 -04:00
Nathan Marz
82f591a5d3 redefine filterer in terms of subselect 2016-04-20 22:09:02 -04:00
Nathan Marz
7a29e3f056 Merge pull request #75 from aengelberg/add-select-view
Add new "subselect" path selector
2016-04-20 21:57:51 -04:00
Beau Fabry
eb20e86f9c Address PR comments
* Behave the same as select-keys for non-existent keys
 * Remove variadic input redirection
 * Use reduce to remove data instead of apply
2016-04-19 17:35:34 -07:00
Beau Fabry
b3c707092e add a submap path 2016-04-19 15:15:06 -07:00
Alex Engelberg
c7252a2b90 Changed name from 'select-view' to 'subselect' 2016-04-19 12:04:18 -07:00
Alex Engelberg
d797e1aec1 Add warning to docstring about input navigator requirement 2016-04-19 12:03:21 -07:00
Alex Engelberg
4c8aeebafc Switch from atom to mutable-cell 2016-04-19 11:55:32 -07:00
Alex Engelberg
96f6bbc9f4 Add select-view path selector + test case 2016-04-19 00:47:56 -07:00
Nathan Marz
c861756836 Merge pull request #73 from thomasathorne/biview
Add `parser` path.
2016-04-18 14:20:19 -04:00
Thomas Athorne
1ddd8c22f6 Clearer names for arguments that are functions. 2016-04-18 16:21:33 +00:00
Nathan Marz
0134656d0a minor code cleanup 2016-04-18 12:18:47 -04:00
Nathan Marz
f048d23cda Merge pull request #63 from StephenRudolph/master
Add idempotency for PersistentQueue collection type
2016-04-18 12:09:59 -04:00
Nathan Marz
c962971d7a fix for bootstrap cljs compatibility 2016-04-17 21:00:58 -04:00
Nathan Marz
703e25e1fe use->require in macros.clj for bootstrap cljs compatibility 2016-04-17 16:26:54 -07:00
Thomas Athorne
60bf33ffab Change name; add a test spec. 2016-04-17 16:04:22 +01:00
Thomas Athorne
c34e900427 Add biview path. 2016-04-16 17:16:23 +01:00
Stephen Rudolph
ddea0a223d Moving CLJS code to use transformers instead of reducers 2016-02-26 17:10:09 -06:00
Stephen Rudolph
0f2118d939 Merge remote-tracking branch 'upstream/master' 2016-02-26 16:29:34 -06:00
Nathan Marz
050384e0fd cleaner and more composable integration 2016-02-21 19:44:50 -05:00
Nathan Marz
70d916dd6a edit -> edited 2016-02-16 18:29:57 -05:00
Nathan Marz
2d868ec587 zipper/specter integration implementation 2016-02-16 15:21:26 -05:00
Nathan Marz
ed6f1902b9 rename VOID to STOP 2016-02-13 18:56:35 -05:00
Stephen Rudolph
1b26aaff1b Fixed CLJS queue usage 2016-02-12 20:27:32 -06:00
Stephen Rudolph
a12222eac5 Persistent queues no longer treated as lists 2016-02-12 16:16:54 -06:00
Nathan Marz
de15b1e23e handle paramsneededpath with 0 params (used for params-reset) correctly in higher order paths 2016-02-11 16:54:14 -05:00
Nathan Marz
8293f68696 allow defprotocolpath to be defined with no params argument for consistency with declarepath 2016-01-31 10:01:08 -08:00
Nathan Marz
b16dbdfdd2 change params-reset to backtrack in params-idx by number of needed params of its path, add test that verifies composability 2016-01-30 12:41:29 -08:00
Nathan Marz
8dd2cb8939 allow declarepath to have parameters, implemented params-reset for enabling recursive parameterized paths 2016-01-30 12:03:46 -08:00
Nathan Marz
7e54757659 auto-coerce map entries to vectors during ALL 2016-01-28 12:41:36 -08:00
Nathan Marz
d56ea62e00 reimplement stay-then-continue and continue-then-stay in terms of multi-path 2016-01-22 19:45:20 -08:00
Nathan Marz
aa8755254f clean up notes 2016-01-14 17:48:39 -05:00
Nathan Marz
dd6dafc390 implemented declarepath/providepath 2016-01-14 17:36:49 -05:00
Nathan Marz
1328551a19 added STAY, stay-then-continue, and continue-then-stay selectors 2016-01-14 13:15:19 -05:00
Nathan Marz
b3b6b99e7a fix replace-in to work with value collection 2016-01-12 16:25:02 -05:00
Nathan Marz
49c749b74e fix typo in comment 2016-01-12 15:40:37 -05:00
Nathan Marz
e37c605697 protocol path extensions now verify if correct number of parameters and error otherwise 2016-01-11 14:45:06 -05:00
Nathan Marz
2ad873da11 fixed #48 2016-01-11 10:25:03 -05:00
Nathan Marz
af7d76be97 improve syntax checking for defpath 2016-01-10 10:35:38 -05:00
Nathan Marz
c9b78ce0d6 add VOID selector 2016-01-10 10:35:18 -05:00
Nathan Marz
0f3ea6c79b throw error if function names incorrectly specified in defpath, improve formatting of error messages 2016-01-05 08:57:27 -05:00
Nathan Marz
3073f1256b fix array creation for cljs 2015-12-16 01:03:39 -05:00
Nathan Marz
41f42e20a1 fixed inadvertant reflection in protocol paths, replace object-array in jvm impl with faster impl 2015-12-16 00:53:50 -05:00
Nathan Marz
827726cf54 implement tests for protocol paths, make clear that it only works in clj 2015-12-12 12:37:21 -05:00
Nathan Marz
fc51d70b0f renamed defparamspath and defparamscollector to defpath and defcollector, defpath without params now produces compiledpath directly, implemented protocolpaths 2015-12-12 12:03:59 -05:00
Nathan Marz
3980e0f194 make comp-paths work on lazyseqs for cljs 2015-11-03 10:51:42 -05:00
Nathan Marz
3a13052145 add nil->val, NIL->SET, NIL->LIST, NIL->VECTOR, and subset selectors 2015-10-10 11:52:50 -04:00
Josh Tilles
8df05c2597 Minor tweak: avoid top-level dos. 2015-10-09 14:58:59 -04:00
Josh Tilles
9e215b638e Support Clojure 1.6 by adopting cljx.
Fixes nathanmarz/specter#16.
Resolves nathanmarz/specter#18.
2015-10-09 14:55:10 -04:00
Nathan Marz
9fcd9e5ed4 walker and codewalker can now be late-bound parameterized 2015-09-24 11:55:24 -05:00
Nathan Marz
df4c3bf974 added paramsfn helper macro for defining filter functions with later bound parameters 2015-09-20 22:24:11 -04:00
Nathan Marz
f12b6bc046 fix typo/formatting 2015-09-18 15:01:01 -04:00
Nathan Marz
c6046aa874 parameterize view and make a parameterized version of using a function called pred 2015-09-12 14:15:35 -04:00
Nathan Marz
42befa556e removed dead code 2015-09-12 14:15:17 -04:00
Nathan Marz
5e08fd199e cleanup capture-params-internally code 2015-09-12 13:16:58 -04:00
Nathan Marz
f7f2911350 precompile ALL, LAST, and FIRST 2015-09-11 17:36:16 -04:00
Nathan Marz
c6522de07d clojurescript port complete, not working for greater than 20 params 2015-09-11 17:17:43 -04:00
Nathan Marz
ffaaf06f9f parameterized paths working for cljs 2015-09-11 16:51:21 -04:00
Nathan Marz
5cb0a8e4f0 complete cljs refactoring 2015-09-11 16:13:03 -04:00
Nathan Marz
7a4caa5b61 partial refactoring to prepare for cljs compatibility 2015-09-11 16:06:31 -04:00
Nathan Marz
c633e3a80a fix comment for putval 2015-09-11 11:23:51 -04:00
Nathan Marz
224369f4eb add comments about what can be parameterized 2015-09-11 11:21:21 -04:00
Nathan Marz
2a30a6aba5 collect-val instead of collect* 2015-09-11 01:42:29 -04:00
Nathan Marz
ae679b6cc1 remove dead code from old collector code 2015-09-10 23:10:34 -04:00
Nathan Marz
fc6392cc9e implement pathed collectors and convert collect and collect-one 2015-09-10 23:09:19 -04:00
Nathan Marz
bcfcd02f80 implemented paramscollector and converted putval to use it 2015-09-10 22:55:43 -04:00
Nathan Marz
983bf84495 parameterize srange and srange-dynamic, ParamsNeededPaths can now be called as a function to convert to CompiledPath 2015-09-10 22:26:32 -04:00
Nathan Marz
ef40adbe3b better names for higher order parameterized path helpers 2015-09-10 21:47:52 -04:00
Nathan Marz
a983e6e028 all higher order selectors now converted to be parameterizable, helpers for making higher order selectors with fixed paths or variable paths complete 2015-09-10 20:47:46 -04:00
Nathan Marz
3187cdad34 have params-paramspath helper automatically compile the path, refactor filterer 2015-09-10 17:12:54 -04:00
Nathan Marz
efd4f2ee9a higher order parameterized builder working, implemented filterer 2015-09-10 17:09:16 -04:00
Nathan Marz
56ba5a5b8d removed unused KeyPath type 2015-09-10 14:08:57 -04:00
Nathan Marz
2dfc490438 remove debugging println 2015-09-10 13:57:27 -04:00
Nathan Marz
d8feed2ca1 paramspath working with composition, measured about 14% slower than compiled path without params and 15x faster than select with on the fly compilation 2015-09-10 13:56:33 -04:00
Nathan Marz
6e3f79dd53 restructured in terms of CompiledPath and implemented composition for ParamsNeededPath 2015-09-10 02:38:52 -04:00
Nathan Marz
d693ad29ae more name refactoring 2015-09-10 00:04:57 -04:00
Nathan Marz
d1a5b66c71 rename StructureValsPathComposer to PathComposer 2015-09-10 00:03:29 -04:00
Nathan Marz
f800a510dd remove unnecessary StructureValsPath protocol and move path composer protocol into impl 2015-09-09 15:20:58 -04:00
Nathan Marz
1d93961cd3 fix not-native tag for optimized cljs prot invocation 2015-07-03 17:40:13 -04:00
Nathan Marz
80e1e3dd30 optimized protocol invocations for cljs 2015-07-03 16:38:06 -04:00
Nathan Marz
a76f124579 get rid of field macro since .- syntax works in both clj and cljs 2015-07-03 15:46:35 -04:00
Nathan Marz
2383cc9aab replace obj-extends? with satisfies?, make default clojurescript impls for protocols by using default instead of object 2015-07-03 15:40:34 -04:00
Nathan Marz
6440e4e605 fix unsafe extensions of protocols to native javascript objects 2015-07-03 15:29:14 -04:00
Nathan Marz
051ba3f038 added not-selected? and transformed selectors 2015-07-02 17:23:18 -04:00
Nathan Marz
b626227a9e remove extra overhead in cljs protocol method invocations 2015-07-01 10:33:29 -04:00
Nathan Marz
859b31bce7 huge speedup to cljs version by optimizing field access 2015-07-01 10:30:51 -04:00
Nathan Marz
38fed4a7d0 fixed cljs obj-extends? to have special case for nil because it cannot be reflected on like normal objects 2015-06-30 19:46:55 -04:00
Nathan Marz
905e6b9b07 fix namespace problem with LAST/FIRST 2015-06-30 17:07:44 -04:00
Nathan Marz
8900eac847 merge in latest changes to master 2015-06-30 14:31:07 -04:00
Nathan Marz
1f2b4f03de fix bug in select-one! where nil result could not be returned 2015-06-29 23:43:15 -04:00
Nathan Marz
8053245c48 allow sets to be used directly as selector (acts as filter) 2015-06-29 18:30:30 -04:00
Nathan Marz
bcc15b1587 change FIRST/LAST to select nothing on empty sequences, closes #4 2015-06-29 18:17:52 -04:00
Nathan Marz
94a451511f merge in new features from master 2015-06-25 16:34:02 -04:00
Nathan Marz
6a2afccbfd add multi-path implementation 2015-06-25 16:30:27 -04:00
Nathan Marz
6b0a907fff fix mutable cell for clj 2015-06-24 18:27:26 -04:00
Nathan Marz
f3080d8e09 fix mutable cells (not sure what problem was 2015-06-24 18:15:07 -04:00
Nathan Marz
784378af34 allow coerce-path and comp-paths to work with more sequence types 2015-06-24 18:02:20 -04:00
Nathan Marz
9ac06c10d8 Clojurescript version working 2015-06-24 17:44:40 -04:00
Nathan Marz
dcc061413f got obj-extends? working in both clj and cljs 2015-06-24 16:21:42 -04:00
Pietro F. Menna
3b3bace828 Testing 2015-06-24 14:28:33 -04:00
Pietro F. Menna
67d95ee00a Fixed merged cnflicts 2015-06-24 11:49:27 -04:00
Pietro F. Menna
1c01a1e808 Renamed update to transform because of Clojure 1.7 2015-06-24 11:42:50 -04:00
Nathan Marz
6d028cbe24 change filterer so it accepts a path that acts like selected? 2015-06-22 14:37:39 -04:00
Nathan Marz
bb1a70c339 fix api doc for cond-path 2015-06-19 14:27:22 -04:00
Nathan Marz
e4a3275ff1 change cond-path/if-path to take a selector for the conditional (works like selected?) 2015-06-19 14:13:22 -04:00
Nathan Marz
da2019b07b added cond-path and if-path selectors 2015-06-18 00:56:03 -04:00
Nathan Marz
5a6d3fe630 fix composing together something defined with comp-paths with other selectors in a comp-unoptimal setting 2015-06-01 14:21:31 -04:00
Nathan Marz
50576e447b empty selectors and nil count as identity path now fixing #5, remove IDENTITY-PATH in favor of nil 2015-05-31 08:50:00 -04:00
Nathan Marz
6bae041970 added putval and IDENTITY-PATH selectors 2015-05-27 01:02:19 -04:00
Nathan Marz
6e440d235c notes 2015-05-11 15:08:51 -04:00
Nathan Marz
085dc1d333 optimize lookup of structurepath implementation for regular functions (about a 3x speedup in non-compiled execution when functions are involved 2015-05-11 15:00:21 -04:00
Nathan Marz
7f69a99861 speed up non-compiled execution path to where it was before 2015-05-11 14:21:02 -04:00
Nathan Marz
cd994b10ee improve execution of kws 2015-05-11 14:02:08 -04:00
Nathan Marz
e0bde53fef formatting 2015-05-11 13:31:12 -04:00
Nathan Marz
060e61218a optimize sequence of structurepaths to not add additional overhead by coercing to structurevalspath 2015-05-11 11:44:42 -04:00
Nathan Marz
0767afca61 prepare for optimized execution of pure structurepaths 2015-05-11 10:35:30 -04:00
Nathan Marz
def5656e40 re-add ability to compose via vectors with a more efficient implementation 2015-05-10 20:00:13 -04:00
Nathan Marz
c47650993d improve performance of non-compiled code path by 3x, remove ability for a vector to be considered a structurepath 2015-05-10 19:56:30 -04:00
Nathan Marz
4e268629c3 complete no protocol execution, speed is generally now just as good or far better than equivalent clojure code 2015-05-10 18:47:57 -04:00
Nathan Marz
b20d035950 add update-fast 2015-05-10 08:09:48 -04:00
Nathan Marz
47aee4d000 broken implementation of skipping protocols 2015-05-10 02:12:06 -04:00
Nathan Marz
5b62817bd5 add docstring to main api 2015-04-22 11:46:13 -04:00
Nathan Marz
ec097f8db2 make filterer eager on select 2015-04-22 11:45:35 -04:00
Nathan Marz
45260ff9c1 change val-select* to collect*, rename comp-structure-paths to comp-paths, clean up names of protocols, add selected? function, update README 2015-04-19 13:45:20 -04:00
Nathan Marz
ea05b98280 added benchmark helper to impl 2015-04-18 12:17:09 -04:00
Nathan Marz
ca1940a026 added view and viewfn 2015-04-18 12:16:51 -04:00
Nathan Marz
d212140c8b refactored interfaces to allow structurepaths to be specified without worrying about vals 2015-04-15 13:43:19 -04:00
Nathan Marz
ffd6464d54 added srange, srange-dyamic, START, and END dynamic paths to manipulate parts of a sequence by index 2015-04-14 23:49:32 -04:00
Nathan Marz
7613ffd74e add setval convenience function to api 2015-04-01 18:00:22 -04:00
Nathan Marz
a6b8546a17 eagerly evaluate ALL 2015-03-01 23:34:20 -05:00
Nathan Marz
857cd04711 fix ALL on all kinds of lists, lazy seqs, etc. 0.0.5 2015-03-01 23:26:56 -05:00
Nathan Marz
97086068d6 fix ALL on regular lists from reversing order 2015-03-01 20:33:42 -05:00
Sol Ackerman
ea0cb032b3 allow updating sets 2015-02-27 11:34:49 -06:00
Nathan Marz
59a1f742bf remove use of transients 2015-02-26 15:58:16 -05:00
Nathan Marz
3750dd73f5 rewrite filter+ancestry to be purely functional and stop using transients incorrectly 2015-02-26 15:48:10 -05:00
Nathan Marz
a1d1f236ab initial commit 2015-02-26 10:55:20 -05:00