[Date Index] [Thread Index] [Author Index]
Re: Assigning part of indexed object
Dear all, Thanks for the solution. Supplemented with Oleksandr Rasputinov's fix: > Unprotect[Set]; > Set[sym_[[part_]], val_] := sym = ReplacePart[sym, part -> val]; > Protect[Set]; it works splendidly. In "some elements of Mathematica Design (1992)" [http://goo.gl/nm1tT], Stephan Wolfram makes a point where one should resist the temptation to design functions to do things that look natural for them to do, as they could break dramatically later on. Here we have a clear case where Set seems it ought to work as redesigned by Oleksandr. Is there any reason for this not being the default behaviour?