ni_nitdoc: Get last element in Set
[nit.git] / 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