|
9 | 9 | @(append-gen-docs
|
10 | 10 | `(module "numbers"
|
11 | 11 | (path "src/js/base/runtime-anf.js")
|
12 |
| - (form-spec (name "num+")) |
13 |
| - (form-spec (name "num-")) |
14 |
| - (form-spec (name "num*")) |
15 |
| - (form-spec (name "num/")) |
| 12 | + (form-spec (name "+ (addition operator)")) |
| 13 | + (form-spec (name "- (subtraction operator)")) |
| 14 | + (form-spec (name "* (multiplication operator)")) |
| 15 | + (form-spec (name "/ (division operator)")) |
16 | 16 | (data-spec
|
17 | 17 | (name "Number")
|
18 | 18 | (variants)
|
@@ -433,7 +433,7 @@ The mathematical constant π, approximated as a @pyret-id["Roughnum"], or
|
433 | 433 |
|
434 | 434 | @section{Number Operators}
|
435 | 435 |
|
436 |
| -@form["num+" "<left> + <right>"]{ |
| 436 | +@form["+ (addition operator)" "left + right"]{ |
437 | 437 | @margin-note{If either of the values in an arithmetic operator is a
|
438 | 438 | @pyret{Roughnum}, the result is a @pyret{Roughnum}}
|
439 | 439 | When @pyret{left} and @pyret{right} evaluate to numbers, adds them and returns
|
|
448 | 448 | }
|
449 | 449 | }
|
450 | 450 |
|
451 |
| -@form["num-" "<left> - <right>"]{ |
| 451 | +@form["- (subtraction operator)" "left - right"]{ |
452 | 452 | When @pyret{left} and @pyret{right} evaluate to numbers, subtracts
|
453 | 453 | @pyret{right} from @pyret{left} and returns the result.
|
454 | 454 |
|
|
461 | 461 | }
|
462 | 462 | }
|
463 | 463 |
|
464 |
| -@form["num*" "<left> * <right>"]{ |
| 464 | +@form["* (multiplication operator)" "left * right"]{ |
465 | 465 | When @pyret{left} and @pyret{right} evaluate to numbers, multiplies
|
466 | 466 | them and returns the result.
|
467 | 467 |
|
|
474 | 474 | }
|
475 | 475 | }
|
476 | 476 |
|
477 |
| -@form["num/" "<left> / <right>"]{ |
| 477 | +@form["/ (division operator)" "left / right"]{ |
478 | 478 | @margin-note{To be used as an operator, @pyret{/} has to have spaces around
|
479 | 479 | it. This means you need to write @pyret{a / 3} rather than @pyret{a/3} to
|
480 | 480 | divide the value stored in @pyret{a} by @pyret{3}. Things like @pyret{4/3} and
|
|
492 | 492 | }
|
493 | 493 | }
|
494 | 494 |
|
| 495 | + |
495 | 496 | @section{Number Functions}
|
496 | 497 |
|
497 | 498 | @function["num-equal" #:contract (a-arrow N N B) #:return B]{
|
|
0 commit comments