I'm not working in any application domain in particular. That DSL just popped in my mind one morning at around 4.00 A.M. when I generally wake up to urinate. :)
Of course I didn't code all the currencies by hand. I just got the currency list from the Internet and then, using a RegExp, I generated the code.
Thank you! I agree with you with regard to the fact that every DSL is a language "per se" that needs to be learned and so it amplifies a language syntax weight but, in general, IMHO a static language "readability" is better than a dynamic one's.
Since Python is a dynamically typed language its function signatures do not say much. Take, for example, the following Python definition:
def append(xs, x):
...
By reading this function signature you can't say anything about it. What are the parameter types? What does it return? Or, does it actually return anything at all? Same reasoning about Ruby being itself dynamic as well.
Now consider the same example in Scala:
def append[T](xs: List[T], x: T): List[T] = ...
Just by reading the signature you can say many things, such as this method takes a list of some type T and a value of type T and returns a list of type T.
I'm not dissing dynamically typed languages here. I understand there are situations where a dynamic language may be the best choice. What I'm saying is that when it comes to "readability" a static language wins over a dynamic one in terms of pieces of information given just by reading function signatures.
I've already read Martin's book and found it brilliant. Thank you for the hint anyway.
Of course I didn't code all the currencies by hand. I just got the currency list from the Internet and then, using a RegExp, I generated the code.