Blackstone And The End Of Hard Coded Return Structures

Home » Blackstone And The End Of Hard Coded Return Structures

One of my pet peeves with some CFML tags is that they hardcode return value structure names. For example, creates a structure named CFFILE that contains the results of the file operation. And many others tags work this way too. What bugs me about this is that if you need to use a tag multiple times (maybe to process multiple file uploads, or to move or delete multiple files) then that structure is overwritten with each subsequent tag invocation, and it is up to you to extract and save any values if needed.
The good news is that Blackstone should fix this (I say “should” because Blackstone is still in beta and stuff could still change). The plan is that tags like will allow you to specify the name of the structure to be created (and will, of course, default to the current hardcoded name), which means that you could name each instance with a unique name, and problem solved.
Just another example of one of the many infrequently discussed goodies in the works.

5 responses to “Blackstone And The End Of Hard Coded Return Structures”

  1. Darryl Lyons Avatar
    Darryl Lyons

    Finally… This would be a great feature, especially when you’ve got more than one CFFILE within a template.

  2. nobody nowhere Avatar
    nobody nowhere

    My pet peeve is that the callee has access to the caller-side scope period (which doesn’t change even if this is implemented). The purpose of separating code is to, well ummmm, separate it.

  3. Sam Curren Avatar
    Sam Curren

    Hmmm… Sounds like other tags will have the same functionality, like CFQUERY (Executiontime), and CFHTTP? I like that.

  4. Ben Forta Avatar
    Ben Forta

    Sam, that’s the plan, although I don’t have a final list yet.

  5. Bert Dawson Avatar
    Bert Dawson

    In a similar vein, it would be nice to be able to pass attributesCollection to cf tags in the same way we can pass it to custom tags. This is a pain when trying to make wrappers for some tags, notable cfmail.

Leave a Reply