Hello, everybody.
Assigning property of an Entity changes the value of a property (or creates a new Entity and even EntityType and registers it in EntityStores).
Syntax like assigning to the property seems to be the only documented way to change the value associated with the property:
Entity["NewClass", "NewEntity"]["prop"] = 1;
But mass updating of Entities using Do does not work:
Do[e["prop"] = 2, {e, EntityList["NewClass"]}] (*Set::write: Tag Entity in NewEntity[prop] is Protected.*)
I think this is because of magic of how Do (and Table) handle expressions.
Surprisingly, isolating the variables using With solves the issue:
Do[With[{a = e}, a["prop"] = 1000], {e, EntityList["NewClass"]}]
Is this an expected behaviour?
Any insights on how Do-like functions process their first arguments are welcome.
Best regards, Pavel