Measures Concepts
GitHub icon

Constants

Constants - language feature

< >
Example from JavaScript, TypeScript:
const one = 1
Example from Ruby:
# Constants in Ruby being with a capital letter. Will throw a warning or error, depending on runtime settings. Name = "John" # Not a constant name = "John"
Example from C3:
const FOO = 123; const void* BAR = null;
Example from Speedie:
constants Opened = 1 Closed = 2
Example from Jule:
const PI = 3.14159265359
Example from Aardvark:
`static` keyword

Languages with Constants include Java, JavaScript, C, C++, PHP, Ruby, C#, Go, Rust, Kotlin, TypeScript, Julia, Objective-C, Dart, F#, Groovy, Chapel, SystemVerilog, C3, Speedie, Jule, Angelscript, Pizza, Apex, Eclipse Command Language, C2, Aardvark, nimrod, Oracle Java, Deesel, Tick C, cooC

Languages without Constants include progsbase

This question asks: Does the language have a way to declare constant compile time variables?

Read more about Constants on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Day 605 feedback@pldb.io Logout