Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Labels:
      None

      Description

      The following explodes because of the presence of recur:

      (defn rec [expr]
        (match expr
               [:global] 'GLOBAL
               [:constant x] x
               [:variable x] x
               [:lazy-variable x] `(deref ~x)
               [:if test if-true if-false] `(if ~(rec test)
                                              ~(rec if-true)
                                              ~(rec if-false))
               [:delist list index] `(get ~(rec list) ~(rec index))
               [:depair pair key] `(get ~(rec pair) ~(match key :first 0 :second 1))
               [:list elements] (map rec elements)
               [:fold-recur index-arg list-sym] `(recur (+ 1 ~index-arg) (rest ~list-sym))
               [:zip left right] `(map vector ~(rec left) ~(rec right))
               [:filter list arg body] `(filter (fn [~arg] ~(rec body) ~(rec list)))
               [:len list] `(count ~(rec list))
               [:pair first second] [(rec first) (rec second)]
               [:block arg body] `(fn [~arg] ~(rec body))
               [:app f arg] `(~(rec f) ~(rec arg))
               [:query e annotations] `(QUERY ~(rec e) ~annotations)
               [:lookup key] `(LOOKUP ~key)
               [:let name value expr] `(let [~name ~value] expr)
               ; ... about 15 more
               ))
      

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              dnolen David Nolen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: