Arc Forumnew | comments | leaders | submit | czoon's commentslogin
1 point by czoon 5911 days ago | link | parent | on: Two things " : " " | | "

1.

  (def paren-adder ((o delimiter '$))
     (rfn parens (expr)
        (if atom.expr expr
            (let (hd . tl) expr
               (if (is hd delimiter)
                  (list parens.tl)
                  (cons parens.hd parens.tl))))))
2.

  (def paren-adder ((o delimiter '$))
     : rfn parens (expr)
        : if atom.expr expr
            : let (hd . tl) expr
               : if (is hd delimiter)
                  (list parens.tl)
                  : cons parens.hd parens.tl )
compare them.

maybe its just me, but i dont like that ")))))))))" MORP or endless sea of right parens.

its not a big problem but "parenthes Less lisp" is better for me.

if i remember correctly, somebody mentioned here that Interlisp has solution with square brackets .

but i think this way is more readable.

probably, you are right about functional code. thanks for your reply.

-----

1 point by eds 5909 days ago | link

I don't think right parentheses are a problem for the following reasons:

* I don't type right parens. If you use Emacs and haven't tried Paredit (http://mumble.net/~campbell/emacs/paredit.el), I would highly suggest it.

* I don't read right parens, at least not in the multiline case. Instead, I read the indentation and the contents of the line, so the parens really don't get in the way at all.

I do think the : operator is an interesting idea for the single line case, when you might have something like

  (foo a (bar b (baz c))) => (foo a : bar b : baz c)
in the middle of a line.

-----

1 point by czoon 5906 days ago | link

and once get used to that , its addictive.

-----

1 point by rincewind 5905 days ago | link

Pythonic:

  (def paren-adder ((o delimiter '$)) :
     rfn parens (expr) :
        if atom.expr expr :
            let (hd . tl) expr :
               if (is hd delimiter)
                  (list parens.tl)
                  (cons parens.hd parens.tl))

-----

1 point by czoon 6146 days ago | link | parent | on: Arc2.tar

is there any solution for this? . . The syntax of the command is incorrect. load items: Error: "directory-list: could not open \"G:\\MzScheme\\arc2\\arc/news/story/\""

-----

1 point by eds 6145 days ago | link

Yes, the Anarki git repo has a fix for this.

http://arclanguage.org/item?id=3647

There is also Anarki Stable which consists of only arc2 and bug fixes.

http://arclanguage.org/item?id=3849

-----

1 point by czoon 6145 days ago | link

thanks i ll try

-----

1 point by czoon 6138 days ago | link

from http://jfkbits.blogspot.com/2008/01/digging-into-arc-in-24-m...

(xdef 'mkdir (lambda (path) (make-directory path))) redefine mkdir. its solves problem.

-----