diff options
| author | Masaya Tojo <masaya@tojo.tokyo> | 2022-05-25 22:57:59 +0900 | 
|---|---|---|
| committer | Masaya Tojo <masaya@tojo.tokyo> | 2022-05-25 22:59:24 +0900 | 
| commit | d54fc9446d97cbecbe4825493046f8216a578737 (patch) | |
| tree | 1d660ad96d0addd591878cd156b885e4eb856e67 | |
| parent | 59259b514654aada9a1bc9279a160b68e507474c (diff) | |
Rename pict-sexp to pict-cons.
| -rw-r--r-- | main.rkt | 15 | 
1 files changed, 6 insertions, 9 deletions
| @@ -67,7 +67,7 @@        '()        (cdr lst))) -(define (%pict-sexp sexp height-list) +(define (%pict-cons sexp height-list)    (when (and (pair? height-list)               (<= 0 (car height-list)))      (amb)) @@ -76,7 +76,7 @@       (let*-values ([(p) (pict-cons-cell sexp)]                     [(p-1 height-list)                      (let-values ([(pict-cdr cdr-height-list) -                                  (%pict-sexp (cdr sexp) (cdr* height-list))]) +                                  (%pict-cons (cdr sexp) (cdr* height-list))])                        (values (arrow-from-cdr p pict-cdr)                                (cons 0 cdr-height-list)))]                     [(p-2 height-list) @@ -86,20 +86,17 @@                                     (amb (cons len height-list)                                          (retry (add1 len) (map sub1 height-list))))])                        (let-values ([(pict-car height-list) -                                    (%pict-sexp (car sexp) height-list)]) +                                    (%pict-cons (car sexp) height-list)])                          (values (arrow-from-car len p pict-car)                                  (map (λ (x) (+ x len)) height-list))))])         (values (lt-superimpose p-1 p-2) height-list))]      [else       (values (pict-atom sexp) (cons 0 (cdr* height-list)))])) -(define (pict-sexp sexp) +(define (pict-cons sexp)    (call-with-amb     (thunk      (define-values (result height-list) -      (%pict-sexp sexp '())) +      (%pict-cons sexp '()))      result))) -(provide/contract [pict-sexp (any/c . -> . pict?)]) - -(define show pict-sexp) -(provide/contract [show (any/c . -> . pict?)]) +(provide/contract [pict-cons (any/c . -> . pict?)]) | 
