lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The two statements are equivalent. Re-read section 3.3.

Mike



Taj Khattra wrote:
couldn't find an errata list on the pil2 home page...

on pg 60

   function getnext(list, node)
       return not node and list or node.next
   end

shouldn't that be

   if not node then return list else return node.next end

to handle the corner case list==nil?

thanks