diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-16 20:39:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-16 20:39:47 -0700 |
commit | 109041fb2ea18893bea32a4743e995f0bc06d5aa (patch) | |
tree | c8b456c6a8caa4864afe0634cd7cba9387009baa /strudel.c | |
parent | 7d94e4b2e24f22de9e12908ff610d4ac7823e1f9 (diff) | |
download | txr-109041fb2ea18893bea32a4743e995f0bc06d5aa.tar.gz txr-109041fb2ea18893bea32a4743e995f0bc06d5aa.tar.bz2 txr-109041fb2ea18893bea32a4743e995f0bc06d5aa.zip |
quasilit: expose access to field formatting.
This is the second round of changes in perparation for
compiling the string quasiliterals special form.
Having split format_fields into a lower level do_format_field
and format_field, we now provide two functions which allow
Lisp code to call do_format_field.
The sys:fmt-simple function has fixed arguments for
the field width/alignment, indexing/slicing, separator
and plist. Any of them can be defaulted with nil. This
function will be useful when the quasiliteral specifies
modifiers that are simple literals or constant expressions.
The sys:fmt-flex function takes a variable number of
arguments, after the object and the plist. This function
has to scan through the arguments and classify them
by type: a string is a separator, an integer is a width
and left/right alignment and so on. The compiler will use
sys:flex when format field modifiers are present whose
arguments contain expressions that get evaluated.
* eval.c (fmt_simple, fmt_flex): New static functions.
(eval_init): sys:fmt-simple and sys:fmt-flex registered.
Diffstat (limited to 'strudel.c')
0 files changed, 0 insertions, 0 deletions