10.07.2015 Views

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

- 108 -(add(mult zero ten)(digit_value ’9’))ten)(digit_value ’8’))"7") -> ... ->MAKE_NUMB (string_val (add(mult(add(mult(add(mult zero ten)(digit_value ’9’))ten)(digit_value ’8’))ten)(digit_value ’7’))"") -> ... ->MAKE_NUMB (add(mult(add(mult(add(mult zero ten)(digit_value ’9’))ten)(digit_value ’8’))ten)(digit_value ’7’))) -> ... ->MAKE_NUMB (add(mult(add(mult nine ten)(digit_value ’8’))ten)(digit_value ’7’))) -> ... ->MAKE_NUMB (add(mult ninety_eight ten)(digit_value ’7’))) -> ... ->MAKE_NUMB nine_hundred_and_eighty_seven => ... =>9876.13. Structure matching with listsWe have been defining list functions with a base case for an empty list argument and a recursion case for a non-emptylist argument, but we have translated them in<strong>to</strong> explicit list selection. We will now extend our structure matchingnotation <strong>to</strong> lists and allow cases for the empty list NIL and for bound variable lists built with :: in place of boundvariables.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!