Read-only forum archive

how to define a newstruct inside a Singular library

how to define a newstruct inside a Singular library

jack · Fri Apr 11, 2014 12:22 pm

Hello,


when defining anything else than a proc inside a '.lib' file,
the user gets an error:
Quote:
cannot assign character 'n' in line ... to any group.


Question: how to define a newstruct used by a Singular library?

Re: how to define a newstruct inside a Singular library

hannes · Wed Jun 11, 2014 6:49 pm

Like any other (non-)proc object: define it INSIDE a procedure.
If you want to have it automatically available after loading
the library, define it in mod_init which will automatically after loading.
See for example
https://github.com/Singular/Sources/blo ... visors.lib

Re: how to define a newstruct inside a Singular library

jack · Thu Jun 12, 2014 3:28 pm

Quote:
Quote:
how to define a newstruct inside a Singular library?[...]
hannes wrote:
[...]
If you want to have it automatically available after loading
the library, define it in mod_init() which will automatically after loading.
[...]


thanks, that was it!