Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The array iteration code is also solid.

Shouldn't there be a NULL at the end of the array and do a null check in the iteration?



I think the last array entry {executeNoMatch , "A?"} will match on any string (and print the fallback "I don't know how to VERB" message), so it's impossible to fall off the end of the array. If you wanted to use a more defensive-programming style then you could add a sentinel of some kind and assert that you never hit it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: