File tree Expand file tree Collapse file tree 14 files changed +99
-14
lines changed Expand file tree Collapse file tree 14 files changed +99
-14
lines changed Original file line number Diff line number Diff line change 44 "../interp-defun.rkt "
55 "../interp-io.rkt " )
66
7- (test-runner (λ p (interp (parse p))))
8- (test-runner-io (λ (s . p) (interp/io (parse p) s)))
7+ (define (closure->proc xs e r)
8+ ;; Could make this better by calling the interpreter,
9+ ;; but it's only used in tests where all we care about
10+ ;; is that you get a procedure.
11+ (lambda _
12+ (error "This function is not callable. " )))
13+
14+ (test-runner
15+ (λ p
16+ (match (interp (parse p))
17+ [(Closure xs e r) (closure->proc xs e r)]
18+ [v v])))
19+ (test-runner-io
20+ (λ (s . p)
21+ (match (interp/io (parse p) s)
22+ [(cons (Closure xs e r) o)
23+ (cons (closure->proc xs e r) o)]
24+ [r r])))
Original file line number Diff line number Diff line change 248248 (check-equal? (run '(match (box 1 ) [(box x) x] [_ 2 ]))
249249 1 )
250250
251- ;; Loot examples
251+ ;; Loot examples
252+ (check-true (procedure? (run '(λ (x) x))))
252253 (check-equal? (run '((λ (x) x) 5 ))
253254 5 )
254255
Original file line number Diff line number Diff line change 3030 (string)
3131 (build-string (heap-ref i)
3232 (lambda (j)
33- (char-ref (+ i 8 ) j))))]))
33+ (char-ref (+ i 8 ) j))))]
34+ [(? proc-bits? i)
35+ (lambda _
36+ (error "This function is not callable. " ))]))
3437
3538(define (untag i)
3639 (arithmetic-shift (arithmetic-shift i (- (integer-length ptr-mask)))
Original file line number Diff line number Diff line change 44 "../interp-defun.rkt "
55 "../interp-io.rkt " )
66
7- (test-runner (λ p (interp (parse p))))
8- (test-runner-io (λ (s . p) (interp/io (parse p) s)))
7+ (define (closure->proc xs e r)
8+ ;; Could make this better by calling the interpreter,
9+ ;; but it's only used in tests where all we care about
10+ ;; is that you get a procedure.
11+ (lambda _
12+ (error "This function is not callable. " )))
13+
14+ (test-runner
15+ (λ p
16+ (match (interp (parse p))
17+ [(Closure xs e r) (closure->proc xs e r)]
18+ [v v])))
19+ (test-runner-io
20+ (λ (s . p)
21+ (match (interp/io (parse p) s)
22+ [(cons (Closure xs e r) o)
23+ (cons (closure->proc xs e r) o)]
24+ [r r])))
Original file line number Diff line number Diff line change 248248 (check-equal? (run '(match (box 1 ) [(box x) x] [_ 2 ]))
249249 1 )
250250
251- ;; Loot examples
251+ ;; Loot examples
252+ (check-true (procedure? (run '(λ (x) x))))
252253 (check-equal? (run '((λ (x) x) 5 ))
253254 5 )
254255
Original file line number Diff line number Diff line change 3737 (string)
3838 (build-string (heap-ref i)
3939 (lambda (j)
40- (char-ref (+ i 8 ) j)))))]))
40+ (char-ref (+ i 8 ) j)))))]
41+ [(? proc-bits? i)
42+ (lambda _
43+ (error "This function is not callable. " ))]))
4144
4245(define (untag i)
4346 (arithmetic-shift (arithmetic-shift i (- (integer-length ptr-mask)))
Original file line number Diff line number Diff line change 44 "../interp-defun.rkt "
55 "../interp-io.rkt " )
66
7- (test-runner (λ p (interp (parse p))))
8- (test-runner-io (λ (s . p) (interp/io (parse p) s)))
7+ (define (closure->proc xs e r)
8+ ;; Could make this better by calling the interpreter,
9+ ;; but it's only used in tests where all we care about
10+ ;; is that you get a procedure.
11+ (lambda _
12+ (error "This function is not callable. " )))
13+
14+ (test-runner
15+ (λ p
16+ (match (interp (parse p))
17+ [(Closure xs e r) (closure->proc xs e r)]
18+ [v v])))
19+ (test-runner-io
20+ (λ (s . p)
21+ (match (interp/io (parse p) s)
22+ [(cons (Closure xs e r) o)
23+ (cons (closure->proc xs e r) o)]
24+ [r r])))
Original file line number Diff line number Diff line change 248248 (check-equal? (run '(match (box 1 ) [(box x) x] [_ 2 ]))
249249 1 )
250250
251- ;; Loot examples
251+ ;; Loot examples
252+ (check-true (procedure? (run '(λ (x) x))))
252253 (check-equal? (run '((λ (x) x) 5 ))
253254 5 )
254255
Original file line number Diff line number Diff line change 3737 (string)
3838 (build-string (heap-ref i)
3939 (lambda (j)
40- (char-ref (+ i 8 ) j)))))]))
40+ (char-ref (+ i 8 ) j)))))]
41+ [(? proc-bits? i)
42+ (lambda _
43+ (error "This function is not callable. " ))]))
44+
4145
4246(define (untag i)
4347 (arithmetic-shift (arithmetic-shift i (- (integer-length ptr-mask)))
Original file line number Diff line number Diff line change 44 "../interp-defun.rkt "
55 "../interp-io.rkt " )
66
7- (test-runner (λ p (interp (parse p))))
8- (test-runner-io (λ (s . p) (interp/io (parse p) s)))
7+ (define (closure->proc xs e r)
8+ ;; Could make this better by calling the interpreter,
9+ ;; but it's only used in tests where all we care about
10+ ;; is that you get a procedure.
11+ (lambda _
12+ (error "This function is not callable. " )))
13+
14+ (test-runner
15+ (λ p
16+ (match (interp (parse p))
17+ [(Closure xs e r) (closure->proc xs e r)]
18+ [v v])))
19+ (test-runner-io
20+ (λ (s . p)
21+ (match (interp/io (parse p) s)
22+ [(cons (Closure xs e r) o)
23+ (cons (closure->proc xs e r) o)]
24+ [r r])))
You can’t perform that action at this time.
0 commit comments