How do I execute a .scm script (outside of the REPL) with MIT-Scheme?
scheme < file.scm should work (as long as you don’t specify –interactive and stdin is not a terminal, scheme works non-interactively).
scheme < file.scm should work (as long as you don’t specify –interactive and stdin is not a terminal, scheme works non-interactively).
Culpepper & Felleisen, Fortifying Macros, ICFP 2010 Culpepper, Tobin-Hochstadt and Felleisen, Advanced Macrology and the Implementation of Typed Scheme, Scheme Workshop 2007 Flatt, Findler, Felleisen, Scheme with Classes, Mixins, and Traits, APLAS 2006 Herman, Meunier, Improving the Static Analysis of Embedded Languages via Partial Evaluation, ICFP 2004
In Scheme and Racket, a symbol is like an immutable string that happens to be interned so that symbols can be compared with eq? (fast, essentially pointer comparison). Symbols and strings are separate data types. One use for symbols is lightweight enumerations. For example, one might say a direction is either ‘north, ‘south, ‘east, or … Read more
PLT Scheme features a built-in, continuation-based web server. Update: PLT Scheme is now called Racket.
UPDATED FOR EL CAPITAN: The best way that I’ve found was from here: Download either the 32-bit or 64-bit dmg file for Scheme. Double click the .dmg file, and you’ll get this window, in which you should drag the “MIT/GNU Scheme” file into the Applications folder. For the 32-bit version, run this command: sudo ln … Read more
TL;DR: They are different; use list when in doubt. A rule of thumb: use list whenever you want the arguments to be evaluated; quote “distributes” over its arguments, so ‘(+ 1 2) is like (list ‘+ ‘1 ‘2). You’ll end up with a symbol in your list, not a function. An in-depth look at list … Read more
Atoms are literals, constants with their own name for value. What you see is what you get and don’t expect more. The atom cat means “cat” and that’s it. You can’t play with it, you can’t change it, you can’t smash it to pieces; it’s cat. Deal with it. I compared atoms to constants having … Read more
To compare it to C, the current continuation is like the current state of the stack. It has all the functions waiting for the result of the current function to finish so they can resume execution. The variable captured as the current continuation is used like a function, except that it takes the provided value … Read more
The form ‘foo is simply a faster way to type the special form (quote foo) which is to say, “do not evaluate the name foo replacing it with its value; I really mean the name foo itself”. I think SISC is perfectly fine for exploring the exercises in TLS.
There are some extremely cool use cases. One example is in GUI programming – I saw this while developing a GUI app in real time as it was running beside my Emacs: I added code for a new button and hit “C-c C-c” to compile that single function, and the button just appeared in the … Read more