Thank you all for your reply!
1. At first we need simple inheritance like making different styles for
a div or table elements all inherited some features
2. There is one parent, grand parent and grand grand parent
3. We need to have children inherit properties from their parent BUT
4. can overload (override) some features they have themselves
Using small code I could implement one step inheritance, but one would like
to have such feature from transclusion like {{!!template}}
A Demo
This demo implement one step inheritance e.g child has only one parent and
no grand parent
look at : http://hirad.tiddlyspot.com/
Here in examples we have a parent with three fields: first-name, last-name,
age
If a tiddler has not a field or a field with empty value, one expects child
inherits its property (field/value) from parent
- parent, child1, child2 is an example of what Mario explained and this
is the current mechanism in Tiddlywiki e.g. what is called templating
- parent, child1-p2, child2-p2 is an example of what I said in the
question, simple inheritance
- All child may not have all fields parent has or may have an empty
field
- A child if has not set a field (here a property) it will inherit
that filed / value from its parent
- NOTE: In this example child2-p2 has NO *last-name* field and its
value has inherited from parent.
This is the content of parent2 which uses a little code to implement the
above simple inheritance
I have gone through what Mark proposed ONE parent ...
*What do you think?*
This if work can have many use cases!
--Mohammad
On Friday, December 6, 2019 at 3:09:50 PM UTC+3:30, PMario wrote:
>
> Hi Mohamad,
>
> I think your example doesn't work, since the "inheritence" in this case
> won't hold. The "child" always needs its own last-name.
>
> eg: Let's say parent-1 and parent-2 have different last-names. The child
> will be transcluded into both parents and would therefore have 3 different
> last-names.
>
> In reality a child can get:
>
> 1) child gets parent-1 last-name
> 2) child gets parent-2 last- name
> 3) a combination of parent-1 and parent-2 last-name
> and may be
> 4) If child is old enough it can decide to get a completely different
> name.
>
> ------------------
>
> I think inheritance violates the tiddlers number 1 rule: A tiddler is the
> smallest unit of content, that makes sense on its own.
>
> have fun!
> mario
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/afbc4066-1fae-4a21-a2ea-27dd408aa756%40googlegroups.com.