Download Sketchy LISP: An Introduction to Functional Programming in by Nils M Holm PDF

By Nils M Holm

Sketchy LISP is a step by step advent to sensible programming in Scheme. via a variety of examples of various complexity, it takes the reader on an interesting and informative travel during the language.

Show description

Read or Download Sketchy LISP: An Introduction to Functional Programming in Scheme, 3rd Edition PDF

Best programming: programming languages books

PHP MySQL avec Flash 8

Réaliser des websites dynamiques en Flash avec ActionScript, MySQL et personal home page (versions five ou 4). remark afficher sur web des données en temps réel, tels les résultats d'une élection ou le ranking d'un fit de tennis ? Grâce à Flash eight, personal home page et MySQL, qui permettent de concevoir des interfaces net graphiques et conviviales, couplées à des bases de données.

The Web Designers Guide to iOS Apps: Create iPhone, iPod touch, and iPad apps with Web Standards (HTML5, CSS3, and j#097;vascript)

When you are a clothier who is familiar with HTML, CSS, and javascript, you could simply tips on how to make local iPhone, iPod contact, and iPad apps—and distribute them world wide through the App shop. while mixed with an Objective-C framework, internet criteria can be utilized to layout and magnificence content material for iOS, utilizing local controls and behaviors for an actual Apple consumer event.

Extra resources for Sketchy LISP: An Introduction to Functional Programming in Scheme, 3rd Edition

Sample text

In the inner let, lambda closes over the binding of down to an unimportant value and then let binds the resulting procedure to the temporary variable t0. In the body of the inner let, the binding of down to #f is still visible. Set! changes its value to the procedure bound to t0. This mutation also affects the value that lambda closed over, because the scope of the outer let is still in effect. The resulting structure is recursive: down = (lambda (x) (if (zero? x) 0 (down (- x 1)))) In general, letrec can be transformed to let in the following way: (letrec ((v1 p1) = ...

Before doing the next iteration in transform, the depth of the current sublist is consed to out. If the maximum depth found so far was bound to out instead of the list, the new maximum depth could be computed right at this point. In this case, the max-list procedure could be optimized away altogether. Of course, transform and out would have to get more descriptive names, too: (define (deepest-sublist x) (letrec ((max-depth (lambda (in max-so-far) (cond ((null? in) max-so-far) (else (max-depth (cdr in) (max (depth (car in)) max-so-far))))))) (max-depth x 0))) Optimizations like this spring to mind quite frequently.

If you plan to use lists as data structures, you would give more descriptive names to procedures extracting specific members. For example, a date could be stored in a list of the form (year month day) but of course, you would not use the names car, cadr and caddr to refer to the single fields of a date object. You would define accessor procedures like these: (define (year date) (car date)) (define (month date) (cadr date)) (define (day date) (caddr date)) Of course, cadr and friends as well as custom names for accessing parts of structured lists are only suitable for handling rather flat and short lists.

Download PDF sample

Rated 4.37 of 5 – based on 6 votes