Created
October 20, 2016 20:53
-
-
Save DougEverly/61f1fa3156127ba62940b032656ab9e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Int32 | |
| def to(t : Int32.class) | |
| self | |
| end | |
| def to(t : Int64.class) | |
| self.to_i64 | |
| end | |
| def to(t : String.class) | |
| self.to_s | |
| end | |
| end | |
| a = 13_i32 | |
| a.to(Int64) | |
| a.to(String) | |
| a.to(Int32) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment