Commit Graph

67 Commits (c228aaf836e01831e23a35577cfe6c2d8b013f5c)

Author SHA1 Message Date
John Benediktsson b66c23133e heaps: cleanup using. 2019-01-11 08:19:50 -08:00
John Benediktsson 75f36fa9c5 heaps: fix minor doc typo. 2019-01-10 16:47:45 -08:00
John Benediktsson d29052c7b9 heaps: simplify code a little, use locals to expose heap-delete logic. 2019-01-10 16:44:22 -08:00
Jon Harper 1c28d326b1 heaps: add comments referring to pypy's heapq.py 2019-01-10 21:52:16 +01:00
Jon Harper cc70de32a7 heaps: fix heap delete: sometimes we need to sift-down 2019-01-10 21:40:28 +01:00
Jon Harper be24351a29 heaps.tests: remove dead code 2019-01-10 21:37:28 +01:00
Jon Harper 8a052aed92 heaps: check heap invariant during tests 2019-01-10 21:37:27 +01:00
Jon Harper 2a8643e936 heaps: bring back data-compare as heapdata-compare
It is useful in several places. Change the name because
0d7233f2da changed the convention and data-* words now
operate on the data directly
2019-01-10 18:21:02 +01:00
Samuel Tardieu 2cfa457258 Fix bugs in heap-delete
When an entry is kept to be use later with `heap-delete`, its `index`
in the owning heap is automatically updated as the entry sifts up
or down.

However, if the entry is removed from the heap via either a `heap-pop`
or a `heap-delete` operation, its index is not invalidated and
the entry can still be used later with `heap-delete` and remove the
wrong element from the heap.

This patch invalidates entries when they leave the heap by setting
their index to `f`, and check the index in `entry>index`.
2019-01-04 07:27:28 -08:00
Doug Coleman 9f213f96f6 core: Add the shuffler words but without primitives.
The nipd branch slowed bootstrap by a minute, this patch does not.

sorry about changing the fjsc line endings...
2018-06-19 22:52:58 -05:00
John Benediktsson 0d7233f2da heaps: simplify by using data vector directly. 2018-05-08 15:11:36 -07:00
John Benediktsson 3a1fb4d588 assoc-heaps: adding / fixing test case. 2018-02-14 16:52:53 -08:00
Doug Coleman e189954ecc core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota-tuple ... ; 2017-06-02 11:57:05 -05:00
John Benediktsson ceb75057da change ERROR: words from throw-foo back to foo. 2015-08-13 16:13:05 -07:00
Doug Coleman b6be8685c3 basis: ERROR: changes. 2015-08-13 03:20:39 -07:00
Doug Coleman 43d6f1d3e2 factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:. 2015-07-02 17:28:17 -07:00
Doug Coleman 59f3b1ea57 Revert "factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!"
Needs a bit more work.

This reverts commit 7e54cc2824.
2015-07-02 13:47:06 -07:00
Doug Coleman 7e54cc2824 factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool! 2015-07-02 11:36:08 -07:00
John Benediktsson c6ee627e1b heaps: correctly size the data vector for >min-heap and >max-heap. 2014-12-15 13:29:01 -08:00
John Benediktsson 768ad8abb9 heaps: fix docs for slurp-heap. 2014-12-15 08:56:24 -08:00
John Benediktsson fe377ba02a heaps: fix slurp-heap to allow modifying the heap while slurping. 2014-12-15 08:53:48 -08:00
John Benediktsson 68b662c44c heaps: make data-first throw on empty. 2014-12-13 16:01:20 -08:00
John Benediktsson 3aa14d7570 heaps: faster heaps, simpler heapsort. 2014-12-01 15:16:47 -08:00
John Benediktsson 937f575735 heaps: change slurp-heap to slurp keys and values. 2014-12-01 15:14:25 -08:00
John Benediktsson ab3f3173af change errors to use "object" instead of "obj". 2014-12-01 08:04:49 -08:00
John Benediktsson 793fa7baeb heaps: whoops, this was an error. 2014-11-30 22:30:15 -08:00
John Benediktsson 76761b2e59 more minor cleanup. 2014-11-30 19:26:23 -08:00
Benjamin Pollack 2c3dd8c3c8 Remove executable bit from tons of files that aren't 2014-11-05 20:40:42 -08:00
John Benediktsson 6ab848775e heaps: use before? and after?. 2014-07-10 07:53:13 -07:00
John Benediktsson c20838117d heaps: fix stack effect for >max-heap. 2014-06-10 17:18:37 -07:00
John Benediktsson 57f9d78892 improve help by linking to types directly. 2014-05-23 20:20:15 -07:00
John Benediktsson feb4dcae9a heaps: cleanup some code, faster heap-compare. 2014-05-21 08:56:30 -07:00
Doug Coleman bfe0ace611 heaps: Add >min-heap, >max-heap. 2013-04-06 13:50:16 -07:00
John Benediktsson 95c1abe468 heaps: performance improvements. 2013-03-06 19:41:37 -08:00
John Benediktsson 52fab586be heaps: inline heap-size also. 2012-09-14 12:07:56 -07:00
John Benediktsson 2422490f86 heaps: speed up heaps benchmark. 2012-09-14 10:03:30 -07:00
Doug Coleman 250d96d7b1 Clean up heaps implementation, test max-heaps. 2011-04-10 12:57:39 -05:00
Slava Pestov 1b4b1a180c Some minor pointless optimizations 2010-04-01 20:09:14 -04:00
Slava Pestov df4fb4a3ee Removing integers-as-sequences 2010-01-15 07:15:33 +13:00
Doug Coleman 0d4b9132d7 fix a bunch of typos in docs 2009-10-21 17:40:43 -05:00
Keith Lazuka 405e5d015b docs: change $subsection to $subsections 2009-10-02 12:15:48 -04:00
Doug Coleman 3f3d57032b Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places, minor refactoring 2009-08-13 19:21:44 -05:00
Joe Groff 7c5ef08aab [ [ ... ] compare ] sort => [ ... ] sort-with 2009-08-02 20:09:23 -05:00
Slava Pestov 389b689796 slightly faster heaps, add benchmark 2009-07-18 00:52:24 -05:00
Slava Pestov 37b01357ec Remove unused words discovered by Samuel Tardieu 2009-06-16 16:38:39 -05:00
Slava Pestov 2d231f066a GC checks now save and restore registers 2009-06-02 18:23:47 -05:00
Doug Coleman 407377fc98 rename peek -> last and update all usages 2009-05-25 16:38:33 -05:00
Doug Coleman 364ea217ef fix more compiler errors 2009-04-17 14:44:08 -05:00
Slava Pestov 25a877e50b Merge OneEyed's patch 2009-02-28 17:06:55 -06:00
Slava Pestov cd53c2bd37 produce and produce-as: don't need third quotation either 2009-02-28 15:31:34 -06:00