<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body>
<div style="font-size: 13.333333015441895px; font-family: tahoma;
color: rgb(0, 0, 0); font-weight: 400; font-style: normal;
background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0, 0);
background-position: 0% 0%; background-repeat: repeat repeat;">I'd
like to have a generic objcclass that would add some extra
functionality for multiple base types. I don't have a lot of
experience with generics, but this compiles:</div>
<div style="font-size: 13.333333015441895px; font-family: tahoma;
color: rgb(0, 0, 0); font-weight: 400; font-style: normal;
background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0, 0);
background-position: 0% 0%; background-repeat: repeat repeat;"> </div>
<div style="font-size: 13.333333015441895px; font-family: tahoma;
color: rgb(0, 0, 0); font-weight: 400; font-style: normal;
background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0, 0);
background-position: 0% 0%; background-repeat: repeat repeat;">------</div>
<div style="font-size: 13.333333015441895px; font-family: tahoma;
color: rgb(0, 0, 0); font-weight: 400; font-style: normal;
background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0, 0);
background-position: 0% 0%; background-repeat: repeat repeat;">
generic TMyControl<T: TWinControl> = class(T)<br>
private<br>
FField: string;</div>
<div style="font-size: 13.333333015441895px; font-family: tahoma;
color: rgb(0, 0, 0); font-weight: 400; font-style: normal;
background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0, 0);
background-position: 0% 0%; background-repeat: repeat repeat;">
procedure Foo;<br>
end;</div>
<div id="signature" style="font-family: tahoma; color: rgb(0, 0, 0);
font-size: 13.333333015441895px; font-weight: 400; font-style:
normal; background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0, 0);
background-position: 0% 0%; background-repeat: repeat repeat;">
<div> </div>
<div> TMyEdit = specialize TMyControl<TEdit>;</div>
<div>
<div style="font-size: 13.333333015441895px; font-family:
tahoma; color: rgb(0, 0, 0); font-weight: 400; font-style:
normal; background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0,
0); background-position: 0% 0%; background-repeat: repeat
repeat;">------</div>
</div>
<div><br>
and this fails with the error 'Class or interface type expected,
but got "NSView"':</div>
<div> </div>
<div>
<div style="font-size: 13.333333015441895px; font-family:
tahoma; color: rgb(0, 0, 0); font-weight: 400; font-style:
normal; background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0,
0); background-position: 0% 0%; background-repeat: repeat
repeat;">------</div>
generic NSMyView<T: NSView> = objcclass(T)<br>
private<br>
FField: string;<br>
procedure Foo; message 'Foo:';<br>
end;</div>
<div>
<div style="font-size: 13.333333015441895px; font-family:
tahoma; color: rgb(0, 0, 0); font-weight: 400; font-style:
normal; background-image: none; background-size: auto;
background-attachment: scroll; background-origin: padding-box;
background-clip: border-box; background-color: rgba(0, 0, 0,
0); background-position: 0% 0%; background-repeat: repeat
repeat;">------<br>
<br>
</div>
</div>
<div>The documentation doesn't mention it, so I'm assuming it's
just not implemented. Is that something that could be
supported? Would it be difficult to do so? Are there any
existing Objective Pascal specific tricks I could use to avoid
duplicating all of the fields/code?</div>
<div> </div>
<div>Thanks!</div>
<div>Zoë Peterson</div>
<div>Scooter Software</div>
</div>
</body>
</html>