Back to Forum | View unanswered posts | View active topics
Topic review - error with a simple program |
Author |
Message |
|
|
Post subject: |
|
|
|
thanks again. yes, point valid about not being reusable in the second, but I only intend to do that when something is too specific to be of use to anyone else. If there is anything general enough, it will be done as a library. It seems that the outdated format issues have to do with the info strings from what I can gather. Other than that the simple test.lib looks like what is required.
thanks again. yes, point valid about not being reusable in the second, but I only intend to do that when something is too specific to be of use to anyone else. If there is anything general enough, it will be done as a library. It seems that the outdated format issues have to do with the info strings from what I can gather. Other than that the simple test.lib looks like what is required.
|
|
|
|
Posted: Thu Dec 18, 2008 5:08 am |
|
|
|
|
|
Post subject: |
|
|
|
Hi Asif, see the manual at http://www.singular.uni-kl.de/Manual/latest/sing_48.htm for a description of the Singular library format. Of course, you could use scripts with a sequence of Singular commands, as with any Unix-like command-line application, i.e. if your code is in input.script then Code: Singular < input.script will execute your script. But note, that the second approach makes re-using of your code very difficult. Best regards, Alexander
Hi Asif, see the manual at [url]http://www.singular.uni-kl.de/Manual/latest/sing_48.htm[/url] for a description of the Singular library format.
Of course, you could use scripts with a sequence of Singular commands, as with any Unix-like command-line application, i.e. if your code is in [i]input.script[/i] then [code] Singular < input.script [/code] will execute your script. But note, that the second approach makes re-using of your code very difficult.
Best regards, Alexander
|
|
|
|
Posted: Wed Dec 17, 2008 11:51 pm |
|
|
|
|
|
Post subject: |
|
|
|
Alexander, thank you for that correction. What about the outdated format thing. Is there an updated manual that addresses that? Also, would you know if there is a way to write scripts instead of doing everything thru procedures and libraries? thanks Asif
Alexander, thank you for that correction. What about the outdated format thing. Is there an updated manual that addresses that? Also, would you know if there is a way to write scripts instead of doing everything thru procedures and libraries? thanks Asif
|
|
|
|
Posted: Wed Dec 17, 2008 9:25 pm |
|
|
|
|
|
Post subject: |
|
|
|
Dear Asif, you forget the semicolons after your inputs. This should do it: Code: load("test.lib"); mdouble(9); Best regards, Alexander Dreyer
Dear Asif, you forget the semicolons after your inputs.
This should do it: [code]load("test.lib"); mdouble(9); [/code] Best regards, Alexander Dreyer
|
|
|
|
Posted: Wed Dec 17, 2008 1:18 pm |
|
|
|
|
|
Post subject: |
error with a simple program |
|
|
I tried writing a simple library using the mdouble proc in the template lib.I called it test.lib: proc mdouble (int i) { return(i+i); } when I load it, and try to run, I get: > load("test.lib") // ** loaded test.lib (1.98,2007/11/06) // ** library test.lib has old format. This format is still accepted, // ** but for functionality you may wish to change to the new // ** format. Please refer to the manual for further information. . mdouble(9) ? error occurred in STDIN line 2: `mdouble(9)` ? last reserved name was `load` skipping text from `(`.
any help would be appreciated. thanks Asif
I tried writing a simple library using the mdouble proc in the template lib.I called it test.lib: proc mdouble (int i) { return(i+i); } when I load it, and try to run, I get: > load("test.lib") // ** loaded test.lib (1.98,2007/11/06) // ** library test.lib has old format. This format is still accepted, // ** but for functionality you may wish to change to the new // ** format. Please refer to the manual for further information. . mdouble(9) ? error occurred in STDIN line 2: `mdouble(9)` ? last reserved name was `load` skipping text from `(`.
any help would be appreciated. thanks Asif
|
|
|
|
Posted: Tue Dec 16, 2008 5:50 pm |
|
|
|
|
|
It is currently Fri May 13, 2022 11:04 am
|
|