[comp.lang.lisp] EVAL problem with Allegro

vijay@chmsr (Vijay Vasandani) (04/08/89)

SUBJECT: "EVAL" PROBLEM IN ALLEGRO COMMON LISP

	I am using Allegro Common Lisp on MacII and I want to display on the
screen some icons I have created using CIconEdit. The functions I have written
to do this are all in the same file that resides in the folder containing the
icon resource. The file looks like



(eval-when (eval compile)
  (require 'records)
  (require 'traps))



(defun open-resource ()
  (with-returned-pstrs
;;
;; "cicn 2050" is the resource file and 2050 is the icon ID#
;;
    ((myfile "hardDisk:Allegro:qsteam1:icons:cicn 2050"))
    (_OpenResFile :ptr myfile :word))
)

(open-resource)



(defun plot-icon (top left bottom right icon-id)
  (%stack-block ((my-rect 8))
    (%put-word my-rect top 0)
    (%put-word my-rect left 2)
    (%put-word my-rect bottom 4)
    (%put-word my-rect right 6)


      (_PlotCIcon :ptr my-rect
                  :ptr (_GetCIcon :word icon-id :ptr))
      (_FrameRect :ptr my-rect)
))




************************* end of file ********************************

	After loading the file I call the function using the dimensions
of the rectangle enclosing the icon and the icon ID# as arguments.

	example: (plot-icon 30 45 90 105 2050) 

The problem I am facing is that when I evaluate the expression using 
"eval-selection" from the eval-menu the icon is displayed, but the same does
not happen when the expression is evaluated from the listener. It was till
now my impression that the two were equivalent processes but apparantly this
is not true. 

	I would really appreciate if any of you netters could enlighten me
with an explantion for what appears to be a trivial insight escaping me.

	If you have solutions or suggestions please send me e-mail
		vijay@chmsr.gatech.edu

 Thank you for your attention,

Vijay Vasandani
Center for Human Machine Research
Georgia Tech. Atlanta Ga 30332
(404) 894-4322
Vijay Vasandani

UUCP:	vijay@chmsr.UUCP
        ...!{allegra,hplabs,ihnp4,ulysses}!gatech!chmsr!vijay
INTERNET:	vijay@chmsr.gatech.edu