scheme
13 stories and discussions about scheme, aggregated from every source we track.
<p>repl.it released support for Emacs Lisp: <a href="https://twitter.com/amasad/status/1143595381789347840" rel="ugc">https://twitter.com/amasad/status/1143595381789347840</a></p> <p>So I thought I'd dust off my old elisp hack and post it here.</p> <p>Instructions:</p> <ol> <li> <p>Go to <a href="https://repl.it/repls/UnluckySturdyCharactercode" rel="ugc">https://repl.it/repls/UnluckySturdyCharactercode</a></p> </li> <li> <p>press the run button</p> </li> <li> <p>evaluate (setq-local lexical-binding t)</p> </li> <li> <p>now you can run most Scheme expressions via the (scheme ...) macro, and most arc expressions via the (arc ...) macro.</p> </li> </ol> <pre><code>> (setq-local lexical-binding t) t > (arc (def adder (n) (fn (x) (+ x n))) (= add2 (adder 2)) (add2 3)) 5 > (scheme (define (adder n) (lambda (x) (+ x n))) (define add2 (adder 2)) (add2 40)) 42 </code></pre> <p>You can refer to elisp functions by surrounding them in with |bars|:</p> <pre><code>> (scheme (|print| "Hello")) "Hello" > (arc (|buffer-string|)) #("GNU Emacs 25.2.2\n*** Welcome to IELM *** Type (describe-mo\ de) for help.\n ;; Hint: .... </code></pre> <p>The original goal was to provide a <em>realistic</em> way of writing Emacs packages in languages other than Emacs Lisp. By "realistic," I mean that it should be basically a thin syntax wrapper over emacs lisp, not a separate runtime environment. That way you can call Emacs Lisp functions from Arc, call Arc functions from elisp lambdas, and so on.</p> <p>This project comes pretty close to that goal. I never got around to releasing it or putting it up on github. <a href="https://github.com/shawwn/y/blob/abcf6f4406178880390308ff0b782a5ed516c688/y.el" rel="ugc">https://github.com/shawwn/y/blob/abcf6f4406178880390308ff0b782a5ed516c688/y.el</a> is probably better for that purpose anyway.</p> <p>It overrides the default Emacs Lisp reader to support Scheme syntax, which is a testament to how flexible elisp actually is. (It also might be some combination of scary and horrible, depending on who the emotions are being experienced by.)</p> <p>For what it's worth, feel free to take any part of the code and use it however you want.</p> <p>There is a version of this that contains most of the old Hacker News codebase. It was hilarious seeing Emacs Lisp generate nearly identical output to Racket. And it'd be fairly straightforward to connect this to an http socket and serve something similar to <a href="http://arclanguage.org/forum" rel="ugc">http://arclanguage.org/forum</a> from an Emacs-powered webserver.</p>
A blog about computers, functional languages, Lisp, and Scheme.
another portable, embeddable Lisp/Scheme implementation based on a register-oriented bytecode vm - zhuzhonghua/dummyscheme
A blog about computers, functional languages, Lisp, and Scheme.