Overhaul the "Scheme programming" section

This commit is contained in:
Gerard Vermeulen 2023-05-28 12:30:01 +02:00
parent 937d9176dd
commit 925f9055e3
1 changed files with 22 additions and 24 deletions

View File

@ -5663,13 +5663,28 @@ configures =code-cells=.
:CUSTOM_ID: sec:scheme-programming
:END:
In case you install [[https://cisco.github.io/ChezScheme/][Chez Scheme]], [[https://call-cc.org/][Chicken Scheme]], [[https://www.gnu.org/software/guile/][GNU Guile]], and [[https://www.gnu.org/software/mit-scheme/][MIT/GNU Scheme]]
with [[https://brew.sh/][Homebrew]], you have to execute the [[https://wiki.call-cc.org/emacs#using-chicken-with-emacs][Using Chicken Scheme with Emacs]] steps or
listing [[lst:finish-chicken-install][Finish Chicken Scheme install]] to access the [[https://wiki.call-cc.org/man/5/The%20User%27s%20Manual][Chicken Scheme Manual]]
locally.
Listing [[lst:setup-geiser][Ensure Geiser installation]] supports the [[https://cisco.github.io/ChezScheme/][Chez Scheme]], [[https://call-cc.org/][Chicken Scheme]], and
[[https://www.gnu.org/software/guile/][GNU Guile]] Scheme implementations and configures Geiser with [[https://cisco.github.io/ChezScheme/][Chez Scheme]] as
default implementation. Evaluate one of the following expressions to switch
between those three implementations:
1. src_emacs-lisp{(setopt scheme-default-implementation 'chicken)},
2. src_emacs-lisp{(setopt scheme-default-implementation 'guile)},
3. src_emacs-lisp{(setopt scheme-default-implementation 'chez)}.
This setup does not support [[https://www.gnu.org/software/mit-scheme/][MIT/GNU Scheme]] which does not work with =ob-scheme=
although it works with =geiser-mit=.
Listing [[lst:setup-geiser][Ensure Geiser installation]] installs the support for those four Scheme
implementations and configures Geiser with a preference for [[https://cisco.github.io/ChezScheme/][Chez Scheme]].
The [[https://wiki.call-cc.org/emacs#using-chicken-with-emacs][Using Chicken Scheme with Emacs]] post or [[lst:finish-chicken-install][Finish Chicken Scheme install]]
listing show how to make the [[https://wiki.call-cc.org/man/5/The%20User%27s%20Manual][Chicken Scheme Manual]] available locally in case you
install [[https://call-cc.org/][Chicken Scheme]] with [[https://brew.sh/][Homebrew]].
#+caption[Ensure =geiser= installation]:
#+caption: Ensure =geiser= installation.
#+name: lst:setup-geiser
#+begin_src emacs-lisp -n
(when (ensure-package-installation 'geiser-chez 'geiser-chicken 'geiser-guile)
(setopt geiser-chez-binary (executable-find "chez")
geiser-scheme-implementation 'chez))
#+end_src
#+caption[Finish Chicken Scheme install]:
#+caption: Finish Chicken Scheme install.
@ -5683,29 +5698,12 @@ cd $(csi -R chicken.platform -p '(chicken-home)')
curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | sudo tar zx
#+end_src
#+caption[Ensure =geiser= installation]:
#+caption: Ensure =geiser= installation.
#+name: lst:setup-geiser
#+begin_src emacs-lisp -n
(when (ensure-package-installation
'geiser 'geiser-chez 'geiser-chicken 'geiser-guile 'geiser-mit)
(setopt geiser-chez-binary (executable-find "chez")
geiser-scheme-implementation 'chez))
#+end_src
*** Org Babel Ackermann Scheme test
:PROPERTIES:
:CUSTOM_ID: sec:obas-test
:END:
Listing [[lst:obas-test][Org Babel Ackermann Scheme test]] allows to check whether the setup works
for [[https://cisco.github.io/ChezScheme/][Chez Scheme]] by default. To switch between [[https://call-cc.org/][Chicken Scheme]], [[https://www.gnu.org/software/guile/][GNU Guile]], or
[[https://www.gnu.org/software/mit-scheme/][MIT/GNU Scheme]], evaluate one of the following expressions:
1. src_emacs-lisp{(setopt scheme-default-implementation 'chicken)},
2. src_emacs-lisp{(setopt scheme-default-implementation 'guile)},
3. src_emacs-lisp{(setopt scheme-default-implementation 'mit)}.
Sofar, [[https://www.gnu.org/software/mit-scheme/][MIT/GNU Scheme]] does not work with =ob-scheme=, although it works with
=geiser-mit=.
Listing [[lst:obas-test][Org Babel Ackermann Scheme test]] allows to check whether the setup works.
#+caption[Org Babel Ackermann Scheme test]:
#+caption: Org Babel Ackermann Scheme test.