Recent

Author Topic: FClass<TArray<Char>> can not be compiled  (Read 1398 times)

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
FClass<TArray<Char>> can not be compiled
« on: October 09, 2024, 08:16:36 pm »
Code: Pascal  [Select][+][-]
  1. procedure foo;
  2. var
  3.     myQChar: QChar<TArray<Char>>;
  4. begin
  5.     myQChar := QChar<TArray<Char>>.Create([' ', ' ']);
  6. end;

I get error at compile when using the above code.
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

jamie

  • Hero Member
  • *****
  • Posts: 7322
Re: FClass<TArray<Char>> can not be compiled
« Reply #1 on: October 10, 2024, 12:44:22 am »
TArray<Type> is a generic.

The only true wisdom is knowing you know nothing

cdbc

  • Hero Member
  • *****
  • Posts: 2476
    • http://www.cdbc.dk
Re: FClass<TArray<Char>> can not be compiled
« Reply #2 on: October 10, 2024, 06:42:00 am »
Hi
@Thaddy: I think it's his own compiler  ...hence, I haven't the foggiest...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6 -> FPC 3.2.2 -> Lazarus 4.0 up until Jan 2025 from then on it's both above &: KDE6/QT6 -> FPC 3.3.1 -> Lazarus 4.99

Thaddy

  • Hero Member
  • *****
  • Posts: 18372
  • Here stood a man who saw the Elbe and jumped it.
Re: FClass<TArray<Char>> can not be compiled
« Reply #3 on: October 10, 2024, 06:43:23 am »
what is a qchar? Benny?
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

cdbc

  • Hero Member
  • *****
  • Posts: 2476
    • http://www.cdbc.dk
Re: FClass<TArray<Char>> can not be compiled
« Reply #4 on: October 10, 2024, 07:23:32 am »
Hi
It's some kind of nonsense, he dreamed up last time he was smoking the big pipe  :D
As far as I can read of his stuff, most of it belongs in /lalalala-land/ Sorry mate, that's just my opinion...
Regards Benny

eta: maybe his idea of a managed string type, gawd help us...
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6 -> FPC 3.2.2 -> Lazarus 4.0 up until Jan 2025 from then on it's both above &: KDE6/QT6 -> FPC 3.3.1 -> Lazarus 4.99

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: FClass<TArray<Char>> can not be compiled
« Reply #5 on: October 10, 2024, 07:27:28 am »
Today is tomorrow's yesterday.

cdbc

  • Hero Member
  • *****
  • Posts: 2476
    • http://www.cdbc.dk
Re: FClass<TArray<Char>> can not be compiled
« Reply #6 on: October 10, 2024, 07:31:27 am »
Hi
@TRon: I know, I use QT daily, but his nonsense has nothing to do with qt-strings...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6 -> FPC 3.2.2 -> Lazarus 4.0 up until Jan 2025 from then on it's both above &: KDE6/QT6 -> FPC 3.3.1 -> Lazarus 4.99

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: FClass<TArray<Char>> can not be compiled
« Reply #7 on: October 10, 2024, 07:37:50 am »
I know that the snippet still makes no sense cdbc but he seem to have been working on implementing his own (qt) classes (at least that is what I remembered from a previous conversation with TS).

@paule32:
it might perhaps help if you could express what was expected that the code-snippet would do (or is suppose to do).
« Last Edit: October 10, 2024, 08:16:50 am by TRon »
Today is tomorrow's yesterday.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12536
  • FPC developer.
Re: FClass<TArray<Char>> can not be compiled
« Reply #8 on: October 10, 2024, 08:36:41 am »
Afaik that is fixed in trunk  . But I had it for a type declaration, don't know about code on the fly, I never did that.

Thaddy

  • Hero Member
  • *****
  • Posts: 18372
  • Here stood a man who saw the Elbe and jumped it.
Re: FClass<TArray<Char>> can not be compiled
« Reply #9 on: October 10, 2024, 10:56:24 am »
QChar
Ah, I see. Why not use UnicodeChar? That is a fundamental type.
Hm, that is just size 2, - I knew that, sigh - so fails. It should be four. Did somebody complain already, because that is a bug and covers just UCS2.
But there is ucs4char. Delphi behaves the same, though.
« Last Edit: October 10, 2024, 11:10:52 am by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
Re: FClass<TArray<Char>> can not be compiled
« Reply #10 on: October 10, 2024, 07:54:08 pm »
I use fpc 3.2.2 for using own classes that are similar to Qt 5 Framework.
I use fpc with gnu c++ 20, to get a code base that can be use from fpc, and g++.
The original idea was, to bundle VCL with g++, to form g++ in a C++ Builder like Compiler.
But I could use Com+.
But this is Windows depend, and I am not a fan of Com+.
So I do experiment for cross-development.
You can follow the process at my https://github.com/paule32/fpc-qt account.
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6195
  • Compiler Developer
Re: FClass<TArray<Char>> can not be compiled
« Reply #11 on: October 10, 2024, 08:54:32 pm »
Code: Pascal  [Select][+][-]
  1. procedure foo;
  2. var
  3.     myQChar: QChar<TArray<Char>>;
  4. begin
  5.     myQChar := QChar<TArray<Char>>.Create([' ', ' ']);
  6. end;

I get error at compile when using the above code.

The compiler does not yet support nested specializations in mode Delphi. Either use mode ObjFPC, then you can do specialize QChar<specialize TArray<Char> > (note the space between the two >). In mode Delphi you need to declare the array specialization separately (that solution can of course be done in mode ObjFPC as well with the appropriate specialize placements):

Code: Pascal  [Select][+][-]
  1. type
  2.   TCharArray = TArray<Char>;
  3. var
  4.   myQChar: QChar<TCharArray>;
  5. begin
  6.   myQChar := QChar<TCharArray>.Create([' ', ' ']);
  7. end.

 

TinyPortal © 2005-2018