# CS ≠ BC for call-with-values

**URL:** https://racket.discourse.group/t/cs-bc-for-call-with-values/1284
**Category:** Questions & Answers
**Tags:** question, racket-cs-versus-bc
**Created:** [September 7, 2022, 4:16pm UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284 "2022-09-07T16:16:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![joskoot](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/joskoot/32/1964_2.png) [@joskoot](https://racket.discourse.group/u/joskoot)
#### Post date: [September 7, 2022, 4:16pm UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284/1 "2022-09-07T16:16:25Z")

</div>

...  
Running the following program with DrRacket BC gives other results than DrRacket CS.  
Can someone tell me why? Is the difference intended? Thanks.  
...

```scheme
#lang racket/base 
; version 8.6 ; windows 10 enterprise
; runs differently on BC and CS.

(struct function (f)
 #:inspector (make-sibling-inspector)
 #:constructor-name make-function
 #:property prop:procedure 0)

(define-syntax-rule (catch expr)
 (with-handlers
  ((exn:fail?
    (λ (exn)
     (fprintf
      (current-error-port)
      "~a~n"
      (exn-message exn)))))
  expr))

(define namespace (make-base-namespace))

(define call/wv
 (namespace-variable-value
  'call-with-values
  #t
  (λ () (writeln 'schapen))
  namespace))

(define (tag x) (printf "~n~s~n" x))
(define (thunk) (values 1 2 3))

(tag 'aap) ; ok in both CS and BC
(call/wv thunk list)

(tag 'noot) ; exception in CS, ok in BC
(catch (call/wv thunk (make-function list)))

(tag 'mies) ; exception in CS, ok in BC
(catch (call/wv (make-function thunk) list))

(tag 'wim) ; exception in CS, ok in BC
(catch (call/wv (make-function thunk) (make-function list)))

(tag 'zus) ; #f in CS, #t in BC
(eq? call-with-values call/wv)

```

---

<div class="post-metadata">

### Author: ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)
#### Post date: [September 7, 2022, 5:34pm UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284/2 "2022-09-07T17:34:05Z")

</div>

This looks like a bug in Racket CS. Note that replacing the definition of `call/wv` with `(eval 'call-with-values namespace)` makes the problem go away.

---

<div class="post-metadata">

### Author: ![joskoot](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/joskoot/32/1964_2.png) [@joskoot](https://racket.discourse.group/u/joskoot)
#### Post date: [September 7, 2022, 7:44pm UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284/3 "2022-09-07T19:44:23Z")

</div>

Thanks for the prompt answer.

 ![DC369554041A4649A528B20B10730B39.png](https://global.discourse-cdn.com/free1/uploads/racket/original/1X/2ad4c25f471d2cfc2782215e9bb5a535b2545175.png)

---

<div class="post-metadata">

### Author: ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)
#### Post date: [September 7, 2022, 11:26pm UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284/4 "2022-09-07T23:26:27Z")

</div>

I've pushed a repair for the next version.

---

<div class="post-metadata">

### Author: ![joskoot](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/joskoot/32/1964_2.png) [@joskoot](https://racket.discourse.group/u/joskoot)
#### Post date: [September 8, 2022, 12:03am UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284/5 "2022-09-08T00:03:42Z")

</div>

That's rapid, Matthew, thanks.
