lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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
> Lua. 

  The snippit of code I presented in another thread [1] 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).

  -spc

[1]	http://lua-users.org/lists/lua-l/2018-07/msg00679.html