[Lazarus] [OT/Readability] Re: Error: Generics without specialization cannot be used as a type for a variable
Lukasz Sokol
el.es.cr at gmail.com
Tue May 10 10:38:20 CEST 2011
Hi Peter,
I recall you are using the lazarus mailing list to send posts/mails,
but you use gmane as news reader ? (if it is not your case, ignore above statement...)
>From the headers it appears you are using Exim to post.
It is incredibly frustrating since something mangles tabs/spaces/newlines on
the way (AND I don't think it's my Thunderbird...? because everybody else's posts are OK)
rendering the code you post completely unreadable.
Annotated below:
On 10/05/2011 01:28, Peter Williams wrote:
[...]
> Okay, except that Island is not meant to be an integer. See here:
the below code is received as one long line, totally unformatted, totally no newlines,
quoted by Thunderbird, even in quoting I see one long line (reader window wraps it automatically,
thus becoming even less readable...)
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
> line 88Tmap_detail = Object FTerrain : Terrain_type; FTerrain_char : char; Fdescription : description_type; Fx, Fy, Flocation_number : integer; Fexits : exit_type; end; // The Island class definition Generic TIsland<T> = class Items : array of Tmap_detail; public constructor Create(AList: TList); procedure Add( Value : Tmap_detail ); end;
[...]
> I have (though all of these posts) been trying to follow the instructions for GENERICS on this page:
> http://wiki.lazarus.freepascal.org/Generics
> This page makes no reference to SPECIALIZE keyword.
also the below line I quote I can only see a very very long one, no line breaks.
> Can someone please provide an example of using a TList and an object (as in my code) so that I had access to a custom Tlist with the Sort procedure... which is really my reason for needing this.
> Best Regards,Peter
(My mailer/news reader is Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Thunderbird/3.1.10 )
I'm not using automatic wordwrap in my postings too, because code sometimes exceeds 80 chars and thunderbird is
less forgiving than Lazarus' SynEdit when it comes to wrapping;
But at least please try to format your code manually when you paste it...
If nobody else sees this but me, feel free to ignore; but if somebody has
a similar issue reading your posts, please back me :)
Kind Regards,
Lukasz
More information about the Lazarus
mailing list