Hi Steve, I like the patch ... would you make it into a pull request on github (vs the master branch) and include the appropriate documentation changes ...
cheers tobi Today Steve Shipway wrote: > So, I have a patch (unified context diff) to add the RPN operators ROLL, > INDEX, COPY and DEPTH. > > DEPTH: push the number of stack elements onto the stack > 1,2,3,DEPTH ==> 1,2,3,3 > COPY: pop the top value form the stack. Copy that number of elements on the > stack. So, DUP is the same as 1,COPY > 1,2,3,2,COPY ==> 1,2,3,2,3 > INDEX: identify the item that far down the stack and copy it onto the top of > the stack (1-based). So, DUP is the same as 1,INDEX > 1,2,3,4,5,2,INDEX ==> 1,2,3,4,5,4 > ROLL: rotate the top n items by s steps (can be positive or negative) So > EXCH is the same as 2,1,ROLL or 2,-1,ROLL > 1,2,3,4,5,3,-1,ROLL ==> 1,2,4,5,3 > > This should allow much more extensive stack manipulation. Stack underflow > and overflow are handled. > > Thanks for the feedback from the group on making ROLL more generic, and > adding DEPTH, INDEX and COPY. These functions may benefit from more > extensive testing as properly debugging the RPN engine is awkward. More > feedback always welcome. > > Steve > > Steve Shipway > s.ship...@auckland.ac.nz > > > -- Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland www.oetiker.ch t...@oetiker.ch +41 62 775 9902 _______________________________________________ rrd-developers mailing list rrd-developers@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers