ASCII control characters: Difference between revisions

Converted to a draft task (see talk page).
(Added Algol 68)
(Converted to a draft task (see talk page).)
Line 1:
{{draft task}}
ASCII is the American Standard Code for Information Interchange. There are 128 ASCII characters of which the first 32 and the last are 'control characters'.
<br>
 
;Task
Show how your language might treat control characters ''en bloc'' by using an enum, an enum like structure or other approach to associate their names with their ASCII values thereby enabling them to be retrieved or listed by name.
 
Technically, the 33rd character 'space' is a printable character, not a control character, though you may treat it as the latter for the purposes of this task.
<br>
;Reference
* [[wp:ASCII|Wikipedia: ASCII]]
<br>
 
=={{header|ALGOL 68}}==
Algol 68 doesn't have ENUMs but it is easy to create constants, this example shows how a facility similar to Go's iota can be implemented.
Line 152 ⟶ 164:
=={{header|Wren}}==
{{libheader|Wren-dynamic}}
I assume this isn't intended to be a task but simply a reference to how individual languages might treat ASCII control characters ''en bloc'' using enum like structures or otherwise. Note that technically 'space' is a printable character, not a control character.
 
Wren doesn't have enums built into the language but can create them dynamically at runtime. However, such enums need to have consecutive integer values.
 
9,476

edits