CLIM mail archive

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

RE: accept-from-string within accept methods



  Date: Wed, 8 Jul 1992 17:54+0100
  From: Markus Fischer <SUN4.SGER!MF%sger.uucp@BBN.COM>
  Reply-To: mf%sger.uucp@BBN.COM
  Subject: accept-from-string within accept methods
  To: curt@eraserhead.jpl.nasa.gov, clim@BBN.COM
  
  ...

  Probably you mean:
  (define-presentation-method accept ((type foo) stream view &key)
  	..
  	(accept-from-string 'integer (read-token stream))
  	..)
  which works fine for me (on Symbolics CLIM 1.1)

This is quite inefficient.  Accept-from-string essentially does this:

  (with-input-from-string (stream string)
     (accept presentation-type stream))

The parser for integer acts like a glorified version of:

  (define-presentation-method accept ((type integer) stream view &key)
  	(parse-integer (read-token stream)))

So your suggestion is equivalent to:

  (with-input-from-string (s (read-token stream))
    (parse-integer (read-token s)))

I suggest instead:

  (define-presentation-method accept ((type foo) stream view &key)
  	..
  	(accept 'integer stream)
  	..)



Main Index | Thread Index