; ======================================================================
;
; Structure and Interpretation of Computer Programs
; (trial answer to excercises)
;
; 计算机程序的构造和解释(习题试解)
;
; created: code17 08/20/05
; modified:
; (保持内容完整不变前提下,可以任意转载)
; ======================================================================
;; SICP No.2.47
;; List Version
(define (make-frame origin edge1 edge2)
(list origin edge1 edge2))
(define (origin f) (car f))
(define (edge1 f) (cadr f))
(define (edge2 f) (caddr f))
;; Pair Version
(define (make-frame origin edge1 edge2)
(cons origin (cons edge1 edge2)))
(define (origin f) (car f))
(define (edge1 f) (cadr f))
(define (edge2 f) (cddr f))