Skip to content

Commit

Permalink
change Apply to Call in python version
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiek committed Oct 27, 2023
1 parent c2f509e commit 13a93db
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions book.tex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

\def\racketEd{0}
\def\pythonEd{1}
\def\edition{1}
\def\edition{0}

% material that is specific to the Racket edition of the book
\newcommand{\racket}[1]{{\if\edition\racketEd{#1}\fi}}
Expand Down Expand Up @@ -15947,14 +15947,21 @@ \section{Explicate Control and the \LangCFun{} Language}
\racket{\code{Apply}}\python{\code{Call}} and \code{FunRef} and the
function for predicate context should be updated for
\racket{\code{Apply}}\python{\code{Call}} but not \code{FunRef}. (A
\code{FunRef} cannot be a Boolean.) In assignment and predicate
contexts, \code{Apply} becomes \code{Call}\racket{, whereas in tail position
\code{Apply} becomes \code{TailCall}}. We recommend defining a new
auxiliary function for processing function definitions. This code is
similar to the case for \code{Program} in \LangVec{}. The top-level
\code{explicate\_control} function that handles the \code{ProgramDefs}
form of \LangFun{} can then apply this new function to all the
function definitions.
\code{FunRef} cannot be a Boolean.)

In assignment and predicate contexts,
%
\racket{\code{Apply} becomes \code{Call}, whereas
in tail position \code{Apply} becomes \code{TailCall}}
%
\python{\code{Call} remains \code{Call}, whereas
in tail position \code{Call} becomes \code{TailCall}}.
%
We recommend defining a new auxiliary function for processing function
definitions. This code is similar to the case for \code{Program} in
\LangVec{}. The top-level \code{explicate\_control} function that
handles the \code{ProgramDefs} form of \LangFun{} can then apply this
new function to all the function definitions.

{\if\edition\pythonEd\pythonColor

Expand Down

0 comments on commit 13a93db

Please sign in to comment.