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
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
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
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
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
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
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
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
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
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
Slava Pestov
669548e62e
Clean up some usages of tuck, and add Joe's curried cleave/spread/apply combinators to kernel vocabulary
2009-02-02 13:43:54 -06:00
Slava Pestov
daf2857d7b
define-inline now takes an effect parameter
...
C: now sets the stack effect of the new word to slot names
add new basis/constants vocab; CONSTANT: foo bar is equivalent to : foo bar ; inline
(going to fold CONSTANT:, ALIAS: and qualified into core soon perhaps)
tighten the screws: inline words now need a stack declaration too
update some usages of inline words
2008-12-15 19:44:56 -06:00
Doug Coleman
d0370a06b0
remove >r r> from heaps
2008-11-29 13:28:52 -06:00
Slava Pestov
de02724135
Make a word inline for the win
2008-11-11 23:04:30 -06:00
Slava Pestov
c19f2257f4
Fix permission bits
2008-10-02 08:34:49 -05:00
Slava Pestov
4ce980b9ac
Move heap-slurp-when to spider
2008-10-01 20:54:58 -05:00
Doug Coleman
ffaab5a14e
add slurp-heap-when, document heap-slurp-*
2008-10-01 18:10:57 -05:00
Slava Pestov
89ce8e1f3e
Add slurp-heap combinator, like slurp-deque
2008-09-15 02:59:00 -05:00
Doug Coleman
945626247f
new accessors
2008-08-29 16:42:22 -05:00
Doug Coleman
42bd621cce
ERROR: instead of throw
2008-08-29 02:13:27 -05:00
Slava Pestov
d66f887736
Create basis vocab root
2008-07-28 22:03:13 -05:00