[REBOL] Re: [ Feature request ] move (correction)
From: Rebolinth::nodep::dds::nl at: 13-Aug-2003 12:21
* CORRECT VERSION !!!!!! (previous one was only copy :-)
Quoting A J Martin
Hello Andrew,
Well yes ofcaurse, i was building a function that was moving series between
different blocks when i though it might even be quicker having it as a native?
i dont know.. (currenlty im using remove and copy or anyother possible solution,
which is fine with me..)
example like:
a: [ a b c d e f g h ... ]
b: [ 1 2 3 4 5 6 ]
>>move/part a b 3
== [ d e f g h ... ]
== [ a b c 1 2 3 4 5 6]
c: [ [ a b ] [ c d ] [ e f ] [ g [ h ] ] ]
d: [ [ 1 2 ] [ 3 4 ] [ 5 6 ] [ 7 [ 8] ] ]
>>move/deep c d 4 1
== [ [ a b ] [ c d ] [ e f ] [ g ] ]
== [ [ h ] [ 1 2 ] [ 3 4 ] [ 5 6 ] [ 7 [ 8] ] ]
e: [ [now/time] [now/date] [ hello ] ]
f: [ [ "this is a string" ] [ now ] ]
>>move/only e f 2
== [ [now/time] [ hello ] ]
== [ [13-Aug-2003] [ "this is a string" ] [ now ] ]
and so on...
I think its usefull but its up to RT :-)
(R)egards,
Norman.
->
-> Norman wrote:
-> > Its seems not to be native ( i probably missed it again ),
-> > perhpas an option for enhancement?
-> >
-> > command: move
-> >
-> > moves values between series
-> >
-> > Description
-> > move /only /part source destination value
-> >
-> > /only { moves as series }
-> > /part { moves to a given length or position }
-> > /deep { moves series values within the block }
->
-> Can you give an example or two?