- SCM result = scm_eval (scm_listify (ly_symbol ("scm->string"), ly_quote_scm (scm), SCM_UNDEFINED));
- *outstream_l_->os << ly_scm2string (result) << endl;
+ /*
+ default to stdin
+ */
+ int fd = 1;
+ if (ofstream* of = dynamic_cast<ofstream*> (ps->os))
+ fd = of->rdbuf ()->fd ();
+ SCM port = scm_fdes_to_port (fd, "a", SCM_EOL);
+
+ /*
+ lilypond -f scm x.ly
+ guile -s x.scm
+ */
+ scm_display (gh_str02scm (
+ ";;; Usage: guile -s x.scm > x.tex\n"
+ "(primitive-load-path 'lily.scm)\n"
+ "(scm-as-output)\n"
+ ";(scm-tex-output)\n"
+ ";(scm-ps-output)\n"
+ "(map (lambda (x) (display (eval x))) '(\n"
+ ), port);
+
+ SCM newline = gh_str02scm ("\n");
+ for (SCM s = gh_cdr (molecules_); gh_pair_p (s); s = gh_cdr (s))
+ {
+ scm_write (gh_car (s), port);
+ scm_display (newline, port);
+ scm_flush (port);
+ }
+ scm_display (gh_str02scm ("))"), port);
+ scm_display (newline, port);
+ scm_flush (port);
+ scm_close_port (port);