#502 closed bug (wontfix)
setting attrubute of a ring in a procedure by passing ordinary copy fails
Reported by: | Owned by: | somebody | |
---|---|---|---|
Priority: | minor | Milestone: | 3-1-6 and higher |
Component: | dontKnow | Version: | 3-1-6 |
Keywords: | Cc: |
Description
Minimal example:
system("reference");
proc setAttrib( rng, attrubuteName, attributeVal) {
attrib( rng, attrubuteName, attributeVal);
}
proc setAttribOfRef( pRngRef, attrubuteName, attributeVal) {
attrib( pRngRef ,attrubuteName, attributeVal);
}
proc minimalExample() {
string attributeName = "name"; string attributeVal = "it works!"; ring parentRing = integer,(x,y,z),dp;
setAttrib( parentRing, attributeName, attributeVal );
if ( attrib( parentRing, attributeName )<> attributeVal ) {
print("setting attrubute by passing ordinary copy failed");
} else {
print("setting attrubute by passing ordinary copy succeeded");
}
reference rngRef = parentRing; setAttribOfRef( rngRef,attributeName,attributeVal);
if ( attrib( parentRing, attributeName )<> attributeVal ) {
print("setting attrubute by passing reference failed");
} else {
print("setting attrubute by passing reference succeeded !");
}
}
minimalExample();
Attributes belong to names. Objects own a fixed number of attributes, new attributes are assigned to the name and not to the object.