Pattern matching - implementation

后端 未结 4 664
执念已碎
执念已碎 2020-12-13 09:14

I am wondering how pattern matching is usually implemented. for example in Erlang do you think its implemented at the byte-code level( there\'s a byte-code for it so that it

4条回答
  •  粉色の甜心
    2020-12-13 09:54

    A very good description of compiling pattern matching is given in "The implementation of functional programming languages" by Simon Peyton Jones. It is a bit old but a very good book. It also contains, amongst other things, a description of compiling list comprehensions.

    The Erlang compiler uses both of these algorithms from the book.

提交回复
热议问题