Two Problems with the Macro Preprocessor

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Two Problems with the Macro Preprocessor

Postby bkjecn » Fri Oct 14, 2011 3:30 pm

Greetings,

I have encountered two problems with the preprocessor.

1) I cannot comment @# for loops. Doing so breaks Dynare because the preprocessor tries to substitute the variables in the commented lines but does not define the variable as a macro variables.
2) I cannot use what looks like macro language syntax in Matlab commands inside a Dynare mod file. Dynare will complain even if the Matlab command is commented. The reason Dynare breaks is the same as in the first problem.

I attached a very simple example demonstrating both problems. I ran into these problems because it would be nice to be able to comment macro preprocessor lines during model development. It would also be nice to be able to 'disp' the values of macro variables so that they are reported in log files.

I cannot figure out how to submit bugs other than through this board. If there would be a better place to submit problems in the future please let me know.

Best,

Ben
Attachments
rbc_baseline.mod
(2.59 KiB) Downloaded 124 times
bkjecn
 
Posts: 35
Joined: Thu Oct 13, 2011 3:02 am

Re: Two Problems with the Macro Preprocessor

Postby SébastienVillemot » Fri Nov 04, 2011 5:12 pm

Hi,

These problems are not bugs. They are inherent to the way the macroprocessor works.

The macroprocessor is a text processor which runs before everything. It does not know about the commenting syntax, which is processed later.

So we do not plan to change the behaviour that your are encountering.

Do you have an example where it causes a problem in a real-life model? The example you posted is rather pathological.

Best,
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests

cron