Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

Perhaps this belongs on stackoverflow, but since it could have some applicability to non-tech contexts, thought I'd post here.

Is there a word that means "make something that is variable constant"?

For example, in programming, I might have a variable queueSize that could be set to different values for different queues. Later I decide to make this a fixed (constant) value for all queues. What is a word to describe this conversion?

Edit

A real-world (non-programming) example is converting from a variable tax-rate to a flat (constant) tax-rate. I proposed below that, in light of this example, the word flatten could be used to answer my question. However, this word does not conventionally mean "to make constant", and has other meanings in the context of several programming languages.

Edit

To be clear, I'm not looking for a word/expression the means changing a variable from one type to another (casting). Rather, I mean keeping the type the same, but changing a field from a variable to a constant value.

share|improve this question
    
This is getting very much into coding, and may end up being inappropriate for this venue. But: When you say "changing" a field, do you mean just assigning it a value that is then not expected to change? E.g., you're not doing anything to the variable at all, just to its value? –  Mark Beadles Aug 6 '12 at 22:32
    
In terms of coding, I think I mean converting a variable to a constant. In C, I might change a variable which can be set during runtime to a define which never (and cannot) change during the lifetime of the application. –  maxenglander Aug 6 '12 at 22:37
    
Ah, so in a previous version of the code it was a variable. Then in a future version of the code you made it a #define (or equivalent)? I think that's very much a question you should ask developers about :) –  Mark Beadles Aug 6 '12 at 22:43
    
I'd say something like "fix" or <tip-of-my-tongue...>. –  Simon Kuang Jul 8 '13 at 19:57
add comment

closed as too localized by Robusto, kiamlaluno, Mark Beadles, Jasper Loy, tchrist Aug 7 '12 at 0:23

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

5 Answers

up vote 5 down vote accepted

I'd say "make a constant of" (or some similar form with "make constant"); for example, "I made queueSize into a constant". More generally, consider fixate, "To make something fixed and stable; to fix". In a programming context, fixate may be perfectly acceptable even where fix (with usual meaning of "convert real to integer") is not.

Without more context, I hesitate to recommend cast because I don't know of a language with a cast keyword that allows casting a variable to static. I imagine make static may mislead some as well, because static has multiple meanings like non-dynamically allocated; in file scope; or single instance in class.

share|improve this answer
    
Yeah, "make constant" suffers the same problems as "make static" and "make fixed" since const(ant), static, and fixed are very common keywords across languages with overloaded meanings. –  Mark Beadles Aug 6 '12 at 21:10
    
I think "make constant" is less confusing that "make static" when it comes to converting a variable into an "invariable". static variables are still mutable/ writable whereas const variables are (ideally) immutable. –  canpolat Aug 6 '12 at 21:27
add comment

For clarity and concision, I'd recommend using "make static" or "make constant".

It's short, only 10-11 characters depending on how you treat the space; unambiguous; and unobscure. Sometimes a single word isn't what you want so much as something short and to the point.

share|improve this answer
add comment

Yes cast is the term we would use in the industry to imply conversion from one type to another..

I casted the int to a long.

Or, you could say make immutable if you mean to say remove the write flag. In a lot of languages this is simply done with a flag anyway and so under the hood nothing drastic is happening.. Some crappy languages call this freezing

Note some languages differentiate between casting and converting on the basis of whether or not it merely reinterprets the underlying data, or converts it to a different representation.

If you're going from a complex data structure, to a simple the one the terms used are marshal or serialize.

share|improve this answer
6  
Never heard anyone say "casted." It's always cast, past & present. I've also never heard the word "cast" used to describe making something static. –  Robert Harvey Aug 6 '12 at 19:53
2  
There is simply no such word as ∗casted. The OED has the verb cast as invariant in its past and past participle alike. It works like set: it doesn’t change. –  tchrist Aug 7 '12 at 0:34
1  
Wiktionary disagrees. Stop trolling. –  Evan Carroll Aug 7 '12 at 14:47
    
Though wiktionary is questionable, it does say that it is 'nonstandard'. –  Mitch Aug 7 '12 at 15:15
    
add comment

Appreciate all the answers so far.

One word which does not conventionally mean "to make constant", but that I think could be (read: I'd like to see) co-opted for that purpose, is flatten. For example, if the US were to switch from a variable tax rate to a flat one, people might say "in 2012 the President flattened the tax rate".

share|improve this answer
1  
flatten is generally reserved concept (and/or word) in java, ruby, and .NET –  New Alexandria Aug 6 '12 at 21:44
    
Well, it's your program, you can use the word however you like. But I'd think this usage would be confusing. Flatten in the tax context means to flatten the curve. –  Mark Beadles Aug 6 '12 at 22:35
add comment

"Pin down", "fix", or "stabilize" can all mean to take something moving, unstable, or unknown and make it known and stationary, if you want non-programming answers.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.