Mark Wooding [Thu, 27 Apr 2006 10:57:40 +0000 (11:57 +0100)]
collect: Reduce consing.
The old collection system made a pair of cons cells: the metadata and a
random `head'.
,--------------------------.
| |
meta | head v tail
+---+-|-+ +---+---+ +---+---+
| * | * | |nil| *-----...--->| |nil|
+-|-+---+ +---+---+ +---+---+
| ^
| |
`-----------'
But we can do better: we can squidge the head and metadata nodes
together. If we start out at
head tail
+---+---+
,-->| * |nil|
| +-|-+---+
| |
`-----'
we can just insert more items by updating (cdar head)...
head tail
+---+---+ +---+---+ +---+---+
| * | *---->| | *----...--->| |nil|
+-|-+---+ +---+---+ +---+---+
| ^
| |
`-----------------------------'
Mark Wooding [Mon, 24 Apr 2006 14:30:23 +0000 (15:30 +0100)]
base, optparse: Various option-parsing enhancements.
* `case2' clauses can optionally bind a variable to its scrutinee.
* New function `option-parse-return' to return a value from
`option-parse-next'.
* Enhance `options' parse-option-form' to understand disambiguating
keywords arguments for all option slots. This also means that these
things can be set from expressions rather than constants.
* Default the `define-program' variables sensibly.
* Make `do-options' use `let*/gensyms'.
* Make the optparse test use the convenience macros.
* Rename `help-opts' to `help-options'. Just because. And tidy up
the code a bunch.
Mark Wooding [Sun, 23 Apr 2006 15:18:21 +0000 (16:18 +0100)]
Reformat all the docstrings.
Indent subsequent lines. Makes the code look prettier, and makes diff
function headers more useful.
Mark Wooding [Sun, 23 Apr 2006 00:58:45 +0000 (01:58 +0100)]
collect: Oops, forgot to export `collect-tail'.
Mark Wooding [Sun, 23 Apr 2006 00:57:42 +0000 (01:57 +0100)]
collect: Whitespace rearrangement.
Mark Wooding [Sun, 23 Apr 2006 00:19:04 +0000 (01:19 +0100)]
base: New macro for parsing function bodies.
Mark Wooding [Sat, 22 Apr 2006 23:59:07 +0000 (00:59 +0100)]
collect, unix: Rename `mdw.collect' package to just `collect'.
Mark Wooding [Sat, 22 Apr 2006 23:58:11 +0000 (00:58 +0100)]
base, optparse: Introduce `case2' macros.
* base: Add new `case2' macro, for fetching two values, switching on
one and binding the other. Also add `ecase2' to do the obvious
thing.
* optparse: Rewrite `do-options' to use `ecase2' (or `case2').
Mark Wooding [Sun, 23 Apr 2006 00:07:42 +0000 (01:07 +0100)]
base: Fix bug in `while'.
Did I ever use this?
Mark Wooding [Sun, 23 Apr 2006 00:02:28 +0000 (01:02 +0100)]
base: Reorder a bit.
Nothing significant actually changed.
Mark Wooding [Sun, 23 Apr 2006 00:00:59 +0000 (01:00 +0100)]
base: Export `nlet' and `while'.
Should have done this a while ago.
Mark Wooding [Thu, 20 Apr 2006 16:29:15 +0000 (17:29 +0100)]
unix: Fix crap typo in header comment.
Mark Wooding [Thu, 20 Apr 2006 16:09:57 +0000 (17:09 +0100)]
optparse: Various enhancements.
* General cleaning up.
* Removal of redundant handling of option docstrings in both options
macro and parse-option-form.
* New feature: option macros can insert several options.
* New suite of standard option-handling things for usual command-line
programs. Should be sufficient for most purposes. I'll probably
invent a subcommand system later when I get a feel for what's
wanted.
Mark Wooding [Thu, 20 Apr 2006 14:00:08 +0000 (15:00 +0100)]
infix: Reader macros for infix expressions.
Mark Wooding [Thu, 20 Apr 2006 13:50:43 +0000 (14:50 +0100)]
safely, optparse: Rename packages.
Mark Wooding [Thu, 20 Apr 2006 11:03:09 +0000 (12:03 +0100)]
General tidying and prettifying.
Mark Wooding [Thu, 20 Apr 2006 11:01:07 +0000 (12:01 +0100)]
Ignore boring files.
Mark Wooding [Thu, 20 Apr 2006 11:00:25 +0000 (12:00 +0100)]
mdw-base: Update-in-place macros.
These are largely here because the infix reader stuff wants them, but
it's handy enough, probably.
Mark Wooding [Tue, 11 Apr 2006 17:49:13 +0000 (18:49 +0100)]
optparse: Use parse-integer in parse-c-integer.
CMU CL's parse-integer has cleverness for parsing bignums relatively
quickly. It's not as scary as Catacomb, but not bad. Use it instead of
the grotty hack we had previously.
Mark Wooding [Tue, 11 Apr 2006 17:20:46 +0000 (18:20 +0100)]
syscall: Don't require (function ...) for the name argument.
In fact, don't allow it.
Mark Wooding [Tue, 11 Apr 2006 17:05:37 +0000 (18:05 +0100)]
safely: For -without-moaning functions, just do it and catch errors.
... rather than probing first and hoping for the best.
Mark Wooding [Tue, 11 Apr 2006 16:55:36 +0000 (17:55 +0100)]
Kill the unix-try macro.
Instead, export sys-* functions which do the right thing. Fix safely to
match.
Mark Wooding [Tue, 11 Apr 2006 17:06:28 +0000 (18:06 +0100)]
safely: Blank lines make code easier to read.
Mark Wooding [Mon, 13 Feb 2006 11:55:44 +0000 (11:55 +0000)]
Merge branch 'svn'
mdw [Mon, 13 Feb 2006 11:54:57 +0000 (11:54 +0000)]
anaphora: Add anaphoric macros.
mdw [Mon, 13 Feb 2006 11:54:33 +0000 (11:54 +0000)]
sys-base: Expand hard-exit a bit.
mdw [Mon, 13 Feb 2006 11:54:16 +0000 (11:54 +0000)]
base: Implement named-let and while.
Mark Wooding [Mon, 13 Feb 2006 11:52:27 +0000 (11:52 +0000)]
Extract Subversion ignore data.
mdw [Thu, 25 Aug 2005 08:46:18 +0000 (08:46 +0000)]
Initial checkin.