Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-05

TTypeKind, strings and chars

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Maciej Izak

Hi,

I'm creating another more advanced (and 99% compatible with Delphi) version of the library Generics.Collections (without GetValueSize and GetReferenceToValue specially for Sven :P) and I have some dilemmas about TTypeKind.

What happened to tkLString? All strings with code page, UTF8String, AnsiString, RawByteString etc. become tkAString. In Delphi analogous types are as tkLString. tkLString is deprecated/dead? ;) I can't find the type that have tkLString "type kind".

Another thing: Why there is tkUChar when we have tkWChar?... I can't find the type that have tkUChar "type kind" too (UnicodeChar is tkWChar).

Regards,
HNB

Reply by email

Paul Ishenin
to Maciej Izak

01.06.13, 6:48, Maciej Izak пишет:

Show quoted text 11 lines
Hi, I'm creating another more advanced (and 99% compatible with Delphi) version of the library Generics.Collections (without GetValueSize and GetReferenceToValue specially for Sven :P) and I have some dilemmas about TTypeKind. What happened to tkLString? All strings with code page, UTF8String, AnsiString, RawByteString etc. become tkAString. In Delphi analogous types are as tkLString. tkLString is deprecated/dead? ;) I can't find the type that have tkLString "type kind".

Compiler uses internally some LongStrings which is not possible to use for variable declarations. I don't know whether this type is needed in RTTI. And yes, Delphi uses tkLString instead of tkAString for ansistrings.

Another thing: Why there is tkUChar when we have tkWChar?... I can't find the type that have tkUChar "type kind" too (UnicodeChar is tkWChar).

I also don't know why we have it. Compiler does not use it.

Best regards,
Paul Ishenin

Reply by email

Maciej Izak
to Paul Ishenin

Thanks for response.

Compiler uses internally some LongStrings which is not possible to use for variable declarations. I don't know whether this type is needed in RTTI. And yes, Delphi uses tkLString instead of tkAString for ansistrings.

Clear.

I also don't know why we have it. Compiler does not use it.

So no one really knows, why have we tkUChar?

Regards,
HNB

Reply by email

waldo kitty
to Maciej Izak
Maciej Izak wrote 11 lines
Thanks for response. Compiler uses internally some LongStrings which is not possible to use for variable declarations. I don't know whether this type is needed in RTTI. And yes, Delphi uses tkLString instead of tkAString for ansistrings. Clear. I also don't know why we have it. Compiler does not use it. So no one really knows, why have we tkUChar?

so maybe svn "blame" will tell when it was put in and by whom?

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Graeme Geldenhuys
to waldo kitty
waldo kitty wrote
so maybe svn "blame" will tell when it was put in and by whom?

commit 7aa20ac1cc61578db56a9de741f306f07a35460c
Author: Florian Klaempfl
Date: Sat Apr 16 14:01:44 2011 +0000

* Merged helper branch made by Sven Barth
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«: U rtl/inc/objc1.inc
U rtl/inc/system.inc
U rtl/objpas/typinfo.pp
A tests/test/tchlp30.pp
...snip...

ie SVN commit r17328

Regards,
G.

Reply by email

Sven Barth
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
On 2013-06-02 02:44, waldo kitty wrote: > so maybe svn "blame" will tell when it was put in and by whom? commit 7aa20ac1cc61578db56a9de741f306f07a35460c Author: Florian Klaempfl Date: Sat Apr 16 14:01:44 2011 +0000 * Merged helper branch made by Sven Barth -- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«: U rtl/inc/objc1.inc U rtl/inc/system.inc U rtl/objpas/typinfo.pp A tests/test/tchlp30.pp ...snip... ie SVN commit r17328

You should look at the context of the change. The one you quoted only added a "," after the "tkUChar" for adding the "tkHelper". The commit which really added "tkUChar" (and "tkUString") was 11739 (see here: http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=11739 ).

Regards,
Sven

Reply by email