3
\$\begingroup\$

Input doesn't make sense in a pure functional enviroment. I've seen some challenges where input was to be read from a file or from STDIN. Are purely functional languages (that do not implement these input methods) allowed to participate?

As an example of such a challenge: Check whether an integer is a power of 2 without using +,- operations

\$\endgroup\$

2 Answers 2

8
\$\begingroup\$

If the question explicitly asks for STDIN or file input, then you're out of luck. The default rules always allow input to be taken as a function argument, but any challenge author is free to override those defaults.

Note that this affects almost any language on some challenges. Ask for reading a file, and CJam (and many esolangs) can't participate. Ask graphical output to screen and many languages can't participate. Ask for a function, and languages that don't have functions can't participate. The bottomline is, not every language is suitable for every challenge, and while authors should thrive to make their challenges as inclusive as can reasonably expected of them, there's not really any obligation to do so.

If you think the limitation is unjustified, leave a comment, asking the OP to be more inclusive (that's what I usually do when someone asks for input from a file that would work just as well from STDIN). If they're not willing to change the rules, you can always downvote the challenge if you still think that the limitation is unjustified or "bullying" your language.

\$\endgroup\$
2
  • \$\begingroup\$ You can use "file:///path/to/file"g in CJam. No relative path support, though. \$\endgroup\$
    – jimmy23013
    Commented Mar 15, 2015 at 6:29
  • \$\begingroup\$ @user23013 thanks, but not the point ;) \$\endgroup\$ Commented Mar 15, 2015 at 8:33
2
\$\begingroup\$

If the author of a question modifies the default rules in such a way that your preferred language cannot compete, answer with the closest possible equivalent (e.g. a named function), and clearly indicate that your answer doesn't quite follow the rules, and hence is uneligible to win.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .