On 3/13/23 10:50 PM, enz...@gmx.com wrote:
Jürgen
your code change didn't fix my problem and actually broke my workaround
I am sorry to hear that. I have no idea though what the purpose of your
workaround actually is. work around which problem? Your initial issue
was the lack of a way to define APL functions, which is fixed now.
please test agains my code okay ?
No. please test my code and let me know precisely why it does
not fix your problem.
enztec
#include <stdio.h>
#include <apl/libapl.h>
/* compile with:
gcc libapl_test.c -L /usr/local/lib/apl -lapl -lstdc++ -o libapl_test
*/
int
main(int argc, char * argv[])
{
init_libapl(argv[0], 0);
apl_exec( "⎕FX 'Z←A SUM B' 'Z←A + B'");
printf(")FNS → %s", apl_command( ")FNS"));
apl_exec( "'⎕CR SUM:' (⎕CR 'SUM')" );
apl_exec( "1 SUM 2" );
const char * foo[] = { "Z←A FOO B", "Z←A SUM B", NULL };
fix_function(foo);
const char * bar = "Z←A BAR B\n" "Z←A SUM B\n";
fix_function_NL(bar);
printf(")FNS → %s", apl_command( ")FNS"));
apl_exec( "⎕CR 'FOO'" );
apl_exec( "⎕CR 'BAR'" );
}