range   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

(define range
  (lambda args
    (cond ((= (length args) 1)
     (make-list-with-proc (car args)  (lambda (i) i)))
    ((= (length args) 2)
     (make-list-with-proc (- (cadr args) (car args)) (lambda (i) (+ (car args) i))))
    ((= (length args) 3)
     (make-list-with-proc (/ (- (cadr args) (car args)) (caddr args))
        (lambda (i) (+ (car args) (* i (caddr args))))))
    (else (println 'bad 'range!) '()))))


Back to Index

Similar Entries

  • adrange    xtlang
  • adrange    xtlang
  • adrange    xtlang
  • limit-range    scheme
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range    xtlang
  • range-limit    scheme
  • range-limit    xtlang
  • range_limit    xtlang
  • range_limit    xtlang
  • set_range    xtlang
  • srange    xtlang