Singular https://www.singular.uni-kl.de/forum/ |
|
howto compare references https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2286 |
Page 1 of 1 |
Author: | Jack [ Thu Sep 26, 2013 6:57 pm ] |
Post subject: | howto compare references |
Hello, is there a method to check if two Singular references belongs to the same name/object? Jack example: Code: system("reference"); ring rng =0,(x),dp; reference ref1 = rng; reference ref2 = rng; // how to check if ref1 and ref2 a tied to same name/object? |
Author: | malex [ Thu Jun 12, 2014 12:38 am ] |
Post subject: | Re: howto compare references |
how about the "same" method? Code: > system(ref1, "help");
system(<ref>, ...): extended functionality for reference/shared data <ref> system(<ref>, count) - number of references pointing to <ref> system(<ref>, enumerate) - unique number for identifying <ref> system(<ref>, undefined) - checks whether <ref> had been assigned system(<ref>, "help") - prints this information message system(<ref>, "typeof") - actual type referenced by <ref> system(<ref1>, same, <ref2>) - tests for identic reference objects > system(ref1, "same", ref2); 0 >reference ref3 = ref1; > system(ref1, "same", ref3); 1 |
Author: | jack [ Thu Jun 12, 2014 3:20 pm ] |
Post subject: | Re: howto compare references |
malex wrote: how about the "same" method? ok, same checks if the reference objects are identic, but then how to test if two references ref1 and ref2 are tied to the >same object<? Code: system("reference");
ring rng =0,(x),dp; reference ref1 = rng; reference ref2 = rng; system(ref1,"same",ref2); //0 |
Page 1 of 1 | All times are UTC + 1 hour [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |