Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - How to check if a library is loaded?
Author Message
  Post subject:   Reply with quote
Perfect, that works. Thanks a lot!
Post Posted: Mon Aug 25, 2008 10:36 pm
  Post subject:   Reply with quote
In Singular-2.x you could look up the global variable LIB (of type string) and search
for the library using the command find e.g.

Code:
> LIB;
standard.lib
> find("LIB","standard.lib");
1
> find(LIB,"ring.lib");
0
> LIB "ring.lib";
// ** loaded /usr/o0/Singular-203/sparcv7-sun-solaris2.7/Singular/2-0-3/LIB/ring.lib (1.17.2.1,2002/02/20)
// some more output here
> LIB;
standard.lib,ring.lib,general.lib,matrix.lib,random.lib,poly.lib,inout.lib
> find(LIB,"ring.lib");
14


This does no longer work, as LIB is now the string "_".

In Singular-3.x you have to use the command defined
with capitalized first letter of the library (without the trailing .lib):

Code:
> defined(Sing);
0
> LIB "sing.lib";
// ** loaded /LIB/sing.lib (1.30,2006/08/02)
> defined(Sing);
1
Post Posted: Sun Aug 24, 2008 6:32 pm
  Post subject:  How to check if a library is loaded?  Reply with quote
I would like to automatically check if a library is loaded. One idea was to use "listvar(package)", but this seems to print such a list to the screen, rather than return an object that I can search through.

I think this used to be possible in Singular 2 with "string(LIB)", but that doesn't seem to be the case anymore.

Does anybody know how to do this?
Post Posted: Sun Aug 24, 2008 8:16 am


It is currently Fri May 13, 2022 10:59 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group