diff options
author | Aria Shrimpton <me@aria.rip> | 2024-03-20 00:47:46 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-03-20 00:47:46 +0000 |
commit | 9983783e1ec5b8635471ee80146a956466245cbb (patch) | |
tree | 10ad24b467922ac5f59f62d03cbb852e2fdf8995 | |
parent | cf38c0a398eff36ce0c8f436d644dfe3834498bb (diff) |
fix broken library shit
-rw-r--r-- | src/crates/library/src/sortedvecmap.rs | 2 | ||||
-rw-r--r-- | src/crates/library/src/sortedvecset.rs | 16 | ||||
-rw-r--r-- | src/crates/library/src/vecmap.rs | 2 | ||||
-rw-r--r-- | src/crates/library/src/vecset.rs | 16 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/crates/library/src/sortedvecmap.rs b/src/crates/library/src/sortedvecmap.rs index 1f05200..6791ad5 100644 --- a/src/crates/library/src/sortedvecmap.rs +++ b/src/crates/library/src/sortedvecmap.rs @@ -1,5 +1,5 @@ /*LIBSPEC-NAME* -rust-hashmap-spec primrose_library::SortedVecMap +rust-sortedvecmap-spec primrose_library::SortedVecMap *ENDLIBSPEC-NAME*/ use crate::{traits::Mapping, vecmap::extract_key}; diff --git a/src/crates/library/src/sortedvecset.rs b/src/crates/library/src/sortedvecset.rs index 0016374..666e954 100644 --- a/src/crates/library/src/sortedvecset.rs +++ b/src/crates/library/src/sortedvecset.rs @@ -1,5 +1,5 @@ /*LIBSPEC-NAME* -rust-eager-unique-vec-spec primrose_library::SortedVecSet +rust-sortedvecset-spec primrose_library::SortedVecSet *ENDLIBSPEC-NAME*/ use crate::traits::{Container, Indexable}; @@ -77,7 +77,7 @@ impl<T: Ord + PartialEq> Container<T> for SortedVecSet<T> { len op-len pre-len post-len *ENDOPNAME*/ (define (op-len xs) (cons xs (length xs))) - (define (pre-len xs) (equal? xs (remove-duplicates (sort xs)))) + (define (pre-len xs) (equal? xs (remove-duplicates (sort xs <)))) (define (post-len xs r) (equal? r (op-len xs))) *ENDLIBSPEC*/ fn len(&self) -> usize { @@ -92,7 +92,7 @@ impl<T: Ord + PartialEq> Container<T> for SortedVecSet<T> { (cond [(list? (member x xs)) (cons xs #t)] [else (cons xs #f)])) - (define (pre-contains xs) (equal? xs (remove-duplicates (sort xs)))) + (define (pre-contains xs) (equal? xs (remove-duplicates (sort xs <)))) (define (post-contains xs x r) (equal? r (op-contains xs x))) *ENDLIBSPEC*/ fn contains(&self, x: &T) -> bool { @@ -104,7 +104,7 @@ impl<T: Ord + PartialEq> Container<T> for SortedVecSet<T> { is-empty op-is-empty pre-is-empty post-is-empty *ENDOPNAME*/ (define (op-is-empty xs) (cons xs (null? xs))) - (define (pre-is-empty xs) (equal? xs (remove-duplicates (sort xs)))) + (define (pre-is-empty xs) (equal? xs (remove-duplicates (sort xs <)))) (define (post-is-empty xs r) (equal? r (op-is-empty xs))) *ENDLIBSPEC*/ fn is_empty(&self) -> bool { @@ -116,7 +116,7 @@ impl<T: Ord + PartialEq> Container<T> for SortedVecSet<T> { clear op-clear pre-clear post-clear *ENDOPNAME*/ (define (op-clear xs) null) - (define (pre-clear xs) (equal? xs (remove-duplicates (sort xs)))) + (define (pre-clear xs) (equal? xs (remove-duplicates (sort xs <)))) (define (post-clear xs r) (equal? r (op-clear xs))) *ENDLIBSPEC*/ fn clear(&mut self) { @@ -127,8 +127,8 @@ impl<T: Ord + PartialEq> Container<T> for SortedVecSet<T> { /*OPNAME* insert op-insert pre-insert post-insert *ENDOPNAME*/ - (define (op-insert xs x) (remove-duplicates (append xs (list x)))) - (define (pre-insert xs) (equal? xs (remove-duplicates (sort xs)))) + (define (op-insert xs x) (sort (remove-duplicates (append xs (list x))) <)) + (define (pre-insert xs) (equal? xs (remove-duplicates (sort xs <)))) (define (post-insert xs x ys) (equal? ys (op-insert xs x))) *ENDLIBSPEC*/ fn insert(&mut self, elt: T) { @@ -143,7 +143,7 @@ impl<T: Ord + PartialEq> Container<T> for SortedVecSet<T> { (cond [(list? (member x xs)) (cons (remove x xs) x)] [else (cons xs null)])) - (define (pre-remove xs) (equal? xs (remove-duplicates (sort xs)))) + (define (pre-remove xs) (equal? xs (remove-duplicates (sort xs <)))) (define (post-remove xs r) (equal? r (op-remove xs))) *ENDLIBSPEC*/ fn remove(&mut self, elt: T) -> Option<T> { diff --git a/src/crates/library/src/vecmap.rs b/src/crates/library/src/vecmap.rs index 700f78b..0b631f6 100644 --- a/src/crates/library/src/vecmap.rs +++ b/src/crates/library/src/vecmap.rs @@ -1,5 +1,5 @@ /*LIBSPEC-NAME* -rust-hashmap-spec primrose_library::VecMap +rust-vecmap-spec primrose_library::VecMap *ENDLIBSPEC-NAME*/ use crate::traits::Mapping; diff --git a/src/crates/library/src/vecset.rs b/src/crates/library/src/vecset.rs index ccf747a..f596161 100644 --- a/src/crates/library/src/vecset.rs +++ b/src/crates/library/src/vecset.rs @@ -1,5 +1,5 @@ /*LIBSPEC-NAME* -rust-eager-unique-vec-spec primrose_library::VecSet +rust-vecset-spec primrose_library::VecSet *ENDLIBSPEC-NAME*/ use crate::traits::{Container, Indexable}; @@ -76,7 +76,7 @@ impl<T: Ord + PartialEq> Container<T> for VecSet<T> { len op-len pre-len post-len *ENDOPNAME*/ (define (op-len xs) (cons xs (length xs))) - (define (pre-len xs) (equal? xs (sort xs))) + (define (pre-len xs) (equal? xs (remove-duplicates xs))) (define (post-len xs r) (equal? r (op-len xs))) *ENDLIBSPEC*/ fn len(&self) -> usize { @@ -91,7 +91,7 @@ impl<T: Ord + PartialEq> Container<T> for VecSet<T> { (cond [(list? (member x xs)) (cons xs #t)] [else (cons xs #f)])) - (define (pre-contains xs) (equal? xs (sort xs))) + (define (pre-contains xs) (equal? xs (remove-duplicates xs))) (define (post-contains xs x r) (equal? r (op-contains xs x))) *ENDLIBSPEC*/ fn contains(&self, x: &T) -> bool { @@ -103,7 +103,7 @@ impl<T: Ord + PartialEq> Container<T> for VecSet<T> { is-empty op-is-empty pre-is-empty post-is-empty *ENDOPNAME*/ (define (op-is-empty xs) (cons xs (null? xs))) - (define (pre-is-empty xs) (equal? xs (sort xs))) + (define (pre-is-empty xs) (equal? xs (remove-duplicates xs))) (define (post-is-empty xs r) (equal? r (op-is-empty xs))) *ENDLIBSPEC*/ fn is_empty(&self) -> bool { @@ -115,7 +115,7 @@ impl<T: Ord + PartialEq> Container<T> for VecSet<T> { clear op-clear pre-clear post-clear *ENDOPNAME*/ (define (op-clear xs) null) - (define (pre-clear xs) (equal? xs (sort xs))) + (define (pre-clear xs) (equal? xs (remove-duplicates xs))) (define (post-clear xs r) (equal? r (op-clear xs))) *ENDLIBSPEC*/ fn clear(&mut self) { @@ -126,8 +126,8 @@ impl<T: Ord + PartialEq> Container<T> for VecSet<T> { /*OPNAME* insert op-insert pre-insert post-insert *ENDOPNAME*/ - (define (op-insert xs x) (sort (append xs (list x)))) - (define (pre-insert xs) (equal? xs (sort xs))) + (define (op-insert xs x) (remove-duplicates (append xs (list x)))) + (define (pre-insert xs) (equal? xs (remove-duplicates xs))) (define (post-insert xs x ys) (equal? ys (op-insert xs x))) *ENDLIBSPEC*/ fn insert(&mut self, elt: T) { @@ -142,7 +142,7 @@ impl<T: Ord + PartialEq> Container<T> for VecSet<T> { (cond [(list? (member x xs)) (cons (remove x xs) x)] [else (cons xs null)])) - (define (pre-remove xs) (equal? xs (sort xs))) + (define (pre-remove xs) (equal? xs (remove-duplicates xs))) (define (post-remove xs r) (equal? r (op-remove xs))) *ENDLIBSPEC*/ fn remove(&mut self, elt: T) -> Option<T> { |