int-1 - ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
; Int-1.scm ; Interpreter - Release 1 ; ; This version of the interpreter is capable of evaluating : ; 1. Literal numbers. 1, 2, 3, . .. ; 2. Literal predicates. #T, #F ; 3. Quoted objects. 'A, 'Hello, '(1 2 3), . .. ; ; As mentioned in class, the basic model our interpreter follows is : ; 1. Read an expression from the keyboard. ; 2. Evaluate the expression. ; 3. Repeat. ; ; As you read this module, you will notice that all of the functions ; defined in this module begin with the letters m-. I have used this ; prefix on all functions defined in my program to avoid name conflicts ; with primitive procedures built into the underlying interpreter. Be ; careful naming procedures. If you accidentally redefine a primitive ; procedure, you will have to reload the underlying interpreter to ; retrieve the original definition. ; ; To launch the interpreter type : (m-scheme) ; ; ********************************************************************** ; ; M-Scheme ; Interpret expressions until the user enters 'Done. ; Parameters : None. ; Returns : Nothing. ; ; This procedure relies on the primitive procedure, read, which returns ; 2 types of information : ; 1. Atom - A single object. ; 2. Pair - A pair of objects. ; You can determine whether the information returned from read is an ; atom or a pair by applying the primitive procedure pair? to the value ; returned by the procedure. ; ; The basic logic of scheme is as follows : ; 1. Read an expression from the keyboard. ; 2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

int-1 - ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online