@@ -128,6 +128,8 @@ of comment
128
128
say 'code again';
129
129
= end code
130
130
131
+ = comment TODO: identifiers
132
+
131
133
= head1 Statements and Expressions
132
134
133
135
Perl 6 programs are made of lists of statements. A special case of a statement
@@ -212,6 +214,12 @@ String literals are surrounded by quotes:
212
214
213
215
See L < quoting|/language/quoting > for many more options.
214
216
217
+ = head3 Blob literals
218
+
219
+ Binary data of L < type Blob|/type/Blob > can be written as C < :base{data} > , so
220
+
221
+ :16<DE AD BE EF>
222
+
215
223
= head3 Number literals
216
224
217
225
Number literals are generally specified in base ten, unless a prefix like
@@ -266,11 +274,40 @@ a real and an imaginary number:
266
274
1+2i
267
275
6.123e5i
268
276
269
- = begin comment
270
277
271
278
= head3 Pair literals
272
279
273
- TODO
280
+ Pairs are made of a key and a value, and there are two basic forms for
281
+ constructing them: C << key => 'value' >> and C < :key('value') > .
282
+
283
+ = head4 Arrow pairs
284
+
285
+ Arrow pairs can have an expression or an identifier on the left-hand side:
286
+
287
+ identifer => 42
288
+ "identifier" => 42
289
+ ('a' ~ 'b') => 1
290
+
291
+ = head4 Adverbial pairs (colon pairs)
292
+
293
+ Short forms without explicit values:
294
+
295
+ my $thing = 42;
296
+ :$thing # same as thing => $thing
297
+ :thing # same as thing => True
298
+ :!thing # same as thing => False
299
+
300
+ The variable form also works with other sigils, like C < :&callback > or
301
+ C < :@elements > .
302
+
303
+ Long forms with explicit values:
304
+
305
+ :thing($value) # same as thing => $value
306
+ :thing<quoted list> # same as thing => <quoted list>
307
+ :thing['some', 'values'] # same as thing => ['some', 'values']
308
+ :thing{a => 'b'} # same as thing => { a => 'b' }
309
+
310
+ = begin comment
274
311
275
312
= head3 Array literals
276
313
0 commit comments