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

Presentation type definition question



I'm having a minor problem fine tuning errors returned from a presentation
type.

Given:

(DEFINE-PRESENTATION-TYPE MUMBLE-FORM ()
   :HISTORY T
   :PARSER ((STREAM &KEY ORIGINAL-TYPE)
	    (ACCEPT '((AND SYS:FORM ((SATISFIES HNAME:FORM-P))))
		    :PROMPT NIL
		    :DEFAULT (DW:PRESENTATION-TYPE-DEFAULT 'MUMBLE-FORM)
		    :STREAM STREAM
		    :ORIGINAL-TYPE ORIGNINAL-TYPE))
   :PRINTER ((OBJECT STREAM)
	     (HNAME::PRINT-FORM OBJECT STREAM 0)))

I get what I want (only objects of type mumble-form light with the mouse)
but if a form is entered that doesn't satisfy form-p I get an error to that
effect ("...object... does not satisfy form-p"), rather than a more english
error (e.g. "the object was not a mumble-form" or something else I would
like to specify for the parser).

If instead I do:

(DEFINE-PRESENTATION-TYPE MUMBLE-FORM ()
   :HISTORY T
   :PARSER ((STREAM &KEY ORIGINAL-TYPE)
	    (LET ((A-FORM (ACCEPT 'SYS:FORM
				  :PROMPT NIL
				  :DEFAULT (DW:PRESENTATION-TYPE-DEFAULT 'MUMBLE-FORM)
				  :STREAM STREAM
				  :ORIGINAL-TYPE ORIGNINAL-TYPE)))
	      (UNLESS (HNAME:FORM-P A-FORM)
		(SYS:PARSE-FERROR
		    "That is not a legal Form"))
	      A-FORM))
   :PRINTER ((OBJECT STREAM)
	     (HNAME::PRINT-FORM OBJECT STREAM 0)))

I get the error response I want, but at the expense of making ALL sys:form's
mousable, rather than only the ones that will ultimately satisfy the UNLESS
clause. (mousing on one that doesn't satisfy the unless will ultimately give
an error, but I don't want it to light up even).

Suggestions would be appreciated.

----
Brad Miller		U. Rochester Comp Sci Dept.
miller@cs.rochester.edu {...allegra!rochester!miller}