picrin-scheme / picrin

lightweight scheme interpreter
MIT License
414 stars 35 forks source link

Check for valid indices in substring and string-copy. #316

Closed dcurrie closed 8 years ago

dcurrie commented 8 years ago

I noticed that some regression tests fail with bizarre strings. Quick test:

> (substring "42" 1 31)
"2bstring \"42\" 1 31)??M???"

This patch checks substrings's indices.

dcurrie commented 8 years ago

It seems my text editor guesses wrong about tab settings in this file... sorry! The mix of tabs and spaces is confusing, Do you have a guideline? [I would prefer spaces only, or second choice, tabs only, but in any case, not mixed!]

KeenS commented 8 years ago

@dcurrie There are no explicit coding rules or contributing guides. It is discussed at #281.

For the moment, @wasabiz and I are using Emacs with 2 space indents. @wasabiz, do you have any additional points?

nyuichi commented 8 years ago

@dcurrie @KeenS

Use 2 space indents. I will review the patch afterwards.

dcurrie commented 8 years ago

The version with two-space indents is now part of pull request #318.

nyuichi commented 8 years ago

Manually merged.