platform

module platform

Dependencies

dep_module_android__platformjavajavaappappawareawareactivitiesactivitiesplatformplatformactivities->platformplatform->javaplatform->appplatform->awarelogloglog->platformkey_eventkey_eventkey_event->platform

Imports

  • app: app.nit is a framework to create cross-platform applications
  • aware: Android compatibility module
  • java: Supporting services for the FFI with Java and to access Java libraries

Concerns

  • core: Nit common library of core classes and methods
    • kernel: Most basic classes and methods.

from core::kernel

Sys

redef class Sys

The main class of the program.

Sys is a singleton class, its only instance is accessible from everywhere with sys.

Because of this, methods that should be accessible from everywhere, like print or exit, are defined in Sys. Moreover, unless there is an ambiguity with self, the receiver of a call to these methods is implicitly sys. Basically it means that the two following instructions are equivalent.

print "Hello World"
sys.print "Hello World"

Methods Implicitly Defined in Sys

Sys is the class where are defined top-level methods, i.e. those defined outside of any class like in a procedural language. Basically it means that

redef class Sys
   fun foo do print "hello"
end

is equivalent with

fun foo print "hello"

As a corollary, in a top-level method, self (the current receiver) is always sys.

Redefines
  • bound_platform: Platform bound at compilation (by importation or -m)