Skip to content

Commit 5ad2fd4

Browse files
committed
Make sure we consistently use "pcontext" not "context" for pcontexts
1 parent 3aeb648 commit 5ad2fd4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/core/points.rkt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
(define *pcontext* (make-parameter #f))
2727
(struct pcontext (points exacts) #:prefab)
2828

29-
(define (in-pcontext context)
30-
(in-parallel (in-vector (pcontext-points context)) (in-vector (pcontext-exacts context))))
29+
(define (in-pcontext pcontext)
30+
(in-parallel (in-vector (pcontext-points pcontext)) (in-vector (pcontext-exacts pcontext))))
3131

32-
(define (pcontext-length context)
33-
(vector-length (pcontext-points context)))
32+
(define (pcontext-length pcontext)
33+
(vector-length (pcontext-points pcontext)))
3434

3535
(define/contract (mk-pcontext points exacts)
3636
(-> (non-empty-listof (listof any/c)) (non-empty-listof any/c) pcontext?)
@@ -41,11 +41,10 @@
4141
(for/lists (pts* exs*) ([(pt ex) (in-pcontext pcontext)] other ...) body ...)])
4242
(mk-pcontext pts* exs*)))
4343

44-
(define (split-pcontext context num-a num-b)
45-
(define num-total (vector-length (pcontext-points context)))
46-
(unless (= (+ num-a num-b) num-total)
44+
(define (split-pcontext pcontext num-a num-b)
45+
(match-define (pcontext pts exs) pcontext)
46+
(unless (= (+ num-a num-b) (vector-length pts))
4747
(error 'split-pcontext "Cannot split pcontext of size ~a into ~a and ~a" num-total num-a num-b))
48-
(match-define (pcontext pts exs) context)
4948
(define-values (pts-a pts-b) (vector-split-at pts num-a))
5049
(define-values (exs-a exs-b) (vector-split-at exs num-a))
5150
(values (pcontext pts-a exs-a) (pcontext pts-b exs-b)))

0 commit comments

Comments
 (0)