Arc Forumnew | comments | leaders | submitlogin
2 points by mdemare 6127 days ago | link | parent

Maybe there should be another version of cut that takes a length instead of an index as argument. Together with allowing negative second arguments, that should reduce the last example from:

    (cut s (- (len s) j) (+ (- (len s) j) i))
to

    (cutl s -j i)


1 point by nex3 6127 days ago | link

It seems a little weird that the second parameter switches meaning from "end" to "length" if the first parameter is negative, but I suppose it's more useful than the alternative...

-----

3 points by mdemare 6127 days ago | link

No, it's another function. cutl instead of cut.

-----

1 point by nex3 6126 days ago | link

Gotta stop trying to read code at four in the morning...

-----