geiser-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Geiser-users] Geiser and MIT/GNU Scheme


From: Rich Loveland
Subject: Re: [Geiser-users] Geiser and MIT/GNU Scheme
Date: Mon, 25 Apr 2016 20:48:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin)

<address@hidden> writes:

> Hello Geiserati!

Hello Peter!

> I've been playing around with geiser and MIT/GNU Scheme, and have come
> up with the code attached.

Awesome!

> It does the following on MIT/GNU Scheme:
> - support for a REPL
> - support for autodoc
> - support for completion
> - support for modules (though the environments in MIT/GNU Scheme are not
>   exactly modules :-/)
> - partial support for M-. *if* the function is compiled and the sources
>   are in the same place as the compiled files, or the sources are a part
>   of the default MIT/GNU Scheme (and geiser-mit-source-directory is set
>   correctly in Emacs).
>
> There's still a lot missing, and some things might not work perfectly,
> but my playing around with it seems to mostly work.
>
> Would anyone be kind enough to try this, and comment on it? It'd be
> great if MIT/GNU Scheme would become one of geiser's supported systems.

I've made the following changes to get it working on my system (Mac OS
X, with the .DMG install of MIT Scheme from
http://www.gnu.org/software/mit-scheme/)

First, local config I had to set:

  (setq geiser-mit-binary
    "/Applications/MIT-Scheme.app/Contents/Resources/mit-scheme")
  (setq geiser-mit-source-directory "/Users/rloveland/Code/mit-scheme/src/")
  (setq geiser-scheme-dir (expand-file-name "~/Desktop/scheme/"))

A few fixes were needed to get it basically running with completions,
etc.

- Add GEISER:NO-VALUES procedure to the list of exports in geiser.pkg,
  since it gets called in geiser-mit.el and was making Emacs throw
  errors

- Add the line `(load-option 'FORMAT)` to emacs.scm since FORMAT was
  being called later in the file

- A tweak to ALL-COMPLETIONS in emacs.scm to remove the case-twiddling
  code (which was breaking on my machine because my Scheme expected
  *PARSER-CANONICALIZE-SYMBOLS?* instead of what you were using).  It
  turns out STRING-PREFIX? plus checks is unneeded because MIT Scheme
  (v9.2) has STRING-PREFIX-CI?  This leaves the code looking like:

  (define (all-completions prefix environment)
    (let ((completions '()))
      (for-each-interned-symbol
       (lambda (symbol)
         (if (and (string-prefix-ci? prefix (symbol-name symbol))
                  (environment-bound? environment symbol))
             (set! completions (cons (symbol-name symbol) completions)))
         unspecific))
      completions))

- I'm not 100% sure, but I think what you are doing with PSTRING->ENV in
  emacs.scm can be achieved with ->ENVIRONMENT, e.g.,

  (pstring->env "user")

  can become

  (->environment '(user))

Do you have a Git repo somewhere?  I'd be happy to send patches.

Thanks for doing this!!!  MIT Scheme is really awesome.

p.s. Incidentally, this work might mean MIT Scheme can be used on
Windows again -- right now it's really hard (IIRC) because Edwin on
Windows has a bug where it doesn't actually save files, all you can do
is run a REPL.  None of the maintainers use Windows AFAICT so it's
unclear when/if that will be fixed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]