Skip to content

Commit

Permalink
Completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Oct 26, 2023
1 parent fd8cf0d commit e3ca8ba
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions quick-reference/chapters/syntax.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,34 @@ \subsubsection{Applications}
(_ <: harmonizer :> _)
\end{lstlisting}
\subsubsection{Abstractions as routing blocks}
Usually, lambda abstractions are supposed to be applied on arguments, using beta-reduction in Lambda-Calculus. But unapplied lambda abstractions can possibly be used in languages that treat them as first-class values\footnote{\url{https://en.wikipedia.org/wiki/First-class_function}}, named closures when they are lexically scoped.
In Faust, a proper semantic has been given to unapplied abstractions as results, which are actually routing circuits, internally called \textit{symbolic boxes}, with their arguments named \textit{slots} and corresponding to inputs. This is a convenient way to work with signals by \textit{explicitly naming them}, to be used in the lambda abstraction body \textit{with their parameter name}.
For instance a stereo crossing block written in the core syntax:
\begin{lstlisting}
process = _,_ <: !,_,_,!;
\end{lstlisting}
can be simply defined as:
\begin{lstlisting}
process = \(x,y).(y,x);
\end{lstlisting}
which is actually equivalent to:
\begin{lstlisting}
process(x,y) = y,x;
\end{lstlisting}
\subsubsection{Pattern Matching}
Pattern matching rules provide an effective way to analyze and transform block-diagrams algorithmically.
\begin{rail}
Expand Down
Binary file modified quick-reference/faust-quick-reference.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions src/manual/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -1198,9 +1198,9 @@ Whenever the Faust compiler find an application of an abstraction it replaces th

Usually, lambda abstractions are supposed to be applied on arguments, using beta-reduction in Lambda-Calculus. But unapplied lambda abstractions can possibly be used in languages that treat them as [first-class values](https://en.wikipedia.org/wiki/First-class_function), named closures when they are lexically scoped.

In Faust, we choose to give a proper semantic to unapplied abstractions as results, to become routing circuits, internally called *symbolic boxes*, with their arguments named *slots* and corresponding to inputs. This is a convenient way to work with signals by *explicitly naming them*, to be used in the lambda abstraction body *with their parameter name*.
In Faust, a proper semantic has been given to unapplied abstractions as results, which are actually routing circuits, internally called *symbolic boxes*, with their arguments named *slots* and corresponding to inputs. This is a convenient way to work with signals by *explicitly naming them*, to be used in the lambda abstraction body *with their parameter name*.

For instance a stereo crossing operation coded in the core syntax:
For instance a stereo crossing block written in the core syntax:

<!-- faust-run -->
```
Expand Down

0 comments on commit e3ca8ba

Please sign in to comment.