Arc Forumnew | comments | leaders | submitlogin
6 points by scn 6140 days ago | link | parent

This is the subseq from arc.arc with an extra (commented) line that would allow -ve end parameters.

  (def subseq (seq start (o end (len seq)))
  ; (if (< end 0) (= end (+ (len seq) end)))
    (if (isa seq 'string)
      (let s2 (newstring (- end start))
        (for i 0 (- end start 1)
          (= (s2 i) (seq (+ start i))))
        s2)
      (firstn (- end start) (nthcdr start seq))))