<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,6 +34,12 @@ module Meta (
     primitive 'nthParam'
   )
 
+  // Returns the list of arguments defined with the provided function. Each element
+  // in the list is the name of the argument as a string.
+  def arguments fn (
+    primitive 'arguments'
+  )
+
   // Creates an identifier from a string.
   def wyId str (
     primitive 'wyId'
@@ -158,8 +164,8 @@ module Foundation (
 
   // Arithmetic operators
   macrop (`a = `b) 1 (
-    if (applic? a &amp;&amp; fnName a == &quot;@&quot;) (
-      ` ((@!) ($ (nthParam a 0))  ($ (nthParam a 1)) $b) 
+    if (applic? a &amp;&amp; fnName a == &quot;at&quot;) (
+      ` ((at!) ($ (nthParam a 0))  ($ (nthParam a 1)) $b) 
     )(
       ` ((=) $a $b)
     )
@@ -184,12 +190,12 @@ module Foundation (
   macro (`arr . `idx) (
     if (applic? idx) (
       if (empty? (params idx)) (
-        ` ((@) $arr ($ (fnName idx)))
+        ` (at $arr ($ (fnName idx)))
       )(
-        ` ( ((@) $arr ($ (fnName(idx)))) ($^ (params idx)) )
+        ` ( (at $arr ($ (fnName(idx)))) ($^ (params idx)) )
       )
     )(
-      ` ((@) $arr $idx)
+      ` (at $arr $idx)
     )
   )
 
@@ -210,6 +216,8 @@ module Foundation (
     )
   )
 
+  // Syntax sugar for opening and closing parentheses (when the closing occurs at
+  // then end of the statement)
   macro (`appl ^ `sub~) (
     if (applic? appl) (
       `( ($ (wyId (fnName appl))) ($^ (params appl &lt;&lt; sub)) )
@@ -218,6 +226,12 @@ module Foundation (
     )
   )
 
+  // Function composition
+  def compose f1 f2 x (f1 (f2 x))
+
+  // Operator for function composition
+  macrox (`fn1 @ `fn2) (compose $fn1 $fn2)
+
   // Control structures
   //
 
@@ -277,8 +291,8 @@ module Foundation (
     primitive 'M'
   )
 
-  def (@) list elmt (
-    primitive '@'
+  def at list elmt (
+    primitive 'at'
   )
 
   def (&lt;&lt;) list elmt (
@@ -291,8 +305,8 @@ module Foundation (
   )
   macropx (`a &gt;&gt; `b) 1 ((&gt;&gt;) $a $b)
 
-  def (@!) ref pos val (
-    primitive '@!'
+  def (at!) ref pos val (
+    primitive 'at!'
   )
 
   def push! list val (
@@ -348,8 +362,8 @@ module Foundation (
     primitive 'load'
   )
 
-  def arguments (
-    primitive 'arguments'
+  def ARGS (
+    primitive 'ARGS'
   )
 
   def exit (</diff>
      <filename>haskell/src/foundation.wy</filename>
    </modified>
    <modified>
      <diff>@@ -220,9 +220,9 @@ dataPrim f =
     onContainers ps wyLength wyLength (WyInt . toInteger . M.size) ) $
   defp &quot;reverse&quot; (\ps -&gt; 
     onContainers ps (WyList . reverse) (WyString . reverse) (WyMap . id) ) $
-  defp &quot;@&quot; (\ps -&gt; 
+  defp &quot;at&quot; (\ps -&gt; 
     evalAtParams ps &gt;&gt;= elemAt ) $
-  defp &quot;@!&quot; (\ps -&gt; do 
+  defp &quot;at!&quot; (\ps -&gt; do 
     ref &lt;- evalWy $ head ps
     oldVal &lt;- liftIO $ readRef ref
     newVal &lt;- evalWy $ last ps
@@ -372,6 +372,13 @@ metaPrim f =
       (WyStmt [WyApplic _ ps _]) -&gt;  return $ ps !! fromInteger idx
       WyApplic _ ps _            -&gt;  return $ ps !! fromInteger idx
       x -&gt; get &gt;&gt;= appErr1 (\e -&gt; &quot;Not a function application: &quot; ++ e) x ) $
+
+  defp &quot;arguments&quot; (\ps -&gt; do
+    fn &lt;- eval $ head ps
+    case fn of
+      (WyLambda as _ _) -&gt; return . WyList . map WyString $ as
+      (WyPrimitive _ as _) -&gt; return . WyList . map WyString $ as
+      (WyCont _) -&gt; return $ WyList [WyString &quot;c&quot;] ) $
   
   defp &quot;splitBlock&quot; (\ps -&gt; do
     block &lt;- eval $ head ps
@@ -402,7 +409,7 @@ stdIOPrim f =
                           str &lt;- concatWyStr eps
                           liftIO $ putStrLn str
                           return WyNull ) $
-  defp &quot;arguments&quot; (\ps -&gt; liftM (WyList . map WyString . safeTail) (liftIO getArgs) ) $
+  defp &quot;ARGS&quot; (\ps -&gt; liftM (WyList . map WyString . safeTail) (liftIO getArgs) ) $
   defp &quot;load&quot; (\ps -&gt; do
     fname &lt;- eval (head ps) &gt;&gt;= stringOrShow
     fcnt &lt;- liftIO $ readFile fname</diff>
      <filename>haskell/src/prim.hs</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-verbose = arguments().0 == &quot;-v&quot;
+verbose = ARGS().0 == &quot;-v&quot;
 descriptions = []
 
 macrox (describe `str `descBody) (</diff>
      <filename>test/base.wy</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>82b3c514a751f5b1751c6ce82b21505ea5574df2</id>
    </parent>
  </parents>
  <author>
    <name>Matthieu Riou</name>
    <email>matthieu.riou@c3-carbon.com</email>
  </author>
  <url>http://github.com/matthieu/witty/commit/df8eee072741180e70e4ea53a73950d3eba62789</url>
  <id>df8eee072741180e70e4ea53a73950d3eba62789</id>
  <committed-date>2009-09-30T21:42:06-07:00</committed-date>
  <authored-date>2009-09-30T21:42:06-07:00</authored-date>
  <message>Function composition with @</message>
  <tree>e71bff0651eb0cec62e5d1b7400c1ce1fb38a6cb</tree>
  <committer>
    <name>Matthieu Riou</name>
    <email>matthieu.riou@c3-carbon.com</email>
  </committer>
</commit>
