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

I think possibly the most hilariously complicated instance of this is in perl’s tokenizer, toke.c (which starts with a Tolkien quote, 'It all comes from here, the stench and the peril.' — Frodo).

There’s a function called intuit_more which works out if $var[stuff] inside a regex is a variable interpolation followed by a character class, or an array element interpolation. Its result can depend on whether something in the stuff has been declared as a variable or not.

But even if you ignore the undecidability, the rest is still ridiculously complicated.

https://github.com/Perl/perl5/blob/blead/toke.c#L4502



Wow. I wonder how that function came to be in the first place. Surely it couldn't have started out that complicated?




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

Search: