If you need to initialize a [STRICT] PRIVATE CLASS VAR you need to do this
in a CLASS CONSTRUCTOR (similarly finalizations will need a CLASS
DESTRUCTOR).  You can expose it thru a read-only CLASS PROPERTY, but there
is no way to make it a real constant (as long as you can access the
variable itself, you can modify it).

-- 
Best regards,
JC Chu

 *From:* bsquared <bwcod...@gmail.com>
*Sent:* ‎November‎ ‎7‎, ‎2012 ‎9‎:‎37
*To:* fpc-pascal@lists.freepascal.org
*Subject:* [fpc-pascal] Questions About Porting Java and Extended Class
Syntax Features

Hello,

I am looking into porting Java to Free Pascal.  I have some confusion about
how to port certain types of Java Lang Features.

What is the best way to port 'private static final' member?
I was thinking the extended class syntax would cover this, but I dont it
will work for a scenario like this:

 private static final ObjectMapper mapper = new ObjectMapper();

or

 private static final  Set<String> = STATIC_SET;
 static {
 STATIC_SET = new HashSet<String>;
 STATIC_SET.Add("A Value");
 ...
 }

Any insight you may have is appreciated.

Thank you.

-- 
Regards,
Brian

______________________________**_________________
fpc-pascal maillist  -
fpc-pascal@lists.freepascal.**org<fpc-pascal@lists.freepascal.org>
http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to