     @_assignTos.push compiled
 
   assignTo: ->
-    @_assignTos[@_assignTos.length - 1]
+    rhs = @_assignTos[@_assignTos.length - 1]
+    cacheName = @_translationCache()?[0]
+    if rhs then cacheName or rhs
 
   resetAssignTo: ->
     @_assignTos.pop()


patternCompile = (ctx, pattern, matched, translatedMatched) ->

  ctx.setAssignTo translatedMatched
  # caching can occur while compiling the pattern
  # precs are {cond}s and {cache}s, sorted in order they need to be executed
  {precs, assigns} = expressionCompile ctx, pattern


instancePrefix = (instanceName, methodName) ->
  "#{instanceName}_#{methodName}"

findSuperClassInstances = (ctx, instanceType, classDefinition) ->
  toConstraint = (superName) ->
    new ClassContraint superName, instanceType
  superConstraints = map toConstraint, classDefinition.supers
  instanceDictFor ctx, constraint for constraint in superConstraints


  # TODO:
  # For now support the simplest function macros, just compiling down to source
