MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

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? 


  • Prev by Date: Re: pattern example
  • Next by Date: Re: Export a Grid[] object without loosing it's format
  • Previous by thread: Re: Assigning part of indexed object
  • Next by thread: Re: Assigning part of indexed object