(l *State, key string, def int)
| 9 | ) |
| 10 | |
| 11 | func field(l *State, key string, def int) int { |
| 12 | l.Field(-1, key) |
| 13 | r, ok := l.ToInteger(-1) |
| 14 | if !ok { |
| 15 | if def < 0 { |
| 16 | Errorf(l, "field '%s' missing in date table", key) |
| 17 | } |
| 18 | r = def |
| 19 | } |
| 20 | l.Pop(1) |
| 21 | return r |
| 22 | } |
| 23 | |
| 24 | var osLibrary = []RegistryFunction{ |
| 25 | {"clock", clock}, |