-
- Downloads
There was an error fetching the commit references. Please try again later.
Remove support for Array literals
Similar to the removal of Map literal support, this is aimed at simplifying the syntax and making it more consistent. Arrays are now created using `Array.new`, which takes every value as a separate argument: Array.new(10, 20, 30, ...) To make this more pleasant to work with, the methods `StringBuffer.new` and `ByteArray.new` now take a rest argument. This means you don't have to write `ByteArray.new(Array.new(...))`, and instead can write `ByteArray.new(...)`. For the `StringBuffer` type this requires that we manually create an instance of it. To remove the need for using VM instructions directly, we introduce `Object.allocate` as a wrapper around this. This allows one to manually create instances like so: static def some_method { let instance = allocate instance.init(...) instance }
Showing
- compiler/lib/inkoc/parser.rb 0 additions, 24 deletionscompiler/lib/inkoc/parser.rb
- compiler/lib/inkoc/pass/define_type.rb 1 addition, 1 deletioncompiler/lib/inkoc/pass/define_type.rb
- compiler/spec/inkoc/pass/define_type_spec.rb 4 additions, 4 deletionscompiler/spec/inkoc/pass/define_type_spec.rb
- runtime/src/core/bootstrap.inko 6 additions, 1 deletionruntime/src/core/bootstrap.inko
- runtime/src/std/ansi.inko 1 addition, 1 deletionruntime/src/std/ansi.inko
- runtime/src/std/array.inko 36 additions, 46 deletionsruntime/src/std/array.inko
- runtime/src/std/array_iter.inko 1 addition, 1 deletionruntime/src/std/array_iter.inko
- runtime/src/std/byte_array.inko 25 additions, 25 deletionsruntime/src/std/byte_array.inko
- runtime/src/std/compiler/keywords.inko 4 additions, 4 deletionsruntime/src/std/compiler/keywords.inko
- runtime/src/std/debug.inko 3 additions, 3 deletionsruntime/src/std/debug.inko
- runtime/src/std/env.inko 1 addition, 1 deletionruntime/src/std/env.inko
- runtime/src/std/ffi.inko 12 additions, 12 deletionsruntime/src/std/ffi.inko
- runtime/src/std/inspect.inko 11 additions, 5 deletionsruntime/src/std/inspect.inko
- runtime/src/std/integer/extensions.inko 4 additions, 4 deletionsruntime/src/std/integer/extensions.inko
- runtime/src/std/iterator.inko 12 additions, 12 deletionsruntime/src/std/iterator.inko
- runtime/src/std/length.inko 2 additions, 2 deletionsruntime/src/std/length.inko
- runtime/src/std/map.inko 3 additions, 3 deletionsruntime/src/std/map.inko
- runtime/src/std/mirror.inko 7 additions, 7 deletionsruntime/src/std/mirror.inko
- runtime/src/std/net/ip.inko 10 additions, 10 deletionsruntime/src/std/net/ip.inko
- runtime/src/std/range.inko 2 additions, 2 deletionsruntime/src/std/range.inko
Please register or sign in to comment