[chapter 11] add implement code

TODO:
1. build_def
2. refactor the error report