<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://dev.eiffel.com/index.php?action=history&amp;feed=atom&amp;title=Reattachment</id>
		<title>Reattachment - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://dev.eiffel.com/index.php?action=history&amp;feed=atom&amp;title=Reattachment"/>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Reattachment&amp;action=history"/>
		<updated>2026-05-01T19:26:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7802&amp;oldid=prev</id>
		<title>Alexander Kogtenkov: /* Unification of feature signature */ Added an example to demonstrate that feature signature may not be known in advance</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7802&amp;oldid=prev"/>
				<updated>2007-03-30T14:54:07Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Unification of feature signature: &lt;/span&gt; Added an example to demonstrate that feature signature may not be known in advance&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:54, 30 March 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivations to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivations to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Unification of feature signature ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Unification of feature signature ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;c&amp;gt;&lt;/ins&gt;EIF_UNION&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/c&amp;gt; &lt;/ins&gt;structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Unfortunately, this cannot be done in advance due to multiple inheritance and feature merging. This way a feature that has nothing to do with formal generic parameters could be called through this formal-generic capable interface. Consider the following example:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;e&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class A feature&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;	f (x: INTEGER) is do ... end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class B [G] feature&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;	f (x: G) is do ... end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class C inherit&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;	A&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;	B [INTEGER]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;		undefine&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;			f&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;		end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/e&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;When generating the code for the feature &amp;lt;e&amp;gt;{A}.f&amp;lt;/e&amp;gt;, there is no knowledge that it will be called with a polymorphic argument of type &amp;lt;c&amp;gt;EIF_UNION&amp;lt;/c&amp;gt; (even if we avoid optimization and &amp;quot;box&amp;quot; expanded arguments instead of using &amp;lt;c&amp;gt;EIF_UNION&amp;lt;/c&amp;gt;, the argument type &amp;lt;c&amp;gt;EIF_REFERENCE&amp;lt;/c&amp;gt; will be different from the expected &amp;lt;c&amp;gt;EIF_INTEGER&amp;lt;/c&amp;gt;).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Access to attributes ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Access to attributes ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely accessed from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely accessed from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alexander Kogtenkov</name></author>	</entry>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7801&amp;oldid=prev</id>
		<title>Alexander Kogtenkov: /* Reattachment of generic derivations in classic */ Divided the text into several sections</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7801&amp;oldid=prev"/>
				<updated>2007-03-30T14:04:00Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Reattachment of generic derivations in classic: &lt;/span&gt; Divided the text into several sections&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:04, 30 March 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All features in a generic derivation with an expanded parameter that involve this generic parameter should be able to handle the case when they are called on a target where this generic parameter is reference, i.e. they should be able to take reference arguments and return reference result.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All features in a generic derivation with an expanded parameter that involve this generic parameter should be able to handle the case when they are called on a target where this generic parameter is reference, i.e. they should be able to take reference arguments and return reference result.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reattachment of generic derivations in classic ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reattachment of generic derivations in classic ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# '''&lt;/del&gt;Dynamic dispatch&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''.&lt;/del&gt;The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivations to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=== &lt;/ins&gt;Dynamic dispatch &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# '''&lt;/del&gt;Unification of feature signature&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''. &lt;/del&gt;In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivations to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# '''&lt;/del&gt;Access to attributes&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''. &lt;/del&gt;Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely accessed from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=== &lt;/ins&gt;Unification of feature signature &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;#&lt;/del&gt;# Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;#&lt;/del&gt;# Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=== &lt;/ins&gt;Access to attributes &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely accessed from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alexander Kogtenkov</name></author>	</entry>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7744&amp;oldid=prev</id>
		<title>Alexander Kogtenkov: /* Reattachment of generic derivations in classic */ Cosmetics</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7744&amp;oldid=prev"/>
				<updated>2007-03-27T11:48:58Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Reattachment of generic derivations in classic: &lt;/span&gt; Cosmetics&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:48, 27 March 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All features in a generic derivation with an expanded parameter that involve this generic parameter should be able to handle the case when they are called on a target where this generic parameter is reference, i.e. they should be able to take reference arguments and return reference result.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All features in a generic derivation with an expanded parameter that involve this generic parameter should be able to handle the case when they are called on a target where this generic parameter is reference, i.e. they should be able to take reference arguments and return reference result.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reattachment of generic derivations in classic ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reattachment of generic derivations in classic ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''Dynamic dispatch'''&lt;/ins&gt;.The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivations to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivations to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''Unification of feature signature'''. In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;access &lt;/del&gt;from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;# '''Access to attributes'''. &lt;/ins&gt;Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;accessed &lt;/ins&gt;from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alexander Kogtenkov</name></author>	</entry>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7736&amp;oldid=prev</id>
		<title>Seilerm: typo fixed</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7736&amp;oldid=prev"/>
				<updated>2007-03-26T20:41:02Z</updated>
		
		<summary type="html">&lt;p&gt;typo fixed&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:41, 26 March 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reattachment of generic derivations in classic ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reattachment of generic derivations in classic ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;derivatins &lt;/del&gt;to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;derivations &lt;/ins&gt;to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely access from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely access from the generic derivations with reference parameters. This involves two changes in code generation:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Seilerm</name></author>	</entry>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7735&amp;oldid=prev</id>
		<title>Alexander Kogtenkov: Added an initial version with the description of implementation on classic</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Reattachment&amp;diff=7735&amp;oldid=prev"/>
				<updated>2007-03-26T14:54:38Z</updated>
		
		<summary type="html">&lt;p&gt;Added an initial version with the description of implementation on classic&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category: Compiler]]&lt;br /&gt;
[[Category: ECMA]]&lt;br /&gt;
See also: [[Object_Layout]], [[Dynamic_Binding]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Conformance of expanded types to (particular) reference types implies that objects of generically derived types with expanded parameters can be attached to generically derived types with reference parameters (e.g., &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; can be attached to &amp;lt;e&amp;gt;ARRAY [ANY]&amp;lt;/e&amp;gt;).&lt;br /&gt;
All features in a generic derivation with an expanded parameter that involve this generic parameter should be able to handle the case when they are called on a target where this generic parameter is reference, i.e. they should be able to take reference arguments and return reference result.&lt;br /&gt;
== Reattachment of generic derivations in classic ==&lt;br /&gt;
# In addition to the &amp;quot;normal&amp;quot; version of the method generated for a particular feature, a new stub can be generated so that its arguments/result types match those of the generic derivation with reference generic parameters. In order to avoid additional pressure on garbage collector, the values passed to/from the generated methods can be embedded in an EIF_UNION structure that allows to pass objects of basic and reference types &amp;quot;as is&amp;quot;, while objects of user-defined expanded type still need to be &amp;quot;boxed&amp;quot; and kept in the heap.&lt;br /&gt;
# The feature &amp;lt;e&amp;gt;{ROUT_TABLE}.is_polymorphic&amp;lt;/e&amp;gt; has to be modified so that it allows for different generic derivatins to share the same table, because now it becomes possible to reattach generic derivations with expanded parameters to the generic derivations with reference parameters. Though not all the reattachments are possible (e.g., no reattachment is possible between the types &amp;lt;e&amp;gt;ARRAY [INTEGER]&amp;lt;/e&amp;gt; and &amp;lt;e&amp;gt;ARRAY [BOOLEAN]&amp;lt;/e&amp;gt;), it's too complicated and/or resource consuming to create the tables for every generic derivation and types that conform to it.&lt;br /&gt;
# Attributes that are declared of a formal generic type (or as of type, anchored to a feature of a formal generic type) have to be accessed as functions so that they can be safely access from the generic derivations with reference parameters. This involves two changes in code generation:&lt;br /&gt;
## Promotion of &amp;lt;e&amp;gt;ATTRIBUTE_B&amp;lt;/e&amp;gt; to &amp;lt;e&amp;gt;FEATURE_B&amp;lt;/e&amp;gt; if an attribute type is (directly or indirectly) a formal generic.&lt;br /&gt;
## Generation of an accessor for the attribute by setting the field &amp;lt;e&amp;gt;generated_in&amp;lt;/e&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Alexander Kogtenkov</name></author>	</entry>

	</feed>