Show pageDiscussionOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== NEWOB ==== <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> ---- Replaces a given object with a new copy </callout> <callout color="green" icon="fa fa-indent" title="Stack Diagram"> ---- ^ __Input Stack__ ^ ^ __Output Stack__ ^ | **O** | **→** | **O<sub>copy</sub>** | | //Level 1// | //→// | //Level 1// | {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} | **Keyword type** | [[manual:chapter5:basics#commands|Command]] || | **Parallel list processing capabilities** | [[manual:chapter5:listproc#group-9quirky-commands|Group 9]] | //Quirky commands// | | **Affected by flags** | //None// || </callout> <callout color="orangered" icon="fa fa-comment" title="Description"> ---- The ''NEWOB'' command replaces an object on the stack with a new copy of itself.\\ \\ The command may seem pointless, but it solves a very specific problem: when an object originated from a larger composite object is extracted and put on the stack it contains a reference to the parent object; even if the parent object is ''[[manual:chapter6:stack:cmd_drop|DROP]]''ped from the stack it keeps on living in the RAM, occupying precious resources.\\ \\ A copy of the extracted object created by ''NEWOB'' breaks this link and allows the ''[[manual:chapter6:system:cmd_garbage|GARBAGE]]'' collection to recover the memory associated with the larger object once it is not needed anymore. </callout> <callout type="success" icon="true" title="Compatibility"> ---- ''NEWOB'' is fully equivalent to its **userRPL** counterpart. </callout> <callout type="info" icon="true" title="Usage"> ---- **__Input__** <code> 4: 3: 2: 1:{ 'LN(X)' 8888. [[ 1 2 3 ] [ 4 5 6 ]]… ………………………………………………………………………………………………………… 3 GET { 2 3 } GET NEWOB </code> \\ **__Output__** <code> 4: 3: 2: 1: 6 ………………………………………………………………………………………………………… </code> </callout> <callout color="darkgray" icon="fa fa-hand-o-right" title="Related Commands"> ---- {{page>manual:chapter6:system&nofooter&noeditbtn&inline}} </callout> manual/chapter6/system/cmd_newob.txt Last modified: 2021/10/04 04:54by jojo1973