[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Default problems with accept



    Date: Thu, 21 May 1992 09:42 PDT
    From: jbarnett@charming.nrtc.northrop.com


    If I evaluate
      (accept '((token-or-type (("None" . :none)) net:printer) :default :none))
    I get the following on the terminal
      Enter a printer or None [default None]:
    If I hit return, the value is the default object (last input) of type printer,
    i.e., the specified and displayed default is not used.  In addition, evaluating
      (accept '((or (member :none) net:printer)) :default :none
	      :default-type '((member :none)))
    produces the same problem -- the displayed default is None but the value is
    a printer.  If I substitute another namespace type, e.g., net:host, for
    net:printer, the same glitch occurs.  However, if I substitute integer, the
    correct behavior results.  Any explanations and/or fixes would be greatly
    appreciated.

This is pretty odd.  In the course of examining this, I was able to
duplicate your problem.  I thought it had something to do with the
parser for the NET:OBJECT presentation type (a supertype of both
NET:PRINTER and NET:HOST) explicitly supplying a default in its
recursive call to ACCEPT.  But when I put some debugging code in the
problem went away!  I tried it on another (freshly-booted) machine and
your example worked right out of the box.

You might try recompiling the NET:OBJECT presentation type.
Alternatively, you might try the "internal" presentation type
DW::LOCAL-PRINTER.

      (scl:accept '((scl:token-or-type (:none) dw::local-printer)) :default :none)

which seems to work for me.