Skip to main content
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 ...
Tobias's user avatar
  • 33.7k
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 ...
Alaneuler's user avatar
  • 277
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 ...
Aquaactress's user avatar
  • 1,473
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-...
Jiahao Liu's user avatar
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 ...
jcubic's user avatar
  • 793
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 ...
Malle Yeno's user avatar
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 ...
wasamasa's user avatar
  • 22.4k
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))) (...
adl's user avatar
  • 646
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).
choroba's user avatar
  • 2,125
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/...
nega's user avatar
  • 3,411
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 (&...
jowalski's user avatar
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 ...
nalzok's user avatar
  • 675

Only top scored, non community-wiki answers of a minimum length are eligible