| One would expect that if you use the multiple ifs in the else if then "it" should get remapped on the subsequent tests. For example: (aif 3 it 'else)
3
So I'd think the following would be 3 also: (aif () 'a 3 it 'else)
nil
In the original version of aif it would return "nil" as it never gets reset after the first test.This is a simple fix: Original: (mac aif (expr . body)
`(let it ,expr (if it ,@body)))
Changed: (mac aif (expr . body)
(if (<= (len body) 2)
`(let it ,expr (if it ,@body))
`(let it ,expr (if it ,(car body) (aif ,@(cdr body))))))
Should I commit this to the git repo? |