"Print all ways of forming positive integer n by multiplying two positive
integers together, ordered by the first term. Then, return whether the sum
of the proper divisors of n is greater than n.
A proper divisor of n evenly divides
;AMB EVALUATOR FROM SECTION 4.3 OF ; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS ;Matches code in ch4.scm. ; To run the sample programs and exercises, code below also includes ; - enlarged primitive-procedures list ; - support for Let (as noted in f
; ADV.SCM ; This file contains the definitions for the objects in the adventure ; game and some utility procedures. (define-class (place name) (instance-vars (directions-and-neighbors '() (things '() (people '() (entry-procs '() (exit-procs '() (method (t
; #1. ; Exercise 1.16 (define (invariant-fast-expt b n) (cond (= n 0) 1) (even? n) (* (/ 1 (invariant-fast-expt (square b) (/ n 2) (invariant-fast-expt (square b) (/ n 2) (else (* (/ 1 (* b (invariant-fast-expt b (- n 1) (* b (invariant-fast-expt b (- n 1
; ; ; ;
Return the decimal value of the Roman numeral whose digits are contained in roman-numeral. Roman-numeral is assumed to contain only Roman digits. Sample call: (decimal-value 'xiv), which should return 14.
(define (decimal-value roman-numeral) (ele
; berkeley.scm 4.03.01 Tue Jul 22 17:22:59 2003 ; ; NOTE: THE MASTER COPY OF THIS FILE IS MAINTAINED BY EECS INSTRUCTIONAL ; SUPPORT. IF YOU MAKE CHANGES HERE THEY WILL GO AWAY. ; ; Compatibility library for UCB Scheme (STk 4.0.1 derivative) as used ; in
APL version of metacircular evaluator.
; SETTING UP THE ENVIRONMENT ; ; ; ; APL primitives aren't part of the environment. They are not subject to redefinition, for example. They are kept in a separate list. So the initial environment is em
;METACIRCULAR EVALUATOR THAT SEPARATES ANALYSIS FROM EXECUTION ; FROM SECTION 4.1.7 OF STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS ;Matches code in ch4.scm ;This file can be loaded into Scheme as a whole. ;*NOTE*This file loads the metacircular eval