Overriding system velocity macros

Hi,

Maybe this has been asked before, but is it OK to write a macro in rx_assembly.vm and give it the same name as one in sys_assembly.vm? At the moment, it seems the new macro overrides the system one, as I had hoped. But is this always going to be the case? Is this a safe thing to do?

Thanks,

Andrew.

Yes, this should be safe.

Thank you.

I’ve just thought of one limitation: Presumably you need to keep the number of parameters the new macro expects same as the original macro, otherwise all existing calls to the macro will be broken.

Andrew.

[QUOTE=Andrew Morrison;3102]Thank you.

I’ve just thought of one limitation: Presumably you need to keep the number of parameters the new macro expects same as the original macro, otherwise all existing calls to the macro will be broken.

Andrew.[/QUOTE]

Yes, that’s true. Also, since Velocity lacks the concept of “scope”, it’s not possible to call the original macro once the “overriding” macro is in place. Any $variables you define will replace existing ones with the same name. This can be rather maddening in certain situations.

I believe that a future version of Velocity will address the scoping issue, but for now, we’re stuck with it.

Dave