Michael Wood writes:
> Makes sense to me, but there's a bug in your function. You want (< %
> 0) instead of (< 0 %).
Quite right; good catch.
thanks,
Phil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure
On Sun, Mar 1, 2009 at 10:13 PM, Phil Hagelberg wrote:
>
> Phil Hagelberg writes:
>
>> It's a pretty common idiom in other languages for substring functions
>> to count from the end if given a negative index.
>>
>> (substring "hello world!" 6 -1) ;; => "world"
>>
>> I'd be glad if Clojure's "s
On Sun, Mar 1, 2009 at 2:13 PM, Phil Hagelberg wrote:
>
> Phil Hagelberg writes:
>
>> It's a pretty common idiom in other languages for substring functions
>> to count from the end if given a negative index.
>>
>> (substring "hello world!" 6 -1) ;; => "world"
>>
>> I'd be glad if Clojure's "su
Phil Hagelberg writes:
> It's a pretty common idiom in other languages for substring functions
> to count from the end if given a negative index.
>
> (substring "hello world!" 6 -1) ;; => "world"
>
> I'd be glad if Clojure's "subs" function could work like this. Should
> I create an issue and