Variables
- What are variables in progamming?
- They're like mathematical variables but they have a direct
implementation in computer hardware.
- There is computer memory associated with a variable (e.g. 2 bytes,
32 bytes, or 2000 bytes).
- It usually has a type associated with (e.g. boolean, integer or string)
- The variable persists for a time specified by the program, then is
used for some other program or perhaps reused for your program.
- You can inspect the variable (e.g. ==, <)
- You can change the variable (=)
- Clips uses lists for its variables. They call them facts.
- So, you define a fact by for instance a 3-ary predicate like:
(age-of Chris 39).
- The developer and the reader nows that the age of Chris is 39, when
he sees this fact.