3 ms·
I think there's a typo in the createQty function: shouldn't it return (uint16 0) if n is less than 0, not greater? Otherwise, great article. This is exactly ho
by kough 10y ago
I think there's a typo in the createQty function: shouldn't it return (uint16 0) if n is less than 0, not greater?
Otherwise, great article. This is exactly how I learned to program with Scheme: mosel the domain carefully, slowly building up helper functions, and conposing at the end.
- lucasmreis 10y agoThank you! I actually just removed createQty from the code. not only it had a typo, it was not being used anywhere beside the tests. And, as some commenter on Disqus said, probably the right thing to do would be returning an Qty option from the function, and treating it properly. I have no experience with Scheme, but already worked with Clojure - it was actually my "gateway" to functional programming languages, hehe!