3 ms·
I think you could use a curried read function, in this case. The read function would be passed as an argument instead of your I/O stream. I fear I've slipped s
by incompatible 8y ago
I think you could use a curried read function, in this case. The read function would be passed as an argument instead of your I/O stream.
I fear I've slipped somewhat into OO habits by using Go interfaces.
- pacala 8y agoExactly right. "Polymorphism" is nothing more than passing a function [or bunch of functions] as argument[s] of another function.