Module:User:Erutuon/languages/documentation

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Documentation for Module:User:Erutuon/languages. [edit]
This page contains usage information, categories, interwiki links and other content describing the module.

An experiment with creating a Language object to which only a specified number of the methods in Module:languages are added. This may be less memory-intensive than creating a Language object with every function (many of which are never used in the module in which the object is generated), as is currently done.

Another issue is that the data in the Language object can be gotten by indexing it – enLanguageObject._rawData.canonicalName -- "English", for example – but this is discouraged. It can even be modified: enLanguageObject._rawData.canonicalName = "German" -- now enLanguageObject:getCanonicalName() == "German". Storing the data in the metatable and preventing access to it would make both of these impossible.