You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#lang rhombus/static
def [n, ...]:
for List (i: 0..3):
i
def [lst :: List, ...]:
for List (i: 0..3):
[i]
[lst.remove(n), ...]
or
#lang rhombus/static
def [n, ...]:
for List (i: 0..3):
i
class Foo(x):
method add(y):
Foo(x + y)
def [foo :: Foo, ...]:
for List (i: 0..3):
Foo(i)
[foo.add(n), ...]
these programs error with “cannot use repetition binding as an expression.” On the other hand, simply switching to dynamic dispatch makes them work.
The text was updated successfully, but these errors were encountered:
A bigger problem, I think, is that dot providers are currently invoked with a parsed expression as the left-hand side. This means that the dot provider for methods cannot have a chance to compose the compound repetition before the left-hand side has already been processed. A possible solution is to allow dot providers to be aware of repetitions (and be invoked with a parsed repetition as the left-hand side), but there are likely other drawbacks.
Consider something like
or
these programs error with “cannot use repetition binding as an expression.” On the other hand, simply switching to dynamic dispatch makes them work.
The text was updated successfully, but these errors were encountered: