thanks Miekel, Bennyand Ken for your responses..
Sunil.
On Mon, Jul 18, 2011 at 7:15 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
> Hi everybody,
>
> I have a situation where I know that the sequence I have at hand is sorted
> but does not implement the Sorted interface. How can I
If the input is always going to be sorted, consider using a sorted-set
or similar collection type to hold it in the first place.
If you're going to need to refer to a particular subsequence
repeatedly, and it's held in a vector, you might also consider using
subvec after using loop/recur to find t
On Monday, July 18, 2011 9:12:05 AM UTC-6, Meikel Brandmeyer wrote:
>
> Hi,
>
> *snip*
>
> However with a different performance promise, I believe.
>
Hi Meikel,
I took a look at the source for subseq, and you're right. To be specific,
when the comparison operation is either > or >=, seqFrom all
Hi,
Am Montag, 18. Juli 2011 16:59:40 UTC+2 schrieb Benny Tsai:
If you know that the input sequence is already sorted, then you can use
> take-while and drop-while in lieu of subseq.
>
> (subseq (sorted-set 1 2 3 4) < 3) -> (take-while #(< % 3) [1 2 3 4])
> (subseq (sorted-set 1 2 3 4) <= 3) ->
Hi Sunil,
If you know that the input sequence is already sorted, then you can use
take-while and drop-while in lieu of subseq.
(subseq (sorted-set 1 2 3 4) < 3) -> (take-while #(< % 3) [1 2 3 4])
(subseq (sorted-set 1 2 3 4) <= 3) -> (take-while #(<= % 3) [1 2 3 4])
(subseq (sorted-set 1 2 3 4)