commit 366ee57b2aa6428b2bf823fd044a9d5685a716cc
parent 27fc80861aab7e7ba9eea88e3fb3cb309c9c3a2c
Author: Leandro Facchinetti <me@leafac.com>
Date: Thu, 14 Apr 2016 07:21:07 -0400
Fix `dot notation for nested hash lookups' example
The previous snippet had a guard of "fender" clause that always resulted in an error, even on valid calls. The fixed snippet performs a check and only errors in bad cases.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/index.rkt b/index.rkt
@@ -1212,7 +1212,8 @@ messages when used in error. Let's try to do that here.
[(_ chain)
#'(hash.refs chain #f)]
[(_ chain default)
- (raise-syntax-error #f "Expected hash.key0[.key1 ...] [default]" stx #'chain)
+ (unless (identifier? #'chain)
+ (raise-syntax-error #f "Expected hash.key0[.key1 ...] [default]" stx #'chain))
(let* ([chain-str (symbol->string (syntax->datum #'chain))]
[ids (for/list ([str (in-list (regexp-split #rx"\\." chain-str))])
(format-id #'chain "~a" str))])