Releases: elliotchance/bento
Releases · elliotchance/bento
v0.16.1
Display with multiple arguments (#55) This is a really dodgy hack until we can properly support varargs. Each of the arguments will be printed with no space between them and a single newline will be written after any (including zero) arguments. I have included examples/am-pm.bento to demonstrate this.
v0.16.0
Added first backend example in PHP (#54) This not only adds an example of a backend in PHP, but also provides all the specification/documentation for the communication protocol.
v0.15.1
Wrap sentences on "," (#53) Sentences can also contains new lines if the line ends with a `,`. This is useful for long inline statements: if my-name != "John", display "oops!", otherwise display "All good." Fixes #49
v0.15.0
Added Questions (#52) A question is a special type of function that is defined with a `?` instead of a `:`: it is ok? yes A question is answered with the `yes` or `no` sentences. Once a question is answered it will return immediately. If a question is not explicitly answered by the end, it's assumed to be `no`. Questions can be asked in conditionals: start: if it is ok, display "All good!" Questions can also take arguments in the same way that functions do: start: declare x is number set x to 123 if x is over 100, display "It's over 100", otherwise display "Not yet" the-number is over threshold (the-number is number, threshold is number)? if the-number > threshold, yes Fixes #21
v0.14.0
Added special "_" (blackhole) variable (#48) The blackhole variable is a single underscore (`_`). It can be used as a placeholder when the value can be ignored. For example: divide 1.23 by 7.89 into _ If `_` is used in a place where the value would be read it will return a zero value (the same as the default value for that type). The following lines would function the same. However, you should not rely on the blackhole variable as a readable value and it may be made illegal in the future: add _ and 7.89 into result add 0 and 7.89 into result Fixes #32
v0.13.0
Multiples lines with "..." (#47) Long sentences can be broken up into multiple lines using `...` at the end of each line, excluding the last line: this is a really long... sentence that should go... over multiple lines Indentation between lines does not make an difference. However, it is easier to read when following lines are indented. Fixes #33
v0.12.1
Allow "a" and "an" before a type (#46) The word `a` or `an` may appear before the type. This can make it easier to read: "is a number" rather than "is number". However, the "a" or "an" does not have any affect on the program. Fixes #43
v0.12.0
Custom precision for numbers (#45) 1. A number variable is exact and has a maximum number of decimal places (this is also called the precision). 2. If the number of decimal places is not specified it will use 6. 3. For integers you should use `number with 0 decimal places`. 4. The number of decimal places cannot be negative. 5. A number has no practical minimum (negative) or maximum (positive) value. You can process incredibly large numbers with absolute precision. 6. Any calculated value will be rounded at the end of the operation so that it never contains more precision than what is allowed. For example if the number has one decimal place, `5.5 * 6.5 * 11` evaluates to `393.8` because `5.5 * 6.5 = 35.75 => 35.8`, `35.8 * 11 = 393.8`. 7. Numbers are always displayed without trailing zeroes after the decimal point. For example, `12.3100` is displayed as `12.31` as long as the number of decimal places is at least 2. 8. The words `places` and `place` mean the same thing. However, it is easier to read when `place` is reserved for when there is only one decimal place. Fixes #34
v0.11.0
Added "while" and "until" loops (#42) Sentences starting with `while` repeat the sentence until while the condition is true. That is, the loop will only stop once the condition becomes false. Conversely, using `until` will repeat the sentence until the condition becomes true. Loops are written in one of the following forms: while/until <condition>, <true> while/until <condition>, <true>, otherwise <false> Fixes #9
v0.10.0
Added System backend (#35) The system backend provides direct access to running programs on the host machine. - `run system command <command>`: Run the `command` and send all stdout and stderr to the console. - `run system command <command> output into <output>`: Run the `command` and capture all of the stdout and stderr into the `output`. - `run system command <command> status code into <status>`: Run the `command` and discard and stdout and stderr. Instead capture the status code returned in `status`. - `run system command <command> output into <output> status code into <status>`: Run the `command` and capture the stdout and stderr into `output` as well as the status code returned into `status`. Example: start: declare echo-result is number run system command "echo hello" status code into echo-result unless echo-result = 0, display "command failed!" Fixes #29