Arc Forumnew | comments | leaders | submitlogin
5 points by pg 5692 days ago | link | parent

In the latest (soon to be released) version

    (aif ((foo 'bar) 'name)
         (print it))
would be

    (only.print foo!bar!name)
assuming print is some function you defined yourself, and you don't mean pr.


1 point by conanite 5691 days ago | link

"warning: future releases of arc are likely to break all of your existing presentations"

I'll find another example so.

assuming print is some function you defined yourself, and you don't mean pr.

is this because only only takes 1-arg functions? Something like

  (def only (f)
    (fn (arg)
      (if arg (f arg))))

?

-----

1 point by andreyf 5691 days ago | link

Hm, you seem to use the . notation as Python uses decorators, but chaining multiple decorators has a very different effect. In python, I'd expect foo.bar.3 to be (foo (bar (3))). In Arc, it seems to do (foo bar 3).

-----

1 point by CatDancer 5691 days ago | link

This will be fixed in the next release of Arc (http://arclanguage.org/item?id=9163)

-----