Implementing a array assignment for custom data structure
- To: mathgroup at smc.vnet.net
- Subject: [mg88874] Implementing a array assignment for custom data structure
- From: Salvatore Mangano <smangano at into-technology.com>
- Date: Tue, 20 May 2008 02:25:41 -0400 (EDT)
Lists support a convenient syntax for element assignment: a[[i]]=v Of course this syntax is syntactic sugar for: Set[Part[a, i], v] SparseArray's have a different structure than lists but still support the same syntax. This leads me to believe that I should be able to implement a custom type (akin to SparseArray) that also allows this syntax (possibly using UpValues) but for the life of me I can't see how to accomplish this. Any ideas?