[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Duck Typing?
- From: Sean Conner <sean@...>
- Date: Tue, 31 Jul 2018 11:51:19 -0400
It was thus said that the Great Gavin Wraith once stated:
> I would be interested to see examples of how to fake
> types, type classes, and other such concepts within
The snippit of code I presented in another thread  is a form of duck
typing. I'm working on a socket framework (to handle both TCP and TLS
connections via Lua coroutines) and I'm mimicking the Lua file operations.
Yes, I could create a FILE object from a TCP socket and use the normal Lua
functions, but that won't work for TLS. So my own versions of read(),
write(), close(), etc).