Basic use of MIT Scheme

Source: Internet
Author: User
After the MIT scheme system is correctly installed under Windows, the program menu will have an MIT scheme directory, including: Documentation: open the Scheme document mit GNU scheme in HTML format in a browser: Start scheme in Edwin environment. Edwin is an emacs-like editor. If you prefer to use command line interaction, you can use the following command to create a shortcut command and put it in your desktop or command menu. Change the directory to your system installation directory: "C: \ Program Files \ Mit-GNU scheme \ bin \ scheme.exe" -- library "C: \ Program Files \ Mit-GNU scheme \ Lib "Exit C-x Z of Edwin System (press Ctrl-X and press Z ): return from Edwin to the command interaction status of scheme. In this case, Edwin is suspended. You can use (edit) to wake up the suspended Edwin and return to the status before the suspension. C-x C: Stop Edwin and return to the command interaction status of scheme. C-x C-Z: Stop Edwin and suspend the scheme system. Starting scheme again will wake up the suspended scheme system and return to the system status before suspension. C-x C-C: Stop the Edwin and scheme systems. From the interaction loop to Edwin, execute (edit) or (Edwin) in interactive mode, start or return to Edwin interactive execution, exit, enter the following expression at the prompt, and press Enter: n] => (exit) the system will require confirmation. In this way, all things that have been done in scheme will be lost. Basic usage: Press enter in command line interaction mode. If you have entered a complete expression, the system will evaluate the value and output the result in Edwin C-X c-e to evaluate a complete expression on the left of the cursor, m-Z evaluate the entire definition in which the cursor is located (a definition is an expression, and its left parenthesis starts from the leftmost) in the command line interaction mode, you can use the MIT-GNU-Scheme document scheme file for editing and loading program files in the Edwin mode. If the program is long, you can write the program source files in an editor outside the system, and then load them into the system using the load function. The following is an example of an absolute path: 1] => (load "E: \ temp \ test1.scm") evaluate this expression, you can see the file loading information. The load function can also load compiled program files. For details, see "3.2 Loading Files" in the Scheme document "mit scheme User's Manual ". Function CD can be used to convert the current working directory. The following is an example: 1] => (CD "E: \ Temp"). Then, you can directly mount the files in this directory with the file name. Save and restore system images: the current operating site of the Scheme system can be saved for future reply to this site. The stored scene is called a "World Image" or a "band ". In fact, when scheme is started, it loads a default band. The compiler is started by loading another band. The Save-disk function saves the current field to a file. In the following example, the file image1: 1] => (Disk-save "image1") function is saved to the current directory to restore the original file: 1] => (Disk-Restore "image1") read the MIT Scheme document: "mit scheme reference" describes detailed features of MIT scheme, "mit scheme User's Manual" describes the use of MIT scheme. "SOS Reference Manual" describes SOS as an object system of scheme. "IMail User's Manual" describes IMail as an email reader using scheme. The following describes several issues related to the first two documents. The MIT scheme manual describes the functions provided by this scheme system, including predefined variables, special forms, and procedures ). For example, procedure: eqv? Obj1 obj2 process name is eqv ?, Take two parameters. Example: (eqv? 3 2) Procedure: list object... the process name is list. Take 0 or any number of parameters. Use Case: (List 1 2 3 4) special example: Special form: Lambda formals expression... in special form, the name is lambda, followed by a parameter table and one or more expressions. Use Case: (lambda (x y) (+ x y) ===use of command line mode is basically used in interactive execution mode, the system (after startup) the version information is displayed in a window, and the last prompt is: 1] => the entered program code is displayed after the prompt. At this time, the system executes the read-evaluation-print loop (read-evaluate-print loop, REPL), you can type an expression (Program) that meets the scheme syntax requirements, and the system needs to evaluate it. Any line feed is allowed in the expression. Once the system reads a complete expression, it will evaluate (calculate) it and print the obtained value. Scheme does not distinguish between uppercase and lowercase letters in identifiers. Define and define are the same as define. The number 1 in the prompt 1] => after startup indicates that the current system runs in the first layer of "Read-evaluate-print loop ". If an error occurs in the evaluation, the system will enter a higher level of "Read-evaluate-print loop", which is also a system error processing cycle. In the error loop, you can still use the scheme system as in the first loop, and do some other things (see the Scheme document) exit one or more layers of "Read-evaluate-print loop": You can use ctrl-u to exit a layer of evaluate loop and press Ctrl-g to return to the first loop. Interrupted execution: press Ctrl-g to kill the ongoing evaluation and return to the first repl press Ctrl-X: To kill the ongoing evaluation and return to the current repl press Ctrl-u: kill the ongoing evaluation and return to the previous repl key combination Ctrl-B: Pause the current evaluation to enter the breakpoint REPL. You can use (CONTINUE) to wake up interrupted execution ==* For details, refer to the following link for more information: http://www.cnblogs.com/henrya2/archive/2009/02/21/1395615.html. Thank you very much.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.