Lisp HUG Maillist Archive

merging fasl files and disconnect-module

Hello,

We are currently working with a large application, which consists of 
hundreds of lisp files and fasl files. Is it possible to merge these 
fasl files into one huge fasl file?

Still another question dealing with fli-code. How can I  disconnect a 
module after the module has been
already registered using 'fli:register-module'. I tried using 
'fli:disconnect-module', but this has no effect.
I notice the effect (i.e.changes in the c code are updated correctly) 
only after restarting LW.

Is this a OSX bug or am I doing something wrong?

I am using LW 4.3.6, OSX 10.2.8 and Project Builder 2.0.1.

Regards,

Mikael


Re: merging fasl files and disconnect-module

Mikael Laurson wrote:

> We are currently working with a large application, which consists of hundreds of lisp files
> and fasl files. Is it possible to merge these fasl files into one huge fasl file?

I've never done this myself, but maybe CONCATENATE-SYSTEM does what you need?

Regards,

Arthur Lemmens


Re: merging fasl files and disconnect-module

Unable to parse email body. Email id is 1788

Re: merging fasl files and disconnect-module

Re: merging fasl files and disconnect-module
Dave Fox        wrote:
   We are currently working with a large application, which consists of
   hundreds of lisp files and fasl files. Is it possible to merge these
   fasl files into one huge fasl file?

Yes, as Arthur already suggested you can use CONCATENATE-SYSTEM.

OK, thanks, I think this is what we need.

   Still another question dealing with fli-code. How can I  disconnect a
   module after the module has been
   already registered using 'fli:register-module'. I tried using
   'fli:disconnect-module', but this has no effect.
   I notice the effect (i.e.changes in the c code are updated correctly)
   only after restarting LW.

   Is this a OSX bug or am I doing something wrong?

Hard to say without an example :)

Check the doc for FLI:DISCONNECT-MODULE. Perhaps you need to call it
with :REMOVE T, and then call again FLI:REGISTER-MODULE.

This example demonstrates my problem.
First I create a simple Project Builder project, LWtest, where I define and export the following C code:

float test2 (float n1, float n2)
  {return n1+n2;}

After building the project I start LW and call the following Lisp code:

(defparameter *test-fli-path* (merge-pathnames "LWtest/build/LWtest.framework/LWtest" (pathname-location (current-pathname))))
(fli:register-module "LWtest.framework" :connection-style :immediate   :file-name *test-fli-path*)
(fli:define-foreign-function
    (test2 "test2"  :source)
   ((n1 :single-float) (n2 :single-float))
  :result-type :single-float
  :language :ansi-c)
(test2 (coerce  1.0 'single-float) (coerce  1.0 'single-float))

which  returns the correct answer = 2.0.

Now, if I change the c code to the following (without leaving LW):

float test2 (float n1, float n2)
  {return n1-n2;}

and rebuild the project and call the following LW code

(fli:disconnect-module  "LWtest.framework" :remove t)

and reevaluate the LW code above (i.e. register-module, define-foreign-function ...)

I still get the old answer (= 2.0).

I get the correct answer (= 0.0), though, if I quit LW and start LW again and evaluate the code above.

So it seems that 'disconnect-module' has no effect.
Mikael

Re: merging fasl files and disconnect-module

Unable to parse email body. Email id is 1793

Updated at: 2020-12-10 08:58 UTC