| 
     
      
      
      From: Thomas B. <bar...@gm...> - 2022-09-07 20:07:18
      
     
   | 
On Wed, 7 Sep 2022, Michel Talon wrote:
> Le 07/09/2022 à 20:17, Thomas Baruchel a écrit :
>> Hi,
>>
>> I wrote large parts of my scripts in Lisp, calling Maxima functions from
>> within the Lisp code. Knowing the $ naming convention, it is easy to call
>> Maxima functions, but I can't manage to call a user-defined function, even
>> by adding the $-sign in front of the name.
>>
>> How can I do this?
>>
>> Best regards,
> To add to the other answers, this is because "user-defined maxima functions"
> are not really functions
Thank you to all of you. It now works as expected.
Maybe a slightly different question however. Is it possible to access Maxima
as a "library" without having to start the interpreter as itself.
I mean: currently, I have to
   * run Maxima;
   * load some Lisp script containing a $main function
   * run (from Maxima) the "main" function
It works greatly, but I don't like too much the idea of having three layers:
   * Maxima interpreter at the toplevel
   * Main loop and most of the work in Lisp code called from Maxima
   * from time to time calling back Maxima from my Lisp code.
Assuming I don't want (this time) to define any function in Maxima, but only
use some core functions, I would expect the following process to work:
   * compile maxima but replace
       (sb-ext:save-lisp-and-die "binary-sbcl/maxima.core" :toplevel #'cl-user::run)
     with
       (sb-ext:save-lisp-and-die "binary-sbcl/maxima.core")
   * run sbcl with    sbcl --core maxima.core --load myfile.lisp
   * calling (for instance) $sqrt from within myfile.lisp
But it doesn't work.
Again, I can already do what I want with my workaround, but curious about it.
Best regards,
--
Thomas Baruchel
 |