Re: [fpc-pascal] Regression in StrToDateTime()

2018-06-14 Thread LacaK
You also can make your own procedure to fix the issue for yourself. Like you can rewrite the function StrToDateTime() to change all '. ' to '.' and then call the original function StrToDateTime() Of course it is possible, but IMO it should be fixed in general way. I have reported bug #33860 I

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 14. Juni 2018, 11:59: > > > > On Jun 14, 2018, at 4:44 PM, Ryan Joseph > wrote: > > > > Something I tried was using properties like this but it didn’t work. Is > that something properties could do? It feels like they should be able to > reach into records fields that

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Marcos Douglas B. Santos
On Thu, Jun 14, 2018 at 8:43 AM, Ryan Joseph wrote: > [...] > His premise for the proposal is that programming languages > should help the programmer to make code which is better read > by the CPU instead of high-level constructs for abstract concepts. > It’s very specific to a particular task

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 7:19 PM, Martin wrote: > > You can do that without the "with" > record TFoo > Bar: TOtherRecord; // has a field abc > end; > > The only thing is that you need to access the field by its fully qualified > name Foo.Bar.abc, instead of Foo.abc. > Which is good, because

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 7:42 PM, Marcos Douglas B. Santos > wrote: > > It is the opposite: programming languages should help programmers > to make code which is better read by human being, not CPU. Jonathan Blow disagrees with you then. :) None of this matter for typical desktop applications.

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 3:23 PM, Marco van de Voort wrote: > >> // works with function parameters also. >> // this is almost like a class helper or at very least mimics ?self? in >> methods. >> >> procedure OpenDoor(with var door: TDoor); >> begin >> state := true; // with imports door

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 4:25 PM, Sven Barth via fpc-pascal > wrote: > > omething like that only leads to confusion. Pascal is a rather explicit > language so manually declaring a Position property inside TDoor would be more > in the spirit of the language. > > A possible alternative would

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 7:26 PM, Sven Barth via fpc-pascal > wrote: > > Because one needs to be able to represent the properties in the RTTI. Without > pointers all that is needed to access the property from code is an offset. > With pointers you'd need to add where dereferences are required

Re: [fpc-pascal] Regression in StrToDateTime()

2018-06-14 Thread Carmel computer - Antal
You also can make your own procedure to fix the issue for yourself. Like you can rewrite the function StrToDateTime() to change all '. ' to '.' and then call the original function StrToDateTime() On Thu, 14 Jun 2018, LacaK wrote: Hi, now I am migrating my applications from FPC 2.6.4 to FPC

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Marco van de Voort
In our previous episode, Ryan Joseph said: > // works with function parameters also. > // this is almost like a class helper or at very least mimics ?self? in > methods. > > procedure OpenDoor(with var door: TDoor); > begin > state := true; // with imports door namespace into entire

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Martin
On 14/06/2018 13:43, Ryan Joseph wrote: On Jun 14, 2018, at 5:18 PM, Mattias Gaertner wrote: If you only want that, why not use objects? The real reason Jon Blow proposed this syntax is because it allows you keep continuous arrays of memory which you can index into using struts. The fact

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Mattias Gaertner
On Thu, 14 Jun 2018 16:44:40 +0700 Ryan Joseph wrote: >[...] > The idea of “with” inside records is so interesting because it basically > mimics inheritance without going full class. If you only want that, why not use objects? Mattias ___ fpc-pascal

[fpc-pascal] Regression in StrToDateTime()

2018-06-14 Thread LacaK
Hi, now I am migrating my applications from FPC 2.6.4 to FPC 3.0.4 and I noticed that logic in function StrToDateTime() was changed. In 2.6.4 there was first detected position of first TimeSeparator and then walking back to first occurence of WhiteSpace. This approach allows DateSeparator='.

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 5:18 PM, Mattias Gaertner > wrote: > > If you only want that, why not use objects? The real reason Jon Blow proposed this syntax is because it allows you keep continuous arrays of memory which you can index into using struts. The fact it mimics multiple inheritance

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 14. Juni 2018, 10:03: > type > TEntity = record > position: TVec2; > end; > TEntityPtr = ^TEntity; > > type > TDoor = record > with entity: TEntityPtr; // import entity namespace for > entire TDoor scope

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 4:44 PM, Ryan Joseph wrote: > > Something I tried was using properties like this but it didn’t work. Is that > something properties could do? It feels like they should be able to reach > into records fields that since everything is known to the property as time of >

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
> On Jun 14, 2018, at 7:51 PM, Ryan Joseph wrote: > > Jonathan Blow disagrees with you then. :) None of this matter for typical > desktop applications. This is strictly for real time graphics, games etc… > where getting tons of cache misses on every frame is an actual problem. Btw here’s

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 14. Juni 2018, 14:48: > > > > On Jun 14, 2018, at 7:26 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Because one needs to be able to represent the properties in the RTTI. > Without pointers all that is needed to access the property

Re: [fpc-pascal] round(2.5)=2

2018-06-14 Thread wkitty42
On 06/13/2018 04:17 AM, Michael Schnell wrote: On 12.06.2018 23:12, Klaus Hartnegg wrote: No, it does not depend on the hardware, but on the setting of $N. Turbo Pascal with $N+ rounds like FreePascal. But the default is $N-. In this mode Turbo Pascal always rounds up. What exactly does $N

Re: [fpc-pascal] AVX512 in ASM - From where should I start?

2018-06-14 Thread Florian Klämpfl
Am 14.06.2018 um 22:37 schrieb Joao Schuler: Hello, In the case that I feel brave enough to code support for AVX512 on asm sections, from where should I start? https://svn.freepascal.org/svn/fpc/branches/tg74/avx512/ Torsten (mainly) and me are working on it. I think a good start would be

Re: [fpc-pascal] AVX512 in ASM - From where should I start?

2018-06-14 Thread Joao Schuler
AWESOME NEWS! Thank you. Should I start by adding more tasm*.pp testing files at fpc/branches/tg74/avx512/tests/test/ specific for AVX512 ? On Fri, Jun 15, 2018 at 6:52 AM, Florian Klämpfl wrote: > Am 14.06.2018 um 22:37 schrieb Joao Schuler: > >> Hello, >> In the case that I feel brave enough

[fpc-pascal] AVX512 in ASM - From where should I start?

2018-06-14 Thread Joao Schuler
Hello, In the case that I feel brave enough to code support for AVX512 on asm sections, from where should I start? This question is related to: https://forum.lazarus.freepascal.org/index.php/topic,41572.0.html I would like to use ZMM registers in my code and do things like these: asm vmovups

[fpc-pascal] Better usage of "with"

2018-06-14 Thread Ryan Joseph
I was just watching a video from Jonathan Blow (the developer of a really popular game named Braid) on a new language he’s working on to get around all the cruft and slowness in c++ for making games. One the problems he identifies is poor memory layout using object oriented inheritance and

Re: [fpc-pascal] round(2.5)=2

2018-06-14 Thread Michael Schnell
On 12.06.2018 23:12, Klaus Hartnegg wrote:   writeln (round(a*1.1)); As with usual float formats 1.1 can't be represented exactly, the result can't be considered any precise value. -Michael ___ fpc-pascal maillist -

Re: [fpc-pascal] round(2.5)=2

2018-06-14 Thread Michael Schnell
On 12.06.2018 23:12, Klaus Hartnegg wrote: The only *reliable* solution appears to be compiling a modified version of FreePascal. It would make the round function a lot slower not to simply rely on the hardware. And in fact the only *reliable* solution is *not ever* to rely on exact values

Re: [fpc-pascal] round(2.5)=2

2018-06-14 Thread Michael Schnell
On 12.06.2018 23:12, Klaus Hartnegg wrote: No, it does not depend on the hardware, but on the setting of $N. Turbo Pascal with $N+ rounds like FreePascal. But the default is $N-. In this mode Turbo Pascal always rounds up. What exactly does $N in Turbo pascal mean ? Obviously it in this