Closed bob-carpenter closed 10 years ago
Suggestion from Ben Goodrich:
Files to fix:
I'm working on it under Stan's feature/issue-382-remove-std-cout-cerr, in case anyone else wants to help out.
New list:
The one in generator.hpp (not generators.hpp) is going to be tricky because it's quoted in generated code. We need to have a way to grab an output stream to pass in.
The program_grammar_def.hpp is a stray commented out line that should just be deleted.
On May 19, 2014, at 5:52 PM, Daniel Lee notifications@github.com wrote:
New list:
• src/stan/command/print.cpp • src/stan/command/print.hpp • src/stan/command/stanc.cpp • src/stan/command/stanc_helper.cpp • src/stan/common/command.hpp • src/stan/common/init_adapt.hpp • src/stan/common/init_windowed_adapt.hpp • src/stan/common/write_iteration.hpp • src/stan/gm/grammars/program_grammar_def.hpp • src/stan/gm/generators.hpp • src/stan/io/stan_csv_reader.hpp — Reply to this email directly or view it on GitHub.
Thanks for the heads up.
If the generator.hpp is too complicated, I'll leave it and add another issue for the remaining one.
On Mon, May 19, 2014 at 2:15 PM, Bob Carpenter notifications@github.comwrote:
The one in generator.hpp (not generators.hpp) is going to be tricky because it's quoted in generated code. We need to have a way to grab an output stream to pass in.
The program_grammar_def.hpp is a stray commented out line that should just be deleted.
- Bob
On May 19, 2014, at 5:52 PM, Daniel Lee notifications@github.com wrote:
New list:
• src/stan/command/print.cpp • src/stan/command/print.hpp • src/stan/command/stanc.cpp • src/stan/command/stanc_helper.cpp • src/stan/common/command.hpp • src/stan/common/init_adapt.hpp • src/stan/common/init_windowed_adapt.hpp • src/stan/common/write_iteration.hpp • src/stan/gm/grammars/program_grammar_def.hpp • src/stan/gm/generators.hpp • src/stan/io/stan_csv_reader.hpp — Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHubhttps://github.com/stan-dev/stan/issues/382#issuecomment-43537859 .
refactoring src/stan/gm/generator.hpp and src/stan/common/command.hpp are beyond the scope of a single pull request, so I'm creating a new issue.
Based on v2.3.0.
I'm working on this again on branch: feature/issue-382-remove-cout-cerr
We can't have std::cout or std::cerr in our API because it doesn't play nicely with uses in clients that control their own streams, like the RStan interface. Interfaces like RStan need to use the R input and output streams instead, or the messages get lost.
The ONLY place we should have the standard I/O streams is in CmdStan.
If we need to pass info about errors or other output, the streams must be plumbed down from the top-level application.