Commit ebb95e7 1 parent 07f93ee commit ebb95e7 Copy full SHA for ebb95e7
File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ Language changes
98
98
* Dictionary comprehension syntax ` [ a=>b for x in y ] ` is deprecated.
99
99
Use ` Dict(a=>b for x in y) ` instead ([ #16510 ] ).
100
100
101
+ * Parentheses are no longer allowed around iteration specifications, e.g.
102
+ ` for (i = 1:n) ` ([ #17668 ] ).
103
+
101
104
Library improvements
102
105
--------------------
103
106
Original file line number Diff line number Diff line change 1415
1415
1416
1416
; ; as above, but allows both "i=r" and "i in r"
1417
1417
(define (parse-iteration-spec s )
1418
- (let* ((lhs (parse-pipes s))
1418
+ (let* ((paren? (eqv? (require-token s) #\( ))
1419
+ (lhs (parse-pipes s))
1419
1420
(t (peek-token s)))
1420
1421
(cond ((memq t ' (= in ∈))
1421
1422
(take-token s)
1428
1429
`(= ,lhs ,rhs)))
1429
1430
((and (eq? lhs ': ) (closing-token? t))
1430
1431
': )
1432
+ ((and paren? (length= lhs 4 ) (eq? (car lhs) 'call )
1433
+ (memq (cadr lhs) ' (in ∈)))
1434
+ (syntax-deprecation s " for (...)" " for ..." )
1435
+ `(= ,@(cddr lhs)))
1436
+ ((and paren? (length= lhs 3 ) (eq? (car lhs) '= ))
1437
+ (syntax-deprecation s " for (...)" " for ..." )
1438
+ lhs)
1431
1439
(else (error " invalid iteration specification" )))))
1432
1440
1433
1441
(define (parse-comma-separated-iters s )
You can’t perform that action at this time.
0 commit comments