C23 groups them with ', which in Sex is quote, so 1'000 read as 1 and
(quote 0); _ between two digits is dropped instead, and anywhere else
stays part of a name.
A C suffix was no number to string->number, so 1u and 1.5f became
symbols, and C got them inside the |pipes| CHICKEN writes those with.
They read now into a literal that prints its C spelling and is typed by
its suffix: an integer in decimal, so 0b101u needs no C23, and a float
in the digits it was written with, since through a double 0.1f could
round to another float and 0.1L would lose what it has over one.
Scheme also reads numbers C has none of. 1/2 reached C as integer
division and +inf.0 as no C at all; those, and integers past 64 bits,
are read errors now. An integer is typed by size as well, so 4000000000
is no longer an int, and one past long long gets the u C would
otherwise only warn about.
Imports were looked for from the unit's directory, so a module in a
subdirectory could not import its neighbours: a pub import failed, a
private one lost its handle declarations, and --public-interface changed
with where sexc ran.
u8 and i32 are typedefs of <stdint.h> names nothing parses, so they had
no rank: (+ a a) over two u8 200s was a u8 holding 144, and (+ n 1) over
an i32 could not be typed at all.
The switch it lowered to took a break in an arm for its own, and the
loop around the match went on. With no else the last arm is the chain's
else, which keeps C from warning that a function may return nothing.
C has a declaration in scope from its own initializer, so in
(match (* e) ((neg (e)) ...)) the binding read the new, uninitialized e.
A binder named like a part of the scrutinee now has it held in a local.
Each program had its own recipe: a hand-written link list, a cd into
tests/ so its includes would not find the modules' namesakes, and a
renamed output so csc would not overwrite the module sexc.o. Read off
their imports like the modules', and compiled to an object named after
their source, they share one rule; include-relative ends the cd.
Each module's prerequisite line restated its import form, so adding a
module or an import meant editing the Makefile to match, and a missed
line only showed when an object came out of order.
A module was a body plus a (module ...) wrapper naming its exports, and
the wrapper came in up to three copies: the root's, a test one that
exported everything, and sextest's, each recompiling the same body.
csc -module makes a file a module by itself, with export forms in its
body, so the wrappers are gone. tests/ and tools/sextest/ link what the
root built, finding it on the repository path; the tests see what a
module exports, and the names only they need are exported as such.
[int const N] read N as the type a trailing const was waiting for, and
wrote int const N b[]; a qualifier waits for a name only when no type
came before it.
An array bound in a pub record, or a name in a pub define's body, is
the importer's to resolve too, and a private define, or one from an
import without pub, failed there as an undeclared identifier. Found in
vs-map-viewer once its units stopped importing everything. A constant
has no declaration short of itself, so it is an error at the pub form.
CHICKEN prints 15 significant digits unless told otherwise, too few to
name every double: 0.9871465422297019 reached the C as
0.987146542229702, a different constant. Found in vs-map-viewer, where
380 literals in a port that has to match .NET bit for bit changed this
way. The shortest spelling that reads back is written, up to 17 digits.
sextest prints the program it read back to sexc, and printed doubles
in CHICKEN's default 15 digits: 0.16666666666666666 arrived as
0.166666666666667, another number.
The array was written at whatever level surrounded it, so [(* q) i]
came out *q[i] -- *(q[i]) to C, compiling with q an int ** and reading
the wrong int. The index now starts afresh too: inside a cast it had
taken the cast's level and gained parens, and so had a chain in the
else arm of ?:, which groups to the right and needs none.
An import pastes another file's forms into the output, so a Makefile
had to make every object depend on every .sex. --depfile names the
modules read, including those read only for an import's interface,
with an empty rule for each, as cc -MD -MP does.
Fixes#40.
An importer is given the pub forms and nothing else, so a pub form
naming a private type, or one from an import without pub, compiled in
its module and failed in every importer with `unknown type name'.
The pub forms are checked as the module itself is compiled. A record,
struct, union or sum behind a pointer needs only declaring, so its
bodyless declaration goes out ahead of them -- the opaque handle that
(pub record T) already gave by hand. Held by value it needs its body,
and a typedef or an enum has no declaration short of its definition:
those are errors at the pub form, saying what would do instead. A name
Sex has no declaration for is left to C.
An importer may now be handed a declaration after the definition it
declares, so a bodyless aggregate no longer replaces known fields.
Fixes#57, #58.
Each method was registered just before its own body was walked, so an
earlier one could not find it. All are registered first now, and one
called above its definition is declared ahead of the bodies, which C
needs as well.
Fixes#44.
getopt-long reads a lone `-' as an option, so -o - died there asking
for a value, and --output=- got through only to create a file named
`-'.
Fixes#43.
Past a typed base, it is a field of a struct only C knows that has no
type, and the warning named the base anyway: `font' for what was
(. font handle), with font declared on the line before.
Fixes#41.
The body walk passed a #(...) by as an atom, so nothing inside one was
typed, dispatched or lifted: (. self p) read as self.p with self a
pointer, where the same path outside the literal was right.
Fixes#45.
C's parens carried over, ((var i int 0) (< i 4) (++ i)), left the
writer short of slots, and it died in caddr with no location; with a
long enough body it would have compiled the body into the header.
Fixes#42.
Every if had its arms anchored, including one inside an argument that
the writer renders as ?:, so a #line landed between its parts and the
C did not compile. -C output, with no directives, hid it.
Fixes#54.
A case body shared the switch's scope, so two cases could not each
declare `bits', and a label could not be followed by a declaration
before C23; inference shared the scope too, and typed a later case's
read of an outer name as the earlier case's local.
Fixes#51.
0x80 was not a number to string->number, so it became a symbol the
printer escaped as |0x80|, and #x was rejected outright. Both spellings
now read as the integer, which the C writes in decimal.
Fixes#47.
The reader took -INFINITY as one symbol, and the leading dash was then
mangled like any other: _INFINITY. -1 was always a number, so a name
gets the same reading.
Fixes#63.
(* char) is a pointer type and (* p) a dereference, and only the names
in scope tell them apart, so semen decides and marks a type for the
writer. Before, both were walked as expressions: sizeof(*char).
Fixes#52.