File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ Language changes
41
41
* ` isa ` is now parsed as an infix operator with the same precedence as ` in `
42
42
([ #19677 ] ).
43
43
44
+ * The identifier ` _ ` can be assigned, but accessing its value is deprecated,
45
+ allowing this syntax to be used in the future for discarding values ([ #9343 ] , [ #18251 ] ).
46
+
44
47
Breaking changes
45
48
----------------
46
49
Original file line number Diff line number Diff line change 99
99
(or (memq (car e) ' (toplevel line module import importall using export
100
100
error incomplete))
101
101
(and (eq? (car e) 'global ) (every symbol? (cdr e))))))
102
+ (if (eq? e '_ )
103
+ (syntax-deprecation #f " _ as an rvalue" " " ))
102
104
e)
103
105
(else
104
106
(let ((last *in-expand*))
Original file line number Diff line number Diff line change @@ -3293,15 +3293,20 @@ f(x) = yt(x)
3293
3293
(define (compile e break-labels value tail )
3294
3294
(if (or (not (pair? e)) (memq (car e) ' (null ssavalue quote inert top core copyast the_exception $
3295
3295
globalref outerref cdecl stdcall fastcall thiscall llvmcall)))
3296
- (let ((e (if (and arg-map (symbol? e))
3297
- (get arg-map e e)
3298
- e)))
3299
- (cond (tail (emit-return e))
3300
- (value e)
3301
- ((or (eq? e 'true ) (eq? e 'false )) #f )
3302
- ((symbol? e) (emit e) #f ) ; ; keep symbols for undefined-var checking
3303
- ((and (pair? e) (eq? (car e) 'outerref )) (emit e) #f ) ; ; keep globals for undefined-var checking
3304
- ((and (pair? e) (eq? (car e) 'globalref )) (emit e) #f ) ; ; keep globals for undefined-var checking
3296
+ (let ((e1 (if (and arg-map (symbol? e))
3297
+ (get arg-map e e)
3298
+ e)))
3299
+ (if (and value (or (eq? e '_ )
3300
+ (and (pair? e) (or (eq? (car e) 'outerref )
3301
+ (eq? (car e) 'globalref ))
3302
+ (eq? (cadr e) '_ ))))
3303
+ (syntax-deprecation #f " _ as an rvalue" " " ))
3304
+ (cond (tail (emit-return e1))
3305
+ (value e1)
3306
+ ((or (eq? e1 'true ) (eq? e1 'false )) #f )
3307
+ ((symbol? e1) (emit e1) #f ) ; ; keep symbols for undefined-var checking
3308
+ ((and (pair? e1) (eq? (car e1) 'outerref )) (emit e1) #f ) ; ; keep globals for undefined-var checking
3309
+ ((and (pair? e1) (eq? (car e1) 'globalref )) (emit e1) #f ) ; ; keep globals for undefined-var checking
3305
3310
(else #f )))
3306
3311
(case (car e)
3307
3312
((call new foreigncall)
You can’t perform that action at this time.
0 commit comments