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

The tinkering with the Integer cache to make 2 + 2 = 5 : https://codegolf.stackexchange.com/a/28818

The trick is to make the int literal to get boxed so that it hits the cache - which requires a printf (rather than println).

And yea, don't do this.



There was an old-time "hacker test", one of the questions of which was "Ever change the value of 4? In a language other than FORTRAN?"

So I guess the answer here would be "yes" to both parts. Well done!


As an occasional dabbler in Forth, I can answer in the affirmative.

Well, I'm not sure I redefined 4 specifically, but I tried out redefining a few integer literals.




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

Search: