Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Mark Morgan Lloyd
On 20/06/18 20:00, Sven Barth via fpc-pascal wrote: Addendum: the support for the "+" operator is now coupled to a new modeswitch "ArrayOperators". If the modeswitch is enabled, then the operator can not be overloaded and it also won't be used even if an overload from a unit without the modesw

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Mattias Gaertner
On Wed, 20 Jun 2018 21:56:56 +0200 Sven Barth via fpc-pascal wrote: >[...] > The modeswitch is enabled by default in Delphi modes as this feature was > added for Delphi compatibility. I would like to use that for objfpc. Is there a command line flag to enable a modeswitch? Mattias

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Ryan Joseph
> On Jun 21, 2018, at 2:56 AM, Sven Barth via fpc-pascal > wrote: > > Addendum: the support for the "+" operator is now coupled to a new modeswitch > "ArrayOperators". Finally got to try this. It’s really satisfying being able to do: var arr: array of integer = (1, 2, 3); i:

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Mattias Gaertner
On Thu, 21 Jun 2018 15:17:39 +0700 Ryan Joseph wrote: >[...] > Finally got to try this. It’s really satisfying being able to do: >[...] > for i in arr do Note: This was supported for a long time. Mattias ___ fpc-pascal maillist - fpc-pascal@

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Ryan Joseph
I mean the += [] part. :) > On Jun 21, 2018, at 3:37 PM, Mattias Gaertner > wrote: > > Note: This was supported for a long time. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread Adriaan van Os
Florian Klämpfl wrote: Am 20.06.2018 um 10:59 schrieb Adriaan van Os: James Richters wrote: I’ve been updating my old programs to use the MATH unit in freepascal and while testing things I came across a runtime error 217 Invalid floating point operation. Here is my test program I su

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 21. Juni 2018, 08:37: > > > > On Jun 21, 2018, at 1:21 PM, Ryan Joseph > wrote: > > > > Thanks Sven. So it was the Lazarus step I was missing! I know about > using “lazbuild” from the command line but there are many .lpi projects in > /compiler. Which one is ppc386? I

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Sven Barth via fpc-pascal
Mark Morgan Lloyd schrieb am Do., 21. Juni 2018, 09:11: > On 20/06/18 20:00, Sven Barth via fpc-pascal wrote: > > > Addendum: the support for the "+" operator is now coupled to a new > > modeswitch "ArrayOperators". > > If the modeswitch is enabled, then the operator can not be overloaded > > and

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Sven Barth via fpc-pascal
Mattias Gaertner schrieb am Do., 21. Juni 2018, 09:24: > On Wed, 20 Jun 2018 21:56:56 +0200 > Sven Barth via fpc-pascal wrote: > > >[...] > > The modeswitch is enabled by default in Delphi modes as this feature was > > added for Delphi compatibility. > > I would like to use that for objfpc. > Is

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread gtt
Zitat von Adriaan van Os : Even with masked exceptions, runtime errors are produced in the Math unit. That is not conformant to the standard. Even with masked exInvalidOp? Can you give an example? ___ fpc-pascal maillist - fpc-pascal@lists.freepa

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread James Richters
>For operations producing results in floating-point format, the default result >of an operation that >signals the invalid operation exception shall be a quiet NaN that should >provide some diagnostic >information (see 6.2). If it shall be a quiet NaN doesn't that mean it would never cause the

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread James Richters
The compiler does seem to be filtering out the conditions that hard coded to resolve to NaN. That explains the seemingly inconsistent results, when I set variables and try the operations that seemed to work before they now produce the error. Thanks for pointing that out. -Original Message-

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread gtt
Zitat von James Richters : For operations producing results in floating-point format, the default result of an operation that signals the invalid operation exception shall be a quiet NaN that should provide some diagnostic information (see 6.2). If it shall be a quiet NaN doesn't that mea

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Ryan Joseph
I’m actually making rapid progress on a macro function syntax where the parameters are replaced by the inputs when called: {$define put(x):='into_x’} put(100); // replaces to ‘into_100’ Do I have permission to develop this feature (even if it’s hidden behind a modeswitch) and if so should I pr

Re: [fpc-pascal] Equivalent of Delphi map files...

2018-06-21 Thread Adriaan van Os
Peter Vreman wrote: The -Xm is 2.1.1 only and not available in 2.0.x. The -Xm is also available for linux and can be added for other platforms if needed and the linker supports it. Is -Xm supposed to work on Mac OS X ? I don't see any file being generated, nor do I get an error message. The l

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 21. Juni 2018, 15:53: > I’m actually making rapid progress on a macro function syntax where the > parameters are replaced by the inputs when called: > > {$define put(x):='into_x’} > > put(100); // replaces to ‘into_100’ > > Do I have permission to develop this feature

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Ryan Joseph
> On Jun 21, 2018, at 10:08 PM, Sven Barth via fpc-pascal > wrote: > > For more questions you can start a thread in fpc-devel. That's the purpose of > that mailing list after all. > Thanks, I’ll post there tomorrow about the technical stuff. At first glance unless I totally underestimate

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Ralf Quint
On 6/21/2018 8:08 AM, Sven Barth via fpc-pascal wrote: Of course you have permission to work on this, after all this is Open Source software. However whether we'd want to integrate this is a totally different topic. I personally am against it, cause I see no real world use in it and the usual

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Am 21.06.2018 um 17:25 schrieb Ryan Joseph: On Jun 21, 2018, at 10:08 PM, Sven Barth via fpc-pascal wrote: For more questions you can start a thread in fpc-devel. That's the purpose of that mailing list after all. Thanks, I’ll post there tomorrow about the technical stuff. At first glanc

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread James Richters
The fact that it raises the exception at all makes it a signaling NaN not a quiet Nan, but they are supposed to be Quiet Nan which never throw the exception according to the specification which clearly states they are Quiet Nans, not Signaling Nans. Suppressing the exception makes them act lik

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread gtt
Zitat von James Richters : The fact that it raises the exception at all makes it a signaling NaN not a quiet Nan, but they are supposed to be Quiet Nan which never throw the exception according to the specification which clearly states they are Quiet Nans, not Signaling Nans. Suppressi

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Marc Santhoff
On Thu, 2018-06-21 at 22:25 +0700, Ryan Joseph wrote: > > > I did a search and found only a few hits on the topic. Since I’ve been > giving theoretical examples here’s something more practical a user > attempted. Can you do that without macros? If I had to guess he had some > funky code and just w

Re: [fpc-pascal] math with infinity and NaN

2018-06-21 Thread Adriaan van Os
g...@wolfgang-ehrhardt.de wrote: Zitat von Adriaan van Os : Even with masked exceptions, runtime errors are produced in the Math unit. That is not conformant to the standard. Even with masked exInvalidOp? Can you give an example? Math.power with a negative base would except, even with maske

Re: [fpc-pascal] Free Pascal console programs on Android are easy

2018-06-21 Thread Paul Breneman
On 06/20/2018 12:01 PM, Paul Breneman wrote: On 06/04/2017 08:00 AM, Paul Breneman wrote: On 05/09/2014 07:06 PM, Paul Breneman wrote: On 03/24/2014 12:08 PM, Paul Breneman wrote: On 03/15/2014 07:33 PM, Paul Breneman wrote: ... My main specialty is communication software ( www.turbocontrol.c

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Ryan Joseph
> On Jun 22, 2018, at 3:19 AM, Marc Santhoff wrote: > > function HOFFSETP(rectypevar: pointer; fieldvar: pointer): longint; inline; > begin > HOFFSETP := longint(fieldvar - rectypevar); > end; > > H5Tinsert(s2_tid, 'c_name', HOFFSETP(@s2[0], @s2[0].c), H5T_NATIVE_DOUBLE); > H5Tinsert(s2

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Michael Van Canneyt
On Fri, 22 Jun 2018, Ryan Joseph wrote: On Jun 22, 2018, at 3:19 AM, Marc Santhoff wrote: function HOFFSETP(rectypevar: pointer; fieldvar: pointer): longint; inline; begin HOFFSETP := longint(fieldvar - rectypevar); end; H5Tinsert(s2_tid, 'c_name', HOFFSETP(@s2[0], @s2[0].c),

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Sven Barth via fpc-pascal
Am 22.06.2018 um 06:35 schrieb Ryan Joseph: Here’s a macro I like from C. It captures the assert expression and prints it back out into the console (it would halt the program also). Can this be done in Pascal? In C they return the file name and line number also which is really nice. {$define

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Ryan Joseph
> On Jun 22, 2018, at 12:21 PM, Michael Van Canneyt > wrote: > > 'Nice' is not an argument. > > If someone else assumes that assert() works as expected - i.e. throws an > exception, then your macro will mess up his code, leading to > unpredictable results. > > From my - admittedly subjectiv

Re: [fpc-pascal] Proper preprocessor?

2018-06-21 Thread Michael Van Canneyt
On Fri, 22 Jun 2018, Ryan Joseph wrote: On Jun 22, 2018, at 12:21 PM, Michael Van Canneyt wrote: 'Nice' is not an argument. If someone else assumes that assert() works as expected - i.e. throws an exception, then your macro will mess up his code, leading to unpredictable results. From

[fpc-pascal] Default record fields

2018-06-21 Thread Ryan Joseph
I want to do a pivot away from the macro stuff to ask another question. Since I’ve wanted to contribute to the compiler for so long and I finally have a little understanding I’d like to know if there’s anything minor I could do, that isn’t offensive to the compiler team. What comes to mind firs