Page 1 of 1

Slicing behaviour vis a vis Python

PostPosted: Mon Apr 14, 2008 1:16 am
by hopscc
The doc alludes to cobra having slicing behaviour like Pythons which I have taken to meaning behaves exactly the same.
Unfortunately (from my point of view at least) it doesnt ,in that slice indexes outside the existing range generate Exceptions rather than
generating a valid result up to the range boundaries.

I'm wondering if that behaviour is an intentional difference from pythons and if so what your reasoning for it might be.

Re: Slicing behaviour vis a vis Python

PostPosted: Mon Apr 14, 2008 2:04 am
by Charles
Not intentional. Will fix.

Re: Slicing behaviour vis a vis Python

PostPosted: Mon Apr 14, 2008 3:28 am
by hopscc
Would you like a patchfile?
code and mods to the testfiles

Re: Slicing behaviour vis a vis Python

PostPosted: Mon Apr 14, 2008 9:14 am
by Charles
That would be great!

Re: Slicing behaviour vis a vis Python

PostPosted: Tue Apr 15, 2008 1:16 am
by hopscc
here ya go
patch file for mods to CobraLang.cs and 3 test files

Re: Slicing behaviour vis a vis Python

PostPosted: Sat Apr 19, 2008 6:28 pm
by Charles
Applied. Thanks.

In the future, feel free to delete obsolete code instead of commenting it out. We can always get it back from version control if we need it.

Re: Slicing behaviour vis a vis Python

PostPosted: Sat Apr 19, 2008 11:22 pm
by hopscc
OK willdo.