Hacker News new | ask | show | jobs
by dragonwriter 3295 days ago
> My go to question is reverse an array (without using any library functions).

If you mean “functions provided by a library outside of the core” there are languages where this restriction doesn't prevent the kind of trivial solution you are trying to prevent.

If you mean “any predefined functions/methods” there are languages where this is impossible (e.g., since even literal array syntax is just syntactic sugar for the Array constructor method.)

Note that there are several languages that fall into both categories (e.g., Ruby.)

There are probably a very narrow slice of languages where this restriction, however you define it, really does what you intend.