Singular https://www.singular.uni-kl.de/forum/ |
|
link a reference object https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2292 |
Page 1 of 1 |
Author: | Jack [ Tue Oct 08, 2013 12:53 pm ] |
Post subject: | link a reference object |
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 |
Author: | hannes [ Wed Jun 11, 2014 6:39 pm ] |
Post subject: | Re: link a reference object |
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 |
Page 1 of 1 | All times are UTC + 1 hour [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |