(if (scode/sequence? expression)
;; This is done in a funny way to enforce processing in sequence order.
;; In this way, compile-by-procedures compiles in a predictable order.
- (let ((first (generate/subproblem/effect
- block continuation context
- (scode/sequence-first expression) 'SEQUENCE-2-SECOND
- expression)))
+ (let ((first-action
+ (generate/subproblem/effect
+ block continuation context
+ (scode/sequence-immediate-first expression) 'SEQUENCE-2-SECOND
+ expression)))
((scfg*ctype->ctype! continuation)
- first
+ first-action
(generate/expression block continuation context
- (scode/sequence-second expression))))
+ (scode/sequence-immediate-second expression))))
(error "Not a sequence" expression)))
(define (generate/conditional block continuation context expression)
(define-integrable (sequence? object)
(object-type? (ucode-type sequence-2) object))
-(define-integrable (%sequence-first sequence) (&pair-car sequence))
-(define-integrable (%sequence-second sequence) (&pair-cdr sequence))
+(define-integrable (%sequence-immediate-first sequence) (&pair-car sequence))
+(define-integrable (%sequence-immediate-second sequence) (&pair-cdr sequence))
(define-guarantee sequence "SCode sequence")
(define (sequence-first expression)
(guarantee-sequence expression 'SEQUENCE-FIRST)
- (%sequence-first expression))
+ (%sequence-immediate-first expression))
(define (sequence-second expression)
(guarantee-sequence expression 'SEQUENCE-SECOND)
- (%sequence-second expression))
+ (%sequence-immediate-second expression))
(define (sequence-immediate-first expression)
(guarantee-sequence expression 'SEQUENCE-IMMEDIATE-FIRST)
- (%sequence-first expression))
+ (%sequence-immediate-first expression))
(define (sequence-immediate-second expression)
(guarantee-sequence expression 'SEQUENCE-IMMEDIATE-SECOND)
- (%sequence-second expression))
+ (%sequence-immediate-second expression))
(define (sequence-immediate-actions expression)
(guarantee-sequence expression 'SEQUENCE-IMMEDIATE-ACTIONS)
- (list (%sequence-first expression)
- (%sequence-second expression)))
+ (list (%sequence-immediate-first expression)
+ (%sequence-immediate-second expression)))
(define (sequence-actions expression)
(if (sequence? expression)
- (append! (sequence-actions (%sequence-first expression))
- (sequence-actions (%sequence-second expression)))
+ (append! (sequence-actions (%sequence-immediate-first expression))
+ (sequence-actions (%sequence-immediate-second expression)))
(list expression)))
(define (sequence-components expression receiver)
(define (copy-sequence expression)
(guarantee-sequence expression 'COPY-SEQUENCE)
- (%make-sequence (%sequence-first expression)
- (%sequence-second expression)))
+ (%make-sequence (%sequence-immediate-first expression)
+ (%sequence-immediate-second expression)))
\f
;;;; Conditional
(define (unsyntax-lambda-body-sequence body)
(if (sequence? body)
- (let ((first-action (sequence-first body)))
+ (let ((first-action (sequence-immediate-first body)))
(if (block-declaration? first-action)
`((DECLARE ,@(block-declaration-text first-action))
- ,@(unsyntax-sequence (sequence-second body)))
+ ,@(unsyntax-sequence (sequence-immediate-second body)))
(unsyntax-sequence body)))
(list (unsyntax-object body))))
\f