Re: [fpc-pascal] Implicit generic specializations

2018-12-03 Thread Ryan Joseph
> On Dec 3, 2018, at 1:59 PM, Sven Barth via fpc-pascal > wrote: > > The dummy symbol should only be created if there isn't an existing symbol > with that name. So maybe something is buggy there. (Also the dummy symbol > should be used for a non-generic routine if the order of declaration is

Re: [fpc-pascal] Generics question

2018-12-03 Thread Martok
Am 03.12.2018 um 08:00 schrieb Sven Barth via fpc-pascal: > Because Delphi does not allow that either. We relaxed that however in 3.1.1 > and > it should be part of 3.2.0. You can test the corresponding branch of you > want. Is this related to ? T

Re: [fpc-pascal] Generics question

2018-12-03 Thread Sven Barth via fpc-pascal
Am Mo., 3. Dez. 2018, 10:53 hat Martok geschrieben: > Am 03.12.2018 um 08:00 schrieb Sven Barth via fpc-pascal: > > Because Delphi does not allow that either. We relaxed that however in > 3.1.1 and > > it should be part of 3.2.0. You can test the corresponding branch of you > want. > > Is this re

Re: [fpc-pascal] Generics question

2018-12-03 Thread Martok
Am 03.12.2018 um 10:53 schrieb Martok: > I'll have to check the real-world code again, might be able to close this bug > as > "fixed in the mean time". Checked, works also in real code. I have added a note saying so on the bug. -- Regards, Martok Ceterum censeo b32079 esse sanandam. _

Re: [fpc-pascal] Implicit generic specializations

2018-12-03 Thread Ryan Joseph
> On Dec 3, 2018, at 2:45 PM, Ryan Joseph wrote: > > I just looked it over and I was wrong about the dummy, it’s just a flag. If > the generic doesn’t cover existing functions then that messes up some > assumptions I made so I need re-think the design now. I believe I managed to solve the pr

Re: [fpc-pascal] Implicit generic specializations

2018-12-03 Thread Martok
Am 03.12.2018 um 14:01 schrieb Ryan Joseph: > I believe I managed to solve the problem and now non-generic procedures take > precedence. I guess it’s possible that you could opt out of an implicit > specialization now but declaring and overload which the specific type you > were interested in. T

Re: [fpc-pascal] Implicit generic specializations

2018-12-03 Thread Ryan Joseph
> On Dec 3, 2018, at 9:10 PM, Martok wrote: > > What happens when there are implicit conversion operators defined? > I.e.: > >operator := (x: integer): string; >// with and without this more specific overload: >procedure DoThis(msg:integer);overload; >generic procedure DoThis(m

[fpc-pascal] Object questions

2018-12-03 Thread Ryan Joseph
Some questions about old-style objects. 1) How can you check if self is assigned? self refers to the struct itself but if the object was allocated on the stack then how do we know self is a pointer or not? procedure TMyObject.Free; begin if self <> nil then dispose(self,Destroy); end; 2)

Re: [fpc-pascal] Object questions

2018-12-03 Thread Sven Barth via fpc-pascal
Am Di., 4. Dez. 2018, 04:06 hat Ryan Joseph geschrieben: > Some questions about old-style objects. > > 1) How can you check if self is assigned? self refers to the struct itself > but if the object was allocated on the stack then how do we know self is a > pointer or not? > > procedure TMyObject.

Re: [fpc-pascal] Object questions

2018-12-03 Thread Ryan Joseph
> On Dec 4, 2018, at 1:52 PM, Sven Barth via fpc-pascal > wrote: > > The type of "Self" inside a object is always the same no matter if it's > allocated on the stack or the heap. Then there’s now way to do a free method like I showed? > > 2) Is there any TObject support in objects? I know