Mark Wooding [Thu, 8 Aug 2019 19:06:51 +0000 (20:06 +0100)]
src/optparse.lisp: Muffle warnings about `&optional ... &key ...'.
Mark Wooding [Thu, 8 Aug 2019 14:57:45 +0000 (15:57 +0100)]
doc/check-docs: Return nonzero if discrepancies are found.
Mark Wooding [Thu, 8 Aug 2019 11:58:07 +0000 (12:58 +0100)]
src/: Write dependency-tracking Makefile fragments.
And deploy them in the Makefile!
Mark Wooding [Thu, 8 Aug 2019 11:44:55 +0000 (12:44 +0100)]
src/module-output.lisp: Introduce `module-output-file'.
This is the code from `frontend.lisp', which has been modified to use
it.
Mark Wooding [Thu, 8 Aug 2019 10:17:14 +0000 (11:17 +0100)]
src/parser/parse-expr-{proto,impl}.lisp: Fully hide the parser state.
We didn't publish the ability to pop things, so external implementers
are rather limited in their options. Withdraw this entirely.
The `push-operator' and `apply-operator' generic functions are now
internal. The `push-value' function is gone entirely: the only caller
was `parse-expression', and that now simply pushes the value onto the
stack directly.
Mark Wooding [Thu, 8 Aug 2019 10:15:17 +0000 (11:15 +0100)]
vars.am: Add GNU Make pattern rules for Sod output files.
Additional dependencies in suffix rules don't work, apparently. Non-GNU
make(1) should just see bizarre filenames which nobody cares about, so
this is a safe thing to do.
Mark Wooding [Thu, 8 Aug 2019 10:13:14 +0000 (11:13 +0100)]
doc/list-exports: Use the same output directory as the main `Makefile'.
This way we (a) don't have to rebuild the project separately for
analysing the symbols, and (b) we won't clobber the ordinary ASDF-
maintained FASLs, which I typically build with different optimization
settings (turning on debugging, specifically).
Mark Wooding [Thu, 8 Aug 2019 00:49:41 +0000 (01:49 +0100)]
src/module-impl.lisp: Indent the first line of a C fragment on output.
If we make the text appear in the right column, then GCC (at least) will
print out the correct line of the original Sod module and underline the
right pieces of it in error messages. Which is pretty awesome,
actually.
Mark Wooding [Thu, 8 Aug 2019 00:25:56 +0000 (01:25 +0100)]
doc/concepts.tex, src/optparse.lisp: Rephrasing respectively.
Mark Wooding [Thu, 8 Aug 2019 00:17:15 +0000 (01:17 +0100)]
doc/concepts.tex, doc/syntax.tex: Replace `\textsf{...}' by `@|...|'.
Also, replace an enterprising combination of the `quote' environment
with `\textsf' by `prog'.
These were all very old.
Mark Wooding [Wed, 7 Aug 2019 17:26:29 +0000 (18:26 +0100)]
doc/*.tex: Add stubs for `file-location' reader methods.
Mark Wooding [Wed, 7 Aug 2019 17:25:21 +0000 (18:25 +0100)]
doc/check-docs: Add a program to check that the right things are documented.
How do you think I managed to find all of the problems I just fixed? ;-)
Mark Wooding [Wed, 7 Aug 2019 17:24:00 +0000 (18:24 +0100)]
doc/*.tex: Add, remove, and/or fix stubs to match reality.
Many stubs were missing. A few were wrongly spelled, or had the wrong
category. Some were spurious. Fixfixfix.
Mark Wooding [Wed, 7 Aug 2019 17:19:02 +0000 (18:19 +0100)]
doc/meta.tex: Rearrange the initargs stubs.
Gather the classes and accessors; gather `make-sod-slot-initarg' and
`make-sod-slot-initarg-using-slot'. Gently reorder things.
Mark Wooding [Wed, 7 Aug 2019 17:13:55 +0000 (18:13 +0100)]
doc/meta.tex: Add missing return values for `make-sod-MUMBLE-initarg'.
Mark Wooding [Wed, 7 Aug 2019 16:55:36 +0000 (17:55 +0100)]
doc/meta.tex: Delete stubs for obsolete `define-sod-class' local-macros.
Mark Wooding [Wed, 7 Aug 2019 16:51:20 +0000 (17:51 +0100)]
doc/misc.tex: Clarify that `augment-options' is in `sod-frontend'.
Mark Wooding [Wed, 7 Aug 2019 16:36:08 +0000 (17:36 +0100)]
doc/parsing.tex: Reorganize the parsing-syntax section.
Add some substructure and labels. Promote `with-parser-context' to
first position.
I'm not sure this is completely right, but the previous situation was a
total mess.
Mark Wooding [Wed, 7 Aug 2019 16:32:58 +0000 (17:32 +0100)]
doc/clang.tex: Clarify that `c-function-arguments' never gives you keywords.
Mark Wooding [Wed, 7 Aug 2019 16:16:06 +0000 (17:16 +0100)]
doc/*.tex: Minor source-level reformatting.
No effect on the document.
Mark Wooding [Wed, 7 Aug 2019 15:26:34 +0000 (16:26 +0100)]
doc/sod.sty: Provide explicit description labelling and indexing commands.
And a `\dhead*' which suppresses the usual labelling and indexing, for
the sake of special effects. Use this new machinery to inhibit
the (possibly confusing) indexing on the example entries in
`lispintro.tex'.
Mark Wooding [Wed, 7 Aug 2019 15:24:33 +0000 (16:24 +0100)]
doc/sod.sty: Rewrite `\descref' to support a [MOD] argument.
Take the opportunity to factor out an annoying part of the parsing,
which `might' come in handy later.
Mark Wooding [Wed, 7 Aug 2019 15:15:31 +0000 (16:15 +0100)]
doc/sod.sty: Make the `modindex' and `modlabel' argument order less mad.
Now it's {MOD}{CAT}{...}...{NAME}, like (nearly) everything else.
Mark Wooding [Wed, 7 Aug 2019 15:10:14 +0000 (16:10 +0100)]
doc/sod.sty: Keep `muffs' and `kwd' names decorated.
Have the `modindex' method strip off the decorations instead.
Mark Wooding [Wed, 7 Aug 2019 14:28:38 +0000 (15:28 +0100)]
doc/sod.sty: Rename the default modifier to `plain'.
Mark Wooding [Wed, 7 Aug 2019 14:24:46 +0000 (15:24 +0100)]
doc/sod.sty: Make `\fmtspecs' be external again.
Sadly, putting `\@...' control sequences in the index doesn't work.
Mark Wooding [Wed, 7 Aug 2019 16:26:42 +0000 (17:26 +0100)]
doc/clang.tex, doc/layout.tex: Add labels and indexing for things in tables.
The simple C types, instruction types, and temporary names lacked
description entries. Use the new `\desclabel' to arrange index entries
and labels.
Mark Wooding [Wed, 7 Aug 2019 16:22:16 +0000 (17:22 +0100)]
src/codegen-impl.lisp: Remove the `setf' writer for `codegen-functions'.
It's not used for anything, and I don't think I want to export it.
Mark Wooding [Wed, 7 Aug 2019 16:21:40 +0000 (17:21 +0100)]
src/parser/streams-impl.lisp: Use slot accessor rather than `with-slots'.
The code is a bit longer, but I think it's more comfortable to read.
Mark Wooding [Wed, 7 Aug 2019 16:20:55 +0000 (17:20 +0100)]
src/method-proto.lisp: Use new `definst' private-slot-name feature.
I missed this when I was fixing up the codegen code.
Mark Wooding [Wed, 7 Aug 2019 16:20:14 +0000 (17:20 +0100)]
src/codegen-proto.lisp: Delete obsolete `HACK' warning.
There's a principled(-ish) feature in `definst' nowadays.
Mark Wooding [Wed, 7 Aug 2019 16:17:55 +0000 (17:17 +0100)]
src/*.lisp: Add missing exports.
All of these have documentation stubs (at least), but for some reason
didn't get exported. In most cases, it's because they're slot accessors
for a class, rather than the headline name, but there are a few
exceptions.
Mark Wooding [Wed, 7 Aug 2019 13:25:50 +0000 (14:25 +0100)]
doc/SYMBOLS: Distinguish c-type and parser (atomic) specifiers and forms.
Mark Wooding [Tue, 6 Aug 2019 12:07:01 +0000 (13:07 +0100)]
doc/list-exports: Executables shouldn't have language-specific names.
Why did I tolerate this for so long?
Mark Wooding [Tue, 6 Aug 2019 12:06:06 +0000 (13:06 +0100)]
doc/list-exports.lisp: Document and lightly reformat.
Much more pleasant.
Mark Wooding [Tue, 6 Aug 2019 12:02:38 +0000 (13:02 +0100)]
doc/list-exports.lisp: Forbid bad slot names in private classes.
Previously we only worried about exported/foreign slot names in classes
whose names were exported symbols. Also worry about classes whose names
are private symbols (in the home package).
Mark Wooding [Tue, 6 Aug 2019 11:59:29 +0000 (12:59 +0100)]
doc/list-exports.lisp (pretty-symbol-name): Don't hide strange symbol names.
The old code just squashed the symbol name to lowercase and printed it.
This hides symbol names which already have lowercase letters in them, or
funny characters like colons.
We don't actually have any such names.
Mark Wooding [Tue, 6 Aug 2019 11:58:23 +0000 (12:58 +0100)]
doc/list-exports.lisp (best-package-name: Don't sort the whole list.
Just pick the shortest one.
Mark Wooding [Tue, 6 Aug 2019 12:04:45 +0000 (13:04 +0100)]
src/c-types-parse.lisp: Rename slots with public names.
Oops. Hadn't noticed these before because `list-exports' wasn't clever
enough.
Mark Wooding [Tue, 6 Aug 2019 11:56:59 +0000 (12:56 +0100)]
src/codegen-proto.lisp (definst): Name the argnames `public' and `private'.
The `cooked' name was no more cooked than the `raw' one, so that was a
daft convention.
Mark Wooding [Tue, 6 Aug 2019 00:51:24 +0000 (01:51 +0100)]
doc/list-exports.lisp: Categorize `setf'-functions as generic or plain.
Mark Wooding [Mon, 5 Aug 2019 17:15:06 +0000 (18:15 +0100)]
sod/doc.sty: Reorganize and improve documentation.
It's almost pleasant to work with now.
Mark Wooding [Mon, 5 Aug 2019 17:15:43 +0000 (18:15 +0100)]
doc/sod.sty, etc.: Remove `type' category code.
It was a synonym for `ty', which I prefer, only you have to pick the
right one to get cross-references to work, which sucks.
Mark Wooding [Mon, 5 Aug 2019 17:11:27 +0000 (18:11 +0100)]
doc/sod.sty: Unpublish `\fmtspecs'.
Mark Wooding [Mon, 5 Aug 2019 17:09:41 +0000 (18:09 +0100)]
doc/sod.sty: Get `\@scripts' to cope if `_' isn't active.
Mark Wooding [Mon, 5 Aug 2019 17:08:08 +0000 (18:08 +0100)]
doc/sod.sty: Debug `@;'.
OMG.
* Don't eat the `\\' and then hope to find it.
* Actually chew through the `;' characters rather than piling them up.
* Don't eat spaces while looking for more `;'s.
Mark Wooding [Mon, 5 Aug 2019 17:06:45 +0000 (18:06 +0100)]
doc/sod.sty: Get `@--...' to typeset a sequence of dashes properly.
Now we can replace the explicit `--\,--' bodge.
Mark Wooding [Mon, 5 Aug 2019 17:06:07 +0000 (18:06 +0100)]
doc/sod.sty: Rewrite `@-' to cope with other things following.
Also, typesets as a dash, which is probably good.
Mark Wooding [Mon, 5 Aug 2019 15:13:13 +0000 (16:13 +0100)]
doc/sod.sty: Hoist `\@ifnextchar@preserve' further up.
Mark Wooding [Mon, 5 Aug 2019 14:10:50 +0000 (15:10 +0100)]
src/parser/streams-{proto,impl}.lisp: Publish classes and generic functions.
I bungled this somehow. The exported classes should have ended up in
`streams-proto.lisp'. I'm not, for now, exporting the proxy streams.
Because of this foolishness, I also failed to include documentation
stubs for any of these, so also add those.
Mark Wooding [Mon, 5 Aug 2019 13:56:19 +0000 (14:56 +0100)]
doc/misc.tex: Mention that `int' is magically exported.
Someone might care.
Mark Wooding [Mon, 5 Aug 2019 13:48:33 +0000 (14:48 +0100)]
doc/misc.tex: Include missing return values in synopses.
Mark Wooding [Mon, 5 Aug 2019 13:27:50 +0000 (14:27 +0100)]
doc/Makefile.am, doc/sod.tex: Include package version on title page.
Maybe this should be in the running header or footer, but I'm not quite
sure where.
Mark Wooding [Mon, 5 Aug 2019 10:09:32 +0000 (11:09 +0100)]
NOTES: New file of things to think about.
Mark Wooding [Mon, 5 Aug 2019 10:09:08 +0000 (11:09 +0100)]
Makefile.am: Distribute the `STYLE' guide.
Mark Wooding [Mon, 5 Aug 2019 09:57:19 +0000 (10:57 +0100)]
asdf-hack.lisp.in: Shore up and distribute.
For a long time, this was a private hack. Shoring up involved using
`*load-pathname*' to find the right directory, and /that/ requires
actually having the hack be in the build directory rather than the
source, and that involves having the makefile put it there, and then it
needs shipping.
Mark Wooding [Mon, 5 Aug 2019 09:55:55 +0000 (10:55 +0100)]
Makefile.am: Ship `emacs-hacks.el' on the offchance.
It's tiny and harmless.
Mark Wooding [Mon, 5 Aug 2019 09:27:42 +0000 (10:27 +0100)]
lib/sod.h (SOD_DECL): Check that we allocated the right size.
Mark Wooding [Mon, 5 Aug 2019 09:26:41 +0000 (10:26 +0100)]
lib/sod.h: Introduce `SOD_RECKLESS' feature macro to inhibit checking.
Currently there isn't any, but there will be soon.
Mark Wooding [Mon, 5 Aug 2019 09:22:48 +0000 (10:22 +0100)]
doc/runtime.tex: Suggest asserting that a stack-allocated object tore down.
As discussed, it's not an error in itself if an object refuses teardown:
that just means that you can forget about it and it's someone else's
problem now. But if you really have to deallocate it right now, that's
not going to work.
It might be an idea to introduce a macro to say, essentially,
{ int rc = sod_teardown(OBJ); assert(!rc); }
Mark Wooding [Mon, 5 Aug 2019 09:21:15 +0000 (10:21 +0100)]
lib/sod.3: Add missing documentation.
I must have just stopped midway through `SOD_DECL'. Documentation for
`sod_teardown', `SOD_MAKE' and friends, and `sod_destroy' is entirely
absent.
Mark Wooding [Mon, 5 Aug 2019 09:19:42 +0000 (10:19 +0100)]
src/output-proto.lisp: Fix some bad indentation.
Bad Emacs. No biscuit.
Mark Wooding [Sun, 4 Aug 2019 18:04:10 +0000 (19:04 +0100)]
frontend.lisp: Add hooks for extensions to add new command-line options.
It seems rather pointless to document the option parser and then fail to
provide any way for extensions to make use of it.
Not that I've actually documented it yet...
Mark Wooding [Sun, 4 Aug 2019 17:56:46 +0000 (18:56 +0100)]
src/optparse.lisp: Cope with options which don't have long names.
This makes the format strings remarkably hairy, but that just adds to
the fun, right?
Mark Wooding [Sun, 4 Aug 2019 17:52:36 +0000 (18:52 +0100)]
src/optparse.lisp: Don't print options which have no help text.
This seems better than crashing because nil isn't a thing that can have
characters extracted from it.
Mark Wooding [Sun, 4 Aug 2019 17:23:15 +0000 (18:23 +0100)]
src/frontend.lisp: Add a function to update the `*usage*' list.
Mark Wooding [Sun, 4 Aug 2019 17:21:01 +0000 (18:21 +0100)]
src/frontend.lisp: Make the option parser available in a special variable.
No effect at the moment, because nobody does anything with the variable.
Mark Wooding [Sun, 4 Aug 2019 17:02:41 +0000 (18:02 +0100)]
src/codegen-proto.lisp (definst): Overhaul argument-list processing.
Previously I just used gensyms for the argument names. That breaks
reloading the system, though: the classes get redefined with new slot
names, but the old instances continue to linger, only they don't work
properly any more.
Instead, write a proper lambda-list parser which allows slot names to be
specified independently of the user-facing argument names.
Of course, this now changes the way the `list-exports' machinery parses
`definst' forms.
Mark Wooding [Sun, 4 Aug 2019 12:59:50 +0000 (13:59 +0100)]
src/module-impl.lisp (find-file): Take a home path rather than a scanner.
Honestly, picking the home path out of the scanner input was always a
bit of a stretch.
Obviously, we also need to fix up the callers, but there's only one of
them.
Mark Wooding [Sun, 4 Aug 2019 12:54:24 +0000 (13:54 +0100)]
src/: Use the `optparse' package in `sod-user'.
This involves moving the `optparse' build into the main `sod' system.
Mark Wooding [Sun, 4 Aug 2019 12:48:52 +0000 (13:48 +0100)]
src/utilities.lisp: Share `int' to `sod' and `optparse' packages.
Now we don't have to choose between the C type and the option type.
Mark Wooding [Sun, 4 Aug 2019 09:25:19 +0000 (10:25 +0100)]
doc/module.tex: Add stub for missing function `clear-the-decks'.
Mark Wooding [Sat, 3 Aug 2019 23:37:55 +0000 (00:37 +0100)]
doc/misc.tex: Document some more miscellaneous utilities.
Mark Wooding [Sat, 3 Aug 2019 23:21:33 +0000 (00:21 +0100)]
src/utilities.lisp (dosequence): Capture SEQ as a variable explicitly.
Previously it used `once-only', but that doesn't actually produce a
binding for constant expressions.
Mark Wooding [Sat, 3 Aug 2019 22:34:59 +0000 (23:34 +0100)]
src/utilities.lisp (compose): Handle the case of zero arguments.
Mark Wooding [Sat, 3 Aug 2019 20:16:21 +0000 (21:16 +0100)]
doc/misc.tex: Fix citation argument brackets.
Mark Wooding [Sat, 3 Aug 2019 20:15:57 +0000 (21:15 +0100)]
doc/clang.tex: Fix `\descref' call missing its category code.
Mark Wooding [Sat, 3 Aug 2019 20:12:31 +0000 (21:12 +0100)]
doc/: Reorder the arguments to `\descref'.
We now have
\descref*{CAT}{NAME}[TEXT]
rather than
\descref*{NAME}[TEXT]{CAT}
which flows much better. There's a complication, that `\@ifnextchar'
gobbles space while looking for its character: implement a custom
version which doesn't do that.
The call sites were mostly fixed by [long line]
$ sed -i '/\\descref\(\*\)\?\({[^}]\+}\(\[[^]]\+]\)\?\)\({[^}]\+}\)/ s//\\descref\1\4\2/g' doc/*.tex
but some calls run over two lines and had to be found and fixed by hand.
Mark Wooding [Sat, 3 Aug 2019 19:40:27 +0000 (20:40 +0100)]
doc/runtime.tex: Fix linking for `obj.teardown' message.
Use new `\descref*' and `\autopageref'.
Mark Wooding [Sat, 3 Aug 2019 19:39:09 +0000 (20:39 +0100)]
doc/: Add `*' option to `\descref' to suppress the page number.
Now you only get the hyperlink.
Mark Wooding [Sat, 3 Aug 2019 19:09:07 +0000 (20:09 +0100)]
doc/concepts.tex: Make a footnote a bit less stuffy.
Mark Wooding [Sat, 3 Aug 2019 19:07:08 +0000 (20:07 +0100)]
doc/runtime.tex, lib/keyword.3: Explain the other benefit of `NO_KWARGS'.
It's not just for hacking around C89 after all.
Mark Wooding [Sat, 3 Aug 2019 15:49:55 +0000 (16:49 +0100)]
doc/concepts.tex: Add some clarifications about initargs.
Mark Wooding [Sat, 3 Aug 2019 15:48:53 +0000 (16:48 +0100)]
doc/concepts.tex: Briefly explain translation-time metaobjects.
Mark Wooding [Sat, 3 Aug 2019 15:47:15 +0000 (16:47 +0100)]
doc/concepts.tex: Delete `no way to discover alignment for instance' claim.
Replace with a reference to the `align' class slot.
Mark Wooding [Sat, 3 Aug 2019 15:46:46 +0000 (16:46 +0100)]
doc/misc.tex: Document many utilities.
Mark Wooding [Sat, 3 Aug 2019 15:41:53 +0000 (16:41 +0100)]
doc/misc.tex: Fix keyword argument name in `find-duplicates'.
Mark Wooding [Sat, 3 Aug 2019 15:40:21 +0000 (16:40 +0100)]
doc/misc.tex: `parse-body' is a function, not a macro.
Mark Wooding [Sat, 3 Aug 2019 15:36:24 +0000 (16:36 +0100)]
doc/misc.tex: Recategorize some descriptions.
* `loc' is a locative thing, not a macro thing.
* `distinguished-point-shortest-paths' doesn't do anything with lists.
* `whitespace-char-p' doesn't track positions.
squash! doc/misc.tex: Recategorize some descriptions.
Mark Wooding [Sat, 3 Aug 2019 15:26:27 +0000 (16:26 +0100)]
doc/structures.tex: Confess to a slight lie about header files.
Mark Wooding [Sat, 3 Aug 2019 15:20:30 +0000 (16:20 +0100)]
doc/: Invent an override for `\xref' categories, and use it.
The most important thing here is to able to list two things as `sections
X and Y'. I can't use plain `\ref' for this any more because I'm
relying on `\xref' to highlight the category name.
Mark Wooding [Sat, 3 Aug 2019 15:23:05 +0000 (16:23 +0100)]
doc/concepts.tex: Link to `SodObject' for the `init' message.
Mark Wooding [Sat, 3 Aug 2019 15:24:08 +0000 (16:24 +0100)]
doc/concepts.tex: Fix subclass/superclass confusion.
If I can't get this right, my readers don't stand a chance.
Mark Wooding [Sat, 3 Aug 2019 15:17:48 +0000 (16:17 +0100)]
doc/sod.sty: Highlight hyperlinks to descriptions better.
Make the name itself be a link, and highlight `page' as part of the page
link.
Mark Wooding [Sat, 3 Aug 2019 15:17:17 +0000 (16:17 +0100)]
doc/sod.sty: Index `*earmuffs*' and `:keywords' more usefully.
Using the new machinery.
Mark Wooding [Sat, 3 Aug 2019 15:16:40 +0000 (16:16 +0100)]
doc/sod.sty: Let the modifier control labelling and indexing.
Mark Wooding [Sat, 3 Aug 2019 15:15:15 +0000 (16:15 +0100)]
doc/sod.sty: Rename `descmod' to `modcat'.
There'll be more `mod...' things along soon.
Mark Wooding [Sat, 3 Aug 2019 15:12:29 +0000 (16:12 +0100)]
doc/sod.sty: Hoist `\@desc@dispatch' above its call sites.
Mark Wooding [Sat, 3 Aug 2019 15:11:24 +0000 (16:11 +0100)]
doc/sod.sty: Forbid page breaks between description header entries.
Mark Wooding [Sat, 3 Aug 2019 15:10:54 +0000 (16:10 +0100)]
doc/sod.sty: Make internal PDF links go to the right places.