diff options
author | Lua Team <team@lua.org> | 1994-07-08 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 1994-07-08 12:00:00 +0000 |
commit | 944fc7d7d95575f2b8023c1f3d4ac19e1369fc76 (patch) | |
tree | eabf0822f2058229cd0d49c7928683b8cf0ed88e /type.lua | |
parent | 8b5979a7e8b9732aa2883d2384f853d87b594770 (diff) | |
download | lua-github-1.1.tar.gz |
Lua 1.11.1
Diffstat (limited to 'type.lua')
-rw-r--r-- | type.lua | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/type.lua b/type.lua deleted file mode 100644 index 26dc162f..00000000 --- a/type.lua +++ /dev/null @@ -1,35 +0,0 @@ -$debug
-
-function check (object, class)
- local v = next(object,nil);
- while v ~= nil do
- if class[v] = nil then print("unknown field: " .. v)
- elseif type(object[v]) ~= class[v].type
- then print("wrong type for field " .. v)
- end
- v = next(object,v);
- end
- v = next(class,nil);
- while v ~= nil do
- if object[v] = nil then
- if class[v].default ~= nil then
- object[v] = class[v].default
- else print("field "..v.." not initialized")
- end
- end
- v = next(class,v);
- end
-end
-
-typetrilha = @{x = @{default = 0, type = "number"},
- y = @{default = 0, type = "number"},
- name = @{type = "string"}
- }
-
-function trilha (t) check(t,typetrilha) end
-
-t1 = @trilha{ x = 4, name = "3"}
-
-a = "na".."me"
-
-
\ No newline at end of file |