Arc Forumnew | comments | leaders | submitlogin
3 points by Jesin 6082 days ago | link | parent

Here's the definition of each from arc.arc:

  (mac each (var expr . body)
    (w/uniq (gseq g)
      `(let ,gseq ,expr
         (if (alist ,gseq)
              ((afn (,g)
                 (when (acons ,g)
                   (let ,var (car ,g) ,@body)
                   (self (cdr ,g))))
               ,gseq)
             (isa ,gseq 'table)
              (maptable (fn (,g ,var) ,@body)
                        ,gseq)
              (for ,g 0 (- (len ,gseq) 1)
                (let ,var (,gseq ,g) ,@body))))))
This should have been:

  (mac each (var expr . body)
    (w/uniq (gseq g gf)
      `(let ,gseq ,expr
         (if (alist ,gseq)
              ((rfn ,gf (,g)
                 (when (acons ,g)
                   (let ,var (car ,g) ,@body)
                   (,gf (cdr ,g))))
               ,gseq)
             (isa ,gseq 'table)
              (maptable (fn (,g ,var) ,@body)
                        ,gseq)
              (for ,g 0 (- (len ,gseq) 1)
                (let ,var (,gseq ,g) ,@body))))))