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

Help with passing floats through apple events



   Date: Wed, 30 Sep 92 13:14:01 -0400
   Sender: cartier@mipsmath.math.uqam.ca
   From: cartier@math.uqam.ca (Guillaume Cartier)

   >I am looking for a way to pass floats (short-floats) in an apple event.
   >
   >What I need is a pointer to the location of the short-float much like the
   >(%int-to-ptr i) function I would like a %short-float-to-ptr function so that I
   >can poke the bytes of the float.
   >
   >Thanks for the help,
   >Marc.

   Check out the %ADDRESS-OF function. You won't even have to bother
   with pointers as %ADDRESS-OF will return the integer representation of
   immediate objects.

   Guillaume.

   *********************************************************************
   * Guillaume Cartier                 (514) 844-5294 (maison)         *
   * L.A.C.I.M.                        (514) 987-4290 (bureau)         *
   * Universite du Quebec a Montreal   (514) 987-8477 (telecopieur)    *
   * Montreal, Quebec, Canada          cartier@math.uqam.ca (internet) *
   *********************************************************************


Well I gave this a try and ... there seems to be a problem as the integer
representation of a short-float in lisp contains 3 tag bits and I'm passing
this information to a c program which would like the information in IEEE
format.

I could send doubles as both lisp and C use the IEEE format however, how do I
get a pointer to a regular float in lisp?  The %address-of function returns an
integer address of the location of a float not a macptr to the float??

Any suggestions?
Marc.