In this video I show you a quick and simple pattern for eliminating the need for if statements in Python and then in Common Lisp using macros to hide functionality.
This pattern can be translated into any language and makes adding additional functionality for varying inputs easier than expanding an if..else for an endless number of trees.
P.S
The macro written in CL is missing a gensym on the val variable so it could potentially leak, but it was only a quick demonstration ;)
A better version is here: https://plaster.tymoon.eu/view/2958#2958
Download
0 formats
No download links available.
Python: removing if statements with a simple pattern | NatokHD