File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,20 @@ similar `${...}` syntax for values based on variables: for example `${#var}`
315
315
is used for the length of ` $var ` . This means ` ${...} ` expressions should not
316
316
seem too weird to developers familiar with these scripting languages.
317
317
318
+ A proposal for counting sequence repetitions was made in [ RFC 88] . That RFC
319
+ proposed several options for additional syntax, however the issue was
320
+ postponed to after the 1.0 release. This RFC addresses the needs of RFC 88,
321
+ and also goes further, as it proposes a more general syntax useful for more
322
+ than just counting repetitions, such as obtaing the index of the current
323
+ repetition. Since the generated values are integer literals, it also
324
+ addresses the ability to index tuples in repetitions (using ` tup.${index()} ` ),
325
+ which was noted as an omission in RFC 88. It's also not possible to implement
326
+ efficiently as a procedural macro, as the procedural macro would not have
327
+ access to the repetition counts without generating a sequence and then
328
+ counting it again.
329
+
330
+ [ RFC 88 ] : https://github.com/rust-lang/rfcs/pull/88
331
+
318
332
# Unresolved questions
319
333
[ unresolved-questions ] : #unresolved-questions
320
334
You can’t perform that action at this time.
0 commit comments