An empty needle matched everything, so half the quote checks were decoration

`case $x in *""*)` is always true, so every check whose text came from a grep
went green the moment the line it greps for was renamed — which is exactly the
case those checks exist for, and they guard files other lanes are editing.
Verified by pointing one grep at a string that is not there: ok before, FAIL
after. sqrt-f32 was overstated in the same spirit; it is a declare, not Flan.
This commit is contained in:
Joseph Ferano 2026-09-12 03:58:42 +07:00
parent bbda5e4cd7
commit e0947adb2a
2 changed files with 22 additions and 3 deletions

View File

@ -16,6 +16,16 @@ fail=0
flat=$(sed -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&amp;/\&/g' "$page" | tr '\n' ' ' | tr -s ' ')
want() {
# An empty needle would match anything — `case $x in **)` is always true — so
# every check whose text comes from a grep would go green the moment the line
# it greps for was renamed. That is the one failure this script exists to
# catch, so the empty case is a failure and not a match.
if [ -z "$2" ]; then
echo "FAIL $1"
echo " nothing to compare against — whatever this quotes has moved"
fail=1
return
fi
needle=$(printf '%s' "$2" | tr '\n' ' ' | tr -s ' ')
case $flat in
*"$needle"*) echo "ok $1" ;;

View File

@ -629,8 +629,8 @@ yielding a huge unsigned length.</p>
<h2 id="prelude">The prelude</h2>
<p>The prelude is written in Flan and prepended to every program, so nothing in it
needs importing. Printing is deliberately not a primitive:
<p>The prelude is written in Flan, all but one line of it, and prepended to every
program, so nothing in it needs importing. Printing is deliberately not a primitive:
<code>write-stdout</code> is the one output primitive and everything above it is
ordinary Flan.</p>
@ -641,7 +641,7 @@ ordinary Flan.</p>
<tr><td>slices of <code>i32</code></td><td><code>swap-i32!</code>, <code>reverse-i32!</code>, <code>sort-i32!</code>, <code>index-of-i32</code>, <code>min-i32</code>, <code>max-i32</code>, <code>sum-i32</code></td></tr>
<tr><td>bytes</td><td><code>bytes=?</code>, <code>starts-with?</code>, <code>ends-with?</code>, <code>index-of-byte</code>, <code>index-of-bytes</code>, <code>trim</code>, <code>digit?</code>, <code>space?</code></td></tr>
<tr><td>parsing</td><td><code>parse-i64</code>, <code>parse-f64</code></td></tr>
<tr><td>numbers</td><td><code>sign-f32</code>, <code>lerp</code>, <code>floor-f32</code>, <code>ceil-f32</code>, <code>round-f32</code>, <code>sqrt-f32</code></td></tr>
<tr><td>numbers</td><td><code>sign-f32</code>, <code>lerp</code>, <code>floor-f32</code>, <code>ceil-f32</code>, <code>round-f32</code>, and <code>sqrt-f32</code>, which is the one <code>declare</code> in the file</td></tr>
<tr><td>random</td><td><code>rand-seed</code>, <code>rand-u32</code>, <code>rand-f32</code>, <code>rand-i32-range</code>, <code>rand-f32-range</code></td></tr>
</table>
</div>
@ -653,6 +653,15 @@ too</strong>: <code>strtoll</code> answers 0 for <code>""</code>, 0 for
<code>"abc"</code> and 12 for <code>"12x"</code>, which are three wrong answers a caller
cannot tell from a real 12.</p>
<p><code>sqrt-f32</code> goes the other way, and is the one function in the file that
is not Flan: <code>(declare sqrt-f32 [x f32] f32 "sqrtf")</code>. Every other number
here is reachable from the four operations and a cast; a square root is not, and the
usual trick of seeding Newton's method from the exponent bits needs a bit-cast between
<code>f32</code> and <code>u32</code> that the language does not have. IEEE-754 makes
<code>sqrt</code> correctly rounded, so libm gives the same bit pattern on both targets
anyway — the very property that keeps the RNG in Flan is, for this one, the argument
for going out to C. It is also why every link carries <code>-lm</code>.</p>
<p>There is no <code>println</code>. There is no overloading yet, so each printer names
its type. The names are the compiler's answer too: <code>(println 1)</code> is
<code>unknown function println</code>.</p>