]> git.lizzy.rs Git - metalua.git/blobdiff - doc/manual/dollar-ref.tex
fix CRLF
[metalua.git] / doc / manual / dollar-ref.tex
index 0f65ae5ab10bf3d0f677eef3b8326002cc777768..bb5054a6a50c7111a1ec458a4bda4f6dfe176a1c 100644 (file)
@@ -1,22 +1,22 @@
-\section[Dollar extension]{{\tt dollar}: generic syntax for macros}\r
-When you write a short-lived macro which takes reasonably short arguments, you\r
-generally don't want to write a supporting syntax for it. The dollar library\r
-allows you to call it in a generic way: if you store your macro in the table\r
-{\tt mlp.macros}, say as function {\tt mlp.macros.foobar}, then you can call it\r
-in your code as {\tt\$foobar(arg1, arg2...)}: it will receive as parameters the\r
-ASTs of the pseudo-call's arguments.\r
-\r
-\paragraph{Example}~\r
-\begin{verbatim}\r
--{ block:\r
-   require 'dollar'\r
-   function doller.LOG(id)\r
-      match id with `Id{ id_name } -> \r
-         return +{ printf("%s = %s", id_name, \r
-                          table.tostring(-{id})) }\r
-      end\r
-   end }\r
-\r
-local x = { 1, 2, 3 }\r
-$LOG(x) -- prints "x = { 1, 2, 3 }" when executed\r
-\end{verbatim}\r
+\section[Dollar extension]{{\tt dollar}: generic syntax for macros}
+When you write a short-lived macro which takes reasonably short arguments, you
+generally don't want to write a supporting syntax for it. The dollar library
+allows you to call it in a generic way: if you store your macro in the table
+{\tt mlp.macros}, say as function {\tt mlp.macros.foobar}, then you can call it
+in your code as {\tt\$foobar(arg1, arg2...)}: it will receive as parameters the
+ASTs of the pseudo-call's arguments.
+
+\paragraph{Example}~
+\begin{verbatim}
+-{ block:
+   require 'dollar'
+   function doller.LOG(id)
+      match id with `Id{ id_name } -> 
+         return +{ printf("%s = %s", id_name, 
+                          table.tostring(-{id})) }
+      end
+   end }
+
+local x = { 1, 2, 3 }
+$LOG(x) -- prints "x = { 1, 2, 3 }" when executed
+\end{verbatim}