"Code like Lego(tm)"
Love at first sight :)
When I first stumbled across Elixir I was thrilled to discover the syntax was almost identical to that of the Ruby language. The power of Erlang available through a Ruby-like syntax. "What a find!", I thought.
A study project
To learn Elixir basics I dreamt up a trivial study project based around the beautiful simplicity of functions that always return one of two things, {:ok, result}
or {:error, reason}
.
The scene was set!
If our functions only return two types of tuple it makes it easy for us to chain them together:
One.func(45, "a string", 3.142)
|> Two.func("foobar")
|> Three.func()
Function Two.func/2
knows exactly what to expect from One.func/3
; function Three.func/1
knows exactly what to expect from Two.func/2
. Great!
But then I said, let's make all functions look the same (argument-wise) and call them 'modifiers' (after all, that's what they are!)
Code like Lego(tm)
ModifyChain provides the scaffolding that allows you to flexibly 'run' a 'chain' of standard, built-in modifiers and makes it easy to mix and blend them with ones you create yourself.
So the idea is that you can build anything, on the fly, by chaining together modifiers in different ways โ just like building a Lego model!
Conclusion
A super simple project to get my feet wet with Elixir and the creation, inadvertently, of a new, fun, easily extensible, scripting language โ ModifyChain Script!
Related Jobs
Related Articles
Related Issues
- Open
- 0
- 0
- Intermediate
- Open
- 0
- 0
- Intermediate
- Open
- 0
- 0
- Intermediate
- Open
- 0
- 0
- Intermediate
Get hired!
Sign up now and apply for roles at companies that interest you.
Engineers who find a new job through Functional Works average a 15% increase in salary.
Start with GitHubStart with TwitterStart with Stack OverflowStart with Email