ni_nitdoc: Get last element in Set
authorStefan Lage <lagestfan@gmail.com>
Fri, 28 Jun 2013 22:06:20 +0000 (18:06 -0400)
committerStefan Lage <lagestfan@gmail.com>
Wed, 3 Jul 2013 20:54:25 +0000 (16:54 -0400)
Signed-off-by: Stefan Lage <lagestfan@gmail.com>

src/ni_nitdoc.nit

index 30e4c28..d0e2f61 100644 (file)
@@ -1189,6 +1189,12 @@ redef class MClassDef
        end
 end
 
+redef class Set[E]
+       fun last: E do
+               return to_a[length-1]
+       end
+end
+
 # Create a tool context to handle options and paths
 var toolcontext = new ToolContext
 toolcontext.process_options