On Wednesday, May 31, 2006 2:54 AM Gernot Hueber wrote:Due to that I want to call external library functions from within Aldor/Axiom I did some trials with Aldors "Foreign" and GCL "defentry" commands. First of all, an example that work (partly), adapted from the aldor users guide. The following definition needs to be compiled by lisp: fricas (1) -> <lisp> (defentry |myprintf| (string) (int "printf"))</lisp> Your user access level is compiler and this command is therefore not available. See the )set userlevel command for more information. When this is compiled inside Axiom, the symbol |myprintf|
becomes known inside the aldor #include "axiom.as" + aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/6328445021691863648-25px002.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. "/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/6328445021691863648-25px002.as", Now call it: fricas arigato() Here is a slightly more interesting example that compiles some C language code and calls it from Aldor. Note: clines is a GCL-specific extension lisp (clines " + lisp Your user access level is compiler and this command is therefore not available. See the )set userlevel command for more information. aldor #include "axiom.as" + aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4532111654619318497-25px005.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. "/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4532111654619318497-25px005.as", Now try it: fricas arigato2() Here is a simple way to output a string by calling the Lisp function PRINC. aldor #include "axiom.as" + aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/7406390156942832244-25px007.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. "/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/7406390156942832244-25px007.as", Try it. fricas output("stuff") Type: Void
|