

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A part of a university lecture series on scheme programming. It includes announcements, a scheme scheme, quotes about scheme, an introduction to scheme fundamentals, special forms, and a discussion on counting trees and lambda expressions. It also covers pairs and lists, symbolic programming, and scheme lists and quotation.
What you will learn
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Wednesday, October 30
http://imgs.xkcd.com/comics/lisp_cycles.png
What are people saying about Lisp?
Scheme programs consist of expressions, which can be:
5 (quotient 10 2) (quotient (+ 8 7) 5) (^3) > (+ (* 3 (+ (* (+ 23 4)5))) (+ (- 6)) 10 7) “quotient” built-in integer names Scheme’sdivision procedure (i.e., function) Combinations multiple linescan span (spacing doesn’t matter)
A combination that is not a call expression is a special form :
(define pi 3.14) 6.28 (* pi 2) (define (abs x) (if (< (- xx) 0) x)) 3 (abs -3) The symbol “pi” global is bound frame to 3.14 in the A procedure is symbol created “abs” and bound to the 7 Evaluation : (1) predicate Evaluate expression. the (2) Evaluate either the alternative. consequent or (Demo)
so many trees exist 9 a long noun phrase a two word modifier some trees are balanced the other trees lean The structure of a sentence can be described by a tree. Each sub-tree is a constituent. W X Y Z (Demo) The number of trees over n leaves with k leaves in the left and n-k in the right is: (The number of trees with k leaves) * (The number of trees with n-k leaves)
Lambda expressions evaluate to anonymous procedures.
(lambda (<formal-parameters>)
) Two equivalent expressions: (define (plus4 x) (+ x 4)) (define plus4 (lambda (x) (+ x 4))) An operator can be a call expression too: ((lambda (x y z) (+ x y (square z))) 1 2 3) add-^ Evaluates x -&- y -&- z^^2 toprocedure^ the 11