lib/kernel: introduce `Sys::run` as the entry point of programs
authorJean Privat <jean@pryen.org>
Wed, 6 Aug 2014 20:14:47 +0000 (16:14 -0400)
committerJean Privat <jean@pryen.org>
Wed, 6 Aug 2014 20:14:47 +0000 (16:14 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/kernel.nit

index dcd48b5..3fc5066 100644 (file)
@@ -83,6 +83,11 @@ class Sys
        # Instructions outside classes implicitly redefine this method.
        fun main do end
 
+       # The entry point for the execution of the whole program.
+       # Its job is to call `main` but some modules may want to refine it
+       # and inject specific work before or after the main part.
+       fun run do main
+
        # Number of the last error
        fun errno: Int is extern `{
                return errno;