Recent

Author Topic: FPC 3.2.x series branched, trunk update to 3.3.1  (Read 51832 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 9619
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #135 on: January 02, 2020, 04:18:53 pm »
You can choose between different calendars if you like. O:-)
I am more like donkey than shrek

lucamar

  • Hero Member
  • *****
  • Posts: 2380
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #136 on: January 02, 2020, 04:42:21 pm »
You can choose between different calendars if you like. O:-)

Well, by the Islamic calendar we are still in the 1440s so there is still a "little" time for a 2019 release :D 8-)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.4/2.0.6  - FPC 3.0.4 on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7924
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #137 on: January 02, 2020, 05:39:29 pm »
You can choose between different calendars if you like. O:-)

Well, by the Islamic calendar we are still in the 1440s so there is still a "little" time for a 2019 release :D 8-)

It is not so much the date, but the associated holidays that do the trick.

TCH

  • Full Member
  • ***
  • Posts: 116
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #138 on: January 17, 2020, 03:24:01 pm »
Any news on FPC 3.2?

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7924
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #139 on: January 17, 2020, 03:29:34 pm »
Any news on FPC 3.2?

Some progress with the major blockers in the last weeks. No news about schedule.

BeniBela

  • Hero Member
  • *****
  • Posts: 708
    • homepage
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #140 on: February 02, 2020, 12:48:44 am »
Now it is already February

I hope fpc3.2 comes soon.

I spend today replacing arrays of strings with arrays of arrays in my project, and it became much faster, but now I notice, it does not compile with fpc 3.0 anymore :/

Thaddy

  • Hero Member
  • *****
  • Posts: 9619
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #141 on: February 02, 2020, 10:24:15 am »
Now it is already February

I hope fpc3.2 comes soon.

I spend today replacing arrays of strings with arrays of arrays in my project, and it became much faster, but now I notice, it does not compile with fpc 3.0 anymore :/
Can you post a small example?
I am more like donkey than shrek

BeniBela

  • Hero Member
  • *****
  • Posts: 708
    • homepage
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #142 on: February 02, 2020, 10:45:44 am »
Can you post a small example?

It was kind of like this:

Code: Pascal  [Select]
  1.  
  2. program p;
  3. type TObjectArray = array of TObject;
  4. procedure testOld(a: array of string);
  5. begin
  6.   //... for s in a do s.split(',') ...
  7. end;
  8. procedure testNew(a: array of TObjectArray);
  9. begin
  10.   //...
  11. end;
  12. var x, y, a, b: tobject;
  13. begin
  14.   testOld(['x,y','a,b']);
  15.   testNew([[x,y],[a,b]])
  16. end.
  17. ~
  18.  

Thaddy

  • Hero Member
  • *****
  • Posts: 9619
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #143 on: February 02, 2020, 11:56:43 am »
Well, in trunk this compiles, note array initialization in mode delphi and mode objectfpc are different:
Code: Pascal  [Select]
  1. program p;
  2. {$mode delphi}
  3. type TObjectArray = array of TObject;
  4. procedure testOld(a: array of string);
  5. begin
  6.   //... for s in a do s.split(',') ...
  7. end;
  8. procedure testNew(a: array of TObjectArray);
  9. begin
  10.   //...
  11. end;
  12. var x, y, a, b: tobject;
  13. begin
  14.   testOld(['x,y','a,b']);
  15.   testNew([[x,y],[a,b]])
  16. end.

Of course I assume your trunk is reasonably up-to-date...

I am more like donkey than shrek

PascalDragon

  • Hero Member
  • *****
  • Posts: 958
  • Compiler Developer
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #144 on: February 02, 2020, 04:03:05 pm »
Can you post a small example?

It was kind of like this:

Code: Pascal  [Select]
  1.  
  2. program p;
  3. type TObjectArray = array of TObject;
  4. procedure testOld(a: array of string);
  5. begin
  6.   //... for s in a do s.split(',') ...
  7. end;
  8. procedure testNew(a: array of TObjectArray);
  9. begin
  10.   //...
  11. end;
  12. var x, y, a, b: tobject;
  13. begin
  14.   testOld(['x,y','a,b']);
  15.   testNew([[x,y],[a,b]])
  16. end.
  17. ~
  18.  

You're relying on dynamic array constructors here with your testNew (the function take an open array of dynamic arrays). These are only supported in 3.2 and newer.

As a workaround you can use the Create constructor which is only available for named dynamic arrays (which your TObjectArray is):

Code: Pascal  [Select]
  1. testNew([TObjectArray.Create(x, y), TObjectArray.Create(a, b)]);

BeniBela

  • Hero Member
  • *****
  • Posts: 708
    • homepage
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #145 on: February 02, 2020, 11:30:32 pm »
Well, in trunk this compiles, note array initialization in mode delphi and mode objectfpc are different:
Code: Pascal  [Select]
  1. program p;
  2. {$mode delphi}
  3. type TObjectArray = array of TObject;
  4. procedure testOld(a: array of string);
  5. begin
  6.   //... for s in a do s.split(',') ...
  7. end;
  8. procedure testNew(a: array of TObjectArray);
  9. begin
  10.   //...
  11. end;
  12. var x, y, a, b: tobject;
  13. begin
  14.   testOld(['x,y','a,b']);
  15.   testNew([[x,y],[a,b]])
  16. end.

Of course I assume your trunk is reasonably up-to-date...

I know, that is why I wrote it in the new way.

But I cannot share the code, as long as most people still use 3.0.x


As a workaround you can use the Create constructor which is only available for named dynamic arrays (which your TObjectArray is):

I did not know about that, but I rewrote it with a custom function