pwh@nimbus.UUCP (Phil Hutto) (02/28/85)
Are people aware of the bugs in the definition of the above FP primitives in the Berkeley implementation distributed with 4.2bsd? They are all very simple to fix but cause functions using them to behave incorrectly. distl,distr,tlr - All have a "fix point" of phi (<>). All should return bottom (?) when given a null argument, yet they return null. In other words, tlr:<> is <>; distl:<> is <>; distr:<> is <>. distr - Doesn't check whether its argument is a "pair", a sequence containing two elements. distr should be undefined for non-pair arguments yet if given three or more arguments it simply returns whatever the result would be if given only the first two arguments. For example, distr:< <a> b c > is < <a b> >. The "definitions" of each function for the above arguments are all clearly given in both the FP manual and Backus' original paper. The functions as implemented simply don't behave as advertised. The fixes are simple. One possible set of fixes is: {NEWtlr (null->%?;tlr) } {NEWdistl (null->%?;distl) } {NEWdistr (eq@[length,%2]->distr;%?) } If anyone knows of other bugs, i'd like to know. We use FP in our graduate programming language course and have had fair success yet bugs in the implementation can be disheartening to a student trying to grasp the concept of the language. -- Phil Hutto School of Information & Computer Science, Georgia Tech, Atlanta GA 30332 uucp: ...!{akgua,allegra,hplabs,ihnp4,seismo,ulysses}!gatech!nimbus!pwh