Timeline for Inheritance in Mathematica using pattern matching on UpValues
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 17, 2014 at 9:42 | comment | added | faysou | Personally I use the ideas exposed in my answer here mathematica.stackexchange.com/a/999/66 with MyClass[object], methods are in the UpValues of MyClass and properties in the DownValues of object. I use the package I quoted above for inheritance. | |
| Mar 16, 2014 at 13:48 | comment | added | shopper | @FaysalAberkane: Yeah, I was looking at that. It definitely has some elements of what I'm trying to do, but not everything. Perhaps more directly applicable is Leonid's impressive question/answer here: link My only problem with his OOP implementation is that the functionality he has provided yields a syntax that is much closer to C++ or Java than Mathematica. | |
| Mar 15, 2014 at 22:56 | comment | added | faysou | Related: library.wolfram.com/infocenter/MathSource/671 I don't know if this would solve your problem, you would have to test. | |
| Mar 15, 2014 at 18:18 | vote | accept | shopper | ||
| Mar 15, 2014 at 15:49 | answer | added | Mr.Wizard | timeline score: 8 | |
| Mar 15, 2014 at 14:16 | comment | added | shopper | @DanielLichtblau: Thanks for your response, but that's not exactly what I'm looking for. I've posted an edit that will hopefully clarify things a bit. | |
| Mar 15, 2014 at 14:15 | history | edited | shopper | CC BY-SA 3.0 | added 1399 characters in body |
| Mar 13, 2014 at 19:19 | comment | added | Daniel Lichtblau | Like this? DefineDerivedClass[class_, superClass_] := Module[{uvs},(*Assign UpValues associated with superClass to class*) uvs = UpValues[superClass]; uvs = uvs /. superClass :> class; UpValues[class] = Join[UpValues[class], uvs] ] | |
| Mar 13, 2014 at 18:14 | history | asked | shopper | CC BY-SA 3.0 |