Closed Mercerenies closed 2 months ago
Note: I think we'll represent incomplete objects not as a new atom but as a wrapped string. So the incomplete object [
will be represented as incomplete("[")
(where the argument is a string literal). The default pretty-printer will know to print this in a special way, but the parser-friendly printer will write it in its full form (since the parser won't have any special behavior for this)
Currently, the only incomplete objects we need are
[
(for starting a vector)(
(for starting a complex number)There's no mixing of delimiters, so a [
must always be terminated with the ]
command (and eqv for (
and )
).
New commands:
[
and (
push the respective incomplete object]
and )
pop until the given incomplete object is encountered, erring if a different incomplete object is encountered insteadDesign note: Incomplete objects are meant to be extremely transient objects and should exist for only a few seconds to allow input for other, more complete objects. If you end up with a nontrivial expression containing an incomplete object (like a vector containing a [
, a summation containing a (
, etc), then you've very likely done something wrong. I intend to be provide no support for evaluating expressions containing incomplete objects, because it makes little sense to do so.
Also, another design note for completeness: Since we're using infix operators for intervals (#71) instead of brackets as Emacs does, we do NOT support input of intervals using incomplete objects.
Incomplete objects are complete: eaae2ef
Will need to expand ( ... )
to support quaternions (#9) eventually, but otherwise done.
For inputting things like vectors or complex numbers