www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ddc9d3e953d4643148e2223e9acd03f6be129f58
parent fc8ab37c3f8a2de12855bd9f184a66cef9725c4d
Author: Ryan Culpepper <ryanc@racket-lang.org>
Date:   Wed, 16 Jun 2010 16:37:25 -0600

macro-stepper: simplified partition code

original commit: e9a8e92585e029410245f30c218ce8cbebe15fb3

Diffstat:
Mcollects/macro-debugger/syntax-browser/partition.rkt | 18++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/collects/macro-debugger/syntax-browser/partition.rkt b/collects/macro-debugger/syntax-browser/partition.rkt @@ -83,22 +83,16 @@ ;; simplified : hash[(listof nat) => nat] (define simplified (make-hash)) - ;; unsimplified : hash[(listof nat) => nat] - (define unsimplified (make-hash)) - ;; next-number : nat (define next-number 0) (define/public (get-partition stx) - (let ([umarks (get-marks stx)]) - (or (hash-ref unsimplified umarks #f) - (let ([smarks (simplify-marks umarks)]) - (or (hash-ref simplified smarks #f) - (let ([n next-number]) - (hash-set! simplified smarks n) - (hash-set! unsimplified umarks n) - (set! next-number (add1 n)) - n)))))) + (let ([marks (simplify-marks (get-marks stx))]) + (or (hash-ref simplified marks #f) + (let ([n next-number]) + (hash-set! simplified marks n) + (set! next-number (add1 n)) + n)))) (define/public (same-partition? a b) (= (get-partition a) (get-partition b)))