Questions About Porting Java and Extended Class Syntax Features

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions About Porting Java and Extended Class Syntax Features

bsquared
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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

RE: Questions About Porting Java and Extended Class Syntax Features

JC Chu
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Questions About Porting Java and Extended Class Syntax Features

leledumbo
Administrator
In reply to this post by bsquared
> What is the best way to port 'private static final' member?

private class var (assuming you want to declare a variable).

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

Static initialization block has no equivalent in Pascal, but since unit have initialization section, you can initialize it there.
Reply | Threaded
Open this post in threaded view
|

Re: Questions About Porting Java and Extended Class Syntax Features

bsquared
On 11/06/2012 07:44 PM, leledumbo wrote:

>> What is the best way to port 'private static final' member?
>
> private class var (assuming you want to declare a variable).
>
>> private static final  Set<String> = STATIC_SET;
>    static {
>    STATIC_SET = new HashSet<String>;
>    STATIC_SET.Add("A Value");
>    ...
>    }
>
> Static initialization block has no equivalent in Pascal, but since unit have
> initialization section, you can initialize it there.
>
>
>
> --
> View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Questions-About-Porting-Java-and-Extended-Class-Syntax-Features-tp5711825p5711827.html
> Sent from the Free Pascal - General mailing list archive at Nabble.com.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
@leledumbo
Thank you.  It has been a while.  I unremembered the initialization and
finalization sections.

@JC Chu
Thank you I was unaware of the 'class constructor' and 'class destructor'.

As an aside, I would like to note that after a couple of years away I
still see the same contributers in this list, and it is excellent to
find that support and commitment.

--
Regards,
Brian

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Questions About Porting Java and Extended Class Syntax Features

Sven Barth-2

Am 07.11.2012 18:33 schrieb "bsquared" <[hidden email]>:
> As an aside, I would like to note that after a couple of years away I still see the same contributers in this list, and it is excellent to find that support and commitment.

After all we have to keep the Pascal community living (or spoken in a recent context: defend the small FPC kingdom against the bigger ones ;) ).

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Questions About Porting Java and Extended Class Syntax Features

leledumbo
Administrator
In reply to this post by bsquared
> As an aside, I would like to note that after a couple of years away I still see the same contributers in this list, and it is excellent to find that support and commitment.

It's not our time yet to retire and hand over the kingdom to the little princes (single 's') out there, as they still need to learn a lot before replacing us so that they can maintain the kingdom as we do now XD