CF is basically untyped. When using variables or constants CF uses 'lazy
evaluation' where the type of a particular var or const is evaluated at
runtime, for example you can stick an integer value into a variable and then
stick that variable into a dateformatting function and you will only get an
error at runtime if the function can't cast the variable into the expected
type.
There are 2 basic type that exist - simple values and complex values.
Complex values are structures, arrays, com objects, query recordsets. Simple
values are string, int, float, datetimes, lists. All the simple datatypes
are represented internally as simple text strings which means that you can
use any of the string functions on say for example, a date object.
Similarly, you can treat a sentence as a space delimited list.
To demonstrate the late or lazy typing of CF try out the following code:
<cfset somevalue="1">
<cfwddx action="cfml2wddx" input="#somevalue#" output="outputPacket1">
<cfwddx action="cfml2wddx" input="#Val(somevalue)#" output="outputPacket2">
<cfoutput>
#HTMLEditFormat(outputPacket1)#
<hr>
#HTMLEditFormat(outputPacket2)#
</cfoutput>
Notice the difference in the type of data indicated by the wddx packet.
n.b. this is important when using WDDX to pass packets to other application
environments where there is typing.
Steve
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 07, 2000 15:34
> To: CF-Talk
> Subject: RE: Is Cold Fusion a Typed Language?
>
>
> There was a brief reference to constants in that article, but nothing
> describing how constants are created. Anyone have further information on
> that topic?
>
> -----Original Message-----
> From: Jon Hall [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 07, 2000 9:48 AM
> To: CF-Talk
> Subject: Re: Is Cold Fusion a Typed Language?
>
>
> Here is an article that Allaire recently posted on their website
> that should
> answer all your questions.
>
> http://www.allaire.com/handlers/index.cfm?ID=14718&Method=Full&Tit
le=ColdFus
ion%20Expressions%3A%20Operands%2C%20Operators%2C%20and%20Other%20Constructs
&Cache=False
I guess ColdFusion would be called an optionally typed language. You can
type variables if it becomes necessary.
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]