We only remove that the body acts as a constructor,
Cool.
I think it would be helpful if in general you more accurately define what you mean in situations like this. IE: define exactly what you mean. Not in narrative, nor with statements starting “of course…”, but some sort of formalised (and more important: unambiguous, and free of linguistic vagaries) description.
So something like this (I’m making this up, don’t pay attention to the detail).
The following statements will be fully supported:
The following statements would be supported with restrictions:
- include - provided file files only include function definitions
- variable assignment, provided they reference static values
- etc
The following statements are illegal and will cause a compilation error etc
And also provide detail as to whether it would cause a compilation error, a runtime error, or the code would simply be ignored)
What about tags?
I don’t mean just in the context of this particular issue, but in general. of course you can still do stuff like properties, variable declaration and definition, functions, static constructors … inside the component body. so you end with the possibilities you have for example in Java or php.
Also not drawing ambiguous similes, but emphatic statements. Let’s not worry how Java or PHP might do it. Let’s dwell on what your intent for .lucee
would be.
For one thing, I don’t think Java allows traits/mixins, but PHP does. CFML has no formal treatment, but then can be achieved with an include and some self discipline.
Obviously saying “Ruby does this cool thing like this [example]. We could do a CFML version like this [example]”. Actual concrete.