Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filter condition to only exclude #false #109

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cogs/r5rs.scm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
(check-equal? "Parsing octal" #o0777 511)
(check-equal? "Parsing binary" #b0110 6)

(check-equal? "filter treats lists as true" (filter (lambda (n) (list 1 2)) (list 1 2)) '(1 2))

(check-equal?
"Symbols are interned correctly - lists should use the existing symbols that have been interned"
(eq? 'definitely-hasnt-been-seen-before
Expand Down
3 changes: 1 addition & 2 deletions crates/steel-core/src/steel_vm/transducers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,8 @@ impl<'global, 'a> VmCore<'a> {

match res {
Ok(k) => match k {
SteelVal::BoolV(true) => Some(Ok(arg)),
SteelVal::BoolV(false) => None,
_ => None,
_ => Some(Ok(arg)),
},
Err(e) => Some(Err(e)),
}
Expand Down
Loading