Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
I started in on this already and here’s the first conflict I found when trying operators. What should happen if you assign a record to another record with a default property? var wrapper: TWrapper; other: TWrapper; // this should assign to ‘obj’ via the default property wrappe

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 4, 2018, at 12:35 PM, Sven Barth via fpc-pascal > wrote: > > I think you need to be clearer what you want to achieve in the end. The > default property as intended by Maciej has the idea that it hoists the > operators of the default property type to the record it is contained in. > E.

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Sven Barth via fpc-pascal
On 03.09.2018 09:15, Ryan Joseph wrote: > Thank you for bearing with me, so finally here are my questions: > > 1) Given this is critical to make management operators work smoothly what > does the compiler team think about this idea to have a default property or > “with" in classes/records? > >

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Michael Van Canneyt
On Mon, 3 Sep 2018, Ryan Joseph wrote: On Sep 3, 2018, at 9:17 PM, Martin wrote: No it is not the same. You.f.Free; will always work, it is not ambiguous. You.Free; depends on no method Free being declared on the class of You, or any of its base classes, or any other default class (if

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Martin
On 03/09/2018 17:00, Ryan Joseph wrote: On Sep 3, 2018, at 9:17 PM, Martin wrote: You.f.Free; will always work, it is not ambiguous. You.Free; depends on no method Free being declared on the class of You, or any of its base classes, or any other default class (if more than one is allowed) t

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 3, 2018, at 9:17 PM, Martin wrote: > > No it is not the same. > > You.f.Free; > will always work, it is not ambiguous. > > You.Free; > depends on no method Free being declared on the class of You, or any of its > base classes, or any other default class (if more than one is allowed)

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 3, 2018, at 9:17 PM, Martin wrote: > > You.f.Free; > will always work, it is not ambiguous. > > You.Free; > depends on no method Free being declared on the class of You, or any of its > base classes, or any other default class (if more than one is allowed) that > would be searched a

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 3, 2018, at 8:16 PM, Michael Van Canneyt > wrote: > > The whole point of 'default' is to be able to make this assignment, for > example to implement nullable types. Just thought about this some more and realized that if you’re thinking more in terms of nullable types (which rely to

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Martin
On 03/09/2018 15:56, Ryan Joseph wrote: In your example if the “a” property was default than: You.Free; would be the same as: You.f.Free; right? I just don’t see where the name of the property applies. The property *removed* a name in fact. It’s like an anti-name. ;) No it is not the sam

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 3, 2018, at 8:16 PM, Michael Van Canneyt > wrote: > >> The >> only reason we have the name is because we’re trying to add this feature >> on top of properties syntax. Array properties had this oddity also and I >> would prefer to just omit the name since it’s meaningless. > > It is

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Michael Van Canneyt
On Mon, 3 Sep 2018, Ryan Joseph wrote: On Sep 3, 2018, at 4:14 PM, Michael Van Canneyt wrote: On Sep 3, 2018, at 2:41 PM, Michael Van Canneyt wrote: 'with' is terribly awkward. “with” came to mind because it’s basically a with statement but within a class. Properties had another side

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 3, 2018, at 4:14 PM, Michael Van Canneyt > wrote: > >>> On Sep 3, 2018, at 2:41 PM, Michael Van Canneyt >>> wrote: >>> 'with' is terribly awkward. >> >> “with” came to mind because it’s basically a with statement but within a >> class. Properties had another side effect of requiri

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Michael Van Canneyt
On Mon, 3 Sep 2018, Ryan Joseph wrote: On Sep 3, 2018, at 2:41 PM, Michael Van Canneyt wrote: 'with' is terribly awkward. “with” came to mind because it’s basically a with statement but within a class. Properties had another side effect of requiring naming which is redundant (I’d proba

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
> On Sep 3, 2018, at 2:41 PM, Michael Van Canneyt > wrote: > > 'with' is terribly awkward. “with” came to mind because it’s basically a with statement but within a class. Properties had another side effect of requiring naming which is redundant (I’d probably just underscore the name always

Re: [fpc-pascal] with in classes/records

2018-09-03 Thread Michael Van Canneyt
On Mon, 3 Sep 2018, Ryan Joseph wrote: I’m sorry to bring this one up again but it was touched upon in regards to management operators and auto free objects. Please bear with me while I recap. I’m writing this email today because I just had this exact same problem in my code and I’m desperat

[fpc-pascal] with in classes/records

2018-09-03 Thread Ryan Joseph
I’m sorry to bring this one up again but it was touched upon in regards to management operators and auto free objects. Please bear with me while I recap. To summarize what I said last time was that I wanted a way to include “with” statement functionality in classes and records to aid in delegati