Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: link a reference object
PostPosted: Tue Oct 08, 2013 12:53 pm 
Hello,

when using references, I stumbled over he following question:
what does
Code:
    link(reference)

exacly do?

Code:
system("reference");
ring rng=0,x,dp;
attrib(rng,"name","rng");

reference rngRef=rng;
attrib(rngRef,"nameRef","rngRef");
attrib(rngRef,"nameRef");

def  linkedRng=link(rngRef); // what happens behind the scenes?
attrib(linkedRng,"nameRef"); // not present, why?
attrib(linkedRng,"name");   // not present, why?


Why does attrib not work for the linked object?
Should it work, or do I misunderstsand the concepts?

Jack


Report this post
Top
  
Reply with quote  
 Post subject: Re: link a reference object
PostPosted: Wed Jun 11, 2014 6:39 pm 

Joined: Wed May 25, 2005 4:16 pm
Posts: 275
In Singular, <typename>(<object>) is always a cast to the named type
- with this exception. Its therefore number one on the "to remove" list.
So: please do not use "reference" and "shared".
Everything else:
http://www.singular.uni-kl.de/Manual/4-0-0/sing_253.htm


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:06 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group