Next Prev Up Top Contents Index

8.5.1 Defining a Translation from Floating Point Number to Integer

Here is an example that defines a presentation translator to accept an integer object from a float presentation. Users have the options of typing in a float or integer to the input prompt or clicking on any float or integer presentation.

(define-presentation-translator integer-to-float
  (integer float my-command-table
           :documentation "Integer as float"
           :gesture :select
           :tester ((object) (integerp object))
           :tester-definitive t)
  (object)
  (float object))
 
(clim:present most-positive-fixnum)
 
(clim:accept 'float)

Common Lisp Interface Manager 2.0 User Guide - 14 Dec 2001

Next Prev Up Top Contents Index