Talk:Unified HQ9+

From Esolang
Jump to navigation Jump to search

The ++ of HQ9++

It took me a while to get my head around HQ9++'s ++ command, so here's a clearer explanation: it creates a new class (with no superclasses; the spec doesn't define what fields, methods, etc. it has but there's no reason to give it any), then creates a new object of that class. (No further mention is made of the object or class in question, so I guess they're either deallocated or leaked.)

If you're using an object-oriented language that doesn't allow you to create classes at runtime, you'd presumably have to write a compiler for HQ9++ rather than an interpreter, so that you can create the classes at compile time (you'd have one class for each ++ command, and the commands would then just create the objects at runtime). Ais523 non-admin (talk)