Skip to content

A modifyed version of the lua.org interpreter aiming to add new metatable functionality

Notifications You must be signed in to change notification settings

FireDragon91245/lua-5.4.6-custom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a modified version of the lua Interpreter

Original Version Lua 5.4.6 from here Download Page Direct Download

Modifications

  • Added '__override' metamethod that is called when a existing key in a table is asigned a new value
  • -> If __override exists gets called and the default asignment is cancled

Example:

local t = {}
setmetatable(t, {
    __override = function(table, key, new_value, old_value)
        print("override", key, new_value, old_value)
    end
})

t.a = 1
print("a value", t.a)
t.a = 2 -- __override gets called default asignment is cancled
print("a value", t.a)

-- stdout:
-- a value 1
-- override a 2 1
-- a value 1

Original README

This is Lua 5.4.6, released on 02 May 2023.

For installation instructions, license details, and further information about Lua, see doc/readme.html.

About

A modifyed version of the lua.org interpreter aiming to add new metatable functionality

Topics

Resources

Stars

Watchers

Forks

Languages