       subModel = get(model, ast.arguments[0])
       if subModel
         collection.update([subModel])
+      else
+        collection.update([])
+    update()
+    model.bind? "change:#{ast.arguments[0]}", update
+    new Dynamic(ast, collection, model, controller)
+
+  @if: (ast, model, controller) ->
+    collection = new Serenade.Collection([])
+    update = ->
+      value = get(model, ast.arguments[0])
+      if value
+        collection.update([model])
       else
         collection.update([])
     update()

        switch ast.command
          when "view" then new Node.view(ast, model, controller)
          when "collection" then new Dynamic.collection(ast, model, controller)
          when "if" then new If(ast, model, controller)
          when "in" then new Dynamic.in(ast, model, controller)
          else new Node.helper(ast, model, controller)
      else throw SyntaxError "unknown type '#{ast.type}'"


  get: -> format(@model, @ast.value, @ast.bound)

Nodes =
  compile: (ast, model, controller) ->
    switch ast.type
