Polymorphic copy: Difference between revisions
Content added Content deleted
(Added PicoLisp) |
m (Missing double quotes) |
||
Line 688: | Line 688: | ||
Any object can be copied by transferring the value and the property list. |
Any object can be copied by transferring the value and the property list. |
||
If we create an object 'A': |
If we create an object 'A': |
||
<lang PicoLisp>: (setq A (new '(+Cls1 +Cls2) 'attr1 123 'attr2 def 'attr3 (4 2 0) 'attr4 T)) |
<lang PicoLisp>: (setq A (new '(+Cls1 +Cls2) 'attr1 123 'attr2 "def" 'attr3 (4 2 0) 'attr4 T)) |
||
-> $385603635 |
-> $385603635 |
||
Line 695: | Line 695: | ||
attr4 |
attr4 |
||
attr3 (4 2 0) |
attr3 (4 2 0) |
||
attr2 def |
attr2 "def" |
||
attr1 123 |
attr1 123 |
||
-> $385603635</lang> |
-> $385603635</lang> |
||
Line 704: | Line 704: | ||
$385346595 (+Cls1 +Cls2) |
$385346595 (+Cls1 +Cls2) |
||
attr1 123 |
attr1 123 |
||
attr2 def |
attr2 "def" |
||
attr3 (4 2 0) |
attr3 (4 2 0) |
||
attr4 |
attr4 |