Deepcopy: Difference between revisions
Content added Content deleted
(Added Wren) |
No edit summary |
||
Line 1,849: | Line 1,849: | ||
: (== A B) |
: (== A B) |
||
-> NIL # but they are not identical (pointer-equal)</lang> |
-> NIL # but they are not identical (pointer-equal)</lang> |
||
=={{header|PureBasic}}== |
|||
<lang PureBasic>Macro PrintStruc(StrucVal) |
|||
PrintN(Str(StrucVal#\value1)) |
|||
PrintN(Chr(StrucVal#\value2)) |
|||
PrintN(StrucVal#\value3) |
|||
If StrucVal#\value4 |
|||
PrintN("TRUE") |
|||
Else |
|||
PrintN("FALSE") |
|||
EndIf |
|||
PrintN("") |
|||
EndMacro |
|||
Structure TTypeA |
|||
value1.i |
|||
value2.c |
|||
value3.s[10] |
|||
value4.b |
|||
EndStructure |
|||
Define.TTypeA a, b |
|||
a\value1=10 |
|||
a\value2='A' |
|||
a\value3="OK" |
|||
a\value4=#True |
|||
b=a |
|||
a\value1=20 |
|||
a\value2='B' |
|||
a\value3="NOK" |
|||
a\value4=#False |
|||
If OpenConsole("") |
|||
PrintN("Value of 'a':") : PrintStruc(a) |
|||
PrintN("Value of 'b':") : PrintStruc(b) |
|||
Input() |
|||
EndIf</lang> |
|||
{{out}}<pre>Value of 'a': |
|||
20 |
|||
B |
|||
NOK |
|||
FALSE |
|||
Value of 'b': |
|||
10 |
|||
A |
|||
OK |
|||
TRUE |
|||
</pre> |
|||
=={{header|Python}}== |
=={{header|Python}}== |