From: Vladimir Zolotykh
Subject: UNINTERNED SYMBOLS FOR FUNCTIONS
Date: 
Message-ID: <3CE3833E.D207D6CE@eurocom.od.ua>
May I use uninterned symbols for functions ?

Is the following safe enough ?

(defmacro def-hello ()
  (let ((temp (gensym)))
    `(eval-when (:compile-toplevel :load-toplevel :execute)
       (ff:def-foreign-call ,temp #|....|#)
       (defun hello () (,temp)))))

If this approach has some drawbacks invisible to me please warn me.
Temp function servers internal purposes only. And not intended to be
called directly.

-- 
Vladimir Zolotykh

From: Barry Margolin
Subject: Re: UNINTERNED SYMBOLS FOR FUNCTIONS
Date: 
Message-ID: <s4PE8.3$y9.79@paloalto-snr1.gtei.net>
In article <·················@eurocom.od.ua>,
Vladimir Zolotykh  <······@eurocom.od.ua> wrote:
>May I use uninterned symbols for functions ?
>
>Is the following safe enough ?
>
>(defmacro def-hello ()
>  (let ((temp (gensym)))
>    `(eval-when (:compile-toplevel :load-toplevel :execute)
>       (ff:def-foreign-call ,temp #|....|#)
>       (defun hello () (,temp)))))
>
>If this approach has some drawbacks invisible to me please warn me.
>Temp function servers internal purposes only. And not intended to be
>called directly.

I don't think there should be a problem.  But why not:

(defmacro def-hello ()
  `(eval-when (:compile-toplevel :load-toplevel :execute)
     (ff:def-foreign-call hello #|....|#)))

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Vladimir Zolotykh
Subject: Re: UNINTERNED SYMBOLS FOR FUNCTIONS
Date: 
Message-ID: <3CE3BFDA.985EF117@eurocom.od.ua>
Barry Margolin wrote:
> 
> I don't think there should be a problem.  But why not:
> 
> (defmacro def-hello ()
>   `(eval-when (:compile-toplevel :load-toplevel :execute)
>      (ff:def-foreign-call hello #|....|#)))

Because some manipulations should be done with input and
output parameters of the call. For example

  (let ((res (#:1234 ........)))
     (case res
       (0)
       (otherwise (native-to-string res]

in the simples case and so on.

-- 
Vladimir Zolotykh
From: Coby Beck
Subject: Re: UNINTERNED SYMBOLS FOR FUNCTIONS
Date: 
Message-ID: <chQE8.83348$xS2.6774391@news1.calgary.shaw.ca>
Vladimir Zolotykh <······@eurocom.od.ua> wrote in message
······················@eurocom.od.ua...
> May I use uninterned symbols for functions ?
>
> Is the following safe enough ?
>
> (defmacro def-hello ()
>   (let ((temp (gensym)))
>     `(eval-when (:compile-toplevel :load-toplevel :execute)
>        (ff:def-foreign-call ,temp #|....|#)
>        (defun hello () (,temp)))))
>
> If this approach has some drawbacks invisible to me please warn me.
> Temp function servers internal purposes only. And not intended to be
> called directly.

One small suggestion I would make: use something like (gensym "hello").
This can be a real time saver when you have a bug in function #:HELLO523
rather than function #:G522

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")