« first day (1074 days earlier)      last day (1325 days later) » 

2:30 PM
@EliahKagan That did not successfully show overloading, because I accidentally called the Int32 method add_ instead of add. When I then called add with arguments of type Int32, they were converted to Float64 and the Float64 overload was called. But removing the spurious _ fixes the problem, creating separate overloads, which are separately called by add(1, 2) and add(0.1, 0.2). The output of each program is the same, which is why it I didn't notice the mistake at first.
 
 
2 hours later…
4:25 PM
Btw, I had committed each of the examples I showed above into a repository I use for trying things out with Crystal. I've since cherry-picked those commits into this gist.
For now you have to look at the revision history to see most the examples because I often built on example on another as a new commit rather than a separate file. (On my Git server, you also have access to the gist as crystal-type-examples-gist--but of course you can also clone it from GitHub--and to the bigger repo as crystal-sketches.)
 
 
1 hour later…
5:32 PM
sorry for my absence
 

« first day (1074 days earlier)      last day (1325 days later) »