nit.git
8 years agolib/std: add some cached services on Path
Jean Privat [Tue, 21 Jul 2015 13:11:48 +0000 (09:11 -0400)]
lib/std: add some cached services on Path

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/std: handle read errors in FileReader
Jean Privat [Tue, 21 Jul 2015 13:11:19 +0000 (09:11 -0400)]
lib/std: handle read errors in FileReader

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/std: rephrase some file errors
Jean Privat [Tue, 21 Jul 2015 13:08:14 +0000 (09:08 -0400)]
lib/std: rephrase some file errors

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: update sav/nitpick_args1.res because read_all_bytes is now documented
Jean Privat [Mon, 20 Jul 2015 19:03:52 +0000 (15:03 -0400)]
tests: update sav/nitpick_args1.res because read_all_bytes is now documented

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/std: handle `last_error` for FileStat-related services in Path
Jean Privat [Mon, 20 Jul 2015 19:02:07 +0000 (15:02 -0400)]
lib/std: handle `last_error` for FileStat-related services in Path

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/std: improve doc of the class `Path`
Jean Privat [Mon, 20 Jul 2015 18:53:22 +0000 (14:53 -0400)]
lib/std: improve doc of the class `Path`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/std: rewrite `Path::rmdir`, `Path::files` and `Path::delete` to handle errors
Jean Privat [Mon, 20 Jul 2015 18:53:00 +0000 (14:53 -0400)]
lib/std: rewrite `Path::rmdir`, `Path::files` and `Path::delete` to handle errors

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/std: add Path::last_error to aggregate errors on path services.
Jean Privat [Mon, 20 Jul 2015 18:51:40 +0000 (14:51 -0400)]
lib/std: add Path::last_error to aggregate errors on path services.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Basic UDP socket
Jean Privat [Mon, 20 Jul 2015 13:34:10 +0000 (09:34 -0400)]
Merge: Basic UDP socket

This PR intro `UDPSocket` and cleans up a bit of the native layer of socket to avoid using callbacks when possible.

`UDPSocket` support sending messages to remote sockets without a connection and more importantly receive message from any sender. However, as of yet it does not support connections or the stream API of Nit.

Some TODO with the sockets:
* Stop using `gethostbyname` :neutral_face:
* Decide on one or many APIs. The native layer has an API closed to the C API and to what is available in other languages, maybe it can be clean up further and exposed as is.

---
Please ignore the first 2 commits from #1573.

Pull-Request: #1574
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Faster write
Jean Privat [Mon, 20 Jul 2015 13:34:04 +0000 (09:34 -0400)]
Merge: Faster write

Allow FlatString to be directly written to files without useless copy (`to_cstring`) or useless iterator (`substrings`)

Numbers, for `nitc nitc.nit`:

* before 5.796
* after 5.440 (-6%)

Close one check-box of #1298

Pull-Request: #1572
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Apply optional params in strip_extension, basename and join
Jean Privat [Mon, 20 Jul 2015 13:33:45 +0000 (09:33 -0400)]
Merge: Apply optional params in strip_extension, basename and join

Using optional parameters, the methods `strip_extension`, `basename` and `join` have a default behavior that fit most usage.

* `Collection::join` appends all elements of the collection by default, the same as `join("")`. This is the old behavior of `Collection::to_s`.

* `String::strip_extension` removes the rightmost extension by default, the same as `s.strip_extension("." + s.file_extension)`.

* `String::basename` does not strip the extension by default.

I haven't updated any users of `strip_extension` because the default behavior requires more work. Thus changing the already existing calls to something else would slow down the programs by a very small margin.

Pull-Request: #1575
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agosrc & lib: use the default behavior of `basename` where applicable
Alexis Laferrière [Sat, 18 Jul 2015 13:43:53 +0000 (09:43 -0400)]
src & lib: use the default behavior of `basename` where applicable

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/standard: revamp doc of `Map::join`
Alexis Laferrière [Fri, 17 Jul 2015 14:09:59 +0000 (10:09 -0400)]
lib/standard: revamp doc of `Map::join`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib & examples..: update users of `join("")`
Alexis Laferrière [Fri, 17 Jul 2015 14:01:23 +0000 (10:01 -0400)]
contrib & examples..: update users of `join("")`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/standard: the single parameter of `String::basename` is optional
Alexis Laferrière [Fri, 17 Jul 2015 13:29:12 +0000 (09:29 -0400)]
lib/standard: the single parameter of `String::basename` is optional

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Protected setters
Jean Privat [Sat, 18 Jul 2015 01:42:35 +0000 (21:42 -0400)]
Merge: Protected setters

Setters of attributes are private by default. This cause some issue as they are exposed as initializers but still invisible in client modules.
The proposed solution to resolve this inconsistency is to make setters protected by default so they are visible in client modules but only usable in subclasses.

This is a change is the spec, to RFC label is set is people have comments on the sanity/usability/kiss/pola/etc.

Close #1552

Pull-Request: #1567
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: Fix autosuperinit
Jean Privat [Sat, 18 Jul 2015 01:41:54 +0000 (21:41 -0400)]
Merge: Fix autosuperinit

Rules are that a named constructor is expected to call super or the autosuperinit in order to be sanely attached to the inheritance hierarchy. If no such a call exists, an implicit call is injected (thus the name auto-super-init) or an error is displayed.

For some historical reasons, the rule was only enforced when a class inherits a concrete or a abstract class. But this restriction is buggy with the last spec of autoinit constructors.

The main change in src/ is just to remove the test the skip the work.
All other changes in the code are to enforce the rule (not that much); basically this means calling init with parameters instead of assigning attributes.
The remaining changes is to update the sav files because missing autosuperinit are now correctly injected.

Close #1550

Pull-Request: #1566
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: lib/noise: compatibility with 32 bits arch and noisier
Jean Privat [Fri, 17 Jul 2015 21:03:25 +0000 (17:03 -0400)]
Merge: lib/noise: compatibility with 32 bits arch and noisier

This PR enables using noise maps in multiplayer multiplatform games.

The integers are limited to 30 bits in length to be compatible with 32 bits architectures with 2 bits for tagging. Forcing this limit allows to get the same results from the same seed on a 32 and 64 bits computers.

The random angle generation is better than previously, the repeated checker pattern is no more. However there is still a visible patterns on the main axes. Further work is need to fix it.

Pull-Request: #1576
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Rename Container to Ref
Jean Privat [Fri, 17 Jul 2015 21:03:18 +0000 (17:03 -0400)]
Merge: Rename Container to Ref

The `Container` class is widely misunderstood and underused.  However it can be very useful to implement a return parameter. This PR rename the class according to this usage. It will make some signatures easier to understand: (example inspired by a similar function from `UDPSocket`)

~~~nit
# This method has 3 outputs:
# * The received message written into `buffer`.
# * The number of bytes written as the return value.
# * The information on the sender of the message is stored in `sender_info`.
fun recv_from(buffer: NativeString, sender_info: Ref[nullable SocketAddress]): Int
~~~

### Bonus Ref tip!

`Ref` can also be used as a hackish equivalent to a `static` variable in C. This example use the dreaded `once` keyword to easily get a singleton, but it could be done cleaner with an attribute in `Sys`.

~~~nit
fun foo
   ...

    # Count the number of times foo is executed
    var counter = once new Ref[Int](0)
    counter.item += 1
    print "foo has been executed {counter.item} times"
end
~~~

Pull-Request: #1573
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Separate code compilation for autobox
Jean Privat [Fri, 17 Jul 2015 21:03:12 +0000 (17:03 -0400)]
Merge: Separate code compilation for autobox

`autobox` (and and its cousin `autobox_extern`) where using RTA information when generating code in order to avoiding to use a C symbol (like a table identifier) that will not be defined in the final compiled program.

The problem is that the approach is incompatible with separate compilation principle where the generated code is independent or the program (thus independent of the liveness of the types of a given program).

The solution is to use symbols in the separate compilation, even for potential (or known) dead classes, and let the global phase define these symbols with invalid information.

Pull-Request: #1570
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agotests: update deserializations tests with nitce because fixed autoinit fix things
Jean Privat [Fri, 17 Jul 2015 20:55:52 +0000 (16:55 -0400)]
tests: update deserializations tests with nitce because fixed autoinit fix things

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoniti: update intern implementation of `io_write`.
Jean Privat [Fri, 17 Jul 2015 20:31:37 +0000 (16:31 -0400)]
niti: update intern implementation of `io_write`.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/noise: fix generation of generated pseudo-random angles
Alexis Laferrière [Mon, 13 Jul 2015 16:01:17 +0000 (12:01 -0400)]
lib/noise: fix generation of generated pseudo-random angles

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/noise: make compatible with 32 bit archs and a bit more random
Alexis Laferrière [Wed, 8 Jul 2015 19:50:19 +0000 (15:50 -0400)]
lib/noise: make compatible with 32 bit archs and a bit more random

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/noise: fix the expected amplitude of the pseudo random value to be in [-1.0 ...
Alexis Laferrière [Thu, 2 Jul 2015 04:57:04 +0000 (00:57 -0400)]
lib/noise: fix the expected amplitude of the pseudo random value to be in [-1.0 .. 1.0]

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/standard: the single parameter of `String::strip_extension` is optional
Alexis Laferrière [Fri, 17 Jul 2015 13:29:02 +0000 (09:29 -0400)]
lib/standard: the single parameter of `String::strip_extension` is optional

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/standard: the single parameter of `Collection::join` is optional
Alexis Laferrière [Sat, 11 Jul 2015 17:25:22 +0000 (13:25 -0400)]
lib/standard: the single parameter of `Collection::join` is optional

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: intro `UDPSocket` and its services
Alexis Laferrière [Mon, 13 Jul 2015 16:46:28 +0000 (12:46 -0400)]
lib/socket: intro `UDPSocket` and its services

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: add UDP related services to the native layer
Alexis Laferrière [Sun, 5 Jul 2015 17:53:48 +0000 (13:53 -0400)]
lib/socket: add UDP related services to the native layer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: refactor IOError from errnos into contructors
Alexis Laferrière [Tue, 14 Jul 2015 11:25:37 +0000 (07:25 -0400)]
lib/socket: refactor IOError from errnos into contructors

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib & examples & tests: update all the many and happy users of the new Ref
Alexis Laferrière [Fri, 17 Jul 2015 12:08:48 +0000 (08:08 -0400)]
lib & examples & tests: update all the many and happy users of the new Ref

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: move `blocking=` to `Socket`
Alexis Laferrière [Sun, 5 Jul 2015 17:52:13 +0000 (13:52 -0400)]
lib/socket: move `blocking=` to `Socket`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/collection: rename Container to Ref
Alexis Laferrière [Fri, 17 Jul 2015 12:07:56 +0000 (08:07 -0400)]
lib/collection: rename Container to Ref

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: intro `TCPSocket`
Alexis Laferrière [Sun, 5 Jul 2015 17:51:50 +0000 (13:51 -0400)]
lib/socket: intro `TCPSocket`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: write and read of the native layer use a user-created buffer
Alexis Laferrière [Mon, 6 Jul 2015 14:16:45 +0000 (10:16 -0400)]
lib/socket: write and read of the native layer use a user-created buffer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: revamp services of `NativeSocketAddrIn`
Alexis Laferrière [Sun, 5 Jul 2015 17:54:22 +0000 (13:54 -0400)]
lib/socket: revamp services of `NativeSocketAddrIn`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: use less callbacks and prefer NativeString in the native layer
Alexis Laferrière [Sun, 5 Jul 2015 13:40:34 +0000 (09:40 -0400)]
lib/socket: use less callbacks and prefer NativeString in the native layer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/socket: rename `Socket::socket` to `Socket::native`
Alexis Laferrière [Sun, 5 Jul 2015 13:38:33 +0000 (09:38 -0400)]
lib/socket: rename `Socket::socket` to `Socket::native`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/file: efficient write to file for FlatString
Jean Privat [Thu, 16 Jul 2015 21:06:20 +0000 (17:06 -0400)]
lib/file: efficient write to file for FlatString

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/file: delegate how to write a string to the string itself
Jean Privat [Thu, 16 Jul 2015 21:05:42 +0000 (17:05 -0400)]
lib/file: delegate how to write a string to the string itself

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/file: add a `from` parameter on `write_native` and `io_write`
Jean Privat [Thu, 16 Jul 2015 21:04:59 +0000 (17:04 -0400)]
lib/file: add a `from` parameter on `write_native` and `io_write`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Fix bug with reverse iterators in arrays
Jean Privat [Thu, 16 Jul 2015 15:35:41 +0000 (11:35 -0400)]
Merge: Fix bug with reverse iterators in arrays

Using `Array::iterator` after a finished `reverse_iterator` iterates only on the first element, or crash if array is empty. As `ReverseArrayIterator` specialize `ArrayIterator`, it can cache itself in the array to be used by `iterator`.

This PR simply disable caching for reverse iterators. We could add a distinct cache for the reverse iterator if we need the performance.

This minimal program highlights the bug:
~~~nit
var a = [1, 2, 3]
for x in a.reverse_iterator do print x
print "-"
for x in a.iterator do print x
~~~

Output:
~~~
3
2
1
-
1
~~~

Pull-Request: #1569
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agosep_comp: do not lose potential mcasttype information in autobox
Jean Privat [Thu, 16 Jul 2015 15:18:40 +0000 (11:18 -0400)]
sep_comp: do not lose potential mcasttype information in autobox

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosep_comp: do not rely on RTA in autobox
Jean Privat [Thu, 16 Jul 2015 15:18:05 +0000 (11:18 -0400)]
sep_comp: do not rely on RTA in autobox

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosep_comp: improve deadness management in compile_class_to_c
Jean Privat [Thu, 16 Jul 2015 15:16:56 +0000 (11:16 -0400)]
sep_comp: improve deadness management in compile_class_to_c

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: update line number in `test_new_native_alt1`
Alexis Laferrière [Thu, 16 Jul 2015 03:02:03 +0000 (23:02 -0400)]
tests: update line number in `test_new_native_alt1`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/array: do not cache reverse iterators as forward iterators
Alexis Laferrière [Wed, 15 Jul 2015 20:56:42 +0000 (16:56 -0400)]
lib/array: do not cache reverse iterators as forward iterators

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Better autoinit conflict message
Jean Privat [Tue, 14 Jul 2015 19:50:57 +0000 (15:50 -0400)]
Merge: Better autoinit conflict message

On

~~~nit
class A
    var x: Int
end

class B
    var y: Bool
end

class C
    super A
    super B
end
~~~

The error message

> a.nit:9,7: Error: conflict for inherited inits a#B#init(y=) and a#A#init(x=)

now become

> a.nit:9,7: Error: cannot generate automatic init for class C. Conflict in the order in inherited initializers a#B#init(y=) and a#A#init(x=). Use `autoinit` to order initializers. eg `autoinit x=, y=`

(fell free to simplify or propose better)

Close #1549

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

8 years agolib/neo4j: use `nosuper` in named constructors to avoid the initialization of `intern...
Jean Privat [Tue, 14 Jul 2015 14:37:48 +0000 (10:37 -0400)]
lib/neo4j: use `nosuper` in named constructors to avoid the initialization of `internal_properties`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/geometry: named constructors use autoinit
Jean Privat [Tue, 14 Jul 2015 12:33:07 +0000 (08:33 -0400)]
lib/geometry: named constructors use autoinit

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/date: named constructors use autoinit
Jean Privat [Tue, 14 Jul 2015 12:32:32 +0000 (08:32 -0400)]
lib/date: named constructors use autoinit

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: lib/standard/bytes: Added pop method
Jean Privat [Mon, 13 Jul 2015 20:24:58 +0000 (16:24 -0400)]
Merge: lib/standard/bytes: Added pop method

The method was missing from Bytes, I needed it so I implemented it, and here's the associated PR.

Pull-Request: #1564
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: Rosetta entropy
Jean Privat [Mon, 13 Jul 2015 20:24:46 +0000 (16:24 -0400)]
Merge: Rosetta entropy

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

8 years agorefund: `Dollar::from_float` use the autoinit constructor
Jean Privat [Mon, 13 Jul 2015 20:04:51 +0000 (16:04 -0400)]
refund: `Dollar::from_float` use the autoinit constructor

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitrpg: `from_json` constructors use the autoinit constructor
Jean Privat [Mon, 13 Jul 2015 20:04:24 +0000 (16:04 -0400)]
nitrpg: `from_json` constructors use the autoinit constructor

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcc: make the autoinit constructor of Automation without parameter
Jean Privat [Mon, 13 Jul 2015 20:03:44 +0000 (16:03 -0400)]
nitcc: make the autoinit constructor of Automation without parameter

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: update (and improve) test for autoinit error message
Jean Privat [Mon, 13 Jul 2015 19:33:45 +0000 (15:33 -0400)]
tests: update (and improve) test for autoinit error message

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelize: improve message in case of inherited autoinit conflict
Jean Privat [Mon, 13 Jul 2015 19:32:58 +0000 (15:32 -0400)]
modelize: improve message in case of inherited autoinit conflict

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: update sav for nuew setter visibility rule
Jean Privat [Mon, 13 Jul 2015 18:16:53 +0000 (14:16 -0400)]
tests: update sav for nuew setter visibility rule

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelize_property: setters are protected by default so are visible to use in setters
Jean Privat [Mon, 13 Jul 2015 18:16:18 +0000 (14:16 -0400)]
modelize_property: setters are protected by default so are visible to use in setters

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/standard/bytes: added documentation for public methods
Lucas Bajolet [Mon, 13 Jul 2015 17:12:31 +0000 (13:12 -0400)]
lib/standard/bytes: added documentation for public methods

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agotests: update sav for enforced superautoinit
Jean Privat [Mon, 13 Jul 2015 16:44:12 +0000 (12:44 -0400)]
tests: update sav for enforced superautoinit

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoautosuperinit: constructors can be defined in interface, so autosuperinit should...
Jean Privat [Mon, 13 Jul 2015 15:40:30 +0000 (11:40 -0400)]
autosuperinit: constructors can be defined in interface, so autosuperinit should search for them

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: update example_hanoi with saner constructor
Jean Privat [Mon, 13 Jul 2015 16:43:24 +0000 (12:43 -0400)]
tests: update example_hanoi with saner constructor

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosrc/niti: PrimitiveNativeFile use autoinit in named inits
Jean Privat [Mon, 13 Jul 2015 16:42:31 +0000 (12:42 -0400)]
src/niti: PrimitiveNativeFile use autoinit in named inits

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/sqlite3: use autoinit in named init `open`
Jean Privat [Mon, 13 Jul 2015 16:41:43 +0000 (12:41 -0400)]
lib/sqlite3: use autoinit in named init `open`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/noise: all classes are serializable
Alexis Laferrière [Tue, 7 Jul 2015 12:06:23 +0000 (08:06 -0400)]
lib/noise: all classes are serializable

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosrc/location: use `nosuper in some specific named constructors
Jean Privat [Mon, 13 Jul 2015 15:38:19 +0000 (11:38 -0400)]
src/location: use `nosuper in some specific named constructors

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/string: named constructors call the autoinit explicitly
Jean Privat [Mon, 13 Jul 2015 15:37:48 +0000 (11:37 -0400)]
lib/string: named constructors call the autoinit explicitly

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/standard/bytes: Added pop method
Lucas Bajolet [Mon, 13 Jul 2015 14:45:18 +0000 (10:45 -0400)]
lib/standard/bytes: Added pop method

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agorosetta code: also add fibonacci_word
Jean Privat [Fri, 10 Jul 2015 15:59:29 +0000 (11:59 -0400)]
rosetta code: also add fibonacci_word

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agorosetta code: also add entropy_narcissist
Jean Privat [Fri, 10 Jul 2015 15:43:32 +0000 (11:43 -0400)]
rosetta code: also add entropy_narcissist

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agorosetta code: entropy
Jean Privat [Fri, 10 Jul 2015 15:24:15 +0000 (11:24 -0400)]
rosetta code: entropy

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/counter: add `Counter::entropy` to shine in private dinners in town
Jean Privat [Fri, 10 Jul 2015 15:24:00 +0000 (11:24 -0400)]
lib/counter: add `Counter::entropy` to shine in private dinners in town

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/counter: add `Collection::to_counter` to simplify the creation of counterss
Jean Privat [Fri, 10 Jul 2015 15:20:28 +0000 (11:20 -0400)]
lib/counter: add `Collection::to_counter` to simplify the creation of counterss

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Tweaks to the Android support
Jean Privat [Fri, 10 Jul 2015 13:55:31 +0000 (09:55 -0400)]
Merge: Tweaks to the Android support

Fixes multi-pointers support, intro `NativeActivity::finish`, landscape mode use the sensor and find the assets folder using the project location.

Pull-Request: #1559
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/android: intro `NativeActivity::finish`
Alexis Laferrière [Sun, 5 Jul 2015 17:50:22 +0000 (13:50 -0400)]
lib/android: intro `NativeActivity::finish`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: support secondary pointers in motion events `pressed`
Alexis Laferrière [Wed, 8 Jul 2015 22:45:18 +0000 (18:45 -0400)]
lib/android: support secondary pointers in motion events `pressed`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: as alternative to motion events feed in only the acting pointer
Alexis Laferrière [Thu, 9 Jul 2015 20:19:39 +0000 (16:19 -0400)]
lib/android: as alternative to motion events feed in only the acting pointer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: intro: `acting_pointer` and fix warnings on `just_went_down`
Alexis Laferrière [Wed, 8 Jul 2015 22:41:45 +0000 (18:41 -0400)]
lib/android: intro: `acting_pointer` and fix warnings on `just_went_down`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: use latest language features for `AndroidMotionEvent::pointers`
Alexis Laferrière [Sat, 4 Jul 2015 20:41:30 +0000 (16:41 -0400)]
lib/android: use latest language features for `AndroidMotionEvent::pointers`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: intro the real `pointer_id`
Alexis Laferrière [Sat, 4 Jul 2015 20:40:42 +0000 (16:40 -0400)]
lib/android: intro the real `pointer_id`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: rename `pointer_id` to `pointer_index`
Alexis Laferrière [Sat, 4 Jul 2015 20:39:57 +0000 (16:39 -0400)]
lib/android: rename `pointer_id` to `pointer_index`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: landscape mode use sensor
Alexis Laferrière [Sat, 4 Jul 2015 20:39:16 +0000 (16:39 -0400)]
lib/android: landscape mode use sensor

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosrc/android: use the project to find the assets, res and libs folders
Alexis Laferrière [Sat, 4 Jul 2015 20:38:43 +0000 (16:38 -0400)]
src/android: use the project to find the assets, res and libs folders

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Some bugfixes and small improvements for nitiwiki
Jean Privat [Thu, 9 Jul 2015 20:10:22 +0000 (16:10 -0400)]
Merge: Some bugfixes and small improvements for nitiwiki

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

8 years agotests: update sav for nitiwiki
Jean Privat [Thu, 9 Jul 2015 18:42:32 +0000 (14:42 -0400)]
tests: update sav for nitiwiki

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Bytes migration
Jean Privat [Thu, 9 Jul 2015 18:12:46 +0000 (14:12 -0400)]
Merge: Bytes migration

As a penultimate step to finish #1262, here are some byte-oriented operations on both `NativeString` and `Text`

Next to come in the infamous Unicode series, a reroll of #1277.

Pull-Request: #1551
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: remove `-s` as short `--status` because it is already short `--rsync`
Jean Privat [Thu, 9 Jul 2015 17:51:53 +0000 (13:51 -0400)]
nitiwiki: remove `-s` as short `--status` because it is already short `--rsync`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: custom config messages are less verbose
Jean Privat [Thu, 9 Jul 2015 17:19:09 +0000 (13:19 -0400)]
nitiwiki: custom config messages are less verbose

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: error on --rsync if wiki.rsync_dir is not configured
Jean Privat [Thu, 9 Jul 2015 17:16:21 +0000 (13:16 -0400)]
nitiwiki: error on --rsync if wiki.rsync_dir is not configured

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: protect arguments of sys.system
Jean Privat [Thu, 9 Jul 2015 17:15:42 +0000 (13:15 -0400)]
nitiwiki: protect arguments of sys.system

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: improve rendering messages with name and paths.
Jean Privat [Thu, 9 Jul 2015 15:57:09 +0000 (11:57 -0400)]
nitiwiki: improve rendering messages with name and paths.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: remove completely root_url as everything is now relative
Jean Privat [Thu, 9 Jul 2015 15:44:41 +0000 (11:44 -0400)]
nitiwiki: remove completely root_url as everything is now relative

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: reintroduce `allow absolute wikilinks` (c2802e0b4) broken by 98a42459
Jean Privat [Thu, 9 Jul 2015 15:40:57 +0000 (11:40 -0400)]
nitiwiki: reintroduce `allow absolute wikilinks` (c2802e0b4) broken by 98a42459

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitiwiki: reintroduce `make wikilink relative` (d03b2d99f) broken by 98a42459
Jean Privat [Thu, 9 Jul 2015 15:40:15 +0000 (11:40 -0400)]
nitiwiki: reintroduce `make wikilink relative` (d03b2d99f) broken by 98a42459

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: Update for new NativeString and Byte views
Lucas Bajolet [Wed, 8 Jul 2015 20:46:32 +0000 (16:46 -0400)]
tests: Update for new NativeString and Byte views

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agosrc: Compiler and interpreter updates for NativeString
Lucas Bajolet [Wed, 8 Jul 2015 20:46:06 +0000 (16:46 -0400)]
src: Compiler and interpreter updates for NativeString

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agobase64/websocket: Rewrite for clarity and compliance to Byte-oriented NativeString
Lucas Bajolet [Wed, 8 Jul 2015 20:45:43 +0000 (16:45 -0400)]
base64/websocket: Rewrite for clarity and compliance to Byte-oriented NativeString

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/standard: NativeString operations are now Byte-oriented instead of Char
Lucas Bajolet [Wed, 8 Jul 2015 20:45:15 +0000 (16:45 -0400)]
lib/standard: NativeString operations are now Byte-oriented instead of Char

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>