Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Question about "nameof"
PostPosted: Fri Aug 08, 2008 1:19 pm 

Joined: Fri Aug 08, 2008 1:10 pm
Posts: 4
Can anybody tell me what is wrong with the following code?
Code:
ring r = 0,(x,y,z),dp;
string s = nameof(basering);
setring s;

In other words, I try to grab the name of my basering into s, and want to switch to this ring later. How should I get this to work? Right now it tells me:
Code:
? s is no name of a ring/qring
? error occurred in STDIN line 14: `setring s; `

I strongly suspect this has worked for an old version of Singular (maybe 2.0).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 08, 2008 8:33 pm 
It still works as before by writing

setring `s`;
> ring r=0,x,dp;
> string s = nameof(basering);
> // define another ring
> ring r2 = real,x,dp;
> basering;
// characteristic : 0 (real)
// number of vars : 1
// block 1 : ordering dp
// : names x
// block 2 : ordering C

> back to the previous ring
> setring `s`;
> basering;
// characteristic : 0
// number of vars : 1
// block 1 : ordering dp
// : names x
// block 2 : ordering C



Another possibility is to use:

def d = basering;

setring d;


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 09, 2008 10:37 am 

Joined: Fri Aug 08, 2008 1:10 pm
Posts: 4
Thanks a lot, that worked!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

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