Skip to content

Commit 838fc96

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

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/core/points.rkt

Lines changed: 12 additions & 9 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,14 @@
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)
47-
(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)
44+
(define (split-pcontext pctx num-a num-b)
45+
(match-define (pcontext pts exs) pctx)
46+
(unless (= (+ num-a num-b) (vector-length pts))
47+
(error 'split-pcontext
48+
"Cannot split pcontext of size ~a into ~a and ~a"
49+
(vector-length pts)
50+
num-a
51+
num-b))
4952
(define-values (pts-a pts-b) (vector-split-at pts num-a))
5053
(define-values (exs-a exs-b) (vector-split-at exs num-a))
5154
(values (pcontext pts-a exs-a) (pcontext pts-b exs-b)))

0 commit comments

Comments
 (0)