 isMap = (node) ->
   isTuple(node) and (elems = inside node; elems.length > 0) and elems[0].label is 'label'
 
+# Compiling arrays, typles and map literals
+
+compileList = (elems) ->
+  # "[#{elems.join ', '}]"
+  "[#{elems.map(compileImpl).join ', '}]"
+
 compileMap = (elems) ->
   [constr, args...] = elems
   items = args.map(compileImpl).join ', '

constructorToJsField = (constr) ->
  constr.token[0...-1]

compileConst = (token) ->
  "({'#{token.token}': true})"

compileList = (elems) ->
  # "[#{elems.join ', '}]"
  "[#{elems.map(compileImpl).join ', '}]"

compileFunctionCall = (op, args) ->
  fn = compileImpl op

      .replace(/^with$/, 'with_')
      .replace(/^in$/, 'in_')

# Scoping

findMissing = (graphs, name) ->
  names = []
  for graph in (graphs or [])
    if name in graph.names
      names.push (setToArray graph.missing)...
      continue
  if names.length > 0
    names
  else
    [name]

lookupIdentifier = (name, node) ->
  while node.parent
    node = node.parent
