Using Reduce (Free PSL version, revision 5368), 24-Jun-2020 on Windows I get the error message "bpsl.exe has stopped working" if I start a new session and run the command
sqrt();
On CSL REDUCE I get the error message
+++ Error attempt to take car of an atom: nil
which seems reasonable.
Francis
Note that on Linux the error message is "Segmentation violation" - which in most of the cases comes from trying to take car or cdr of an atom.
Clearly this is not properly handled on Windows. I'm sure that it worked a while ago.
I will look at it.
Rainer
The CSL and PSL issues are really the same - I hope I have just checked in
an update that arranges that this input leads to a more proper "wrong
number of arguments" diagnostic.
Anybody who feels keen might try as many other functions and operators as
they can think of and see which check for the right number of arguments
nicely. A few that I tried were OK but it is possible that there are more
cases like this - each individually not hard to fix --- but finding them
all and making the changes could become pretty tedious!
Arthur
On Sun, 27 Sep 2020, Francis Wright wrote:
I believe I have corrected the bug causing the crash.
Can you please rebuild from scratch and check?
Rainer
Yes, it looks fine now, thanks. I built PSL REDUCE revision 5442 from scratch on 64-bit Windows 10, undid Arthur's argument checking code, and now I get
after which REDUCE continues to a new prompt.
Francis
Hmm, that looks like a car on nil in interpreted code. Can you try again after "on comp;" before redefining the function?
My test is a bit simpler:
Rainer
OK. Using compiled code I get
Francis
Excellent.
This is from optimized code where car/cdr are compiled into indirect memory references.
It is difficult (but theoretically possible) to analyze the faulting instruction and so determine the operation (car/cdr/rplaca/rplacd) and the atom on which it operates.
On the other hand, it is much easier to identify the problem in interpreted code.
Rainer
Bug is fixed.