[fpc-pascal] Questions About Porting Java and Extended Class Syntax Features

JC Chu jcchu at acm.org
Wed Nov 7 03:50:03 CET 2012


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 <bwcode4u at gmail.com>
*Sent:* ‎November‎ ‎7‎, ‎2012 ‎9‎:‎37
*To:* fpc-pascal at 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 at lists.freepascal.**org<fpc-pascal at lists.freepascal.org>
http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20121107/b0f0f2c5/attachment.html>


More information about the fpc-pascal mailing list