Skip to content

Commit 5525d04

Browse files
committed
Integrate technical editing for Chapter 11
1 parent d2711de commit 5525d04

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

11_language.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ parentheses follow.
231231
(((syntax tree)))(((Egg language)))(((parse function)))This is all we
232232
need to parse Egg. We wrap it in a convenient `parse` function which
233233
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.
235236

236237
// include_code strip_log
237238
// test: join
@@ -354,9 +355,10 @@ specialForms["if"] = function(args, env) {
354355
(((conditional execution)))Egg's `if` construct expects exactly three
355356
arguments. It will evaluate the first, and if the result isn't the
356357
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.
360362

361363
(((Boolean)))Egg differs from JavaScript in how it handles the
362364
condition value to `if`. It will not treat things like zero or the

0 commit comments

Comments
 (0)