-
- Downloads
There was an error fetching the commit references. Please try again later.
Clean up Object, Conditional, and Boolean
This makes it easier to implement Conditional and Equal, and makes Object a little bit less of a mess. These changes uncovered two bugs: 1. The compiler did not support looking up default methods on a trait when they were defined on Object. 2. Map.iter was not implemented correctly. If the last bucket in a Map was Nil, Map.iter would produce a Nil value. This has been fixed by the Iterator not producing values at all in this case. Originally I started working on these changes in hopes of getting rid of Object entirely. This will not be possible, as it makes Inko a bit annoying to work with. For example, Conditional and Equal would have to be implemented manually for every object, leading to a lot of boilerplate. Instead, we'll keep Object for the time being.
Showing
- compiler/lib/inkoc/type_system/object.rb 7 additions, 0 deletionscompiler/lib/inkoc/type_system/object.rb
- runtime/src/core/prelude.inko 4 additions, 5 deletionsruntime/src/core/prelude.inko
- runtime/src/std/boolean.inko 1 addition, 40 deletionsruntime/src/std/boolean.inko
- runtime/src/std/compiler/ast/node.inko 2 additions, 1 deletionruntime/src/std/compiler/ast/node.inko
- runtime/src/std/conditional.inko 28 additions, 24 deletionsruntime/src/std/conditional.inko
- runtime/src/std/map.inko 12 additions, 7 deletionsruntime/src/std/map.inko
- runtime/src/std/object.inko 15 additions, 49 deletionsruntime/src/std/object.inko
- runtime/src/std/operators.inko 20 additions, 6 deletionsruntime/src/std/operators.inko
- runtime/tests/test/std/compiler/test_parser.inko 30 additions, 30 deletionsruntime/tests/test/std/compiler/test_parser.inko
- runtime/tests/test/std/test_map.inko 23 additions, 0 deletionsruntime/tests/test/std/test_map.inko
- runtime/tests/test/std/test_object.inko 8 additions, 0 deletionsruntime/tests/test/std/test_object.inko
Please register or sign in to comment