This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// An example of using gojay to decode a 'recursive' data-structure | |
// typical of hierarchal data used in a cli. | |
// | |
// Keywords: Decode JSON recursive | |
// | |
package main | |
import ( | |
"testing" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The section describing iterators was configusing to me. http://www.lua.org/pil/7.1.html | |
-- | |
-- I think it simpler to describe the 'stateless' iterator first, then | |
-- go into the nitty details of a 'stateful' iterator using closures. | |
-- | |
-- | |
-- Example of making an iterator in lua | |
-- | |
-- The 'real' syntax for the 'for' statement is this | |
-- for <v> in <iter-fn>, <thing_2_iterate>, <initial-key> do |