Commit 05f8d916 authored by Michael Raskin's avatar Michael Raskin

Syncing from Monotone at 20190331-065408. Last commit message was A note about...

Syncing from Monotone at 20190331-065408. Last commit message was A note about not requiring too much
parent 16ec5c0c
[.](pdf|ps|log|aux|eps|[0-9]+|dvi|nav|out|snm|toc|vrb)$
^debugging-local-variables-full[.]tex$
\documentclass{beamer}
\usepackage{fontspec}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\setmainfont{DejaVu Serif}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{indentfirst}
\setbeamercovered{transparent=50}
\mode<presentation>{
\usetheme{Madrid}
}
\title{Specifying code walking support}
\author[M.~Raskin]{\textbf{Michael Raskin}, raskin@mccme.ru}
\institute[TUM]{Dept. of CS, TU Munich}
\date{April 1, 2019}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
\begin{frame}
\frametitle{Extending Common Lisp: Theory}
Common Lisp is a programmable programming language
~
Major language features can be added via macros
~
No limits — code is data!
~
Conforming code is portable between implementations
\end{frame}
\begin{frame}
\frametitle{Extending Common Lisp: Practice}
CLOS was a library
Cells, ContextL
~
If necessary, one can code walk!
Iterate
~ \pause
Implementation-specific code walking code bitrots
~
Agnostic-Lizard: 2017, portable — still not too late to the game?
Test suite to break the other portable code walkers…
\end{frame}
\begin{frame}
\frametitle{Code walking support}
Standard is not enough
\qquad opaque lexical environments
Common Lisp: the Language (2 ed.) \textit{is} enough
~
Implementations have enough functions… with unique names
Interesting expansions of standard macros
\end{frame}
\begin{frame}[fragile]
\frametitle{Standard macros}
\texttt{ (defun f (x) (1+ x)) }
is currently allowed to expand to any of the following:
\begin{verbatim}
; CLISP
(impl::define-function
'f (function f '(lambda (x) (block f (1+ x)))))
; SBCL
(impl::define-function
'f (impl::named-lambda f (x) (block f (1+ x))))
; Please no
; Bonus «no» if define-function is special operator
(impl::define-function 'f "x -> (1+ x)")
; Please?
(impl::define-function
'f (labels ((f (x) (1+ x))) (function f)))
\end{verbatim}
\end{frame}
\begin{frame}
\frametitle{Can we agree on what implementations can signal?}
CDR?
~
CDR-NN package for necessary functionality?
Either \texttt{with-augmented-environment}, or \texttt{augment-environment},
or \texttt{environment-entry-names}, or \texttt{macroexpand-all}.
~
:CDR-NN-EXPANSIONS feature for standard-conforming code in the expansions?
~
Goals:
Unified naming for function/macro aliases — cheap for implementations
Full code-walking friendliness — cheap enough to have a chance…
~
Current draft: https://gitlab.common-lisp.net/mraskin/cdr-walkability
\end{frame}
\end{document}
......@@ -121,6 +121,17 @@ is currently allowed to expand to any of the following:
(define-function 'f (impl::named-lambda f (x) (block f (1+ x))))
(define-function 'f "x -> (1+ x)")
Note that the standard permits to provide a macro expansion for a special
operator. The requirements of both the standard and of this specification can
be satisfied if impl::named-lambda is a special operator implemented via
expansion to
(function '(impl::named-lambda f (x) (block f (1+ x))))
but with an additional macro expansion provided that returns
(labels ((f (x) (1+ x))) (function f))
Full code walking support requirements (CDR-NN-b).
A compliant implementation SHALL implement CDR-NN-a, SHALL satisfy the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment