Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(207)

Unified Diff: lily/grob-property.cc

Issue 4894052: Creates pure closures (Closed)
Patch Set: Version to be pushed to master. Created 12 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lily/function-documentation.cc ('k') | lily/include/unpure-pure-container.hh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lily/grob-property.cc
diff --git a/lily/grob-property.cc b/lily/grob-property.cc
index 2a4368f9ab7ffa5b25c9f5fe01278c0e1f83abfa..de1e01b396b4e63dd2f9099c35b52ea318ae7576 100644
--- a/lily/grob-property.cc
+++ b/lily/grob-property.cc
@@ -18,6 +18,7 @@
#include "program-option.hh"
#include "profile.hh"
#include "simple-closure.hh"
+#include "unpure-pure-container.hh"
#include "warn.hh"
#include "protected-scm.hh"
@@ -123,6 +124,7 @@ Grob::internal_set_value_on_alist (SCM *alist, SCM sym, SCM v)
{
if (!ly_is_procedure (v)
&& !is_simple_closure (v)
+ && !is_unpure_pure_container (v)
&& v != ly_symbol2scm ("calculation-in-progress"))
type_check_assignment (sym, v, ly_symbol2scm ("backend-type?"));
@@ -149,7 +151,7 @@ Grob::internal_get_property_data (SCM sym) const
if (do_internal_type_checking_global && scm_is_pair (handle))
{
SCM val = scm_cdr (handle);
- if (!ly_is_procedure (val) && !is_simple_closure (val))
+ if (!ly_is_procedure (val) && !is_simple_closure (val) && !is_unpure_pure_container (val))
type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"));
check_interfaces_for_property (this, sym);
@@ -177,6 +179,8 @@ Grob::internal_get_property (SCM sym) const
}
#endif
+ if (is_unpure_pure_container (val))
+ val = unpure_pure_container_unpure_part (val);
if (ly_is_procedure (val)
|| is_simple_closure (val))
{
@@ -192,7 +196,7 @@ SCM
Grob::internal_get_pure_property (SCM sym, int start, int end) const
{
SCM val = internal_get_property_data (sym);
- if (ly_is_procedure (val))
+ if (ly_is_procedure (val) || is_unpure_pure_container (val))
return call_pure_function (val, scm_list_1 (self_scm ()), start, end);
if (is_simple_closure (val))
return evaluate_with_simple_closure (self_scm (),
@@ -294,7 +298,8 @@ Grob::internal_get_object (SCM sym) const
{
SCM val = scm_cdr (s);
if (ly_is_procedure (val)
- || is_simple_closure (val))
+ || is_simple_closure (val)
+ || is_unpure_pure_container (val))
{
Grob *me = ((Grob *)this);
val = me->try_callback_on_alist (&me->object_alist_, sym, val);
« no previous file with comments | « lily/function-documentation.cc ('k') | lily/include/unpure-pure-container.hh » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b