From 4d607d38a0095b8887ce43149df918f419d3a7e2 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Fri, 29 Apr 2005 21:26:00 +0000 Subject: [PATCH] attempted fix --- doc/comparison.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/comparison.tex b/doc/comparison.tex index 4116a54653..87baa06288 100644 --- a/doc/comparison.tex +++ b/doc/comparison.tex @@ -98,7 +98,7 @@ in Factor. It would be #! This is pointless do-something ; \end{verbatim} -As you might guess, \texttt{:} starts a definition and \texttt{;} ends it. Right after the colon is the name of the function we are defining here: \texttt{function}. The docstring is anything after \texttt{#!}. You have to put a \texttt{#!} at the beginning of each line. For a plain old comment, use \texttt{!} wherever you used \texttt{#}. But where did the argument go? The argument has no name; it is stored on the stack. That nameless argument is then automatically passed to another function called \texttt{do-something} and then it automatically returns the value. The fact that Factor passes arguments around automatically, basically, makes it \emph{concatenative}, and the fact that Python uses variables explicitly makes it \emph{applicative}. For a slightly more complicated example, we can look at a function that uses multiplication to square a number using multiplication. As you probably know, in Python it's +As you might guess, \texttt{:} starts a definition and \texttt{;} ends it. Right after the colon is the name of the function we are defining here: \texttt{function}. The docstring is anything after \verb|#!|. You have to put a \verb|#!| at the beginning of each line. For a plain old comment, use \texttt{!} wherever you used \verb|#|. But where did the argument go? The argument has no name; it is stored on the stack. That nameless argument is then automatically passed to another function called \texttt{do-something} and then it automatically returns the value. The fact that Factor passes arguments around automatically, basically, makes it \emph{concatenative}, and the fact that Python uses variables explicitly makes it \emph{applicative}. For a slightly more complicated example, we can look at a function that uses multiplication to square a number using multiplication. As you probably know, in Python it's \begin{verbatim} def square(x): return x*x