stevedonovan/Penlight — pull request #45 by user-none (2013-01-18 17:06:38+00:00)
Title: Add support for read only tables

Add support for making a table read only. I find this helpful when used in conjunction with pl.config. After reading the config into a table then adding any default values I make the table read only to prevent accidental modification. In my use I have some config values that shouldn't change (db salt) and I'd rather have modification of that value produce an error instead of having unintended and unforeseen consequences.

Uses the methods described at:
http://lua-users.org/wiki/ReadOnlyTables
http://www.lua.org/pil/13.4.5.html