Re: [fpc-pascal] access violation?

2018-07-27 Thread Victor Campillo
On 27/07/18 07:36, Michael Van Canneyt wrote: It is by design. And - OMG !! - it is even documented: https://www.freepascal.org/docs-html/current/rtl/system/tobject.free.html There is no need to search the docs, it is even more quick just jump to the implementation of free and see what it

Re: [fpc-pascal] Syntax changes suggestions

2018-07-27 Thread Ryan Joseph
> On Jul 25, 2018, at 8:05 AM, R0b0t1 wrote: > > This looks ugly. It also introduces modifiers to variable > declarations. Some features should not be part of the language, they > should be built on top of it. Yeah, introducing modifiers to variables is not so great. You could avoid

Re: [fpc-pascal] access violation?

2018-07-27 Thread Ryan Joseph
> On Jul 27, 2018, at 10:16 AM, Dmitry Boyarintsev > wrote: > > type > TRobust = class(TObject) > public > v : Integer; > procedure RobustMethod; > end; > > procedure TRobust.RobustMethod; > begin > if Self = nil then Exit; // remove or comment out this line to start >

Re: [fpc-pascal] access violation?

2018-07-27 Thread Mattias Gaertner
On Fri, 27 Jul 2018 11:06:11 -0600 Ryan Joseph wrote: >[...] > I’m totally confused now. Since when was it ok to call methods on nil > objects? You can't if you compile with -CR. The RTL is not compiled with objectchecks, so it works there. > According to this test not only can you call

Re: [fpc-pascal] access violation?

2018-07-27 Thread Ryan Joseph
> On Jul 26, 2018, at 11:36 PM, Michael Van Canneyt > wrote: > > It is by design. > > And - OMG !! - it is even documented: I never use Free directly so I had no idea. How is that even accomplished in the language? I thought it was just a method and behaved accordingly. If it is magic

Re: [fpc-pascal] access violation?

2018-07-27 Thread Dmitry Boyarintsev
On Fri, Jul 27, 2018 at 11:15 AM, Ryan Joseph wrote: > I never use Free directly so I had no idea. How is that even accomplished > in the language? I thought it was just a method and behaved accordingly. > > If it is magic then how do we call other methods on nil objects? There are > times that

Re: [fpc-pascal] access violation?

2018-07-27 Thread Dmitry Boyarintsev
On Fri, Jul 27, 2018 at 1:06 PM, Ryan Joseph wrote: > I had no idea you could do that! > Obviously, it speaks high of your abilities ;) You've been able to accomplish your tasks without use of hacks (of any kind), playing strict by the rules. I’m totally confused now. Since when was it ok to

Re: [fpc-pascal] access violation?

2018-07-27 Thread Ryan Joseph
> On Jul 27, 2018, at 11:24 AM, Mattias Gaertner > wrote: > > You can't if you compile with -CR. > The RTL is not compiled with objectchecks, so it works there. > >> According to this test not only can you call methods on nil objects but >> it calls the method statically (like a class

Re: [fpc-pascal] Syntax changes suggestions

2018-07-27 Thread Sven Barth via fpc-pascal
R0b0t1 schrieb am Do., 26. Juli 2018, 09:53: > On Mon, Jul 23, 2018 at 11:11 AM, Ryan Joseph > wrote: > > > > > >> On Jul 22, 2018, at 4:54 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> > >> And that's why there are people who *do* care about it. Of course you >

Re: [fpc-pascal] Syntax changes suggestions

2018-07-27 Thread Ben Grasset
How is auto more "ugly" than literally any other modifier in the entire language? They're all just english words, of varying length. Also building features on top of a language will always result in worse performance than having them be a part of it. On Wed, Jul 25, 2018 at 10:05 AM, R0b0t1

Re: [fpc-pascal] access violation?

2018-07-27 Thread Ryan Joseph
> On Jul 27, 2018, at 2:17 PM, Mattias Gaertner > wrote: > > You are right. I just tested myself. > Either I'm confusing the flag or it has been changed. > Once upon a time Lazarus used the same trick and I had to change the > code as some users wanted use the flag. Do you need me to file a

Re: [fpc-pascal] access violation?

2018-07-27 Thread Mattias Gaertner
On Fri, 27 Jul 2018 11:41:51 -0600 Ryan Joseph wrote: >[...] > How do I disable this? I just ran this test program with -CR and I still > calls the method statically. You are right. I just tested myself. Either I'm confusing the flag or it has been changed. Once upon a time Lazarus used the

Re: [fpc-pascal] access violation?

2018-07-27 Thread Michael Van Canneyt
On Fri, 27 Jul 2018, Dmitry Boyarintsev wrote: From high-level (OOP) such actions are not welcomed (and are enforced using -CR in case of FPC). In order to have robust, maintainable and portable (to either other platform or even language) a developer should respect high-level rules and

Re: [fpc-pascal] access violation?

2018-07-27 Thread Dmitry Boyarintsev
On Fri, Jul 27, 2018 at 3:22 PM, Michael Van Canneyt wrote: > In order to have robust, maintainable and portable (to either other >> platform or even language) a developer should respect high-level rules and >> never depend on low-level rules to be the same on any platform. >> > > Do I have