/** * make install -> MOD/mydemo.* * Usage of mydemo in Singular: * load("mydemo.so"); or LIB("mydemo.so")// Loades the module "mydemo.so" from 'MOD/' into namespace 'Mydemo' * or LIB"mydemo.so"; // does the same, but emits a 'deprecated library format' message * * listvar(Mydemo); // shows all symbols in Mydemo: variables: info, version, category, procedures and ?examples?. * * help Mydemo; // shows info about mydemo (content of string variable Mydemo::info). * * Mydemo::proclist(); // calls procedure 'proclist' from 'Mydemo' * * ?????????????????????????????????????????????????????????????????????????????????? * * BUG0: empty '%Singular'/'%procedures' section causes a syntax error for modgen when it comes to next '%' section. * BUG1: 'info' and 'example' strings come into 'mydemo.cc' as is, that is without ending '\n\'. * BUG2: no Singular procedure 'Mydemo::testa'!!! * * BUG3,4: HOW TO GET HELP OR EXAMPLE FOR A C/Singular PROCEDURE? * * for example the following commands work: * execute(Mydemo::proclist_example); * Mydemo::testa_help; * * while the following ('standard') don't: * example Mydemo::proclist; * help Mydemo::testa; * * ?????????????????????????????????????????????????????????????????????????????????? * BUG5 in modgen generator: "double quotions in help and example strings are not supported!?!????" proc DoubleQuotiontsInHelpAndExample() " keine \"Hilfe\" :(((( " // '\"' are not currently allowed here! { "helpme"; Mydemo::_helpme(); } example { "EXAMPLE: "; echo = 2; // '"' are not currently allowed here! Mydemo::helpme(); } BUG6 in modgen scanner: "parameters of type ring are not supported!?!????" none testRingParameter(ring r) // this line gives "error: parse error at end of file" { %declaration; %typecheck; %return(); } BUG7 in modgen generator: "returning a variable is wrongly generated!" int returnSomething(int j) { %declaration; %typecheck; int i = j; %return(i); // this line results into: "__res->data = (void *)i(j);" after generation!?! } * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! fixed bugs: 1. ".bin not found": replaced "strchr" by "strrchr" in search for .bin file in generated procedure "mod_init(...)". NOTE: one MUST specify AUBSOLUTE or relative location of ".so" file since Singular have NO complete path in "currPack->libname" and ".bin" file will not be searched in "MOD" directory at the moment ->>> This is a BUG7!!! 2. "jump crosses initialization": i have moved parameter type error handling to be directly after handling. // BUG: jump crosses initialization: none jumpCrosses(int j) { %declaration; %typecheck; int i = 0; // this line was giving "error: jump crosses initialization" %return(); } * **/