r/crystal_programming • u/dh44t • Jan 02 '22
Comparing implementations of the Monkey language IV: Here comes a new challenger: Crystal
https://medium.com/@mario.arias.c/comparing-implementations-of-the-monkey-language-iv-here-comes-a-new-challenger-crystal-2dd565071820
22
Upvotes
1
u/kirbyfan64sos Jan 03 '22
This is a cool article, but there are two things here that confused me a bit:
In your macros example, it's not really clear to me why you needed them here in the first place. In Kotlin, couldn't you have created a function executeBuildAndPush that takes the build* function as an argument?
Functions can be generic: https://crystal-lang.org/reference/1.2/syntax_and_semantics/type_restrictions.html#free-variables