Changeset 13654 in project


Ignore:
Timestamp:
03/10/09 10:03:47 (11 years ago)
Author:
Kon Lovett
Message:

Save.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/stack/tags/2.0.0/stack.scm

    r13536 r13654  
    1616  (local)
    1717  (no-procedure-checks)
    18   (no-bound-checks)
    1918  (bound-to-procedure
    2019    ##sys#signal-hook
     
    7574(define-inline (%stack-pop! stk)
    7675  (%stack-count-dec! stk 1)
    77         (let ([ls (%stack-list stk)])
     76        (let ((ls (%stack-list stk)))
    7877                (%stack-list-set! stk (%cdr ls))
    7978                (%car ls) ) )
     
    8887
    8988(define-inline (%stack-node-ref loc stk idx)
    90   (let ([pr (%list-pair-ref (%stack-list stk) idx)])
     89  (let ((pr (%list-pair-ref (%stack-list stk) idx)))
    9190                (if (not (%null? pr)) pr
    9291                          (##sys#signal-hook #:bounds-error loc "out of range" idx 0 (%stack-count stk)) ) ) )
     
    147146(define (list->stack ls)
    148147  (%check-list 'list->stack ls)
    149         (let ([stk (%make-stack)])
     148        (let ((stk (%make-stack)))
    150149    (%stack-count-set! stk (%length ls))
    151150    (%stack-list-set! stk (%list-copy ls))
     
    185184  (%check-index 'stack-cut! start 0 end)
    186185  (%check-index 'stack-cut! end start (%fx+ (%stack-count stk) 1))
    187   (let ([cnt (%fx- end start)])
     186  (let ((cnt (%fx- end start)))
    188187    (%stack-count-dec! stk cnt)
    189188    ; From the top?
    190189    (if (%fx= 0 start)
    191190        ;then removing leading elements
    192         (let* ([spr (%stack-list stk)]
    193                [epr (%list-pair-ref spr (%fx- cnt 1))]
    194                [ls spr])
     191        (let* ((spr (%stack-list stk))
     192               (epr (%list-pair-ref spr (%fx- cnt 1)))
     193               (ls spr))
    195194          (%stack-list-set! stk (%cdr epr))
    196195          (%set-cdr!/immediate epr '())
    197196          ls )
    198197        ;else removing interior elements
    199         (let* ([spr (%stack-node-ref 'stack-cut! stk (%fx- start 1))]
    200                [epr (%list-pair-ref spr cnt)]
    201                [ls (%cdr spr)])
     198        (let* ((spr (%stack-node-ref 'stack-cut! stk (%fx- start 1)))
     199               (epr (%list-pair-ref spr cnt))
     200               (ls (%cdr spr)))
    202201          (%set-cdr!/maybe-immediate spr (%cdr epr))
    203202          (%set-cdr!/immediate epr '())
Note: See TracChangeset for help on using the changeset viewer.