Hacker News new | past | comments | ask | show | jobs | submit login

If you haven't read the code for how Elixir handles Unicode support [0] I highly recommend doing so. At compile time it reads from several Unicode Character Database text files [1] and then defines a whole slew of functions using the contents of the files that take advantage of pattern matching via unquoting. I already knew all about pattern matching before I came across this but I was still absolutely floored by how awesome this is. In the past when working with C I've needed to do something similar but it required running an external tool whose output was a .c file. It worked but it was hardly elegant.

[0]: https://github.com/elixir-lang/elixir/blob/master/lib/elixir...

[1]: http://www.unicode.org/Public/8.0.0/ucd/




Yep very elegant solution




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: