Returns Some(t)
if name
can be selected dynamically on qual
, None
if not.
Returns Some(t)
if name
can be selected dynamically on qual
, None
if not.
t
specifies the type to be passed to the applyDynamic/selectDynamic call (unless it is NoType)
NOTE: currently either returns None or Some(NoType) (scala-virtualized extends this to Some(t) for selections on staged Structs)
Translate selection that does not typecheck according to the normal rules into a selectDynamic/applyDynamic.
Translate selection that does not typecheck according to the normal rules into a selectDynamic/applyDynamic.
foo.method("blah") ~~> foo.applyDynamic("method")("blah") foo.method(x = "blah") ~~> foo.applyDynamicNamed("method")(("x", "blah")) foo.varia = 10 ~~> foo.updateDynamic("varia")(10) foo.field ~~> foo.selectDynamic("field") foo.arr(10) = 13 ~~> foo.selectDynamic("arr").update(10, 13)
what if we want foo.field == foo.selectDynamic("field") == 1, but foo.field = 10
== foo.selectDynamic("field").update(10)
== ()
what would the signature for selectDynamic be? (hint: it needs to depend on whether an update call is coming or not)
need to distinguish selectDynamic and applyDynamic somehow: the former must return the selected value, the latter must accept an apply or an update