nshift-intervalIntervalsshift-intervalGoTo Top

shift-interval   interval amount => new-interval[Function]

Purpose
Create a new interval by shifting interval by amount.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

interval     An interval
amount     A number
new-interval     An interval

Returns
A new, shifted interval.

Description
The structure of the original interval (cons, two-element list, or two-element array) is maintained in the newly allocated, shifted new-interval.

See also
    copy-interval
    expand-interval
    expand-point
    infinite-interval
    interval-end
    interval-start
    interval-values
    make-interval
    nexpand-interval
    nshift-interval

Examples

  > (shift-interval '(2 5) 2)
  (4 7)
  > (shift-interval '(2 . 5) -1)
  (1 . 4)
  > (shift-interval #(2 5) .5)
  #(2.5 5.5)
  >


The GBBopen Project


nshift-intervalIntervalsshift-intervalGoTo Top