> > I don't know whether it's marked for deprecation - for that
> > to happen, it would have to be part of the documented, desired
> > behavior of the language in the first place. To the best of my
> > knowledge, it isn't - it's a "trick" of the language which just
> > happens to work. On the other hand, there's a function called
> > SetVariable, the behavior of which is documented and clear.
>
> Actually, this method is documented in the 4.5 docs...
> /CFDOCS/CFML_Language_Reference/2_ColdFusion_Tags/lr2_088.htm
>
> Dynamic variable names
> In this example, the variable name is itself a variable.
>
> <CFSET myvariable="current_value">
> <CFSET "#myvariable#"=5>
>
> Or in the CF5 docs with the same text...
> /cfdocs/CFML_Reference/Tags94.html#1103445
Well, I guess it IS listed in the docs. In fact, just for fun, I looked on
the net for CF 3 docs, and found the exact same text there. I couldn't find
any CF 2 docs for comparison.
However, this brings me to a larger documentation question/problem. My
problem with Allaire documentation is that it appears to me to be written
with very little coordination between the people writing the language itself
and those writing the documentation. I can certainly understand this, since
CF is a pretty simple language, but as documentation, it's woefully
incomplete. For example, right in the CFSET page you mention, the syntax for
CFSET is listed as:
<CFSET variable_name=expression>
Yet, at the bottom of the page, there's an example which defies this syntax:
<CFSET MAILER.AddRecipients("form.fromname", "form.fromemail")>
Now, we all know this works - we know that we can use CFSET to simply call a
function (or in this case, a method). But this certainly isn't explained
anywhere. There are plenty of examples through the documentation, I'm sure.
My favorite is the example of CFLOCK in the 4.0.1 docs:
"To synchronize access to the application, use the member variable
application.applicationName to retrieve it. To synchronize access to the
session, use the member variable session.sessionID."
Well, according to the CF server development team, reading those variables
would need a lock! "What we got here is a failure to communicate."
When I think of documentation - especially with documentation of syntax - I
think of completeness. Documentation of a programming language should list
all of the possible forms and structures of syntax. The CF documentation
doesn't come close to this. Personally, this doesn't bother me too much, but
I think it's a problem.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists