changeset 45:8d3187b12443

Start of sketch of a List object
author John@Yosemite-PC
date Thu, 15 Mar 2012 23:50:49 -0400
parents 8913e7d79cad
children 6c0a8acccbc8
files Lists.lua
diffstat 1 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Lists.lua	Thu Mar 15 22:58:54 2012 -0400
+++ b/Lists.lua	Thu Mar 15 23:50:49 2012 -0400
@@ -93,6 +93,47 @@
 reserveIdP = {} -- "reserve id present"
 local personName2id = {} -- given "name" get that person's id
 
+List = 
+{
+    id = 0
+    name = ""
+    Sort = function()
+    end
+}
+function List:new() -- TODO: take args, build list
+    n = {}
+    setmetatable(n,self)
+    self.__index = self
+    return n
+end
+function List:HasID(id)
+    for i = 1,#self do
+        if id == self[i].id then
+            return true
+        end
+    end
+    return false
+end
+function List:GetID()
+    return self.id
+end
+function List:RemoveEntry()
+end
+function List:InsertEntry()
+end
+function List:OrderedIter()
+end
+
+
+
+
+
+
+
+
+
+
+
 
 function SelfDestruct()
     lists = {}