cleanup of stepper's shared.rkt

This commit is contained in:
John Clements 2010-12-07 20:44:02 -08:00
parent 5456e83ce4
commit b0c6154ae0

View File

@ -1,8 +1,6 @@
#lang racket #lang racket
(require "my-macros.rkt" (require scheme/class)
srfi/26
scheme/class)
; CONTRACTS ; CONTRACTS
@ -283,11 +281,11 @@
(define (list-partition lst n) (define (list-partition lst n)
(if (= n 0) (if (= n 0)
(2vals null lst) (vector null lst)
(if (null? lst) (if (null? lst)
(list-ref lst 0) ; cheap way to generate exception (list-ref lst 0) ; cheap way to generate exception
(let*-2vals ([(first rest) (list-partition (cdr lst) (- n 1))]) (match-let* ([(vector first rest) (list-partition (cdr lst) (- n 1))])
(2vals (cons (car lst) first) rest))))) (vector (cons (car lst) first) rest)))))
; (define expr-read read-getter) ; (define expr-read read-getter)
; (define set-expr-read! read-setter) ; (define set-expr-read! read-setter)
@ -482,7 +480,7 @@
(cond [(or (stepper-syntax-property stx 'stepper-skipto) (cond [(or (stepper-syntax-property stx 'stepper-skipto)
(stepper-syntax-property stx 'stepper-skipto/discard)) (stepper-syntax-property stx 'stepper-skipto/discard))
=> =>
(cut update <> stx (cut skipto/auto <> traversal transformer) traversal)] (lambda (x) (update x stx (lambda (y) (skipto/auto y traversal transformer)) traversal))]
[else (transformer stx)])) [else (transformer stx)]))
; small test case: ; small test case: