v3.5.0 #56
minirang
announced in
Announcements
v3.5.0
#56
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
New:
andandor.a and banda or bcombine conditions, and&&and||are other spellings of them. The operands can be of any type (the usual falsy values apply) and the result is always aboolean. The right operand is evaluated only when the left one does not already decide the result, sox is not 0 and 10 / x > 1never divides by zero; a chain of hundreds of operands stops early too. They bind looser than!, which binds looser than a comparison, so!x is 3still means!(x is 3).New:
%and**.%is the remainder of a division and takes the sign of the divisor, likemath_mod(-7 % 3is2).**raises to a power, groups to the right and binds tighter than a unary minus on its left (-2 ** 2is-4,2 ** 3 ** 2is512), likemath_pow. Both operators and both functions now run the same code (engine/common/Arithmetic.h), so results and refusals agree: a remainder by zero and0 ** -1areE4-006, a negative base with a fractional exponent or a result too large to represent isE4-025, and a non-number operand isE4-005.Behavior change:
andandorare reserved words. A program that used either as the name of a variable, function or parameter must rename it. A lone&or|is a syntax error that names the doubled spelling (&&,||), as=namesto.==and!=are still not operators; equality isisandis not.Fixed: on Windows, an error thrown inside a function crashed
cuffc.exebuilt with GCC at-O2 -fltoor-O3 -flto. Every error report from inside a function and everyor_elsearound a failing call ended in an access violation (14 tests of the Windows job).stackPointer()used__builtin_frame_address, which gives the functions that inline it a frame pointer; GCC then describes the savedxmm6-xmm15of such a frame wrongly to the Windows exception unwinder, so an exception passing through it returned those callee-saved registers corrupted to the catching function. On Windows the engine now takes the address of a local variable instead, and the build flags are unchanged. The cause was found by reproducing the failure with a MinGW cross compiler under Wine; the design notes describe it.Fixed:
cli/tests/run_tests.ps1skipped the comparison ofcuffshwithcuffcon Linux and macOS, and failed the interactive suites on Windows. The folders it compares were written with backslashes, so PowerShell 7 outside Windows found none of them. The interactive suites drive a POSIX pseudo-terminal (pty,termios, signals) that Windows does not have; they are now reported as not applicable there instead of failing, and the unusedpywinptyrequirement is gone.New: the shell workflow runs on Windows.
repl-test.yamlbuildscuffc.exeandcuffsh.exewith MSYS2's MinGW-w64 and runs the native checks ofrun_tests.ps1(piped scripts, error text, Korean paths, flags, limits, andcuffshagainstcuffcover every shipped script). It also runs whenMakefile.winchanges.Fixed:
tests/run.shignoredCXX. The unit tests were always built withg++, although the documentation listsCXX; it is honoured now. The unit-test binaries are built in a private temporary directory instead of fixed names in/tmp, so two runs no longer overwrite each other.*.shfiles are checked out with LF line endings on every platform.Tests and documentation. New cases for
%,**,and,or, short-circuit evaluation and the precedence of all of them, error cases for each refusal and for a lone&or|, and unit tests that run longand/or/**chains under a small stack. The language reference (precedence table, arithmetic, logic, reserved words), the tour, themathpage and the error descriptions ofE4-006andE4-025describe the new operators; the design notes record the decisions (items 44 and 45).This discussion was created from the release v3.5.0.
All reactions