It's more than that.  Take a custom tag with a CFFLUSH tag inside:

<cf_myTag>
text 1
<cfflush />
text 2
</cf_myTag>

What's the desired behaviour?  The CFFLUSH tag should dump the current
response buffer to the client, of course.  But is "text 1" in the
response buffer?  You can't say with any kind of reliability until the
closing CF_MYTAG tag, because that's where the custom tag can mess
with generated content.  So say CF_MYTAG doesn't do anything with
generated content.  Then you'd want CFFLUSH to include 'text 1' in the
buffer that is flushed.  But say CF_MYTAG hides the generated content
(like CFSAVECONTENT does).  This time you'd definitely NOT want 'text
1' included in the flushed buffer.

Because there's no way for CF to know if a custom tag's generated
content is actually going into the stream until the closing tag, it
can't process CFFLUSH in any sort of reliable way.  It can definitely
process it, but the behaviour would have to be that it doesn't flush
anything that is inside a custom tag that it is also within.  That's
all well and good (and undoubtedly what the getPageContext() hack ends
up doing), but it can lead to very subtle bugs, because it appears
that some stuff will be flushed when it actually won't be.

It's definitely better that it's just an error scenario, to prevent
those bugs from arising.  If you really want to subject yourself to
those risks, then as has been pointed out, it's simple to do with the
PageContext.  You and I might understand the tiny subtleties of
CFFLUSH and custom tag output buffers, but a lot of CFers don't,
especially those without a lot of experience with the language.

Bottom line, Macromedia did exactly the right thing when they designed
the rules.  Even if they do seem kind of silly and arbitrary on the
surface, there is a lot of careful planning and design underneath.

cheers,
barneyb

On Thu, 24 Feb 2005 11:46:32 -0000, Adam Cameron <[EMAIL PROTECTED]> wrote:
> > It's not a bug, I can assure you that.  Whether it's something that you
> > (and others) would like changed is a different question; it's current
> > behaviour is exactly as the language was designed.
> 
> So it's a design bug, rather than an implementation bug then?
> 
> (Sorry - as we know -  it irks me when people say "oh, actually it's OK that
> that's wrong/bad/silly, because we designed it that way").
> 
> --
> Adam

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]

Reply via email to