expander: another improvement to make-readtable's error message

Currently `(make-readtable #f #\a 'dispatch-macro)` produces the error
message

```
; make-readtable: expected procedure argument after symbol argument
;   given: 'dispatch-macro
```

which is very confusing, because it sounds like `'dispatch-macro` is
incorrect, but it is in fact correct already.

This PR adjusts the error message to:

```
; make-readtable: expected procedure argument after symbol argument
;   symbol: 'dispatch-macro
```

which is the convention that is already used when the mode argument is not given.
This commit is contained in:
Sorawee Porncharoenwase 2021-04-16 16:55:55 +07:00 committed by Matthew Flatt
parent bad18f5be6
commit 73381c3ad3
3 changed files with 12 additions and 9 deletions

View File

@ -54518,7 +54518,7 @@ static const char *startup_source =
"(if(char? mode_0)"
" \"expected readtable or #f argument after character argument\""
" \"expected procedure argument after symbol argument\")"
" \"given\""
" (if (char? mode_0) \"character\" \"symbol\")"
" mode_0))"
"(void))"
"(values))))"

View File

@ -61329,13 +61329,15 @@
"expected 'non-terminating-macro after #f")))
(begin
(if (null? (cddr args_1))
(raise-arguments-error
'make-readtable
(if (char? mode_0)
"expected readtable or #f argument after character argument"
"expected procedure argument after symbol argument")
"given"
mode_0)
(let ((app_0
(if (char? mode_0)
"expected readtable or #f argument after character argument"
"expected procedure argument after symbol argument")))
(raise-arguments-error
'make-readtable
app_0
(if (char? mode_0) "character" "symbol")
mode_0))
(void))
(let ((target_0 (caddr args_1)))
(let ((rest-args_0 (cdddr args_1)))

View File

@ -81,7 +81,8 @@
(if (char? mode)
"expected readtable or #f argument after character argument"
"expected procedure argument after symbol argument")
"given" mode))
(if (char? mode) "character" "symbol")
mode))
(define target (caddr args))
;; Update the readtable