Bugs in tex-mcond



Here's the comment I just added above the new TEX-MCOND.
Hopefully it is acceptable.

    Best,
     Mark


;;
;; The format of MCOND expressions is documented above the definition
;; of DIM-MCOND in displa.lisp.  Note that MCOND expressions may
;; contain more than one non-T condition when elseif is used.  This
;; was not always the case, so it's possible that some code in Maxima
;; still doesn't handle this case properly.  Here are some examples:
;;
;;   ((%mcond) $a $b t nil)         <==>  'if a then b
;;   ((%mcond) $a $b t $d)          <==>  'if a then b else d
;;   ((%mcond) $a $b $c nil t nil)  <==>  'if a then b elseif c then false
;;   ((%mcond) $a $b $c $d t nil)   <==>  'if a then b elseif c then d
;;   ((%mcond) $a $b $c $d t $f)    <==>  'if a then b elseif c then d else f
;; 
;; Also note that DIM-MCOND omits display of the final "else" in the
;; following three cases, so we do the same here:
;; 
;;   ((%mcond) $a $b t nil)      ==>  'if a then b
;;   ((%mcond) $a $b t $false)   ==>  'if a then b
;;   ((%mcond) $a $b)            ==>  'if a then b
;;
;; The first two cases happen in practice, as can be seen by
;; evaluating ?print(if a then b) and ?print('(if a then b)).
;; I'm not sure if the third case ever actually occurs.
;;
;; The use of '$false (instead of nil) may be a hack that is no longer
;; needed.  For more information on this, search for $false in
;; PARSE-CONDITION of nparse.lisp and DIM-MCOND of displa.lisp.  Also
;; see the mailing list thread with subject "Bugs in tex-mcond" which
;; took place in January 2011.  -MHW
;;