lib: create directories for some lib (in order to prepare examples)

Signed-off-by: Jean Privat <jean@pryen.org>
lib: move some examples/* into specific subdirectories of their lib

examples/ starts to become a mess.
So move the simple examples of lib into an `example` subdirectory of the lib.

Signed-off-by: Jean Privat <jean@pryen.org>
neo: do not instantiatetypes directly, use the model API

Signed-off-by: Jean Privat <jean@pryen.org>
engines: no more `super_inits` method used in old-style automatic init

Signed-off-by: Jean Privat <jean@pryen.org>
lib/standard: make IFStream a PollableIStream so it can be used as stdin

Signed-off-by: Jean Privat <jean@pryen.org>
modelbuilder: parent in load_rt_module is optionnal

Signed-off-by: Jean Privat <jean@pryen.org>
niti: add -e to feed the interpreter with a program on the command line

Signed-off-by: Jean Privat <jean@pryen.org>
niti: add -n to run the program for each line in file-name arguments

Signed-off-by: Jean Privat <jean@pryen.org>
src: reduce warnings and spelling errors

Thanks to the new detected warnings, it is easier to remove them.
Also fix some spelling errors because vim colored them in red.

Signed-off-by: Jean Privat <jean@pryen.org>
modelize: `missing-doc` on attributes

missing-doc only fires on public properties.
But attributes are always Private, so consider the getter method instead.

It make sense since the documentation on an attribute documents more the
getter than the attribute.

Signed-off-by: Jean Privat <jean@pryen.org>
niti: introduce `read_variable` and `write_variable`

So the internal map is no more acceded directly, thus opening the door to
a more efficient implementation.

Signed-off-by: Jean Privat <jean@pryen.org>
niti: rename `init_naive_interpreter` as `Interpreter::start`

Signed-off-by: Jean Privat <jean@pryen.org>
niti: change some visibility to avoid unnecessary intrude imports

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: src: reduce warnings and spelling errors

Thanks to the new detected warnings, it is easier to remove them.
Also fix some spelling errors because vim colored them in red.

Pull-Request: #795
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: neo: do not instantiate types directly, use the model API

Since visibility on constructor is disabled in nitg, the errors was not detected.

Pull-Request: #797
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: engines: no more `super_inits` method used in old-style automatic init

Unneeded old code...

Pull-Request: #798
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: modelize: `missing-doc` on attributes

missing-doc only fires on public properties.
But attributes are always Private, so consider the getter method instead.

It make sense since the documentation on an attribute documents more the
getter than the attribute.

Pull-Request: #800
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
version 0.6.9

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Niti loves the command line

Nit is both a good compiled language and a good interpreted language (except that the naive interpreter is slow).

Some people already use nit as a traditional script-language by including a shebang at the first line of their programs and set them executable (`chmod +x`).

~~~nit
print "Hello world"
~~~

This experimental PR make the nit interpreter more script-useful.

First, it introduces the `-e` option to run a program written on the command line.
Like with ruby, perl, bash and other script language.

~~~sh
$ nit -e 'print 5+5'
10
~~~

Second, and this is just wonderful, it adds the `-n` option (from ruby and perl) to automatically iterate over the lines of files given as arguments. The current line is named `sys.line` (instead of `$_` in perl and ruby).

It works for stdin if no argument

~~~sh
$ echo "hello world" | nit -n -e 'print sys.line.capitalized'
Hello World
~~~

or on the arguments (as files) if one or more is given (it is the perl and ruby semantic)

~~~sh
$ nit -n -e 'print sys.line.capitalized' README
Nit Is A Statically Typed Object-Oriented Programming Language.
The Goal Of Nit Is To Propose A Statically Typed Programming Language Where Structure Is Not A Pain.
[...]
~~~

The logic of the `-n` is written in a library loaded at runtime (`niti_runtime.nit`), so can be updated without having to recompile the interpreter.

Pull-Request: #799
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Merge: Niti: small refactoring

Some small improvements in the interpreter code infrastructure.

Pull-Request: #801