Arc Forumnew | comments | leaders | submitlogin
1 point by PieSquared 6028 days ago | link | parent

An unrelated question about the ':' syntax: does it really compose functions, or does it work with macros as well?

In other words, can I say

  (macro:function arguments)
or does it only work with functions?


2 points by absz 6021 days ago | link

It's actually in-between:

  (f:g a b c)
becomes

  ((compose f g) a b c)
, which normally wouldn't work if f or g were a macro; however, compose is special-cased in ac.scm so that in the head of a list, this becomes

  (f (g a b c))
. Thus, : only works with macros at the head of a list. You can't do

  (f a b macro:function c)

.

-----

1 point by tokipin 6027 days ago | link

it works with macros as well, which makes for a convenient "modifier" syntax

example: http://arclanguage.com/item?id=4436

-----

1 point by almkglor 6027 days ago | link

The "ultimate" modifier being p-m:

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

-----