Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

This method is incidentally related to How to Set parts of indexed lists?

This method is incidentally related to How to Set parts of indexed lists?

added 113 characters in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

This method is incidentally related to How to Set parts of indexed lists?


This method is incidentally related to How to Set parts of indexed lists?

added 170 characters in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

Perhaps though it would be better for these functions to ignore your construct rather than mutating it errantly.

Attributes[setDiscreteData] = HoldFirst; setDiscreteData[s_Symbol, rhs_] := With[{a := $DD[s]}, Set[s,a new_]= rhs;  s=. ^:= a =(ClearAll[s]; new;a=.); aSet[s, new_] ^:= rhs; a = new;  Length[s] ^:= a // Query["tally", Tr, Last]; ] 

The Symbol may be reset to normal (all definitions cleared) using Unset:

dd=. 

Perhaps though it would be better for these functions to ignore your construct rather than mutating it errantly.

Attributes[setDiscreteData] = HoldFirst; setDiscreteData[s_Symbol, rhs_] := With[{a := $DD[s]}, Set[s, new_] ^:= a = new; a = rhs;  Length[s] ^:= a // Query["tally", Tr, Last]; ] 

Perhaps it would be better for these functions to ignore your construct rather than mutating it errantly.

Attributes[setDiscreteData] = HoldFirst; setDiscreteData[s_Symbol, rhs_] := With[{a := $DD[s]}, a = rhs;  s=. ^:= (ClearAll[s]; a=.); Set[s, new_] ^:= a = new;  Length[s] ^:= a // Query["tally", Tr, Last]; ] 

The Symbol may be reset to normal (all definitions cleared) using Unset:

dd=. 
shorten code; clarify use
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k
Loading
added 58 characters in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k
Loading
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k
Loading