OvermindDL1
Coding challenge: Force non-equality - runtime
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.
Most Liked
JEG2
Qqwy
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.
gregvaughn
Last Post!
OvermindDL1
True, just recently I added ocaml and rust to an Elixir Ports benchmark on a github repo recently. I like the test to see how things go. ^.^
Popular in Discussions
Other popular topics
Chat & Discussions>Discussions
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









