Re: [fpc-pascal] mode switch madness

2019-04-15 Thread Jonas Maebe
On 15/04/2019 17:19, Zoë Peterson wrote: On 4/14/2019 10:41 AM, Jonas Maebe wrote: That was because Apple did the same with the Objective-C language: https://en.wikipedia.org/wiki/Objective-C#Objective-C_2.0 :) How does $modeswitch objectivec1 differ from objectivec2?  That article mentions t

Re: [fpc-pascal] mode switch madness

2019-04-15 Thread Zoë Peterson
On 4/14/2019 10:41 AM, Jonas Maebe wrote: That was because Apple did the same with the Objective-C language: https://en.wikipedia.org/wiki/Objective-C#Objective-C_2.0 :) How does $modeswitch objectivec1 differ from objectivec2? That article mentions that Objective-C 2.0 added 64-bit support,

Re: [fpc-pascal] MacOS wrong timestamp in debug map object file

2019-04-15 Thread Marco van de Voort
Op 2019-04-15 om 13:36 schreef Martin: Apparently the files may be on an NAS. Not sure if relevant... I.e. maybe if there is some cache... That might be the reason.  If you have remote files, you have three date systems, the local PC one, the NAS one, and the one of the filesharing protocol

Re: [fpc-pascal] MacOS wrong timestamp in debug map object file

2019-04-15 Thread Jonas Maebe
On 15/04/2019 13:36, Martin wrote: I suspect it might be the linker (from apples developper tools?) that writes the timestamp into the debug map? So not fpc? FPC indeed has nothing to do with the debug map. Would the linker maybe have it's own cache, that may cause something like this? I ha

[fpc-pascal] MacOS wrong timestamp in debug map object file

2019-04-15 Thread Martin
I don't know the Mac well enough... What could cause the below? From https://forum.lazarus.freepascal.org/index.php/topic,44950.msg317604.html#msg317604 The logfile tells that the units have been compiled right before lldb was launched. So the date 15.4 should be correct. LLDB complains error

[fpc-pascal] MacOS wrong timestamp in debug map object file

2019-04-15 Thread Martin Frb
I don't know the Mac well enough... What could cause the below? From https://forum.lazarus.freepascal.org/index.php/topic,44950.msg317604.html#msg317604 The logfile tells that the units have been compiled right before lldb was launched. So the date 15.4 should be correct. LLDB complains error

Re: [fpc-pascal] class contracts [[was: Re: Optional param modifier]]

2019-04-15 Thread Martin Frb
On 15/04/2019 09:41, Sven Barth via fpc-pascal wrote: Am 14.04.2019 um 23:48 schrieb Martin Frb: As for "documentation". I disagree with the way it is done in oxygen. But I am not sure I have any good alternative. For me a class contract (require/ensure) is part of the interface. Putting them

[fpc-pascal] class contracts [[was: Re: Optional param modifier]]

2019-04-15 Thread Martin Frb
On 15/04/2019 09:41, Sven Barth via fpc-pascal wrote: Am 14.04.2019 um 23:48 schrieb Martin Frb: type   TFoo= class function DoTheFooThing(Foo1, Foo2: TFoo): Tbar;     requires    assigned(Foo1) or assigned(Foo2): 'Need at least 1 foo, for the connection';     guarantees /

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Rainer Stratmann
On Sonntag, 14. April 2019 21:35:43 CEST wkitt...@windstream.net wrote: > On 4/14/19 7:28 AM, Rainer Stratmann wrote: > > On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: > >> E.g. i have a loop which test each s[i] char for several cases: 'a', > >> 'b', 'c'. > >> > >> for i:= 1 to leng

Re: [fpc-pascal] Optional param modifier

2019-04-15 Thread Marco van de Voort
Op 2019-04-13 om 09:47 schreef Sven Barth via fpc-pascal: I think the same as when I read the suggestion for an inout variant of VAR. Move this out of the language syntax, and make it directives or attribute like syntax (like we will need to get anyway for const ref). Im defin

Re: [fpc-pascal] Optional param modifier

2019-04-15 Thread Marco van de Voort
Op 2019-04-12 om 21:11 schreef Ryan Joseph: What do you do about the problem of not knowing when a parameter of a 3rd party function can accept null? If it is native Pascal it is probably VAR, as Jonas said. If it is an header for an external package/API, consult their documentation. ___

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Sven Barth via fpc-pascal
Am 15.04.2019 um 09:06 schrieb Bernd Oppolzer: Am 15.04.2019 um 08:29 schrieb Tomas Hajny: On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote:   .   . On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote:   .   . Can FPC optimize it so it only reads s[i] once (to register), not 3 times?

Re: [fpc-pascal] Optional param modifier

2019-04-15 Thread Sven Barth via fpc-pascal
Am 14.04.2019 um 23:48 schrieb Martin Frb: As for "documentation". I disagree with the way it is done in oxygen. But I am not sure I have any good alternative. For me a class contract (require/ensure) is part of the interface. So it would have to be like (and similar for plain procedures, no c

Re: [fpc-pascal] Optional param modifier

2019-04-15 Thread Sven Barth via fpc-pascal
Am 15.04.2019 um 01:19 schrieb Ryan Joseph: On Apr 14, 2019, at 7:08 PM, Martin Frb wrote: Almost. assert takes the condition itself assert(condition_that_must_be_true, 'error message') so it would be assert(name<>'', 'requires "name <> " failed for CreateHero'); You can already ins

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Bernd Oppolzer
Am 15.04.2019 um 08:29 schrieb Tomas Hajny: On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote: . . On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: . . Can FPC optimize it so it only reads s[i] once (to register), not 3 times? . . True for New Stanford Pascal: .