6
votes
Accepted
Converting a Scheme function to Emacs Lisp
You are almost there. There are only two little details you need to take care of:
Remove the quoting #' in (funcall #'(average-damp 'square) 10). You do want to eval average-damp and give you the ...
4
votes
Accepted
defun in defun is not local?
Use cl-labels to define local functions (cl-flet works, but recursive function reports error), and in the beginning of the .el file enable the lexical scoping:
;; -*- lexical-binding: t -*-
(defun ...
4
votes
Converting a Scheme function to Emacs Lisp
There are two problems I found with the code you wrote.
problem 1
(funcall #'(average-damp 'square) 10)
funcall requires a function as it's first argument. However, here you're trying to pass in the ...
3
votes
Accepted
Capturing output scheme when executing a code block in org-mode
Find the path of ob-scheme.el, for me that is
~/.emacs.d/.local/straight/repos/org/lisp/ob-scheme.el
and then in function org-babel-scheme-execute-with-geiser, change geiser-eval-region to geiser-...
1
vote
How to send newline into comint mode?
For Scheme in particular sending newline takes no effect but you can set scheme code that is hidden:
(defun scheme-send-last-sexp-fix ()
"Send the previous sexp to the inferior Scheme process
...
1
vote
Executing mit-scheme blocks in org-mode
Given how many variables are involved with personal configs, it will be very difficult to diagnose what the problem here is with the information available. However, you had asked for help in debugging ...
1
vote
Accepted
How do I change the default indentation of 'if' for Common Lisp and Scheme?
Yes, there is. There are a few customization suggestions for common-lisp-indent-function inside cl-indent.el. The same mechanism is used for scheme-indent-function. Place the following in your init ...
1
vote
Converting a Scheme function to Emacs Lisp
You can not enter x value to (average-damp ) in your code.
You should declare x as a function argument or define (average-damp ) as a macro.
(defun average-damp (f x)
(average x (funcall f x)))
(...
1
vote
Accepted
Automatically fixing bad indentation (Scheme-Lisp)
Select the whole code (e.g. by pressing C-Space at the start and using cursor keys to get to the end) and run indent-region (bound to C-M-\ in my Emacs).
1
vote
Evaluating the Chez Scheme code with C-x C-e
Here's what I did to get things running in my Emacs on macOS.
After installing chez via brew install chezscheme, I started my Emacs.
In my scratch buffer I ran (use-package geiser) to install/...
1
vote
Potential bug in geiser installation when using it with guile
Don't have enough reputation to upvote this, but this stymied me for too long. Same config, Emacs 26, geiser from MELPA stable. The bug is always some version of
apply: Invalid function: (lambda (&...
1
vote
Executing programs the efficient way with Spacemacs
I've got an workaround: open an terminal in Emacs with the Shell layer. After installing the Shell layer, you can toggle a shell window using SPC '.
You can execute mit-scheme < xxx.scm in that ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scheme × 34org-mode × 6
org-babel × 5
repl × 5
indentation × 4
key-bindings × 2
spacemacs × 2
doom × 2
comint × 2
slime × 2
evil × 1
elisp × 1
package × 1
osx × 1
window × 1
hooks × 1
shell × 1
font-lock × 1
major-mode × 1
syntax-highlighting × 1
functions × 1
images × 1
auto-complete-mode × 1
process × 1
literate-programming × 1