From: Chris Hanson Date: Thu, 5 Dec 2019 00:25:30 +0000 (-0800) Subject: Eliminate use of with-values. X-Git-Tag: mit-scheme-pucked-10.1.20~10^2~7 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8ec6ea8fe7605b621afbba3f0c209041e5c2b1a1;p=mit-scheme.git Eliminate use of with-values. --- diff --git a/src/6001/floppy.scm b/src/6001/floppy.scm index 1089ec7b4..f0cb747bc 100644 --- a/src/6001/floppy.scm +++ b/src/6001/floppy.scm @@ -449,7 +449,7 @@ then answer \"yes\" to the prompt below.") (append-string "Copying files from working directory to floppy.\n") (let* ((working-directory (read-working-directory)) (floppy-directory (read-floppy-directory))) - (with-values + (call-with-values (lambda () (three-way-sort file-record/name=? working-directory @@ -620,7 +620,7 @@ M-x rename-file, or use the `r' command in Dired.") (let ((eol (or (string-find-next-char string #\newline start end) end))) - (with-values + (call-with-values (lambda () (parse-dosls-line string start eol offset)) (lambda (filename time) @@ -867,13 +867,13 @@ M-x rename-file, or use the `r' command in Dired.") (values '() '() set*) (let ((item (member? (car set) set*))) (if item - (with-values + (call-with-values (lambda () (loop (cdr set) (delq! (car item) set*))) (lambda (set-only both set*-only) (values set-only (cons (cons (car set) (car item)) both) set*-only))) - (with-values (lambda () (loop (cdr set) set*)) + (call-with-values (lambda () (loop (cdr set) set*)) (lambda (set-only both set*-only) (values (cons (car set) set-only) both diff --git a/src/compiler/back/lapgn1.scm b/src/compiler/back/lapgn1.scm index 0d9193304..cdfffe816 100644 --- a/src/compiler/back/lapgn1.scm +++ b/src/compiler/back/lapgn1.scm @@ -69,7 +69,7 @@ USA. unspecific) remote-links)) - (with-values prepare-constants-block + (call-with-values prepare-constants-block (or process-constants-block (lambda (constants-code environment-label free-ref-label n-sections) diff --git a/src/compiler/fggen/fggen.scm b/src/compiler/fggen/fggen.scm index 4629bcb13..6dde3278b 100644 --- a/src/compiler/fggen/fggen.scm +++ b/src/compiler/fggen/fggen.scm @@ -64,7 +64,7 @@ USA. (make-expression block continuation - (with-values + (call-with-values (lambda () (let ((collect (lambda (names declarations body) diff --git a/src/compiler/fgopt/blktyp.scm b/src/compiler/fgopt/blktyp.scm index f92396736..8635f1750 100644 --- a/src/compiler/fgopt/blktyp.scm +++ b/src/compiler/fgopt/blktyp.scm @@ -95,7 +95,7 @@ USA. (set-procedure-closure-context! procedure (make-reference-context original-parent)) - (with-values + (call-with-values (lambda () (let ((uninteresting-variable? (lambda (variable) @@ -465,7 +465,7 @@ USA. bound-variables variables-nontransitively-free) true))) - (with-values + (call-with-values (lambda () (filter-bound-variables (block-bound-variables block) free-variables diff --git a/src/compiler/fgopt/delint.scm b/src/compiler/fgopt/delint.scm index e1173b4ae..c3d6de762 100644 --- a/src/compiler/fgopt/delint.scm +++ b/src/compiler/fgopt/delint.scm @@ -40,7 +40,7 @@ USA. (procedure (block-procedure block))) (let ((delete-integrations (lambda (get-names set-names!) - (with-values + (call-with-values (lambda () (find-integrated-variables (get-names procedure))) (lambda (not-integrated integrated) @@ -60,7 +60,7 @@ USA. (begin (set! deletions (eq-set-adjoin rest deletions)) (set-procedure-rest! procedure false)))) - (with-values + (call-with-values (lambda () (find-integrated-bindings (procedure-names procedure) (procedure-values procedure))) @@ -76,7 +76,7 @@ USA. (define (find-integrated-bindings names vals) (if (null? names) (values '() '() '()) - (with-values + (call-with-values (lambda () (find-integrated-bindings (cdr names) (cdr vals))) (lambda (names* values* integrated) @@ -89,7 +89,7 @@ USA. (define (find-integrated-variables variables) (if (null? variables) (values '() '()) - (with-values + (call-with-values (lambda () (find-integrated-variables (cdr variables))) (lambda (not-integrated integrated) diff --git a/src/compiler/fgopt/order.scm b/src/compiler/fgopt/order.scm index 3fed5e02c..8e3c7bb4b 100644 --- a/src/compiler/fgopt/order.scm +++ b/src/compiler/fgopt/order.scm @@ -42,7 +42,7 @@ USA. (begin (edges-disconnect-right! previous-edges) (edge-disconnect! next-edge) - (with-values + (call-with-values (lambda () (order-subproblems/application (parallel-application-node parallel) @@ -127,7 +127,7 @@ USA. (operands (list-filter-indices (cdr subproblems) (inliner/operands inliner)))) (set-inliner/operands! inliner operands) - (with-values + (call-with-values (lambda () (discriminate-items operands subproblem-simple?)) (lambda (simple complex) @@ -195,14 +195,14 @@ USA. (define (order-subproblems/out-of-line combination subproblems rest) (let ((alist (add-defaulted-subproblems! combination subproblems))) - (with-values + (call-with-values (combination-ordering (combination/context combination) (car subproblems) (cdr subproblems) (combination/model combination)) (lambda (effect-subproblems push-subproblems) (set-combination/frame-size! combination (length push-subproblems)) - (with-values + (call-with-values (lambda () (order-subproblems/maybe-overwrite-block combination push-subproblems rest alist @@ -295,7 +295,7 @@ USA. (if (and (procedure/open? model) (stack-block/static-link? model-block)) (lambda () - (with-values thunk + (call-with-values thunk (lambda (effect-subproblems push-subproblems) (values effect-subproblems @@ -306,7 +306,7 @@ USA. standard))) (define (optimized-combination-ordering context operator operands callee) - (with-values + (call-with-values (lambda () (sort-subproblems/out-of-line operands callee)) (lambda (integrated non-integrated) @@ -362,14 +362,14 @@ USA. subproblems)) (define (sort-subproblems/out-of-line all-subproblems callee) - (with-values + (call-with-values (lambda () (sort-integrated (cdr (procedure-original-required callee)) all-subproblems '() '())) (lambda (subproblems integrated non-integrated) - (with-values + (call-with-values (lambda () (sort-integrated (procedure-original-optional callee) subproblems diff --git a/src/compiler/fgopt/param.scm b/src/compiler/fgopt/param.scm index a791c67b0..e81426b39 100644 --- a/src/compiler/fgopt/param.scm +++ b/src/compiler/fgopt/param.scm @@ -163,7 +163,7 @@ parameters in registers. (or (node/bad-variables node) (let ((bad-variables (eq-set-union - (with-values (lambda () (find-node-values node)) + (call-with-values (lambda () (find-node-values node)) values->variables) (walk-next node walk-node-for-variables)))) (set-node/bad-variables! node bad-variables) @@ -223,7 +223,8 @@ parameters in registers. rvalues)))) (define (complex-parallel-constraints subproblems vars-referenced-later) - (with-values (lambda () (discriminate-items subproblems subproblem-simple?)) + (call-with-values + (lambda () (discriminate-items subproblems subproblem-simple?)) (lambda (simple complex) (let ((discriminate-by-bad-vars (lambda (subproblems) @@ -233,9 +234,9 @@ parameters in registers. (memq var vars-referenced-later)) (subproblem-free-variables subproblem)))))) (constraint-graph (make-constraint-graph))) - (with-values (lambda () (discriminate-by-bad-vars simple)) + (call-with-values (lambda () (discriminate-by-bad-vars simple)) (lambda (good-simples bad-simples) - (with-values (lambda () (discriminate-by-bad-vars complex)) + (call-with-values (lambda () (discriminate-by-bad-vars complex)) (lambda (good-complex bad-complex) (add-constraint-set! good-simples good-complex diff --git a/src/compiler/fgopt/reuse.scm b/src/compiler/fgopt/reuse.scm index 712e4bbee..a99ce8c9c 100644 --- a/src/compiler/fgopt/reuse.scm +++ b/src/compiler/fgopt/reuse.scm @@ -82,7 +82,7 @@ USA. (eq? (car adjustment) 'KNOWN) (cdr adjustment))))) (if overwritten-block - (with-values + (call-with-values (lambda () (subproblems->nodes subproblems caller-block @@ -92,7 +92,7 @@ USA. (begin (set-combination/reuse-existing-frame?! combination overwritten-block) - (with-values + (call-with-values (lambda () (order-subproblems/overwrite-block caller-block @@ -113,7 +113,7 @@ USA. (define reuse-size-limit 7) (define (subproblems->nodes subproblems caller-block overwritten-block) - (with-values + (call-with-values (lambda () (let ((n-subproblems (length subproblems))) (let ((targets @@ -136,7 +136,7 @@ USA. (list-tail subproblems n-targets)) (values (make-nodes subproblems) '())))))) (lambda (nodes extra-subproblems) - (with-values + (call-with-values (lambda () (discriminate-items nodes (lambda (node) diff --git a/src/compiler/improvements/gasn.scm b/src/compiler/improvements/gasn.scm index 3f5dc1abf..7a2d4fedf 100644 --- a/src/compiler/improvements/gasn.scm +++ b/src/compiler/improvements/gasn.scm @@ -30,7 +30,7 @@ (deallocate-registers nodes pushed registers)))))) (define (deallocate-registers nodes pushed registers) - (with-values + (call-with-values (lambda () (discriminate-items registers (lambda (register) diff --git a/src/compiler/machines/C/ctop.scm b/src/compiler/machines/C/ctop.scm index a8be8a328..97e294325 100644 --- a/src/compiler/machines/C/ctop.scm +++ b/src/compiler/machines/C/ctop.scm @@ -333,7 +333,7 @@ USA. (compiler-phase "Pseudo-Assembly" ; garbage collection (lambda () - (with-values + (call-with-values (lambda () (stringify (if (not (zero? *recursive-compilation-number*)) diff --git a/src/compiler/machines/C/stackify.scm b/src/compiler/machines/C/stackify.scm index 900b07cb3..278fc1bca 100644 --- a/src/compiler/machines/C/stackify.scm +++ b/src/compiler/machines/C/stackify.scm @@ -98,7 +98,7 @@ USA. (vector-set! info 2 #t)) (vector-set! info 0 new) info)))) - + (define (stackify/count/decrement! obj) (let ((info (stackify/table/lookup obj))) (cond ((not info) @@ -686,7 +686,7 @@ USA. (fix:+ curr-depth* 1) max-depth* regmap*)))))))) - + (define (build/unique obj prog curr-depth max-depth regmap) ;; Returns @@ -897,12 +897,13 @@ USA. (fix:max (fix:+ curr-depth 1) max-depth) regmap)) ((fake-compiled-procedure? obj) - (with-values (lambda () - (build (fake-procedure/block obj) - prog - curr-depth - max-depth - regmap)) + (call-with-values + (lambda () + (build (fake-procedure/block obj) + prog + curr-depth + max-depth + regmap)) (lambda (prog* max-depth* regmap*) (values (build/natural stackify-opcode/cc-block-to-entry @@ -941,7 +942,7 @@ USA. (conc-name stackify-escape/)) (kind false read-only true) (contents false read-only true)) - + (define (stackify/make-uuo-arity arity) (stackify-escape/make 'arity arity)) diff --git a/src/compiler/machines/i386/lapgen.scm b/src/compiler/machines/i386/lapgen.scm index c353e9379..14db2f06b 100644 --- a/src/compiler/machines/i386/lapgen.scm +++ b/src/compiler/machines/i386/lapgen.scm @@ -268,7 +268,7 @@ USA. (LAP (LEA ,target (@RO W ,pc-register (- ,label-expr ,pc-label))))))) (define (with-pc recvr) - (with-values (lambda () (get-cached-label)) + (call-with-values (lambda () (get-cached-label)) (lambda (label reg) (if label (recvr label reg) diff --git a/src/compiler/rtlgen/fndblk.scm b/src/compiler/rtlgen/fndblk.scm index 00961e3dd..ef6099f29 100644 --- a/src/compiler/rtlgen/fndblk.scm +++ b/src/compiler/rtlgen/fndblk.scm @@ -105,7 +105,7 @@ USA. (let ((end-block? (let ((end-block (block-parent block))) (lambda (block) (eq? block end-block))))) - (with-values + (call-with-values (lambda () (find-block/loop link diff --git a/src/compiler/rtlgen/fndvar.scm b/src/compiler/rtlgen/fndvar.scm index 1c93d8aaf..86802ad3e 100644 --- a/src/compiler/rtlgen/fndvar.scm +++ b/src/compiler/rtlgen/fndvar.scm @@ -207,7 +207,7 @@ USA. (values locative (variable-name lvalue))))) (define (find-block/variable context variable if-known if-ic) - (with-values + (call-with-values (lambda () (find-block context 0 @@ -227,7 +227,7 @@ USA. block locative)))) (define (nearest-ic-block-expression context) - (with-values + (call-with-values (lambda () (find-block context 0 (lambda (block) (not (block-parent block))))) (lambda (block locative) @@ -236,7 +236,7 @@ USA. locative))) (define (closure-ic-locative context block) - (with-values + (call-with-values (lambda () (find-block context 0 (lambda (block*) (eq? block* block)))) (lambda (block locative) @@ -246,7 +246,7 @@ USA. (define (block-ancestor-or-self->locative context block prefix suffix) (stack-locative-offset - (with-values + (call-with-values (lambda () (find-block context prefix (lambda (block*) (eq? block* block)))) (lambda (block* locative) diff --git a/src/compiler/rtlgen/opncod.scm b/src/compiler/rtlgen/opncod.scm index 900e635b5..6cce0e6ee 100644 --- a/src/compiler/rtlgen/opncod.scm +++ b/src/compiler/rtlgen/opncod.scm @@ -318,7 +318,7 @@ USA. '() false false))) (make-scfg (cfg-entry-node scfg) '())) (let ((temporary (rtl:make-pseudo-register))) - (with-values + (call-with-values (lambda () (generate-continuation-entry (combination/context combination) @@ -1716,7 +1716,7 @@ USA. (preamble (rtl:make-assignment temporary (rtl:make-fetch register:value)))) - (with-values + (call-with-values (lambda () (generate-continuation-entry (combination/context combination) preamble)) diff --git a/src/compiler/rtlgen/rgproc.scm b/src/compiler/rtlgen/rgproc.scm index 923c3b69f..c174ea9e8 100644 --- a/src/compiler/rtlgen/rgproc.scm +++ b/src/compiler/rtlgen/rgproc.scm @@ -64,7 +64,7 @@ USA. nentries (closure-block-entry-number block))))) (needs-entry? - (with-values + (call-with-values (lambda () (procedure-arity-encoding procedure)) (lambda (min max) (rtl:make-procedure-header @@ -76,7 +76,8 @@ USA. (rtl:make-open-procedure-header (procedure-label procedure)))))) ((procedure-rest procedure) - (with-values (lambda () (procedure-arity-encoding procedure)) + (call-with-values + (lambda () (procedure-arity-encoding procedure)) (lambda (min max) (if (open-procedure-needs-dynamic-link? procedure) (scfg*scfg->scfg! @@ -188,7 +189,7 @@ USA. (rtl:make-constant (make-unassigned-reference-trap))))))))) ((IC) - (with-values (lambda () (make-ic-cons value 'USE-ENV)) recvr)) + (call-with-values (lambda () (make-ic-cons value 'USE-ENV)) recvr)) ((TRIVIAL-CLOSURE) ;; This is not an error. ;; It can be the consequence of bad style. diff --git a/src/compiler/rtlgen/rgrval.scm b/src/compiler/rtlgen/rgrval.scm index 5e9b314fd..f95983f0d 100644 --- a/src/compiler/rtlgen/rgrval.scm +++ b/src/compiler/rtlgen/rgrval.scm @@ -30,7 +30,7 @@ USA. (declare (usual-integrations)) (define (generate/rvalue operand scfg*cfg->cfg! generator) - (with-values (lambda () (generate/rvalue* operand)) + (call-with-values (lambda () (generate/rvalue* operand)) (lambda (prefix expression) (scfg*cfg->cfg! prefix (generator expression))))) @@ -217,7 +217,7 @@ USA. *ic-procedure-headers*)) (let ((context (procedure-closure-context procedure))) (if (reference? context) - (with-values (lambda () (generate/rvalue* context)) + (call-with-values (lambda () (generate/rvalue* context)) kernel) ;; Is this right if the procedure is being closed ;; inside another IC procedure? @@ -288,7 +288,7 @@ USA. ((= (block-entry-number block*) 1) ;; Single entry point. This could use the multiclosure case ;; below, but this is simpler. - (with-values (lambda () (procedure-arity-encoding procedure)) + (call-with-values (lambda () (procedure-arity-encoding procedure)) (lambda (min max) (rtl:make-typed-cons:procedure (rtl:make-cons-closure @@ -320,7 +320,7 @@ USA. (cons procedure children))) (entries (map (lambda (proc) - (with-values + (call-with-values (lambda () (procedure-arity-encoding proc)) (lambda (min max) (list (procedure-label proc) min max)))) diff --git a/src/compiler/rtlgen/rgstmt.scm b/src/compiler/rtlgen/rgstmt.scm index 7b40656ba..3250d6cef 100644 --- a/src/compiler/rtlgen/rgstmt.scm +++ b/src/compiler/rtlgen/rgstmt.scm @@ -105,7 +105,7 @@ USA. (rvalue (definition-rvalue definition))) (generate/rvalue rvalue scfg*scfg->scfg! (lambda (expression) - (with-values (lambda () (find-definition-variable context lvalue)) + (call-with-values (lambda () (find-definition-variable context lvalue)) (lambda (environment name) (load-temporary-register scfg*scfg->scfg! environment (lambda (environment) diff --git a/src/compiler/rtlgen/rtlgen.scm b/src/compiler/rtlgen/rtlgen.scm index 8989a82ed..16f628632 100644 --- a/src/compiler/rtlgen/rtlgen.scm +++ b/src/compiler/rtlgen/rtlgen.scm @@ -86,7 +86,7 @@ USA. unspecific))) (define (generate/expression expression) - (with-values + (call-with-values (lambda () (generate/rgraph (expression-entry-node expression) generate/node)) (lambda (rgraph entry-edge) @@ -96,7 +96,7 @@ USA. (expression-debugging-info expression))))) (define (generate/procedure procedure) - (with-values + (call-with-values (lambda () (generate/rgraph (procedure-entry-node procedure) @@ -146,7 +146,7 @@ USA. (define (generate/continuation continuation) (let ((label (continuation/label continuation))) - (with-values + (call-with-values (lambda () (generate/rgraph (continuation/entry-node continuation) @@ -214,7 +214,7 @@ USA. (special-primitive-handler obj))))) (define (wrap-with-continuation-entry context prefix scfg-gen) - (with-values (lambda () (generate-continuation-entry context prefix)) + (call-with-values (lambda () (generate-continuation-entry context prefix)) (lambda (label setup cleanup) (scfg-append! setup (scfg-gen label) diff --git a/src/compiler/rtlopt/rcompr.scm b/src/compiler/rtlopt/rcompr.scm index 85b9f6a19..89c80f940 100644 --- a/src/compiler/rtlopt/rcompr.scm +++ b/src/compiler/rtlopt/rcompr.scm @@ -70,7 +70,7 @@ USA. (let ((expression (rtl:assign-expression rtl))) (if (not (rtl:expression-contains? expression nonfoldable-expression?)) - (with-values + (call-with-values (lambda () (let ((next (rinst-next rinst))) (if (rinst-dead-register? next register) @@ -114,7 +114,7 @@ USA. (phi-1 next))) (recursion (lambda (unwrap wrap) - (with-values + (call-with-values (lambda () (loop (unwrap expression))) (lambda (next expression) @@ -123,8 +123,7 @@ USA. (values false false))))))) (let ((recurse-and-search (lambda (unwrap wrap) - (with-values (lambda () - (recursion unwrap wrap)) + (call-with-values (lambda () (recursion unwrap wrap)) (lambda (next expression*) (if next (values next expression*) @@ -132,7 +131,7 @@ USA. (lambda (rtl) rtl ; ignored false)))))))) - + (cond ((interpreter-value-register? expression) (search-stopping-at expression (lambda (rtl) diff --git a/src/compiler/rtlopt/rtlcsm.scm b/src/compiler/rtlopt/rtlcsm.scm index 0f5559c0b..dce7b6b85 100644 --- a/src/compiler/rtlopt/rtlcsm.scm +++ b/src/compiler/rtlopt/rtlcsm.scm @@ -46,7 +46,7 @@ USA. (loop)))))) (define (merge-suffixes! rgraph suffixes) - (with-values + (call-with-values (lambda () (discriminate-items suffixes (lambda (suffix) @@ -169,7 +169,7 @@ USA. (let loop ((bblocks bblocks)) (if (null? bblocks) '() - (with-values (lambda () (matching-suffixes bblock (car bblocks))) + (call-with-values (lambda () (matching-suffixes bblock (car bblocks))) (lambda (sx sy adjustments) (if (or (interesting-suffix? bblock sx) (interesting-suffix? (car bblocks) sy)) @@ -215,7 +215,7 @@ USA. (adjustments '())) (if (or (null? rx) (null? ry)) (values wx wy adjustments) - (with-values + (call-with-values (lambda () (match-rtl (rinst-rtl (car rx)) (rinst-rtl (car ry)) e)) (lambda (e adjustment) diff --git a/src/edwin/artdebug.scm b/src/edwin/artdebug.scm index 90e091903..fe5eb4649 100644 --- a/src/edwin/artdebug.scm +++ b/src/edwin/artdebug.scm @@ -990,7 +990,7 @@ Prefix argument means do not kill the debugger buffer." string?) (define (print-subproblem number frame port) - (with-values (lambda () (stack-frame/debugging-info frame)) + (call-with-values (lambda () (stack-frame/debugging-info frame)) (lambda (expression environment subexpression) (print-history-level (stack-frame/compiled-code? frame) diff --git a/src/edwin/bufwmc.scm b/src/edwin/bufwmc.scm index 429ea1a0e..abcda0ecf 100644 --- a/src/edwin/bufwmc.scm +++ b/src/edwin/bufwmc.scm @@ -57,13 +57,13 @@ USA. (%window-line-end-index? window index)))) (define (buffer-window/index->y window index) - (with-values (lambda () (start-point-for-index window index)) + (call-with-values (lambda () (start-point-for-index window index)) (lambda (start-index start-y line-start-index) line-start-index (predict-y window start-index start-y index)))) (define (buffer-window/index->coordinates window index) - (with-values (lambda () (start-point-for-index window index)) + (call-with-values (lambda () (start-point-for-index window index)) (lambda (start-index start-y line-start-index) (let ((group (%window-group window)) (char-image-strings (%window-char-image-strings window)) @@ -88,7 +88,7 @@ USA. (make-mark (%window-group window) index)))) (define (buffer-window/coordinates->index window x y) - (with-values (lambda () (start-point-for-y window y)) + (call-with-values (lambda () (start-point-for-y window y)) (lambda (start-index start-y) (predict-index window start-index start-y x y)))) @@ -97,7 +97,7 @@ USA. (let ((index (mark-index mark))) (and (fix:<= (%window-group-start-index window) index) (fix:<= index (%window-group-end-index window)) - (with-values (lambda () (start-point-for-index window index)) + (call-with-values (lambda () (start-point-for-index window index)) (lambda (start-index start-y line-start-index) line-start-index (predict-index-visible? window start-index start-y index)))))) diff --git a/src/edwin/comred.scm b/src/edwin/comred.scm index 320e7467e..c11f03cf4 100644 --- a/src/edwin/comred.scm +++ b/src/edwin/comred.scm @@ -385,7 +385,7 @@ USA. (set-car! history (cons (command-name command) arguments)) (set! command-history (cdr history)))))) (cond ((string? specification) - (with-values + (call-with-values (lambda () (let ((end (string-length specification))) (let loop @@ -403,7 +403,7 @@ USA. index end #\newline))) - (with-values + (call-with-values (lambda () (interactive-argument (string-ref specification index) @@ -411,7 +411,7 @@ USA. (+ index 1) (or newline end)))) (lambda (argument expression from-tty?) - (with-values + (call-with-values (lambda () (if newline (loop (+ newline 1)) diff --git a/src/edwin/dabbrev.scm b/src/edwin/dabbrev.scm index 38130754b..b57813045 100644 --- a/src/edwin/dabbrev.scm +++ b/src/edwin/dabbrev.scm @@ -98,7 +98,7 @@ with the next possible expansion not yet tried." (current-point)))) (if (zero? n) (values (mark-permanent-copy start) expansion) - (with-values + (call-with-values (lambda () (dabbrevs-search start pattern direction do-case)) (lambda (loc expansion) @@ -159,8 +159,8 @@ with the next possible expansion not yet tried." (if (or expansion (> which 0)) (step3 loc expansion) ;; Look forward - (with-values (lambda () - (search&setup-table (max 1 (- which)) false)) + (call-with-values + (lambda () (search&setup-table (max 1 (- which)) false)) (lambda (loc expansion) (set-variable! last-dabbrevs-direction -1) (step3 loc expansion))))) @@ -168,8 +168,8 @@ with the next possible expansion not yet tried." ;; Try looking backward unless inhibited. (if (< which 0) (step2 loc false) - (with-values (lambda () - (search&setup-table (max 1 which) true)) + (call-with-values + (lambda () (search&setup-table (max 1 which) true)) (lambda (loc expansion) (if (not expansion) (set-variable! last-dabbrevs-expansion-location diff --git a/src/edwin/edtfrm.scm b/src/edwin/edtfrm.scm index eb078787d..79436cdce 100644 --- a/src/edwin/edtfrm.scm +++ b/src/edwin/edtfrm.scm @@ -164,7 +164,7 @@ USA. (window-cursor-enable! cursor-window))) (define-method editor-frame (:button-event! editor-frame button x y) - (with-values + (call-with-values (lambda () (inferior-containing-coordinates editor-frame x y buffer-frame?)) (lambda (frame relative-x relative-y) diff --git a/src/edwin/edtstr.scm b/src/edwin/edtstr.scm index ae279ccba..13bde6089 100644 --- a/src/edwin/edtstr.scm +++ b/src/edwin/edtstr.scm @@ -50,7 +50,7 @@ USA. (let ((bufferset (make-bufferset initial-buffer)) (screen (display-type/make-screen display-type make-screen-args))) (initialize-screen-root-window! screen bufferset initial-buffer) - (with-values + (call-with-values (lambda () (display-type/get-input-operations display-type screen)) (lambda (halt-update? peek-no-hang peek read) (%make-editor name diff --git a/src/edwin/rmail.scm b/src/edwin/rmail.scm index 902b9e7cd..bda7d6715 100644 --- a/src/edwin/rmail.scm +++ b/src/edwin/rmail.scm @@ -824,7 +824,7 @@ and reverse search is specified by a negative numeric arg." regexp "..."))) (message msg) - (with-values + (call-with-values (lambda () (without-clipping buffer (lambda () @@ -1044,7 +1044,7 @@ original message into it." (make-mail-buffer (without-clipping buffer (lambda () - (with-values (lambda () (original-header-limits memo)) + (call-with-values (lambda () (original-header-limits memo)) (lambda (start end) `(("To" "") ("Subject" @@ -1603,7 +1603,7 @@ Leaves original message, deleted, before the undigestified messages." (define (memoize-messages buffer start end) (let ((memo (buffer-msg-memo buffer))) - (with-values + (call-with-values (lambda () (memoize-messages* start end @@ -1620,7 +1620,7 @@ Leaves original message, deleted, before the undigestified messages." (let ((next (msg-memo/next memo))) (if (not next) (memoize-messages buffer start end) - (with-values (lambda () (memoize-messages* start end memo)) + (call-with-values (lambda () (memoize-messages* start end memo)) (lambda (start tail) (mark-temporary! start) (set-msg-memo/next! tail next) diff --git a/src/edwin/things.scm b/src/edwin/things.scm index a4601044a..872983b81 100644 --- a/src/edwin/things.scm +++ b/src/edwin/things.scm @@ -195,7 +195,7 @@ USA. buffer (ref-variable-object tab-width)))) tab-width))) - (with-values + (call-with-values (lambda () (compute-horizontal-space target-column (mark-column point) diff --git a/src/edwin/tterm.scm b/src/edwin/tterm.scm index 5b81cc181..50abbd3fd 100644 --- a/src/edwin/tterm.scm +++ b/src/edwin/tterm.scm @@ -45,7 +45,7 @@ USA. (let ((baud-rate (output-port/baud-rate (console-i/o-port))) (x-size (output-port/x-size (console-i/o-port))) (y-size (output-port/y-size (console-i/o-port)))) - (make-screen (with-values + (make-screen (call-with-values (lambda () (compute-scrolling-costs description baud-rate @@ -1113,7 +1113,7 @@ USA. (output-n screen command n-lines))) (define (compute-scrolling-costs description baud-rate x-size y-size) - (with-values + (call-with-values (lambda () (i/d-line-cost-vectors description baud-rate @@ -1122,7 +1122,7 @@ USA. (or (ts-insert-line description) (ts-reverse-scroll description)))) (lambda (insert-line-cost insert-line-next-cost) - (with-values + (call-with-values (lambda () (i/d-line-cost-vectors description baud-rate diff --git a/src/runtime/conpar.scm b/src/runtime/conpar.scm index 083c58761..188402129 100644 --- a/src/runtime/conpar.scm +++ b/src/runtime/conpar.scm @@ -550,7 +550,7 @@ USA. #f)) (define (stack-frame->control-point stack-frame) - (with-values (lambda () (print-stack-frame stack-frame)) + (call-with-values (lambda () (print-stack-frame stack-frame)) (lambda (element-stream next-control-point) (make-control-point (stack-frame/interrupt-mask stack-frame) @@ -575,7 +575,7 @@ USA. (if (eq? (stack-frame/return-address stack-frame) return-address/join-stacklets) (values (stream) (vector-ref (stack-frame/elements stack-frame) 1)) - (with-values + (call-with-values (lambda () (let ((next (stack-frame/%next stack-frame))) (cond ((stack-frame? next) diff --git a/src/runtime/debug.scm b/src/runtime/debug.scm index 765c8b558..8e3b773ce 100644 --- a/src/runtime/debug.scm +++ b/src/runtime/debug.scm @@ -439,7 +439,7 @@ USA. (let loop ((frame top-subproblem) (level 0)) (if frame (begin - (with-values (lambda () (stack-frame/debugging-info frame)) + (call-with-values (lambda () (stack-frame/debugging-info frame)) (lambda (expression environment subexpression) subexpression (terse-print-expression level @@ -868,7 +868,7 @@ USA. (set-dstate/number-of-reductions! dstate (improper-list-length (stack-frame/reductions stack-frame))) - (with-values (lambda () (stack-frame/debugging-info stack-frame)) + (call-with-values (lambda () (stack-frame/debugging-info stack-frame)) (lambda (expression environment subexpression) (set-dstate/expression! dstate expression) (set-dstate/subexpression! dstate subexpression) diff --git a/src/runtime/environment.scm b/src/runtime/environment.scm index 5969c36d1..75b3a282d 100644 --- a/src/runtime/environment.scm +++ b/src/runtime/environment.scm @@ -562,7 +562,7 @@ USA. (dbg-block/length block)))) (let ((stack-link (dbg-block/stack-link block))) (cond ((not stack-link) - (with-values + (call-with-values (lambda () (stack-frame/resolve-stack-address frame diff --git a/src/runtime/process.scm b/src/runtime/process.scm index ff1aa64d5..f3b08a2ff 100644 --- a/src/runtime/process.scm +++ b/src/runtime/process.scm @@ -423,9 +423,9 @@ USA. #f #f #f)) (define (start-pipe-subprocess filename arguments environment) - (with-values make-pipe + (call-with-values make-pipe (lambda (child-read parent-write) - (with-values make-pipe + (call-with-values make-pipe (lambda (parent-read child-write) (let ((process (make-subprocess filename arguments environment @@ -436,7 +436,7 @@ USA. process)))))) (define (start-pty-subprocess filename arguments environment) - (with-values open-pty-master + (call-with-values open-pty-master (lambda (master-channel master-name slave-name) master-name (make-subprocess filename arguments environment diff --git a/src/runtime/xeval.scm b/src/runtime/xeval.scm index 241936ce2..d02ed0e4a 100644 --- a/src/runtime/xeval.scm +++ b/src/runtime/xeval.scm @@ -40,7 +40,7 @@ USA. ((scode-constant? expression) expression) (else - (with-values (lambda () (split-environment environment)) + (call-with-values (lambda () (split-environment environment)) (lambda (bound-names interpreter-environment) (hook/extended-scode-eval (cond ((null? bound-names)