swift-lispkit
swift-lispkit copied to clipboard
`(lispkit math)` truncation procedures do not guard against zero divisor
Unlike division, implementations of the truncation procedures in (lispkit math)
(such as truncate-remainder
) do not guard against the divisor (n2
) being zero, and this causes LispPad to crash when the procedure is evaluated.
How to reproduce:
➤ (/ 2 0) ; ⚠️ 〚eval error〛 division by zero
➤ (truncate-remainder 2 0) ; app crashes
Happy to attempt a PR but I reckon my Swift is good enough to find the problem, but not good enough to come up with an elegant solution!
PS: Thank you so much for building software that has brought me so much joy ❤️ Never thought I'd be writing Lisp on the couch on my iPad!
Thanks a lot for the bug report! This is indeed pretty bad. Have just fixed the "division by zero" issues. It will take a few more weeks before this change is available via LispPad.
Great to hear you like LispPad!
The new releases of LispPad and LispPad Go fix this problem finally. Thanks for reporting the bug!