getfenv(f)
功能:回傳函數f的當前環境表。
參數:f 可以為函數或調用棧的級別,級別1[預設值]為當前的函數,
級別0或其它值將回傳全局環境_G。
範例:
--得到函數 Note 的table 表ID
getfenv(Note)
--顯示函數 Note 的 table 表內容
table.foreach (getfenv(Note), print)