Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
After quite a while I played with Reduce again, restoring some code from 1981. I had a hard (well..) time to crack wrong usage of sgn in an array declaration, after some fiddling I discovered that disabling fancy made the warning "***** procedure sgn invalid as array" show up ! Seems to me like an unwanted side-effect. Apart from that: the code is up & running again, great !!!
Title should be ..makes ERROR… disappear due to the 5* nature of the message from Reduce. In addition: I did not find 'sgn' in the pdfs of Reduce or Lisp - but it IS in the oblist (…). Now another issue pops up: apparently it is not possible to redefine 'sgn' or any 'standard' identifier. The CSL binary that I use (from reduce-windows-20091021.zip) suggests "tell Hearn" ! (related to lose flag).
I will look into it at some stage - thanks for the report. "on fancy" works by hijacking output and trying to interpret it as TeX-like stuff - so if something breaks into printing something quite different it may get muddled.
Right now I can not see anybody setting a 'lose flag on sgn. There is an internal function called sgn that you will see in packages/arith/bfauxil.red and it is not intended for use directly by normal users. Can you provide a script to help me reproduce the issue?
Indeed if you introduce a procedure of your own it can overwrite or replace one that the system has. SOME but far from all system functions are protected against this via a "lose" mechanism. Separating the user and the internal name-spaces would not be a quick job I am sorry to say.
Arthur, will do, couple of days.. Gert. By the way, some of the Interactive Reduce lessons also show the issues. Will add detail on those as well.
Using the interactive Reduce lessons by David Stoutemyer: lesson 2 starts immediately with a fancy related problem (turning off fancy solves that) and lesson 4 starts with a redefinition:
algebraic procedure cot(x);
which triggers the "\*\*\* cot not defined (LOSE flag) \*\*\*\*\* tell Hearn !!" message… In another (historical) context I once declared an array sgn(n) which also lead to problems (but now only at run time). Renaming the array solves that.
The cot definition problem arose from two sources. First of all, the lesson was out-of-date. Since it was written, an explicit definition for cot has been added in a way that won't allow it to be redefined, hence the LOSE message. The "tell Hearn" message arose from a poorly formed result when you try to redefine such a function. I have a fix for this which will be added to the Sourceforge sources in the near future.
What we really need is a volunteer to go through those lessons and make them consistent with the current system. Any volunteers?
OK, the error generated by a call to "typerr" did not survive outputhandler!* being set in the way that "fancy" output did - I have changed it so that some "x invalid as y" diagnostics now get displayed even in fancy mode. The presentation may not be perfect but it is better the way it is now than not seeing anything at all!
Speaking of the Reduce lessons by David Stoutemyer, they don't seem to be included in the binary distribution. Do they come with the source? If so, I think it would be sensible for them to accompany the binaries also. If not, from where are they available? I've tried Googling for them with no success…
I have added a copy to the files on Sourceforge under packages/lessons. But PLEASE NOTE that they are over 20 years old and have not been updates at all recently, so there is not guarantee associated with them.
For livejournal: I googled with this string: "stoutemyer interactive reduce lesson"
For Arthur and Tony: just a little while since I was here.. will go thru the lessons and try to make them all run with fancy on. Am I correct in stating that they're 'only' in the tarball right now ? Seems like a lot to download if you only want the lessons…
I just put the lessone in the subversion repository, and you may be able to us ethe sourceforge "growse source" to find just them. I have not made a full-archive tarball for a while but hope to in the next few weeks.
Once one has first checked out the subversion stuff just "svn update" ibly fetches what is new and can be respectably cheap.