[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Proposal: Virtualization of Filesystem Operations for Lua 5.2.
- From: Miles Bader <miles@...>
- Date: Thu, 03 Nov 2011 09:02:30 +0900
HyperHacker <firstname.lastname@example.org> writes:
> One of my favourite features of Lua is you can replace anything. You
> could add support for reading zip files transparently by replacing
> io.open and friends with your own wrappers, for example. Talk about
> "drivers" that seem to be meant to define how functions behave seems
> a bit redundant when you can change their behaviour already by
> replacing them.
One has to be a bit careful how one goes about it though, since it's
not uncommon to cache module functions in local variables... so any
wrapping needs to be done in code that is guaranteed to run before
anything uses the wrapped functions...
> Also, I'd definitely want "chdir" rather than "cd". Readability is good.
The car has become... an article of dress without which we feel uncertain,
unclad, and incomplete. [Marshall McLuhan, Understanding Media, 1964]