> you sort of end up with a meta-programming language when you do that, which ends up being less ergonomic than your initial code
I would say that what you end up with is a program.
> Then you have questions like how do you do control flow within that list
You don't. Each objective has an "isDone" method. That method returns true if done, false if not. If unable to complete its objective for some reason, throw an exception. Seems like pretty canonical object orientation to me.
> Can you branch or loop over multiple objectives?
No, but you could easily have an objective that groups together multiple smaller discrete objectives.
> If you add support for that you end up even closer to a meta programming language, with worse syntax than if things were directly in the base language.
Again, I just think you end up with a program, using the syntax of the language in which you're writing.
Like if you write a story, you end up with a story, written using the language in which you wrote it.
I would say that what you end up with is a program.
> Then you have questions like how do you do control flow within that list
You don't. Each objective has an "isDone" method. That method returns true if done, false if not. If unable to complete its objective for some reason, throw an exception. Seems like pretty canonical object orientation to me.
> Can you branch or loop over multiple objectives?
No, but you could easily have an objective that groups together multiple smaller discrete objectives.
> If you add support for that you end up even closer to a meta programming language, with worse syntax than if things were directly in the base language.
Again, I just think you end up with a program, using the syntax of the language in which you're writing.
Like if you write a story, you end up with a story, written using the language in which you wrote it.