Opened 2 years ago
Closed 23 months ago
#5151 closed enhancement (fixed)
bc-6.1.1
Reported by: | Bruce Dubbs | Owned by: | lfs-book |
---|---|---|---|
Priority: | normal | Milestone: | 11.3 |
Component: | Book | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description
New minor version.
Change History (2)
comment:1 by , 2 years ago
comment:2 by , 23 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed at r11.2-173-g9292384ba.
Note:
See TracTickets
for help on using tickets.
## 6.1.1
This is a production release that fixes a build issue with predefined builds and generated tests.
## 6.1.0
This is a production release that fixes a discrepancy from the
bc
standard, a couple of memory bugs, and adds new features.The discrepancy from the
bc
standard was with regards to the behavior of thequit
command. Thisbc
used to quit whenever it encounteredquit
during parsing, even if it was parsing a full file. Now,bc
only quits when encounteringquit
*after* it has executed all executable statements up to that point.This behavior is slightly different from GNU
bc
, but users will only notice the difference if they putquit
on the same line as other statements.The first memory bug could be reproduced by assigning a string to a non-local variable in a function, then redefining the function with use of the same non-local variable, which would still refer to a string in the previous version of the function.
The second memory bug was caused by passing an array argument to the
asciify()
built-in function. In certain cases, that was wrongly allowed, and the interpreter just assumed everything was correct and accessed memory. Now that arrays are allowed as arguments (see below), this is not an issue.The first feature was the addition of the
is_number()
built-in function (u
indc
) that returns 1 if the runtime argument is a number and 0 otherwise.The second feature was the addition of the
is_string()
built-in function (t
indc
) that returns 1 if the runtime argument is a string and 0 otherwise.These features were added because I realized that type-checking is necessary now that strings can be assigned to variables in
bc
and because they've always been assignable to variables indc
.The last added feature is the ability of the
asciify()
built-in function inbc
to convert a full array of numbers into a string. This means that character-by-character printing will not be necessary, and more strings than just single-character ones will be able to be created.