Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 5:30 PM, Sven Barth via fpc-devel > wrote: > > Huh? Who said anything about generics themselves? I meant the generic > keywords: "generic" and "specialize". So that those that want to use mode > ObjFPC without the keywords can do so. Ah, I see now. That’s even better. :

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 23:17 schrieb Ryan Joseph: On Jun 7, 2019, at 5:06 PM, Sven Barth via fpc-devel wrote: No. The generic keywords are part of mode ObjFPC. The only thing I plan to do is to move the whole idea of generic keywords to a modeswitch, but that is neither here nor there currently.

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ben Grasset
On Fri, Jun 7, 2019 at 3:44 PM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > "0..5" defines a new type. "set of (Alpha, Beta, Gamma)" defines a new > type. "record a, b: longint end" defines a new types. > Building on my last reply, also, here's an example that shows what I

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 5:06 PM, Sven Barth via fpc-devel > wrote: > > No. The generic keywords are part of mode ObjFPC. The only thing I plan to do > is to move the whole idea of generic keywords to a modeswitch, but that is > neither here nor there currently. Good idea to make generics a mod

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 5:08 PM, Sven Barth via fpc-devel > wrote: > > Before we add a postfix operator I prefer not to add *any* of this *at all*. What about smart pointers then? I don’t want Pascal to get left behind on this. We need a solution for this and I want it to be the least intrusive

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 23:06 schrieb Ryan Joseph: On Jun 7, 2019, at 4:56 PM, Sven Barth via fpc-devel wrote: Because I don't want to open the can of worms that is going to be overloading the postfix "operator". People are going to abuse the hell out of it (they will with default properties as w

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 22:54 schrieb Ryan Joseph: On Jun 7, 2019, at 4:51 PM, Sven Barth via fpc-devel wrote: It has been part of FPC from the beginning of generics. It allows the parser to differentiate easier that a specialization is following. This was less important when only type declaratio

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 4:56 PM, Sven Barth via fpc-devel > wrote: > > Because I don't want to open the can of worms that is going to be overloading > the postfix "operator". People are going to abuse the hell out of it (they > will with default properties as well, don't get me wrong there), ma

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 22:50 schrieb Ryan Joseph: On Jun 7, 2019, at 4:47 PM, Sven Barth via fpc-devel wrote: Am 07.06.2019 um 22:41 schrieb Ryan Joseph: Does that make sense? I’d like to scratch the idea of default properties and do this instead if it was permitted. No. FPC is not going down t

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 4:51 PM, Sven Barth via fpc-devel > wrote: > > It has been part of FPC from the beginning of generics. It allows the parser > to differentiate easier that a specialization is following. This was less > important when only type declarations could contain specializations,

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 22:45 schrieb Ryan Joseph: On Jun 7, 2019, at 3:50 PM, Sven Barth via fpc-devel wrote: generic procedure MemCopy(Dest, Src: specialize TPointerType.PT; Len: PtrUInt); begin while Len > 0 do begin Dest^ := Src^; Inc(Dest); Inc(Src); Dec

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 4:47 PM, Sven Barth via fpc-devel > wrote: > > Am 07.06.2019 um 22:41 schrieb Ryan Joseph: >> Does that make sense? I’d like to scratch the idea of default properties and >> do this instead if it was permitted. > No. FPC is not going down that operator madness. So why ar

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 4:44 PM, Ben Grasset wrote: > > You're just describing what is *currently* valid and not-valid syntax, which > we all already know. No one has explained *why* exactly "^Type" would be > somehow a negative thing in the context of method signatures, while at the > same tim

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 22:41 schrieb Ryan Joseph: Does that make sense? I’d like to scratch the idea of default properties and do this instead if it was permitted. No. FPC is not going down that operator madness. Regards, Sven ___ fpc-devel maillist - fp

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 3:50 PM, Sven Barth via fpc-devel > wrote: > > generic procedure MemCopy(Dest, Src: specialize TPointerType.PT; Len: > PtrUInt); > begin > while Len > 0 do begin > Dest^ := Src^; > Inc(Dest); > Inc(Src); > Dec(Len); > end; > end; May

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ben Grasset
On Fri, Jun 7, 2019 at 3:44 PM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > No, I think you *missed* the point. "^Type" defines a new type. "0..5" > defines a new type. "set of (Alpha, Beta, Gamma)" defines a new type. > "record a, b: longint end" defines a new types. All fo

[fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
I was thinking about my patch for default properties and how invasive the changes are into the compiler and heavy handed the approach is. I’m not even sure the compiler team would accept it like it is since it has such potential for overreach and having strange unpredictable effects. In my opin

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread denisgolovan
Hi Sven Just my 50 cents. Just stumbled upon the same problem today. I mean typed pointer in generic function. But "specialize TPointerType.PT" is just too much noise. Personally, I consider this issue really annoying as for generics. -- Regards, Denis Golovan _

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ben Grasset
On Fri, Jun 7, 2019 at 3:26 PM Jonas Maebe wrote: > So if you add something in it that is in fact the same as a regular type > definition, something is wrong. > What exactly is "wrong" there, though? In a world where they both worked, doing this, as we've discussed: procedure Proc(Param: ^TSome

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 18:37 schrieb Ben Grasset: For example, consider the following code, that implements a generic "memcpy"-style procedure using a static advanced-record method: program Example; {$mode Delphi} type   TMem = record   public type     PT = ^T;   public     class procedure Copy(Des

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Sven Barth via fpc-devel
Am 07.06.2019 um 21:06 schrieb Ben Grasset: On Fri, Jun 7, 2019 at 2:35 PM Jonas Maebe > wrote: None of these can be defined as a type in parameter lists. Keep in mind that "^Type" defines a new type. Semantically, it's at the same level as "0..5"

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Jonas Maebe
On 07/06/2019 21:06, Ben Grasset wrote: On Fri, Jun 7, 2019 at 2:35 PM Jonas Maebe > wrote: Your "^Type" inline type definition would behave  exactly the same as a regular pointer type definition.  Of course. It would be strange if it didn't, I think. That'

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 3:06 PM, Ben Grasset wrote: > > To me it's always seemed illogical (in various different Pascal compilers > over time, not just FPC) that the "parameter" declarations there don't work, > whereas things like the "var" ones (which are just as "inline", I'd say) work > just

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ben Grasset
On Fri, Jun 7, 2019 at 2:35 PM Jonas Maebe wrote: > None of these can be defined as a type in parameter lists. Keep in mind > that "^Type" defines a new type. Semantically, it's at the same level as > "0..5" and "record a, b: longint end;". > Right, that's the point. There's nothing else that *w

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Jonas Maebe
On 07/06/2019 20:26, Ben Grasset wrote: On Fri, Jun 7, 2019 at 1:47 PM Jonas Maebe > wrote: It would be inconsistent to only allow such declaration for pointers, and not for other types (a programming language should strive to be as orthogonal as possible

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ben Grasset
On Fri, Jun 7, 2019 at 1:47 PM Jonas Maebe wrote: > It would be inconsistent to only allow such declaration for pointers, > and not for other types (a programming language should strive to be as > orthogonal as possible, with as few exceptions as possible). > I can't think of any particular vari

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Jonas Maebe
On 07/06/2019 18:37, Ben Grasset wrote: B) Is there a specific reason is has *not* been implemented previously? (Seems unlikely) Pascal does not support declaring any new types inside parameter lists, apart from a) local procvar types (in ISO/MacPas modes) b) open arrays In both cases, these

Re: [fpc-devel] avr-gdb and dwarf 3

2019-06-07 Thread Christo Crause
On Fri, Jun 7, 2019 at 1:02 PM Dimitrios Chr. Ioannidis via fpc-devel < fpc-devel@lists.freepascal.org> wrote: >AFAIU, you build the AVR RTL with dwarf 3 ( doesn't support dwarf 2 ) > if you want RTL debugging information. But, the avr-gdb ( at least the > latest 3.5.4.1709 from Microchip ( At

[fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ben Grasset
For example, consider the following code, that implements a generic "memcpy"-style procedure using a static advanced-record method: program Example; {$mode Delphi} type TMem = record public type PT = ^T; public class procedure Copy(Dest: PT; Src: PT; Len: PtrUInt); static; inline;

[fpc-devel] avr-gdb and dwarf 3

2019-06-07 Thread Dimitrios Chr. Ioannidis via fpc-devel
Hi, AFAIU, you build the AVR RTL with dwarf 3 ( doesn't support dwarf 2 ) if you want RTL debugging information. But, the avr-gdb ( at least the latest 3.5.4.1709 from Microchip ( Atmel ) ) supports only dwarf 2. How can I debug the RTL ? regards, -- Dimitrios Chr. Ioannidis ___