Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3281

Re: Assigning part of indexed object

From "Fabrice P. Laussy" <fabrice.laussy@n0spam-gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Assigning part of indexed object
Date 2011-06-24 11:52 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iu1tp3$9kr$1@smc.vnet.net> (permalink)
References <itsjn7$8u7$1@smc.vnet.net> <itv7ve$pbu$1@smc.vnet.net>

Show all headers | View raw


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? 

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Assigning part of indexed object "Fabrice P. Laussy" <fabrice.laussy@n0spam-gmail.com> - 2011-06-22 11:29 +0000
  Re: Assigning part of indexed object Valeri Astanoff <astanoff@gmail.com> - 2011-06-23 11:25 +0000
  Re: Assigning part of indexed object magma <maderri2@gmail.com> - 2011-06-23 11:26 +0000
  Re: Assigning part of indexed object Oleksandr Rasputinov <oleksandr_rasputinov@hmamail.com> - 2011-06-23 11:27 +0000
    Re: Assigning part of indexed object "Fabrice P. Laussy" <fabrice.laussy@n0spam-gmail.com> - 2011-06-24 11:52 +0000
      Re: Assigning part of indexed object Oleksandr Rasputinov <oleksandr_rasputinov@hmamail.com> - 2011-06-25 09:31 +0000
  Re: Assigning part of indexed object Leonid Shifrin <lshifr@gmail.com> - 2011-06-25 09:30 +0000
    Re: Assigning part of indexed object Oleksandr Rasputinov <oleksandr_rasputinov@hmamail.com> - 2011-06-26 10:31 +0000
    Re: Assigning part of indexed object Oleksandr Rasputinov <oleksandr_rasputinov@hmamail.com> - 2011-06-26 21:40 +0000
  Re: Assigning part of indexed object Leonid Shifrin <lshifr@gmail.com> - 2011-06-29 21:31 +0000
    Re: Assigning part of indexed object "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-07-01 00:46 +0000

csiph-web