Laziness and Streams - Part 2 Nov 03, 2019 Following up from Laziness and Streams - Part 1 and inspired by Jeremy Fairbank’s function streams in JavaScript I wanted to try to implement a lazy Stream in Python. The problem is that Python does not have non-strict arguments like Scala does with the => operator. Python does have a lambda keyword which you can use to define functions in a single line expression. The lambda keyword doesn’t need to take arguments, so it can be used as a non-strictness operator hack. ...
Laziness and Streams - Part 1 Oct 01, 2019 I’m currently working my way through Functional Programming in Scala. Chapter 5 focuses on non-strictness as a property of functions. I found the chapter really fascinating because this property allows one to build a lazily evaluated list. In the next post, I’ll try doing the same in Python. What follows here my explanation in Scala taken from the book. I try to cover the Scala specific syntax and features so hopefully this makes sense even if you’re not familiar with Scala. ...