newLISP Fan Club

Forum => newLISP in the real world => Topic started by: TedWalther on August 09, 2015, 03:16:50 PM

Title: impliciting indexing doesn't cross list/string boundaries
Post by: TedWalther on August 09, 2015, 03:16:50 PM
I have this:


Quote
(set 'foo '("#foo" "bar" "baz" "some text"))


I expected this to work:


Quote
(foo 0 0) => "#"


Instead it returned "#foo".  A bit surprising.  I know that (foo 0) works as a list index; is newlisp supposed to ignore bogus indexes afterward?  Either newlisp should cross the list/string boundary and let the index apply to the string or array equally with the list, or return an error, no?



Using version 10.6.2
Title: Re: impliciting indexing doesn't cross list/string boundarie
Post by: TedWalther on August 09, 2015, 03:44:41 PM
This one did work: (first (foo 0))