You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Singular 4.1, they added some new types, including smatrix and cring. We probably will want to support those eventually. Right now, adding support for a new Singular type foobar is very cumbersome, as it involves at least changing the following (and more if we actually want to provide useful functions for those types):
src/singtypes.h: add SINGTYPE_FOOBAR and SINGTYPE_FOOBAR_IMM to enum SingType
src/singtypes.h: update GAPtoSingType, and HasRingTable (and ensure HasRingTable stays in sync with its counterpart in src/gen_highlevel_mappings.g); and also add ExportAsRecEntry(SINGTYPE_FOOBAR) in `InitSingTypesFromKernel()
lib/libsing.gd and lib/libsing.gi: add constructor SI_foobar`
lib/singtypes.gd: call DeclareCategory, create GAP types and put them into _SI_Types
src/gen_highlevel_mappings.g: add foobar to IsRingDep and possibly singularConstructors
... ?
A lot of that could be generated by a script from a single source file. That could then also do additional things; e.g. it would be nice if we also had a way to map Singular enum values like STRING_CMD to strings (e.g. "STRING_CMD") and back; then this can be used to add helpful comments in generated code and for other debugging purposes.
The text was updated successfully, but these errors were encountered:
libSingular provides Tok2Cmdname
(const char * Tok2Cmdname(int tok) in Singular/ipshell.h)
which converts STRING_CMD to "string", int('+') to "+", etc.
The other way is provided by IsCmd
(int IsCmd(const char *n, int & tok); in Singular/ipshell.h)
return for IsCmd("string",t) STRING_CMD (and sets t to ROOT_DECL_LIST)
OK, I just realized that I am actually aware of these, and we are using them -- what I meant is that I really want the string "STRING_CMD" as output for the input value STRING_CMD. But that, too, shouldn't be too hard to set up.
In Singular 4.1, they added some new types, including
smatrix
andcring
. We probably will want to support those eventually. Right now, adding support for a new Singular typefoobar
is very cumbersome, as it involves at least changing the following (and more if we actually want to provide useful functions for those types):src/singtypes.h
: addSINGTYPE_FOOBAR
andSINGTYPE_FOOBAR_IMM
toenum SingType
src/singtypes.h
: updateGAPtoSingType
, andHasRingTable
(and ensureHasRingTable
stays in sync with its counterpart insrc/gen_highlevel_mappings.g
); and also addExportAsRecEntry(SINGTYPE_FOOBAR)
in `InitSingTypesFromKernel()lib/libsing.gd
andlib/libsing.gi: add constructor
SI_foobar`lib/singtypes.gd
: callDeclareCategory
, create GAP types and put them into_SI_Types
lib/singtypes.gi
: add a_SI_TypeName
methodlib/view.gi
: add View methodssrc/gen_highlevel_mappings.g
: addfoobar
toIsRingDep
and possiblysingularConstructors
A lot of that could be generated by a script from a single source file. That could then also do additional things; e.g. it would be nice if we also had a way to map Singular enum values like
STRING_CMD
to strings (e.g."STRING_CMD"
) and back; then this can be used to add helpful comments in generated code and for other debugging purposes.The text was updated successfully, but these errors were encountered: