@@ -231,7 +231,8 @@ parentheses follow.
231
231
(((syntax tree)))(((Egg language)))(((parse function)))This is all we
232
232
need to parse Egg. We wrap it in a convenient `parse` function which
233
233
verifies that it has reached the end of the input string after parsing
234
- the program, and which gives us the program's data structure.
234
+ the expression (an Egg program is a single expression), and which
235
+ gives us the program's data structure.
235
236
236
237
// include_code strip_log
237
238
// test: join
@@ -354,9 +355,10 @@ specialForms["if"] = function(args, env) {
354
355
(((conditional execution)))Egg's `if` construct expects exactly three
355
356
arguments. It will evaluate the first, and if the result isn't the
356
357
value `false`, it will evaluate the second. Otherwise, the third gets
357
- evaluated. Because this `if` form is an expression, not a statement as
358
- it is in JavaScript, it has a value—namely, the result of the second
359
- or third argument.
358
+ evaluated. This `if` form is more similar to JavaScript's ternary `?:`
359
+ operator than to JavaScript's `if`—is an expression, not a statement,
360
+ and it produces a value—namely the result of the second or third
361
+ argument.
360
362
361
363
(((Boolean)))Egg differs from JavaScript in how it handles the
362
364
condition value to `if`. It will not treat things like zero or the
0 commit comments