Arc Forumnew | comments | leaders | submitlogin
1 point by andreyf 4291 days ago | link | parent

> It is backwards compatible with the [ .. _ .. ] form.

I agree that this is important - it's hard to beat the elegance of [ .. _ .. ] when you have one variable.

From the thread you linked, I'm a big fan of:

    [a b -> (- (/ b (* 2 a)))]
While this seems a bit obfuscated:

    [(- (/ _1 (* 2 _0)))]


1 point by shader 4290 days ago | link

The only things I don't like about arrow form are 1) two characters, and 2) it looks like other math symbols.

I like the colon form, but some text editors make it almost invisible. If the font makes it bold enough, it can be easier to recognize than many of the others.

I originally like the pipe form, as it's also pretty obvious. However, since this is a lisp, you can always rewrite it to suite your individual tastes ;) How about writing a "config" file for arc, and various conversion tools, that allow us to all write in our own style, and easily convert between them? Then we wouldn't have to argue over which separator to use.

-----

1 point by andreyf 4290 days ago | link

How about writing a "config" file for arc, and various conversion tools, that allow us to all write in our own style, and easily convert between them?

Good call, but this doesn't address the problem of having to explicitly list parameters, which can be the majority of the code in a small function.

-----

1 point by rincewind 4291 days ago | link

I implemented something like the first one in my m-expression reader, "a -> b;" is translated into "(fn a b)". It could be used with cchooper's customisable reader, so you can still use s-exprs most of the time, like this:

  (map #m[a;b]-> 0 - b / 2 / a; my-list)
it would be read as

  (map (fn (a b) (- 0 (/ b 2 a))) my-list)

-----