>>110285331
opendylan is ok but its syntax is a little bit obnoxious
define class <car> (<object>)
slot serial-number :: <integer> = unique-serial-number();
slot model-name :: <string>,
required-init-keyword: model:;
slot has-sunroof? :: <boolean>,
init-keyword: sunroof?:,
init-value: #f;
end class <car>;
define variable *unique-serial-number* = 0;
define function unique-serial-number() => (usn :: <integer>)
let serial = *unique-serial-number*;
*unique-serial-number* := *unique-serial-number* + 1;
serial;
end function;
define constant $blue-car = make(<canr>, model: "Viper");
define constant $black-car = make(<car>, model: "Town Car", sunroof?: #t);
define constant $red-car = make(<car>, model: "F40", sunroof?: #f);
The class-based OOP is inferior to a good implementation of prototype based oop (although the CLOS inspiration compensate some of its warts respect to mainstream oop language)
Still the comparison is kinda moot, it's not a miminal language with code-as-data-driven foundation. I would put it in a different championship
>>110285589
The analogy doesn't make any sense. Red was build with this goal to begin with https://www.youtube.com/watch?v=-KqNO_sDqm4
posting is not mandatory, anon. There is no karma to gain here