On Mon, Jul 31, 2017 at 11:28 AM, Felipe Monteiro de Carvalho
wrote:
> On Mon, Jul 31, 2017 at 2:08 PM, Marcos Douglas B. Santos
> wrote:
>> But that is the goal to achieve...
>> Not because Java, but to restrict the initialization of the attributes.
>
> I meant that if its trivial to restrict se
On Mon, Jul 31, 2017 at 2:08 PM, Marcos Douglas B. Santos
wrote:
> But that is the goal to achieve...
> Not because Java, but to restrict the initialization of the attributes.
I meant that if its trivial to restrict setting final fields to
constructors, but it might be a lot of work to check and
On Mon, Jul 31, 2017 at 6:25 AM, Felipe Monteiro de Carvalho
wrote:
> On Sun, Jul 30, 2017 at 10:47 PM, Sven Barth via fpc-pascal
> wrote:
>> (though if one would restrict the assignments to the constructors itself
>> without any methods called by the constructor then we might be able to
>> imple
On Sun, Jul 30, 2017 at 10:47 PM, Sven Barth via fpc-pascal
wrote:
> (though if one would restrict the assignments to the constructors itself
> without any methods called by the constructor then we might be able to
> implement that nevertheless, don't know what Java or other languages
> with final
On Sun, Jul 30, 2017 at 5:47 PM, Sven Barth via fpc-pascal
wrote:
> On 30.07.2017 20:55, Marcos Douglas B. Santos wrote:
>>
>> I would like to instantiate my attribute only once inside constructor
>> and then it will be "const" or "final", I mean, immutable.
>> Today it is not possible, right? Any
On 30.07.2017 20:55, Marcos Douglas B. Santos wrote:
> On Sun, Jul 30, 2017 at 1:46 PM, Maciej Izak wrote:
>> 2017-07-30 18:37 GMT+02:00 Marcos Douglas B. Santos :
>>>
>>> 1. Is this by design?
>>
>>
>> Yes. To disallow this you need to use {$J-} directive.
>
> I know that we can use this "hack"
On 30/07/17 19:55, Marcos Douglas B. Santos wrote:
I would like to instantiate my attribute only once inside constructor
and then it will be "const" or "final", I mean, immutable.
Today it is not possible, right? Any thoughts to the future?
It is not what you are asking for, but you can do this:
On Sun, Jul 30, 2017 at 1:46 PM, Maciej Izak wrote:
> 2017-07-30 18:37 GMT+02:00 Marcos Douglas B. Santos :
>>
>> 1. Is this by design?
>
>
> Yes. To disallow this you need to use {$J-} directive.
I know that we can use this "hack" in local functions/methods, but in
an attribute... What is the go
2017-07-30 18:37 GMT+02:00 Marcos Douglas B. Santos :
> 1. Is this by design?
>
Yes. To disallow this you need to use {$J-} directive.
> 2. Is there a way to declare attributes "final" like Java does?
>
No for constants.
--
Best regards,
Maciej Izak
__
The following code is compilable.
I'm using a private const with type defined and I can change it in the
constructor.
1. Is this by design?
2. Is there a way to declare attributes "final" like Java does?
=== begin ===
type
TFoo = class
private
const INT: Integer = 0;
public
construc
10 matches
Mail list logo