Skip to content

Commit

Permalink
fix filter condition to only exclude false (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwparas authored Dec 4, 2023
1 parent 881262e commit 88612db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 88612db

Please sign in to comment.