objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
157 stars 11 forks source link

[question] Is array an object on Objeck? #279

Closed ghost closed 1 year ago

ghost commented 1 year ago

Or is it a primitive type? Could you add the ->ToString() method and ->Print() and ->PrintLine() methods to array so we could print an array simply with arr->PrintLine()?

Update: On Java it needs to use Arrays.toString() method to correctly print the array to the screen, doing arr.toString() or System.out.println(arr) will print gibberish. I don't know how should we handle this on Objeck.

objeck commented 1 year ago

Kind of. There is a hidden array class that provides rudimentary array support. It could be extended to provide Print() and PrintLine() functionality.

objeck commented 1 year ago

This feature has been added and tested.