Re: [fpc-pascal] Free Pascal 3.0.4-rc1 released!

2017-08-07 Thread Mattias Gaertner
On Tue, 18 Jul 2017 10:44:55 +0200 (CEST)
mar...@stack.nl (Marco van de Voort) wrote:

>[...]
> ftp://freepascal.stack.nl/pub/mirrors/fpc/beta/3.0.4-rc1/

The fpc-3.0.4-0.rc1.x86_64.rpm does not work on Fedora 21 x86_64:

Free Pascal Compiler version 3.0.4rc1 [2017/07/02] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o: unrecognized 
relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
test.pas(3,1) Error: Error while linking
test.pas(3,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Should I create a bug report?

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal 3.0.4-rc1 released!

2017-08-07 Thread Marco van de Voort
In our previous episode, Mattias Gaertner said:
> >[...]
> > ftp://freepascal.stack.nl/pub/mirrors/fpc/beta/3.0.4-rc1/
> 
> The fpc-3.0.4-0.rc1.x86_64.rpm does not work on Fedora 21 x86_64:
> 
> Free Pascal Compiler version 3.0.4rc1 [2017/07/02] for x86_64
> Copyright (c) 1993-2017 by Florian Klaempfl and others
> Target OS: Linux for x86-64
> Compiling test.pas
> Linking test
> /usr/bin/ld: warning: link.res contains output sections; did you forget -T?
> /usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o: unrecognized 
> relocation (0x2a) in section `.text'
> /usr/bin/ld: final link failed: Bad value
> test.pas(3,1) Error: Error while linking
> test.pas(3,1) Fatal: There were 1 errors compiling module, stopping
> Fatal: Compilation aborted
> Error: /usr/bin/ppcx64 returned an error exitcode
> 
> Should I create a bug report?

Yes, but make sure it is RPM/fedora in the title, so the fedora maintainer
sees it.

A linker version would also be nice.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] inline callback functions?

2017-08-07 Thread Ryan Joseph
I’m seeing feature this in other languages and it’s pretty useful. Has anyone 
ever considered this for Pascal?

Instead of declaring a method in the class (or other function) it’s written 
inline from the callers scope and inherits from that scope. The only advantage 
is readability since everything appears in one line and it’s cleaner since you 
don’t pollute the class with methods are only used in a single location and 
never called directly.

procedure TMyClass.FadeOut; 
var
fadeAction: TSpriteAction;
begin
fadeAction := TAction.ActionWithDuration(self, 2.0);
fadeAction.SetEndedAction(@
begin
... // scoped in the calling class so "self" is 
available
end;
);
fadeAction.FadeOut;
end;

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] inline callback functions?

2017-08-07 Thread Mattias Gaertner
On Mon, 7 Aug 2017 10:52:35 -0600
Ryan Joseph  wrote:

>[...]

Note that "inline" functions in FPC have a different meaning:
https://www.freepascal.org/docs-html/prog/progsu36.html

What you mean are "anonymous functions" or "closures".

State in FPC:
http://lists.freepascal.org/pipermail/fpc-devel/2016-August/037328.html

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-08-07 Thread Michael Schnell

On 02.08.2017 09:29, Michael Van Canneyt wrote:



FPC "forces" nothing. It offers a single-byte string TStrings 
implementation.
If you want to use that for Unicode, you indeed have no choice but to 
use UTF8

or use/write a separate class that uses UTF16.


That is why I said that it is less silly ! :)

But it does force TStrings siblings to handle single-byte strings (While 
Delphi forces TStrings siblings to handle 16-bit-word Strings).


As a huge count of classes in the RTL (and the LCL and MSEGUI and ..., 
and in user code) are or use TStrings siblings the compatibility issues 
and certain other problems are due to happen.


(I hope I will not completely banned now, as I already am under 
monitoring for this kind of posts...)


-Michael
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal