Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9237459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:32:23+00:00 2026-06-18T07:32:23+00:00

Is it possible to ensure const correctness in Haxe? It’s pretty important in a

  • 0

Is it possible to ensure const correctness in Haxe? It’s pretty important in a project where data passing is done to multiple parties. I want to ensure other programmers won’t try to modify my data while it is being exposed for reading. They should be able to read it and modify it using a particular but different function.

A very simple example is here:

//Here the returned geometry should be const
public function getGeometry():Geometry {
    return mGeometry;
}

//We might want to declare GeometryTransformation as const to insure
it will not be modified here and will be reusable for other cases.
public function transform(GeometryTransformation):Void{
    //...
    mObservers.sendMessage(GeometryEvent.TRANSFORMATION_OCCURED, this, mGeometry);
}

There are tons of cases where const correctness improves the readability of the code without having to refer to documentation. It also saves us from insidious and hard to find bugs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:32:24+00:00Added an answer on June 18, 2026 at 7:32 am

    What you can always do is define an immutable super type (interface, super class or anonymous type) of the data you want to pass around and then have all client be written against that.

    There is no such thing as const though. The closest you get are read-only fields.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Check if multiple strings exist in another string Check to ensure a
I'm trying to setup two servers that replicate data. I want to ensure HA
Dear Masters! Is it possible to ensure, that only characters with codes between 0
Possible Duplicate: How do I ensure a text box is alphanumeric but without a
Is it possible when using TFS server to automatically have it ensure a specific
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How to do the vector of sets in C++? I want to
Possible Duplicate: check whether internet connection is available with C# I just want to
I'm working on a new project and we're using a pretty nice stack. NHibernate,
Using JAXB (2) is it possible to ensure that null values are not marshalled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.