summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2023-12-13 16:01:16 +0100
committerDavid A. Madore <david+git@madore.org>2023-12-13 16:01:16 +0100
commita40a72a07392dfa97f710d9d80b86288252ba040 (patch)
tree2ed11c9e104fcad905b64d0e5f2c5a7e0ec57e4f
parent71884652cf8ee42894f8f6898e62f6fe864282ae (diff)
downloadinf110-lfi-a40a72a07392dfa97f710d9d80b86288252ba040.tar.gz
inf110-lfi-a40a72a07392dfa97f710d9d80b86288252ba040.tar.bz2
inf110-lfi-a40a72a07392dfa97f710d9d80b86288252ba040.zip
Add a few call/cc puzzles.
-rw-r--r--transp-inf110-02-typage.tex19
1 files changed, 18 insertions, 1 deletions
diff --git a/transp-inf110-02-typage.tex b/transp-inf110-02-typage.tex
index b60778b..389acbe 100644
--- a/transp-inf110-02-typage.tex
+++ b/transp-inf110-02-typage.tex
@@ -3379,9 +3379,26 @@ $\rightarrow$ 42\\
(call/cc (lambda (k) (+ (k 42) 1)))\hfill ;; (+ \_ 1) never reached\\
$\rightarrow$ 42\\
(* (call/cc (lambda (k) (k 42))) 2)\hfill ;; Nothing weird here\\
-$\rightarrow$ 84
+$\rightarrow$ 84\\
+((call/cc (lambda (k) k))\\
+\ (call/cc (lambda (k) k)))\hfill ;; Endless loop: why?
\par}
+\bigskip
+
+{\footnotesize
+
+Très difficile à comprendre :
+
+{\tt
+((lambda (yin)\\
+\ \ \ ((lambda (yang) (yin yang))\\
+\ \ \ \ ((lambda (kk) (display \#\textbackslash *) kk) (call/cc (lambda (k) k)))))\\
+\ ((lambda (kk) (newline) kk) (call/cc (lambda (k) k))))
+\par}
+
+}
+
\end{frame}
%
\begin{frame}