implicit indexing on empty string
Posted: Mon Oct 13, 2014 7:51 pm
I'm surprised that implicit indexing doesn't raise an error
on an empty string (when called with 0 or -1), while it
does on an empty list:
> ("" 0)
""
> ("" -1)
""
With another index, we get an error as expected:
> ("" 1)
ERR: invalid string index
If we compare to implicit indexing on an empty list, we always
get an error:
> ('() 0)
ERR: invalid list index
>('() -1)
ERR: invalid list index
Any explanation for this?
(btw, thanks again Lutz, newLISP is a real pleasure to use)
on an empty string (when called with 0 or -1), while it
does on an empty list:
> ("" 0)
""
> ("" -1)
""
With another index, we get an error as expected:
> ("" 1)
ERR: invalid string index
If we compare to implicit indexing on an empty list, we always
get an error:
> ('() 0)
ERR: invalid list index
>('() -1)
ERR: invalid list index
Any explanation for this?
(btw, thanks again Lutz, newLISP is a real pleasure to use)