From 9983783e1ec5b8635471ee80146a956466245cbb Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Wed, 20 Mar 2024 00:47:46 +0000 Subject: fix broken library shit --- src/crates/library/src/sortedvecmap.rs | 2 +- src/crates/library/src/sortedvecset.rs | 16 ++++++++-------- src/crates/library/src/vecmap.rs | 2 +- src/crates/library/src/vecset.rs | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') 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 Container for SortedVecSet { 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 Container for SortedVecSet { (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 Container for SortedVecSet { 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 Container for SortedVecSet { 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 Container for SortedVecSet { /*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 Container for SortedVecSet { (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 { 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 Container for VecSet { 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 Container for VecSet { (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 Container for VecSet { 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 Container for VecSet { 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 Container for VecSet { /*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 Container for VecSet { (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 { -- cgit v1.2.3