News for hackers. Stuff that matters.
Re:OOP in C by AlbertoGP on Sunday January 08, 2023 @11:20AM (#34300357)
I’ve built it for now in a separate branch called “self”:

    git clone -b self https://github.com/Sentido-Labs/cedro.git
    cd cedro
    make bin/cedro # Just “make” will build cedrocc etc.
    bin/cedro - <<'    EOF' # Mind the indentation.
    #pragma Cedro 1.0 self
    list->init();
    list.init();
    list->append(123);
    list.append(123);
    EOF
The “self” flag after “#pragma Cedro 1.0” activates the “self” macro, because it should not be done by default.

Result:

    list->init(list);
    list.init(&list);
    list->append(list, 123);
    list.append(&list, 123);
I’ll try it out for a few days and if it works well in practice I’ll document it and merge it into master.

There are no comments on this comment yet.