Hi all,
I ran into a situation recently where I had a macro that was a getting a bit long, so I decided to factor out some of its functionality.
I looked at what it needed to do, and decided to implement it as a function that would be called from the macro.
It took me a while to figure out why I needed to compile the file twice to get it to work - on the first pass, the function was not yet defined, so the macro couldn't do its job. On the second pass, of course, it worked.
Is there a standard way to deal with this sort of pattern? Does the pattern itself raise code smell alarms?
I ran into a situation recently where I had a macro that was a getting a bit long, so I decided to factor out some of its functionality.
I looked at what it needed to do, and decided to implement it as a function that would be called from the macro.
It took me a while to figure out why I needed to compile the file twice to get it to work - on the first pass, the function was not yet defined, so the macro couldn't do its job. On the second pass, of course, it worked.
Is there a standard way to deal with this sort of pattern? Does the pattern itself raise code smell alarms?
~garethw