On Jul 9, 2004, at 3:12 PM, Claude Schneegans wrote:

> >>1) all typed variables could be referenced w or w/o the "typed" scope
>  >>2) in a block of strongly-typed code the "typed" scope would implied
>  >>(roughly analogous to Java's import statement)
>  >>3) Then The CF parser/compiler would have a set of
> readily-identifiable
>  >>strongly-typed variables, that it could resolve efficiently.
>
>  How about just use declarations like in C:
>  int myInteger;
>  char myString = "abcdef";

You certainly would have to declare them like this somewhere --  I was
just responding to Jim's statement that according to the CF team,
optional strong-typing would be difficult to implement -- easier to
enforce strong-typing system-wide.

If that were the case, then CF would be more difficult to learn for
inexperienced programmers.

>  Then in all the rest of the template,
>  - declared variables are strongly typed and cannot be converted to
> another type unless through an appropriate function.
>  - undeclared variables will behave exactly as presently.
>  Plus an option in Application.cfm that could enforce stroug typing.
> In this mode, any use of an

That is good for Application-wide enforcement, but I would also like to
see it on a more-granular level:

CFC
template
code block

> undeclared variable would be considered as illegal and trigger an
> error.
>
>  This is about the way Clipper has implemented local and compiled
> variables as an extra feature in version 5, compared to fully dynamic
> variables before.
>
>  This way, one could create 100% strongly typed program, or ignore the
> new feature and work exactly like before.

But, almost any of the above would be an improvement for those who want
to use it.

All of these are suggestions -- MACR or NA would need to decide whether
to extend the language, and how to implement it without sacrificing
backward compatibility.  NA may have an advantage here.

Dick

>  --
>  _______________________________________
>  REUSE CODE! Use custom tags;
>  See http://www.contentbox.com/claude/customtags/tagstore.cfm
>  (Please send any spam to this address: [EMAIL PROTECTED])
>  Thanks.
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to