0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

tinyscheme on Android ( Termux )

Last updated at Posted at 2021-10-26

android termux のパッケージに tinyscheme というパッケージがあった。
これは arm で動いた。

IMG_20211024_141705_037.jpg

Emacs で REPL を動かすセッティング

emacs での簡単な簡易的セットアップ。これで emacs で tinyscheme コードを編集する分には()入力してからの中へ入れる。

Emacs で

1:M-x customize-variable

2:Enter scheme-program-name. Press Enter.
3:Replace 'scheme' with the path to your Scheme executable.

IMG_20211024_145442_550.jpg

eg)
Termux ターミナルで

~ $ which tinyscheme                                                    /data/data/com.termux/files/usr/bin/tinyscheme

このプログラムまでの path "/data/data/com.termux/files/usr/bin/tinyscheme" を scheme-program-name の初期値のscheme の語と入れ換えて入力。すなわち書き換え。

IMG_20211024_145442_610.jpg

4:Click the 'State' button and select 'Set for Current Sessions'.

IMG_20211026_182156_171.jpg

  • 'Save for Future Sessions' を選ぶと ~/.emacs.d/init.el 等に設定コードが書き込まれる。
  • 'Set for Current Sessions' を選んだ場合設定は emacs を終了させると次回同じように使うには、1. から設定する。

M-x run-scheme

IMG_20211024_145442_620.jpg

editモードのマニュアル
C-h m

IMG_20211024_145753_268.jpg

Hello

save hello.scm

hello.scm
(define fhello (lambda ()
                 "Hello world"))

M-x run-scheme

C-c C-l hello.scm

IMG_20211026_185653_966.jpg

参考:

もうひとつの Scheme 入門

勾配の緩やかな初心者向け Scheme 入門ページです。
コンピュータは使ったことがあるが、プログラミング経験があまりない人を想定しています。 Scheme の解説はすでに山ほど優れたものがありますが、あえて解説記事を書いてみました。 Scheme のような抽象的な話題は波長が合えばすんなりと理解できますが、あわないと全く理解できません。 他の解説を読んで今ひとつよく理解できなかった人は試しに読んでみてください。
この記事の目標はコンピュータ科学の教科書の決定版である SICP を読める程度の Scheme の知識を提供することです。
4. 関数を定義しよう
https://www.shido.info/lisp/scheme4.html

TinyScheme

TinyScheme
"Safe if used as prescribed" (Philip K. Dick, "Ubik")

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?