Complete and fix the sections on Racket and Scheme programming

This commit is contained in:
Gerard Vermeulen 2023-06-10 07:20:55 +02:00
parent 3ce2caddc0
commit 6df1dd56b9

View File

@ -5704,29 +5704,45 @@ configures =code-cells=.
** [[https://racket-lang.org/][Racket Programming]]
:PROPERTIES:
:CUSTOM_ID: sec:racket-programming
:header-args:emacs-lisp: :eval never-export
:END:
[[https://kchousos.github.io/posts/sicp-in-emacs/][SICP in Emacs]]
Refer to the [[https://kchousos.github.io/posts/sicp-in-emacs/][SICP in Emacs]] post for an Emacs setup to study of [[https://web.mit.edu/6.001/6.037/sicp.pdf][Structure and
Interpretation of Computer Programs]] in Org. Listing [[lst:setup-sicp]] installs
the required Emacs packages but you have also to install the [[https://docs.racket-lang.org/sicp-manual/index.html][SICP Collections]] in
for instance the [[https://racket-lang.org/][Racket]] programming environment [[https://docs.racket-lang.org/drracket/][DrRacket]].
#+caption[Ensure =racket= installation to study SICP]:
#+caption: Ensure =racket= installation to study SICP.
#+name: lst:setup-sicp
#+begin_src emacs-lisp -n
(when (ensure-package-installation 'racket-mode 'sicp)
;; Calling `package-upgrade-all' upgrades `ob-racket' always.
(setopt package-vc-selected-packages
'((ob-racket :vc-backend 'Git
:url "https://github.com/hasu/emacs-ob-racket.git")))
(unless (package-installed-p 'ob-racket)
(package-vc-install
'(ob-racket :url "https://github.com/hasu/emacs-ob-racket.git"))))
(package-vc-install (assoc 'ob-racket package-vc-selected-packages))))
#+end_src
#+begin_src racket :lang sicp
"Hello, world!"
#+caption[SICP Racket test]:
#+caption: SICP Racket test.
#+name: lst:sicp-test
#+header: :wrap "src text -n"
#+begin_src racket :eval never-export :exports both :lang sicp
(inc 42)
#+end_src
#+RESULTS:
: "Hello, world!"
#+caption[SICP Racket test result]:
#+caption: SICP Racket test result.
#+name: lst:sicp-test-result
#+RESULTS: lst:sicp-test
#+begin_src text -n
43
#+end_src
** [[https://en.wikibooks.org/wiki/Scheme_Programming][Scheme Programming]]
:PROPERTIES:
:CUSTOM_ID: sec:scheme-programming
:header-args:emacs-lisp: :eval never-export
:END:
Listing [[lst:setup-geiser][Ensure Geiser installation]] supports the Scheme implementations
@ -5769,6 +5785,7 @@ curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | sudo tar zx
*** Org Babel Ackermann Scheme test
:PROPERTIES:
:CUSTOM_ID: sec:obas-test
:header-args: :eval never-export
:END:
Listing [[lst:obas-test][Org Babel Ackermann Scheme test]] allows to check whether the setup works.