 		applyConstraint: (name, expression) ->
 			@constraints ?= {}
 			@constraints[name] = (new Function([], 'return ' + expression)).bind(@)
-#				console.log 'adding constraint', name, constraint[1], this
+#			console.log 'adding constraint', name, expression, @
 #				console.log 'eval', @constraints[name]()
 
 			scopes = propertyBindings.find(expression)

			bindings = constraintBinding.bindings or= {}

			for scope in scopes
				{binding, property} = scope
				bindingfn = (new Function([], 'return ' + binding)).bind(@)
				bindings[property] = bindingfn
#					console.log('bound', name, expression, property, binding)

#				console.log 'matched constraint', name, @, expression


		bindConstraints: () ->
			# register constraints last
			for name, value of @constraints
#				console.log 'binding constraint', name, value, this
				@setAttribute(name, value())
				for bindexpression, binding of @constraints[name].bindings
					property = binding.property
					boundref = binding.compiled()
					boundref = boundref.$view if boundref.$view
#					console.log 'binding to', property, 'on', boundref
					boundref.bind(property, @constraintCallback(name, value))

		# generate a callback for a constraint expression, e.g. x="${this.parent.baz.x + 10}"
		constraintCallback: (name, value) ->
