CL Enumerations: Function RANGE
 

Function RANGE

Package:

CL.EXTENSIONS.ENUMERATIONS

Syntax:

  range start end &optional (incr #'1+)
  => number-enumeration
  

Arguments and Values:

start---a number

end---a number or NIL

incr---a function or a number

number-enumeration---a number-enumeration instance

Description:

The function RANGE is a utility function the produce a "stream" (quote mandatory) of numbers. It is almost equivalent to the APL/J iota operator and to Python xrange type.

The call

  cl-prompt> (range 2 10 3)
  #<Number enumeration [2 10) at 2 by #<FUNCTION> XXXXXX>
  
is equivalent to
  cl-prompt> (enumerate 'number :start 2 :end 10 :by 3)
  #<Number enumeration [2 10) at 2 by #<FUNCTION> XXXXXX>
  

The main use of the RANGE function is in conjunction with FOREACH and other iteration constructs.

Affected By:

None.

Exceptional Situations:

None.

See Also:

NUMBER-ENUMERATION class, NEXT, HAS-NEXT-P, CURRENT, PREVIOUS, HAS-PREVIOUS-P, FOREACH.

Notes:

None.