       when 'symbol'
         name = node[1]
         {vars} = node.scopeNode
-        if (v = vars["set_#{name}"])?.type is 'F'
+        if (v = vars["set_#{name}"])?.category is VERB
           [GET, v.scopeDepth, v.slot, MON]
         else
           v = vars[name]

          # Form vectors from sequences of data
          i = 0
          while i < a.length - 1
            if h[i].type is h[i + 1].type is 'X'
              j = i + 2
              while j < a.length and h[j].type is 'X' then j++
              a[i...j] = [['vector'].concat a[i...j]]
              h[i...j] = type: 'X'
            else
              i++
          # Apply conjunctions
          i = a.length - 2
          while --i >= 0
            if h[i + 1].isConjunction and (h[i].type is 'F' or h[i + 2].type is 'F')
              a[i...i+3] = [['conjunction'].concat a[i...i+3]]
              h[i...i+3] = type: 'F'
              i--
          # Apply postfix adverbs
          i = 0
          while i < a.length - 1
            if h[i].type is 'F' and h[i + 1].isAdverb
              a[i...i+2] = [['adverb'].concat a[i...i+2]]
              h[i...i+2] = type: 'F'
            else
              i++
          # Hooks
          if h.length is 2 and h[0].type is h[1].type is 'F'
            a = [['hook'].concat a]
            h = [type: 'F']
          # Forks
          if h.length >= 3 and h.length % 2 is 1 and all(for x in h then x.type is 'F')
            a = [['fork'].concat a]
            h = [type: 'F']
          if h[h.length - 1].type is 'F'
            if h.length > 1 then err a[h.length - 1], 'Trailing function in expression'
          else
            # Apply monadic and dyadic functions
            while h.length > 1
              if h.length is 2 or h[h.length - 3].type is 'F'
                a[-2..] = [['monadic'].concat a[-2..]]
                h[-2..] = type: 'X'
              else
                a[-3..] = [['dyadic'].concat a[-3..]]
                h[-3..] = type: 'X'
          # Replace `"expr"` node with `a[0]` in the AST
          node[..] = a[0]
          extend node, a[0]

        else
          assert 0

    visitLHS = (node, rhsType) ->
      node.scopeNode = scopeNode
      switch node[0]
        when 'symbol'
          name = node[1]
          if name is '∇' then err node, 'Assignment to ∇ is not allowed.'
          if vars[name]
            if vars[name].category isnt rhsType
              err node, "Inconsistent usage of symbol '#{name}', it is assigned both nouns and verbs."
          else
            vars[name] = scopeDepth: scopeNode.scopeDepth, slot: scopeNode.nSlots++, category: rhsType
        when 'expr'
          rhsType is NOUN or err node, 'Strand assignment can be used only for nouns.'
          for i in [1...node.length] by 1 then visitLHS node[i], rhsType
        when 'index'
          rhsType is NOUN or err node, 'Index assignment can be used only for nouns.'
          visitLHS node[1], rhsType
          for i in [2...node.length] by 1 when c = node[i] then visit c
        else
          err node, "Invalid LHS node type: #{JSON.stringify node[0]}"
      rhsType

    for i in [1...scopeNode.length] by 1 then visit scopeNode[i]

