I’m curious if anyone would be interesting in giving and trying an occasional coding challenge (perhaps a new tag or category could be made if it gets popular). These would not be ones like Exercism has or so, but strictly challenges to try to solve language-specific tasks that you may never run across in real-life. Let’s do a simple task as an example:
Force non-equality - runtime
Given this code:
defmodule Testing do
def f() do
# Put 1-expression
end
def test() do
false = ( f() == f() )
true
end
end
Fill in the # Put 1-expression here with code to make the test pass where calling Testing.test() returns true.
The weird thing about anonymous functions, is that each definition creates a new anonymous function object. But if you assign an anonymous function to a variable, or compile a module that contains it in one of its functions, then this will only create one anonymous function object, and so it will be equal to itself.