Closed her01n closed 9 months ago
In scheme list values are accepted as true in boolean context. For example:
λ > (if (list 1 2) 1 2) => 1
But, filter only accepts #true as true value:
λ > (filter (lambda (n) (list 1 2)) (list 1 2)) => '()
The result of the last expression should be:
λ > (filter (lambda (n) (list 1 2)) (list 1 2)) => '(1 2)
A workaround is to use if explicitly:
λ > (filter (lambda (n) (if (list 1 2) #true #false)) (list 1 2)) => '(1 2)
I have tested with commit 881262eb1cc34268f82b611312037b8d76875464, on arch linux with rust version "rustc 1.74.0 (79e9716c9 2023-11-13) (Arch Linux rust 1:1.74.0-1)"
Thanks for the report - will be fixed in #109
Should be fixed now, thanks again for the report! - closed in #109
In scheme list values are accepted as true in boolean context. For example:
But, filter only accepts #true as true value:
The result of the last expression should be:
A workaround is to use if explicitly:
I have tested with commit 881262eb1cc34268f82b611312037b8d76875464, on arch linux with rust version "rustc 1.74.0 (79e9716c9 2023-11-13) (Arch Linux rust 1:1.74.0-1)"