On Sun, 22 Jan 2017, Sven Schreiber wrote:
Am 22.01.2017 um 01:18 schrieb Allin Cottrell:
> It would be good to have the same sort of thing working on the left-hand
> side (assignment to an arbitrarily nested member of a compound object).
> We're not there yet but I'm hopeful... Stay tuned.
Great news! Would it make the parsing easier if some new syntactical element
were introduced? (Like requiring extra parentheses, as in (b.matarr[3])[2:3]
?) But I guess in principle the strict left-to-right ordering should give the
same information...
Thanks for the suggestion, but actually we don't need any new
syntactical device; as you say, strict left-to-right should do the job
provided it's engineered correctly.
I'm currently working on supporting arbitrary nesting on the left-hand
side of assignments (on a new "gentest" branch in git). In principle
this isn't a lot more difficult than on the right but in practice it's
quite complex because it involves replacing a good deal of accumulated
ad-hocery with a systematic treatment. In my testing branch I've got
things such as this working:
<hansl>
bundles bs = array(1)
bs[1].num = 3
eval bs[1].num^3
bs[1].mat = I(3)
bs[1].mat[2,2] = 17
eval bs[1].mat
</hansl>
However, various things that are formulated in terms of the old ad hoc
approach are broken at present and it'll take a while to ensure that
the new approach gets used consistently.
Allin