CLIM mail archive

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

Use of CLIM:EXPRESSION in interactor commands



   Date: Fri, 25 Feb 94 13:24:37 CST
   From: lgm@iexist.att.com


   CLIM 2.0-beta on LispWorks-3.2.21-beta-4
   CLIM 2.0 on Allegro 4.2

   How can I correctly include arguments of type CLIM:EXPRESSION within
   an interactor command, such as the one below?

   (define-clim-expr-command (clim-expr::make-cons :name t :menu t)
       ((car 'clim:expression)
	(cdr 'clim:expression))
     (format t "~&~s~&" (cons car cdr)))

   The above command works fine if I enter arguments that have no
   embedded #\Space; but if I try to enter (A B), I get an error because
   the CLIM command processor interprets the #\Space as an argument
   delimiter and is unable to read a complete Lisp expression from "(A".
   On the other hand, if I use :AUTO-ACTIVATE T, at least one
   implementation correctly reads a list or string (i.e., a Lisp object
   whose printed representation has a specific delimiter) as an argument,
   but then no longer correctly handles a #\Space meant to delimit a
   number or symbol.  Instead, I have to use #\Tab, which correctly
   delimits the argument but looks funny.

   Perhaps the CLIM:ACCEPT method for CLIM:EXPRESSION ought to turn off
   the argument-delimiting behavior of #\Space during collection of
   obviously incomplete input.  When its input is apparently complete,
   the value of :AUTO-ACTIVATE would then determine whether to wait for
   an explicit delimiter or simply return the value found.

The definitions of "obviously incomplete" and "apparently complete"
are very hard to implement.  That is why the EXPRESSION type is so
hard to get right.  This was broken in Dynamic Windows, too; it's no
surprise that CLIM doesn't work right.

I'll buy the drinks for the person who can get EXPRESSION right.

References:

Main Index | Thread Index