Arc Forumnew | comments | leaders | submitlogin
1 point by rntz 5424 days ago | link | parent

It doesn't handle use of complex expressions in functional position very well - no matter how long they are, it prints them on one line. An example is the source code for 'each:

    arc> src.each
    (from "arc.arc")
    (mac each (var expr . body)
      (w/uniq (gseq gf gv)
        `(let ,gseq ,expr
           (if (alist ,gseq)
                 ((rfn ,gf (,gv) (when (acons ,gv) (let ,var (car ,gv) ,@body) (,gf (cdr ,gv)))) ,gseq)
               (isa ,gseq 'table)
                 (maptable (fn ,var ,@body) ,gseq)
               (for ,gv 0 (- (len ,gseq) 1)
                 (let ,var (,gseq ,gv) ,@body))))))t
Notice the long line that sticks out.


1 point by shader 5424 days ago | link

Hmmm. I guess I'll need to add code to support indentation of lists in function position. It should only be one or two lines.

What does pg's ppr do for src.each?

-----

1 point by shader 5424 days ago | link

Ok, apparently pg's version also does the really long line there.

I'll add a special case in ppr for 'cons in function position. How should it be indented? I'll start with two spaces, but I'm open for suggestions.

-----

1 point by shader 5424 days ago | link

Nevermind. I'm indenting it just like 'each is indented in arc.arc.

The new version should now be on github and anarki's master branch.

I'll try and move it over to arc3.master soon.

-----