/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 2005--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
#include "simple-closure.hh"
+#include "unpure-pure-container.hh"
#include "grob.hh"
if (is_simple_closure (expr))
{
SCM inside = simple_closure_expression (expr);
+ SCM proc = is_unpure_pure_container (scm_car (inside))
+ ? (pure ? scm_car (inside) : unpure_pure_container_unpure_part (scm_car (inside)))
+ : scm_car (inside);
SCM args = scm_cons (delayed_argument,
evaluate_args (delayed_argument, scm_cdr (inside),
pure, start, end));
if (scm_cdr (args) == SCM_UNSPECIFIED)
return SCM_UNSPECIFIED;
if (pure)
- return call_pure_function (scm_car (inside), args, start, end);
- return scm_apply_0 (scm_car (inside), args);
+ return call_pure_function (proc, args, start, end);
+ return scm_apply_0 (proc, args);
}
else if (!scm_is_pair (expr))
return expr;
else if (scm_car (expr) == ly_symbol2scm ("quote"))
return scm_cadr (expr);
- else if (ly_is_procedure (scm_car (expr)))
+ else if (is_unpure_pure_container (scm_car (expr))
+ || ly_is_procedure (scm_car (expr)))
{
+ SCM proc = is_unpure_pure_container (scm_car (expr))
+ ? (pure ? scm_car (expr) : unpure_pure_container_unpure_part (scm_car (expr)))
+ : scm_car (expr);
SCM args = evaluate_args (delayed_argument, scm_cdr (expr), pure, start, end);
if (args == SCM_UNSPECIFIED)
return SCM_UNSPECIFIED;
if (pure)
- return call_pure_function (scm_car (expr), args, start, end);
- return scm_apply_0 (scm_car (expr), args);
+ return call_pure_function (proc, args, start, end);
+ return scm_apply_0 (proc, args);
}
else
// ugh. deviation from standard. Should print error?