sequence function: swrite-range
description:
swrite-range(start-idx, finish-idx, write-seq) input-seq
the sequence write to range function
is almost the same as swrite(range(start-idx, finish-idx), write-seq) input-seq
but there are some differences. eg, swrite-range can handle negative indices too.
index values start at 1, not 0. So 1 is the first element, 2 is the 2nd element, and so on.
negative index values work too. eg, -1 is the last element in the sequence, -2 is the 2nd last, and so on.
examples:
-- writing a ket:
swrite-range(|2>, |4>, |FISH>) ssplit |abcdefgh>
|a> . |FISH> . |FISH> . |FISH> . |e> . |f> . |g> . |h>
-- writing an empty ket:
swrite-range(|2>, |4>, |>) ssplit |abcdefgh>
|a> . |> . |> . |> . |e> . |f> . |g> . |h>
-- writing a sequence:
swrite-range(|2>, |4>, |X> . |Y> . |Z>) ssplit |abcdefgh>
|a> . |X> . |Y> . |Z> . |X> . |Y> . |Z> . |X> . |Y> . |Z> . |e> . |f> . |g> . |h>
see also:
sread, sread-range, swrite, sselect
Home