[NTG-context] table assignment in the context lua code

Ulrike Fischer news3 at nililand.de
Wed Mar 9 15:41:06 CET 2011

font-dum.lua contains the following code snippet:

   local reencodings     = { } 
   fonts.enc.reencodings = reencodings

   local function specialreencode(tfmdata,value)
      local encoding = value and reencodings[value]

1. Why is the assignment 
    fonts.enc.reencodings = reencodings
and not the other way round?

Similar definitions in the same file use more "logical" looking
assignments like e.g. "local setups  = fonts.protrusions.setups"

2. How does it work? Why is the local table variable "reencodings"
in the function specialreencode able to retrieve values stored later
in fonts.enc.reencodings?

Ulrike Fischer 

More information about the ntg-context mailing list