Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Jonas Maebe
On 27/07/16 22:47, Sven Barth wrote: Am 27.07.2016 21:04 schrieb "Maciej Izak" >: In that case SmartPtr/SmartObj/Nullable type has no sense for me. The basic purpose is excluded. You can do that today by using for example proxyobject._.foo();

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Sven Barth
Am 27.07.2016 21:04 schrieb "Maciej Izak" : > > > 2016-07-27 15:33 GMT+02:00 Jonas Maebe : >> >> It would seem better to me that you do have to add something after your proxy object (specify a field, call a method, use proxyobject[x], ...) to get the

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Jonas Maebe
Michael Van Canneyt wrote on Wed, 27 Jul 2016: On Wed, 27 Jul 2016, Jonas Maebe wrote: Michael Van Canneyt wrote on Wed, 27 Jul 2016: Why not introduce an address operator ? operator @ (T : MyType) : Pointer; It's only needed because Maciej wants the proxy type to behave differently

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Michael Van Canneyt
On Wed, 27 Jul 2016, Jonas Maebe wrote: Michael Van Canneyt wrote on Wed, 27 Jul 2016: Why not introduce an address operator ? operator @ (T : MyType) : Pointer; It's only needed because Maciej wants the proxy type to behave differently from all other existing types. The solution is

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Michael Van Canneyt
On Wed, 27 Jul 2016, Jonas Maebe wrote: Michael Van Canneyt wrote on Wed, 27 Jul 2016: On Wed, 27 Jul 2016, Maciej Izak wrote: TNullable = proxy record ... looks good for me, even better than pure record, the context is more clear. Yes. Exactly what Jonas wanted to achieve, I

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Sven Barth
Am 27.07.2016 14:12 schrieb "Maciej Izak" : > > > 2016-07-27 13:11 GMT+02:00 Michael Van Canneyt : >> >> Instance: ^T; default; > > > ";" between default and type will not work. > > TNullable = proxy record > ... > > looks good for me, even better than

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Michael Van Canneyt
On Wed, 27 Jul 2016, Maciej Izak wrote: 2016-07-27 13:11 GMT+02:00 Michael Van Canneyt : Instance: ^T; default; ";" between default and type will not work. Sorry, typo :/ TNullable = proxy record ... looks good for me, even better than pure record, the

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Maciej Izak
2016-07-27 13:11 GMT+02:00 Michael Van Canneyt : > Instance: ^T; default; ";" between default and type will not work. TNullable = proxy record ... looks good for me, even better than pure record, the context is more clear. -- Best regards, Maciej Izak

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Maciej Izak
2016-07-27 11:24 GMT+02:00 Jonas Maebe : > > On a more general note, I think the fact that @recordvar no longer is a > pointer to the record is wrong. You need a different keyword instead of > "record" in that case (or possibly a modifier for the "record" keyword, > like

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Jonas Maebe
Maciej Izak wrote on Wed, 27 Jul 2016: @@ operator is very simple way to determine where you point. In any other case we have casting hell. See below (and more below). @@ exist rather as fulfillment to pa := @a; form tdefault7.pp (anyway is necessary for untyped pointers). You might not like

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Maciej Izak
2016-07-27 10:38 GMT+02:00 Michael Van Canneyt : > > ? A compiler always behaves rational. Not Delphi compiler ;). Check new intrinsic "IsManaged" for XE7 and newer ;) -- Best regards, Maciej Izak ___ fpc-devel maillist -

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Michael Van Canneyt
On Wed, 27 Jul 2016, Maciej Izak wrote: 3. "default" need to be transparent and usable with existing code base, some compiler magic is part of my further compiler development (I mean here "Storage Modifiers" and ARC objects in DelphiNextgen mode). With current approach is possible to pass

Re: [fpc-devel] "Default" discussion for SmartPointers etc

2016-07-27 Thread Maciej Izak
2016-07-27 10:12 GMT+02:00 Maciej Izak : > TNullable = record > curiosity: Pascal nilable types are more elastic than C# nullable types: Nested "nilable" types are allowed. :) -- Best regards, Maciej Izak ___ fpc-devel maillist