So I was reading Adam latest blog post about the lucee 5 property modifiers and I had a thought. Up until now I have used the this scope for public variables and the variables scope for private variables like this:
component {
variables.var1 = "accessible only inside this component";
this.var2 = "accessible from outside this component";
}
In my mind i equate this to:
//sudo code equiv
component {
private var1 = "accessible only inside this component";
public var2 = "accessible from outside this component";
}
With these new modifiers I would expect to rewrite my code like this:
// new way
component {
private this.var1 = "accessible only inside this component";
public this.var2 = "accessible from outside this component";
}
Question #1: Do the access modifiers also work for variables scoped variables? i.e.
private variables.var1 = "accessible only inside this component";
Question #2: Regardless of the answer to Q1, Is specifying the this scope not redundant now?
In my head I now read the new way as being this
public this.var2 == public public var2
I guess what Im really wondering wondering is if eventually we can write our code like this. Where we can drop specifying the this scope altogether in the variable declaration in the component body and only need to specify it within a function that accesses it.
component {
private var1 = "accessible only inside this component";
public var2 = "accessible from outside this component";
public function doSomething(){
if( this.var1 == this.var2){
//do something else
}
}
}
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/01343201-dfcc-4e9d-bbc6-904ae478cc0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.