the idea is to combine the two scopes, variables and this, into one.
so with the absence of the variables scope, we still want to allow to keep
variables as private.
That might be the idea, but that’s not what you’ve done. You’ve done this:
private this.lastName=“Sorglos”; // cannot be accessed from outside
public this.comment=“This is a comment”; // can be accessed from outside
And that’s daft.
I’m all for getting rid of the scopes, but if that’s what you want to do
then do that. Don’t do something else, especially something else that is
half-arsed,overlaps existing behaviour whilst at the same time
Also… stuff like this does not belong in CFML at all. CFML has scopes.
Just deal with that.
If you want to do away with scopes, do it in .lucee. That’d be cool, and
makes sense there.
If you wanted to implement the public / private thing in CFML, then there
should be a syntax rule that one can do this:
public myPublicVar = “something”;
OR one can do this:
this.myPublicVar = “something”;
(and those would be equivalent).
This is analogous to already-implemented handling of using var or using
the local scope. So it makes sense to perpetuate that paradigm.
But THIS would yield a syntax error:
public this.myPublicVar = “something”;
No good comes from this:
public variables.myVar = “something”;
Because it will still need to coexist with
variables.myVar = “something”;
And then subsequent unqualified / uncontextualised usage of variables.myVar later
in the code.
And that just makes things a confusing mess.On Tuesday, 2 February 2016 21:48:08 UTC, Igal wrote: