Skip to content

Commit a24d845

Browse files
committed
Talk about identifiers
1 parent 4b29315 commit a24d845

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lib/Language/syntax.pod

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,28 @@ of comment
128128
say 'code again';
129129
=end code
130130
131-
=comment TODO: identifiers
131+
=head2 Identifiers
132+
133+
Identifiers are a grammatical building block that occur in several places. An
134+
identifier is a primitive name, and must start with an alphabetic character
135+
(or an underscore), followed by zero or more word characters (alphabetic,
136+
underscore or letter). You can also join two or more identifiers by a dash
137+
C<-> or a single quote C<'>, and the result is also considered to be an
138+
identifier.
139+
140+
# valid identifiers:
141+
x
142+
something-longer
143+
with-numbers1234
144+
don't
145+
146+
# not valid identifiers:
147+
with-nubmers1234-5
148+
42
149+
150+
Names of constants, types and routines are identifiers, and they also appear
151+
in variable names (optionally proceeded by a sigil; see
152+
L</language/variables|variables> for more details.)
132153
133154
=head1 Statements and Expressions
134155

0 commit comments

Comments
 (0)