Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 854 Bytes

5.md

File metadata and controls

21 lines (12 loc) · 854 Bytes

Part 5: functions

This part is the one you might have been waiting for. It's time to add functions to our little language.

Functions are created with the lambda form, which returns an instance of Closure. The first few tests guide you to implement the lambda form correctly.

The next tests concern calling functions. A function call happens when we evaluate a list in which the first element is a function closure.

Finally, we handle some situations where function calls are done incorrectly, and make sure we give appropriate errors.

Make it happen!

This is probably the most difficult part of making the language, so don't worry if it takes a bit longer than the previous parts.

mvn test=FunctionsTest test

What's next?

Ready for the last part of the language? In part 6 we add a ways to work with lists.