Yes I know that that works, but strictly speaking salary is not private when
it is in the variables scope, due to the bug.


-----Original Message-----
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 5:32 PM
To: CF-Talk
Subject: RE: CFC theory


That is not true as I have already responded with the use of the
variables scope. The following does work.

        <cfset variables.salary = arguments.salary>

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]

> -----Original Message-----
> From: Pete Freitag [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 02, 2002 2:35 PM
> To: CF-Talk
> Subject: RE: CFC theory
>
> >> On Monday, September 2, 2002, at 01:54 , Hal Helms wrote:
> >> I can't agree that this is the same as in Java. In Java, I can
define
> an
> >> instance variable as private and then set it to an identically
named
> >> argument passed into a method.
>
> > Only if you explicitly qualify the instance variable with 'this.' so
it
> > doesn't clash with the argument name (remember that in Java,
arguments
> are
> > the unnamed scope - so you have exactly the same type of namespace
> clash!)
>
> I think what Hal is getting at is that in Java you can do this:
>
> private int x;
> void foo(int x) {
>       this.x = x;
> }
>
> in C++ you can do this:
>
> void foo(int x) {
>       this->x = x;
> }
>
> but there is no way to do that with CFC's.
>
> I think the this scope was a poor name choice, I would expect the this
> keyword to point to, or reference my object as it does in C++ or Java.
I'm
> not saying that CFC's should be exactly like Java or C++ classes, but
it
> would have led to less confusion if "this" was named "public" or
something
> else.
>
> _____________________________________________
> Pete Freitag
> CTO, CFDEV.COM
> ColdFusion Developer Resources
> http://www.cfdev.com/
>
>
>

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to