# Error report: in handling values arity

**URL:** <https://racket.discourse.group/t/error-report-in-handling-values-arity/3448>\
**Category:** General\
**Tags:** drracket, bug\
**Created:** [December 26, 2024, 10:12am UTC](https://racket.discourse.group/t/error-report-in-handling-values-arity/3448 "2024-12-26T10:12:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danprager](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/danprager/32/279_2.png) [@danprager](https://racket.discourse.group/u/danprager)\
**Post date:** [December 26, 2024, 10:12am UTC](https://racket.discourse.group/t/error-report-in-handling-values-arity/3448/1 "2024-12-26T10:12:29Z")

</div>

Minimal example:

```scheme
#lang racket

(define (f x y)
  (values x y))

(define a (f 1 2)) ; error - as opposed to e.g. (define-values (a b) (f 1 2))

```

At least in Dr Racket, the error message lacks the usual "X" link to the source location.

```scheme
result arity mismatch;
 expected number of values not received
  expected: 1
  received: 2

```

Version 8.14 [cs].

---

<div class="post-metadata">

**Author:** ![bremner](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bremner](https://racket.discourse.group/u/bremner)\
**Post date:** [December 26, 2024, 4:29pm UTC](https://racket.discourse.group/t/error-report-in-handling-values-arity/3448/2 "2024-12-26T16:29:25Z")

</div>

Daniel Prager via Racket Discourse  
[notifications@racket.discoursemail.com](mailto:notifications@racket.discoursemail.com) writes:

> (define a (f 1 2)) ; error - as opposed to e.g. (define-values (a b) (f 1 2))

If understand correctly, you think this should not be an error. I  
suspect that things are working as intended, but maybe it helps us  
collectively to understand the issue if you explain what value a should  
get if this is not an error.

d

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [December 26, 2024, 5:52pm UTC](https://racket.discourse.group/t/error-report-in-handling-values-arity/3448/3 "2024-12-26T17:52:57Z")

</div>

```scheme
#lang racket/base

(define a (values 1 2))

```

This program provokes the same error:

```scheme
result arity mismatch;
 expected number of values not received
  expected: 1
  received: 2

```

In DrRacket the red cross (the "X") is missing, i.e. the error doesn't have a source location.

FWIW the expansion is:

```scheme
(module anonymous-module racket/base
  (printing:module-begin 
    (module configure-runtime '#%kernel 
       (#%require racket/runtime-config) 
       (configure #f)) 
    (define a (values 1 2))))

```

---

<div class="post-metadata">

**Author:** ![danprager](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/danprager/32/279_2.png) [@danprager](https://racket.discourse.group/u/danprager)\
**Post date:** [December 26, 2024, 7:00pm UTC](https://racket.discourse.group/t/error-report-in-handling-values-arity/3448/4 "2024-12-26T19:00:27Z")

</div>

> If understand correctly, you think this should not be an error.

No, I agree that it is an error.

In this instance the error location is not reported.

As I wrote in the initial error report:

> At least in Dr Racket, the error message lacks the usual "X" link to the source location.

Dan
