File: TODO

package info (click to toggle)
zoem 04-173-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,316 kB
  • ctags: 1,716
  • sloc: ansic: 14,114; sh: 798; makefile: 206; perl: 14
file content (1098 lines) | stat: -rw-r--r-- 37,847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
regularia implementatia projectia

!  make segments also use lib linked list source. Should be much less fragmented
   memory ..
   yamSegPush etc.

!  recode \item 

!  \begin{section}
   \end{section}

-  much better naming/ownership in file/filter.c

==================================================================

-  whilst, while loop with output.

-  document how to deal with failing yamDigest.
   in order to get partial text, need to push empty text.
-  look at ctr and cmp failing digests, not treated right currently methinks.
-  need to reset special level when \special{} is issued (check)?
-  implement linked lists in special1 with grim code.

?  what about filtering strings? good for anything?
   would best be integrated with byte-syntax.
   it would require some syntax for selecting and deselecting special tables.

-  do not reset (push/pop) line count in stdia.

o  does a #0 key also enter the while loop in which \k's are sought
   and checked?

?  can zoem crash if stdin/stdout are closed?
?  sth to include comments in source. .\", <!-- -->

-  sanitize prefixes in source code (zoem, yam, empty)
   ting_stack_push
   enter_interactive
   yamOutput

/  make explicit framework for opening/writing/appending files,
   both design and interface.
   currently: indexed by file path name.

-  port sections to enclosed variants.
-  port items to enclosed variants.
   if e.g. \end{itemize} closes the previous item,
   go all the way to the new framework (not bc).

?  car ccar etc use \@{\N} rather than \@{\P}.
   is it useful in the same conditions as with html? strange.

-  make handle for tuning line break in cpar variants.

o  \system{date}{{+{%B}{%e}{%Y}}}
   does not work in creating a vararg because of protection.

?  seg 0 stack -1 ?

-  some framework with access control (:) for overwriting keys.
   idiotic of course, but still food for thought.
   FFT: food for thought.

-  would diversions be useful?

========================================================================
regularia

-  hum, why not indicate positional parameters by a different character?
   It is, after all, a sublanguage.
   [but \!!1 idiom is useful; how to do that with #1 ?] 

-  place/need for diversions in zoem? [can't think of one yet]

w  s/error/inform/
   zum.azm; zoemput zoemstat session keys.

?  txt device does not parse at scope ??
   what does it that copy does not do - well, it interprets \| for one
   thing, but that's not a whole lot.

-  \zinsert{}, \finsert{}
   syntax to include a single line.

-  not a good way yet to join a list. apply with if yes, but cumbersome.

#  \write{stdout}{device}{enter something\@{\N> }}
      writes spurious newline *if* -o - is used,
      otherwise ok.
   Understandable: newline in input is simply flushed, fixed by
   escaping or removing those newlines.

-  some sleep interface.
   \write{stderr}{sleep}{msg}  (ugly)
   \system{sleep}    [hardcoded allow?, ugly]

-  unify zinsert, finsert ?
   better control in zinsert.

w  parsing of varargs; not erring on '{arg} boo {arg}'

#! refload does not evaluate its arguments, so it has to wrapped
   in something that does; e.g. write or apply.

/  should each caller of yamOutput check the result and say something ..?
   (in ops.c all do now).

-  should grape absence be an error, or optionally ?
   --grape-honor.

-  make a decision on begin{label}{:vararg} misfeature, \$0.

-  nobody outside segment.c should need yamSegFree.
   but apply2 is a special case .... parts of it should better be
   encapsulated by segment.c and parse.c

-  this should fail ?
   ||| at scope in and scope:
   ||| \@{\&{\foo}}
   abcfoo_start{ foo_at }foo_enddef
   simply says unknown escape '@' ..

-  \let cannot distinguish error from bounce.

catch
-  re-audit that what is returned in case of error. what is sensible ?
   (e.g. file name digest, \defined#2, tr#4, end)
   focus should be on that what is normally returned.

-  xml syntactic sugar, SEGMENT_CONSTANT
   I've tried to screw it up a couple of times, so far no luck.
   Does it really behave exactly like the rest of zoem wrt delay
   and nested digest?
   [errors cannot be caught by \catch#2, that's one difference]

-
   ___ [zoem] error around input line <5> in <tst.azm>
   ___ last key seen is <foobar>
   ___ [expand] no definition found for key <foobar>
   not very helpful; write key only if successful?

-  \begin{foo}{{!}{b}}
   no error. yamKeyDef/Set is used, and that does not check.
   so need checkusrname in there.

-  tracing: at base file level, add line numbers to keys.

-  A very OOOLD todo. nobody knows what it means anymore, but it is pretty deep.
\(@array)
\(%hash)
      evaluating expressions will require splicing into the string
      in the previous segment, which is equivalent with inserting
      a segment below and fiddling with ofsets.

-  unicode input: UCS-16 UCS-32
      + fgetwc
      -> need data structure support
   unicode input: utf-8
      + fgetc
      -> need nothing, can do nothing
   zoem unicode encoding; \#{402} \#{x192}
      -> need output hook mechanism, either string mapping (e.g. entities)
         or putwc-like thingy.
   zoem byte encoding: \'{32} \'{x20}

-  try do to more stuff with nwrite, nnew (more efficient).

-  \@{\S} is meaningful even with \@{\w}.

-  implement itemize with style rules rather than tables ?

-  formatted or device scope: sth to specify that only leading
   whitespace should be removed ?
   \`^`

-  env: labels could be of the form aaa::bbbb,ccc etc.
-  env: how easy is it to override/extend existing environments?
-  env: perhaps some option to indicate that the begin sequence
   wants to do its own parsing.


#  possible to capture stuff without enclosing it .. but only
   using \write#3 (need to enclose it *somehow*).

#  \catch{error}{abc\write{\__fnout__}{device}{\<zut> hih \</foo>}def}
   results (understandably) in 'hih abc'

#  accept should perhaps enclose the results in delay scope?
   so that \setx{foo}{\eval{\accept{bounce}{....}}} you know.
   guess not; some apply magic might do the trick for this obscure need.

#! whitespace munging:
   it seems we use n_newlines and s_spaces in both \w and \W mode.
   (counting and stacking respectively), which seems nice.

!  mcx util implement buffering (BUT, troublesome with
   fscanf invocations), and mcxIOfind etc .

?  when to push/pop interactive mode

-  yamInputPush/Pop -- should it no longer be an interface ?

!  format:
   sth to specify no padding at right side for centered
   and substring alignment.  (to remove trailing spaces)

!? format continues when these errors occur ?
   (sth to do with apply!?)
___ [\format#2] unexpected end of format sequence (no dot)
___ [\format#2] unexpected token [^]

!  allow \10, \11 etc.

!  long term:
   possible to unify all the character-iterating code?
   checking escapes, jumping blocks etc.
   (assemble into a single file)
      yamProtect
      yamUnprotect
      yamReadData
      yamLength

-  begin: set some key to pass info to the env whether
   key-val syntax was used or array syntax.
   \$_ -> kvp
   \$_    pos

#  some format modifier to indicate device length of argument.
!  for padding, might also need to apply length key if it is given,
   same for delimiters.

# terrible idea
?  how about syntax to let the parser know an argument should
   be expanded first? (difficult to implement by the way).
   {\][foo bar}

!  \:/ messes up the line count in error reporting.
   (need to attach extra structure to files).
   [ why not use ___jump_lc___ ?  -  because e.g. it
   could defeat a purpose]

check:
   squashing and stacking should be done regardless of which scope we
   are in, only depending on fd->doformat.
   indenting should be done regardless of scope and fd->doformat,
   but it should only be done for nonempty lines.

!/ \@{\W} is needed for indenting, but also implies squashing.
   indenting and squashing pbb need to be decoupled.

   what are reasonable rules?
   do I stack indent as well????
   apparently yes.
   is there a difference between device and plain scope?

!  writeto does not work in interactive mode.
?  some syntax to remember previously opened file name.
   e.g. with clmformat the first output could be used
   as log file.
-  if \writeto{..} is given before anything is output, the
   default output should not be opened, perhaps. but that
   would require some ugly check on the key index ...

at scope:
   if you put \@{\w} at the beginning of line, what happens with
   stacked newlines, stacked spaces?

-  zoem#1 perhaps need to be able to silence the interpreter.

-  inspect; change to a different or additional meta character?

?  is there a use for stuff like substr, pos ?

-  perhaps inspect should a sublanguage not based on the backslash,
   but e.g. on the tilde.

-  for recursive stuff, perhaps sth that can test whether entry
   is a vararg or not. (how to distinguish blocks from lists though?)

-  how to recurse over grape data

\apply to anonymous key with embedded while seems tricky.
interpolation skips \!{} scope. perhaps it's time to break this,
and see what breaks in mcl and zoem docs.
[but not the one that's eaten by apply of course ..]

-  how about interpolating \!{} scope (as a variant (governed how))?
   uh, currently (not doing) this is needed to localize nested \1 occurrences.

-  how about optifying \<> to variant \@{<} .. \@{>} rather than
   \@{< .. >}.

   then \<\zut> (\zut -> '>') would automatically get mapped to <&gt;>
   simply by character filtering.
   [would there be a problem with delay scope??]
   [basic problem; mixing different character translations and scopes
   is annoyingly difficult; perhaps the first stage X has to utilize
   e.g. the \@{..} second stage syntax].

-  how about \setc{} primitive (set stuff only if not set already) -
   it can be a composite of course ...
   perhaps I should create a pseudo package to import predefined macros;
   or make it really a package -> then move predefined macros also to package.
   \input{zmconv.zmm}
   setc would be handy I guess.
   then need also setxc ?
   and setxlc (local) too much proliferation.

-  can urlencode simply be done using inspect + predefined grape keys?
   register a grape space for zoem primitive use; e.g. __
   assumption[first '?' must not be encoded] anything else?

w  issues section:
      implicit \par in item(ize)
      \par opening tag only.
      (if explicit par in itemize; must it be non-spacing?)
      vector [ flow text, environment, paragraph, spacing ] is problematic.
   in the end I may want to switch to full paragraph enclosure,
   and more direct control on the margin. It is unsatisfactory that
   every \item implicitly has paragraph/text mode following it.

-  how about backwards compatibility; allowing override of primitives
   (enable shadowing?) (but primitives are looked up first ..)

-  how about allowing macros to be placed in the primitive dictionary?
   e.g. the builtin zoem macros.

-  introduce spacings in terms of percentages?

-  for enabling with intermezzo this type of thing:
      mcl             the cluster algorithm

   input/output
      mcxio(5)        the graph/matrix input/output format
      mcxassemble     create matrices from raw data
      mcx             general matrix operations

   we'd need 3 widths (left margin as well) plus more spacing power
   to intermezzo.
   the left margin is perhaps nice to have; however is this is an obvious or
   arbitrary addition (where to stop)? The intermezzo thing would be nice
   though.  Does this violate the general typesetting compartimentalization/box
   idea?  Is that idea just a limiting abstraction anyway?

!  how about \urlencode primitive.
   httpref would just use that, and it would neatly localize everything.
   urlencoding is context dependent: first '?' denotes the search part (always?)
   how to discern which & -> &amp; ; which & -> %26
   user must do the &amp; (or #38; for that matter) part.

-  proceed with moving \@{<>} syntax to \<> syntax in mac/*zmm* 

-  how about \import{iso-latin-1.zmm} ?
   mapping all characters not in base ascii set ..

-  how about splitting up styles? e.g \"doc::style::links"
   so that refined selections are possible.
   and/or some interface to export style definitions to the doc preamble.

-  consider
   \set{zut}{<>}
   \<foo \zut>{<><>}

   might one e.g. want foo="zut &lt" type syntax?
   so that really only < and > must be output in device scope?

!? redo the special design
      I  suppose I want to temporarily map ' ' to \~.
         (in conjunction with " to "" mapping ..)
     II  URL encoding.
  [For II; that's probably best done by a separate primitve, too much
   rules]
  [For I; that's hardly something one needs]
   the special level stuff isn't all that great.
   some local \@ syntax to push and pop or even just select definitions might
   be a lot better:
   what would it take? indexed special arrays, enable switching ?
-  specials and \N etc don't mix for special==\n
   what's the design/policy/contract?
   [specials would imply or take precedence over \W]

-  replace tabs by spaces ??? make \"tab" or \@{\t} or \'0xy' or whatever?

!/ clean up zmm packages, esp doc.zmm -> repl \@{<>}FOO{\@</>} by \<>{FOO}
   syntax. div.flushright ???

-  further tweak system inspection, e.g. looking at rm cp ln mv dd ?
   but also need to look at sh tcsh bash esh ....... and on and on ???

-  why not make inline file syntax: \:{foo} ?
   (there are several reasons to think of)

?  make dictionaries named: (e.g. itemize).
   enable a way of setting a macro in a named dictionary.
   this would solve the \set{$marginleft}{foo} problem.
   so .. that would be
   \pop#2 (name as well)
   \push#2 (name as well)

   and begin/end/env could set the session key
   \__env__
   \set{env=$itemize:foo#1}{zut \1} [????]

#  what happens with e.g. \system{ date } ?
   (it fails)

-  rewrite macro packages such that only and all non-exported primitives 
   share the same prefix. exported primitives should then be simply
   greppable.

-  better names for --unsafe-silent, --system-honor, --unsafe.
-  should system-honor be the default, and system-relax be the option?
-  perhaps make key from which the system settings can be derived. 
-  system prompting: stdin is not shown.

========================================================================
implementatia

-  pass length arguments to printf like functions where possible.
   esp e.g. with \! and \<> syntax.

-  key definitions can be preparsed -> more bloated data structure,
   but faster interpolation -> needed length can also be computed
   in advance.

-  yamExpandKey present in apply#2 and inspect#4

*  -  zoem does not have 'real' array syntax.
   -  "data" in zoem must obey zoem syntax.

========================================================================
projectia

-  Unicode support. Perhaps this will require a zoem space warp;
   if so zoem will bring forth zoef.
   byte-orientation is one aspect. What can go in? utf8/16/32 ?
   What goes out? Mapping to *ML entities?

========================================================================

-  can I do 3 below ?
   perhaps introduce 'BOL' special

    The copy mode behavior can be quite tricky, but there  are  some  rules
    that ensure a safe usage.

    1.     Printable  backslashes  must  be denoted as \e.  To be more pre-
           cise, \e represents the current  escape  character.   To  get  a
           backslash glyph, use \(rs or \[rs].

    2.     Double all backslashes.

    3.     Begin  all text lines with the special non-spacing character \&.

    This does not produce the most efficient code, but it should work as  a
    first  measure.   For  better  strategies,  see the groff info file and
    groff_tmac(5).

-  -i foo (!-o) results in foo.ozm
   -i -  (!-o) results in stdout
[gershwin hobo zoem/src > devzoem
=== Interactive session, I should recover from errors.
=== If I exit unexpectedly, consider sending a bug report.
=== A single dot on a line of its own triggers interpretation.
\__fnin__ \__fnout__ \__fnentry__ \__fnbase__
.
----------------------------------------
stdia - - -

!  let decimals handling is crude.

*  interactive mode uses device filter; it does not map \|, \~, \- .
   if one uses txt filter, whitespace is not munged.
   so that's a bit annoying; it seems not to be a nice solution to
   initialize mapping of zoem glyphs for device filter; it would
   currently need explicit bookkeeping whether user is doing first time
   call or later time call (in order to wipe them out).

!  when mcxIO supports buffering, readfile should use mcxIOstep and
   buffered input.

-  inline files may cause premature exit (no recovery).

?  default turn off white space munging ??

!  precision_g:
   should be taken relative to absolute value!
   (now 0.00000009 == 0.00000001)

#  yamInputIncrLc; could parse.c know by itself from the seg
   whether to call it justly or not?
   Right now incrlc checks the txt against hd[idx].txt,
   to see whether we are at the outer level in a regularly
   processed file. Presumably parse.c has no way of checking
   this; a fresh seg linked list is created for each digest.

#  what happens when inline files simply don't end ?
   zoem (p)errs ok but the line number is funny; it pertains
   to the last finished chunk.

#  zinsert *does* strip comments.

#  --allow:cmd
   cmd has to match exactly the cmd use in zoem input (no path stripping)

#  \def{%%{foo}}{3}
   does sth.  (it sets \%{%{foo}}).

*  The advantage of \&{ .. } and \@{ .. } and \%{ .. }{ .. } syntax over
   \`snt` like syntax is that the former is better
   extendible ...  i.e. you can later give meaning to \&&{ .. } or \&foo{ .. }
   etc etc.
#  (fixed \=fname= to \={fname}).

#  \inspect{posix}{(([a-z])*)}{_#2{\!ucase{\1}}}{abcde2347#)$*&xyz}
   does not work; must be
   \inspect{posix}{([a-z])*}{_#1{\!ucase{\1}}}{abcde2347#)$*&xyz}

#  for statement is ugly in zoem:
   \for{\set{i}{1}}{
      \cmp{lt}{\i}{10}}{
      \setx{i}{\let{\i+1}}}{
      do stuff 
   }

#  \system{perl}{{-e}{'print "hi\\n";'}} fails
   \system{perl}{{-e}{print "hi\\n";}} works. shell quote hell.
   \system{exec}{{date}} fails; (shell builtin, not a system binary)

#  BEWARE using \@{ .. \&{ .. }} syntax with the copy filter:
   \&{ } will not be interpreted at write time.
   (in pitfall section in zum.azm)

?  how about  a primitive to make a subtree of the global tree
   the new rooted tree ??

-  make grape dictionary ...

!  more primitives could act like '%': being able to take variable
   number of arguments.
   it would be an additional property of a primitive.

   BUT the parser has to know this; for '%' it knows by virtue of
   the first character.

   So, such primitives would e.g. have to share some prefix. like '%'.
   \%system{a}{b}{c}
   it's not an interesting avenue methinks

-  NOTE parsing stuffs everything in arg1_g;
   %#1 then *again* extract arguments.
   this is so that the macro location mechanism need not be adapted.
   (we can simply search for %#1)

-  zoem GOTCHAS
   try to remove helper files (e.g. fqf-html, fqf-roff),
   if errors keep occurring;

   it is possible that a helper file contains erronenous or obsolete input; if
   it is newly created the error will go away. As long as the helper file
   contains erroneous input, the macro package in charge will never get to
   remove/renew it, since zoem will exit when encountering an error.

   look at log messages "wrote to stream".

   enable appending?
   explicit closing?
   sth like
   \fdo{my.out}{open}
   \fdo{my.out}{append} open for appending
   \fdo{my.out}{close}
   \fdo{my.out}{flush}

-  xml sugar:
   optify white space rules

-  xml sugar:
   make '<' and '>' yamSpecial tokens (259 and 260), so that the
   functionality can be supported for other formats too.
   this requires some additional rules which are not yet clear.

/  removed \; feature. how about making protect smarter?
   the feature was meant for creating the effect of \protect{ ...  \: comment }
   (which is in that form impossible as the comment is stripped at read time).


-  make mode where inline documentation is parsed. doxygen-like, e.g.
   /* zoem::doc
    foo bar *\,/ blah
    zut.
   */
   should be separate package .. code.zmm or sth.

-  interactive:
   \| and \~ etc are ignored ??

-  mailing list.

-  clarify inspect interface, make test suite, retry to refactor code.
   reinvestigate GNU posix regex long string/match bug.

-  document doc.zmm, or point out why it is not.

-  further inter and intra link *_zmm.azm files

-  can I make zoem crash by writing to __ type keys,
   or undeffing them? e.g. via unchecked key-pick-ups,
   or via assumed pointer identity, or ..
   the file.c fntxt_g variable does not feel right.

!  how does nested \zinsert{stdia} work?
   it actually seems to work, but what is happening with fp's meanwhile?

!  how grave is this:
   pushing a $-dict means the increment of $itemcount is screwed,
   (because set will create a new one).
   so changing styles by pushing is very much not to be recommended.

/, clean up the in/out/stdia code,
   clean up entry.c
   some stuff done; entry.c remains long listing of things
   that need to be done in order.
-  should separate yamEntry into yamInit and yamEntry.
-  make clean functions in certain modules. For example, the entry function may
   want to let the key module complain when not all opened scopes have been
   closed.

?  should exit really be premature?

-  explain tracing encoding.

-  equip yamfilterat with extra argument, so that tracing can
   show more information.
   note that \@{asldf fkdalk} fragments are currently not shown by tracing.

!  try to make handle for yes/no tracing file read.
   it can be interesting to see comments stripped etc.

-  get rid of the yam prefix.

?  valgrind says:
   ***** failing system call:
   ***** \system{ls}{{-#}}
   ls: invalid option -- #
   Try `ls --help' for more information.
   ==22922== Warning: invalid file descriptor 1 in syscall write()

   but it is difficult to trace this to zoem code.

!  document optkvp, reqkvp etc in manual page. other additions?
!  how about a 'dump' primitive;
      dump keys according to conditions.

#! let sprintf liability.

?? customize escape character, for both scopes.

?  split \W, \w for both both scopes.
   hum ho, best to think of device target as a single scope, whitespacewise.

-  make html.zmm file, with html specific stuff only.
   (specials).

!! much duplication between kvp and opt macros: '\%s%' vs '='
!  ellipsis in html, troff.

!  should separate zoem macro package from zoem source package.

#/ find out what the original line length is (for terminal).
   simply store .ll in register ?
   not simple -> look at andoc.mac or one of its siblings,
   pbb done via command line arguments and terminal info.
   uh, it's done via prepending to file stream I believe.

?  'skip empty newlines' (zoem.azm)

-  fork, close, fileno in yamSystem; understand the details and get them right.
   opportunity to debug fileno/dup/close/fork knowledge.

-  check c gotchas wrt isspace, signed/unsigned char. etc.

-  make \'010' ascii byte codes.
   should be converted during file input. do not allow on the fly
   creation of these ?

   \'010' \'0a' \'011100011'
   \'ff'\'ab'\'23'
   \'ff'\'ab'\'23'

   length determines base.
   hum ho but why not allow encoding of 16-bit and 32-bit and 64-bit
   values as well?
   (refer to s-expression syntax proposed by Rivest.
   http://theory.lcs.mit.edu/~rivest/sexp.txt)

-  audit print, err, tell for print format stuff. beware of %c.

-  is buzzz.1 installed in regular path?

-  \| can be given multiple definitions. that's either useful
   or funny.  are glyph constants only seen at filter time?

-  formatted output, C printf like?

!  verbatim automatic indent in html, not so in roff.

-  what kinds of chars are acceptable as anchors in html?

x  inspect#2 bug which is hard to fix:
   \inspect{posix{\\b}{()}}{ab cd ef gh}
   \b matches; pointer is set to next char; \b matches again.

==========================================================================

chapter support:

-  write chapter mode in zmm macros:

in order to offer more info-like behaviour (e.g. chapters in different
-utput files):

-nly additional zoem primitive needed is ability to change default output file.
\defaultfile{..}

refs need to include an extra infix.

\sec does either
   \setx{refinfix}{chap\ctrput{sec}}
-r \setx{refinfix}{}

\anch{} {... \refinfix ...}
\setx{%{refinfix}{intro}}{\refinfix}

\iref{intro} then uses \%{refinfix}{intro}
and e.g. \base\%{refinfix}{intro}.html#\1

then there might (or might not) be some issues with .zmr and .zmt files.
dunnow about them yet.

==========================================================================

regular todos:

?  remove 9 args limitation?
   WELL, the vararg stuff seems to lend enough power.
?  maintain stack of ting pointers to keys currently being parsed.
   this should make error analysis easier.  For ease I might even include the
   ting pointer in the segment struct.  it can be printed while unwinding.
   HOWEVER, it simply prints the reverse now found with --trace-keys.

-  how about the totally hackish callback prefix trick \.foo idea? (s/dotfoo)
-  more error checking in let wrt overflow, nan.
-  portability of isnan, isfinite. on CWI, <ieeefp.h>
-  fix the YAM_ARG_MAX vs 10 misery.
-  do I have separator that vanishes with eval? just \""? #ans: \!{}
-  let interface is not so clean, int/i32/mcxenum/flags - wise speaking.
-  perhaps different naming for look,grep in inspect2.
-  clean up parsing code (the char slurping guys).
-  clean up filtering code.
-  find out which units are supported by both html and troff.
?  add troff top+bottom margin support to spacing env.
-  may need print macro for numbers; e.g. to limit nr of decimals printed.
-  give let a decimals argument.
-  reconsider debugging and verbosity design


/  ownership output is divided between file and filter modules.
   well, no: it's owned by file, but filter keeps track of the name
   of the current default output stream.

/  closing file handles: need to set handle to NULL (otherwise if I inspect
   it a second time it'll contain gargbage).
   also, mcxIO filehandles need to be closed by method.
   (what did I mean here? -- there's mcxIOclose)

?  yamParseScopes does not choke on {aaa}: ok? (rather than {} or {{aaa}}).

/  tagoffset skips \!{ .. } enclosed parts.
   is that really what I need?

/  ownership + mcxTings as function argument.
   yamReadFile
   yamInlineFile

/  unify yamOutput and yamDigest (nah) ?

#  [inspect2 grep possible bug. grep seems not implemented?]
   mnot correct needs look as well ..
   grep can be used with substitute pattern and without look;
   look really needs grep to be useful I believe.

#  if yamElemsParse errs, it does not know  how many tings it wrote
   should add sth in struct to count that.
#  fased out usage of yamElemsParse; it indicated poor interfaces
   (e.g. inspect#2).

#! buzzz inspect2 inclusion bug (size limitation?????)
   seems known regexp bug (google regex exec long string fails)
   temporary fix: make separate special purpose stripping program.  grrr.

?  at directive: don't write newlines (shorthand for cumbersome
   translate expression)?

-  perhaps better support for counters attached to stacked scopes
   (current practice is somewhat cumbersome)

-  do finsert and zinsert share code with dofile? should not be the case
   I believe (e.g. wrt inline files).

-  what when i want to apply different keys to the same data?
   currently difficult wrt backslash i believe.

   \def{foo#1}{[\1]}
   \def{bar#1}{{\1}}
   \def{zut#1}{<\1>}
   \apply{_#1{\!\1{a}\|}}{{foo}{bar}{zut}}
   does not work because after expansion apply uses
   anon key containing '\\1'

 ! \apply{_#1{\1{a}\|}}{{\!foo}}
 ! *does* work

   \def{$foo#1}{[\1]}
   \def{$bar#1}{{\1}}
   \def{$zut#1}{<\1>}
   \apply{_#1{\!$\1{a}\|}}{{foo}{bar}{zut}}
   works; apply uses
   \$\1

   \def{foo#1}{[\1]}
   \def{far#1}{{\1}}
   \def{fut#1}{<\1>}
   \apply{_#1{\!f\1{a}\|}}{{oo}{ar}{ut}}
   works also.

   dotfoo
   A conceivable feature 
   is that during parsing
   \.foo is simply interpreted as \foo
   this would enable callbacks, e.g. for shipping typeface information:
   bf, it, tt etc.
   \apply{_#1{\!.\1{a}\|}}{{foo}{bar}{zut}}
   but it is seems too special purpose to be good.
   \def{bf#1}{bf[\1]}
   \def{it#1}{it[\1]}
   \def{st#2}{\apply{_#1{\!{}\1{\2}\|}}{{foo}{bar}{zut}}}

   nuther solution is to make cb_bf, cb_it, cb_tt keys that map
   to bf, it, tt.

-  can it be useful to keep track in yamfilterdata, the state in
   which the last character was output (at or plain)?
   This pertains also to the squashing problems.

-  interface for precision

?  \inspect{posix,grep,lines{^From:}{}}{\finsert{/var/mail/stijn}}
   does not grep.
   \inspect{posix,grep,lines{(^From:.*)}{_#1{\1}}}{\finsert{/var/mail/stijn}}

?  enable \itembar in itemize. The generic_zmm.azm man page looks ugly
   (without it).

-  Is it interesting to see how much of m4's functionality can
   be supported? e.g. formatted output.
   No general formatted output: where is the end?
   par functionality, columns ..
   C printf family: maybe.

-  suppose paths can contain slashes (as under MS), then it has
   to be unprotected before use.

-  perhaps \car or \par should be required everywhere, so no implicit
   \par after e.g. \itemdef.

-  ZOEM_TRACE_REGEX make it a macro (and thus remove
   the ugly '& tracing_g' part)
   The current trace interface is rotten. difficult to find sth
   satisfactory though.

?  for lref etc, make the troff printed argument italic?

-  how about a '\register#2{name}{descr}' command, so that it's easy
   to find all macro's supported by a package.
   .zmm files are not parsed by -i flag. perhaps

   zoem -r man.zmm
   should list all registered macro's in man.zmm

-  after \itemdef, it is pbb best custom to require \car (or \par).
   for that matter, every piece of flow writing should be  preceded
   by one of those.

?  perhaps generalization of the stacking mechanism: multiple stacks.

-  do we need more protect/unprotect subtleties, finer control by user,
   e.g. wrt to sending data and retrieving output to/from system commands? 

-  it would be nice if you could sort composite structures on substructures ..
   this is pbb plain stupid to strive for though.

-  Different file names can refer to the same file (i.e ./foo, foo).
   Right now zoem hashes by file name. Is there a thing that is
   constant as long as the generic name is constant, i.e. the inode
   or file descriptor (I badly need education)?

-  make \dots commando.

-  repeated parsing stuff in read.c (viewed alone),
   repeated parsing stuff in parse.c (viewed alone),
   repeated parsing stuff in {read,parse}.c

   repeated stuff in filter.c, messy look of filter.c

#  difference between sibref and aref wrt to html extension.

-  check all uses of href and httpref (local use of httpref is conceivable).
-  should sibref take full name?
   href is now used for both internal and external references.
   should perhaps rename lref to iref, href to lref.

?  can car work in conjunction with itemize?
   should  implement it for troff, tis now unconditional par skip.

-  find out the best values for $w1 and $w2 in itemize env, and
   find out whether width and height should have dimension in <td>.

-  \protect, so that I need not escape backslashes with vim all the time.
   that could make \finsert obsolete, except that it is more efficient.

-  should use \<> syntax more often: does not require the repeated
   \@{..} \$xx \@{..} \$xx \@{..} alternation.
   this may require though that the indentation rules are changed.

-  zoem in interactive mode opens stdia.ozm.

-  do sth with ftinc in html.

-  checks by xml sugar should pbb not be fatal -- easier for debugging.

-  perhaps make substr macro, also allowing -1 syntax.

#  in html, after verbatim, no <p> makes ns forget about text-align:justify:
   <p> present makes ns insert extra vertical space.
   made \car and \car#1 to combat this, but it is slightly ugly,
   as it is html-specific whether car or par should be used.

?  summary attribute for itemize?
?  anchor attribute too?

-  can I remove table#5? mm not entirely replaceable by apply.

man.zmm:
   o  should make indent smaller.
      perhaps make it adjustable, because faq and man need different amount?

-  automatic spacing with xml sugar is different from what I do when
   coding in at scope.
   (e.g. <table><tr>). remove automatic tabbing from sugar, or remove
   everything?

x  how about TOC's where all numbers are aligned to the left :)
   with those neatly dotted lines.  That would not be an itemize env, but
   probably a toc env. interesting whether it'd be doable in html without gifs.

-  unprotect could take list of chars to unprotect, or take mode arg.
   1=bs, 2=lc, 4=rc.
   should inpspect unprotect bs? myes,
   \B must be specified as \\B.
   \\ must be specified as \\\\.
-  wat would  unprotect do with @ scope? 

#  the folllowing should be fixed:
\inspect{posix}{$}{()}{ab
cd
ef}
   $ matches;  pointer is set to after 'ab'; $ matches again.

?  integrate 'margin itemize' from faq with plain itemize?
   then w1+w2 align right up to the current margin border.
   perhaps difficult, as the faq aims for a particular visual effect.
-  would also need to provide 'dotted' functionality.
-  would also need to provide right-align in margin.

?  make exported symbols known to the world.
   \export{key}{signature}{descr},
   \export{key}{signature}.

?  interactive mode input buffering does not work ok:
   try pasting
\system{sort}{}{Security Updates for Woody. Some of you may have noticed already that
the Security Team is already supporting Woody in their [5]advisories.
Apparently the new [6]security build structure is working properly.
In order to use the updated packages automatically, you should add deb
http://security.debian.org/ woody/updates main contrib non-free to
a}
   a few times and you'll see a yamClosingCurly freaking out.
(this seems fixed)

#  '/' close indicator at start (as in </foo>)
   and in unary (as in <foo/>) are assumed to be at begin/end resp,
   presence of intervening ws is not checked. Is it allowed in XML anyway?

   so perhaps add checking for ws, complain and warn if found.
   shd now be easy given the new mcxStr[R]Chr{Is,Aint} functions.

-  ownership of the mcxTing objects, is a potential fountain for bugs.
   so far i seem to do ok. sth like a design, or rules, or documentation
   would be cool though. I have hinted at ownership at some places, for a start.

-  does count work without vararg or lines?

-  in the parsing stuff, try to define and use character classes,
   e.g. issyntax (for \, {, and }).
   possibly, the mcxStr[R]Chr{Is,Aint} are handy too.

#  the xml stackidx_g hack works with multiple files
   only if writing begin and end tags are nested as should.
   (i.e. multiple files are treated as one big file).

-  inspect2: moet duidelijke specs en restricties maken.
-  inspect2: implement limit

-  make test cases:
      patterns
         ([^o]*)
         ()
         (.*)
      strings (as scopes)
         {}

-  yamKeyGet does not return a const Ting. Why not?
   it should be clear which routines return the *real thing* and
   which return a *copy*.

-  finsert and zinsert should be able to use inline files as well.
   finsert should then escape the data afterwards (??).
   finsert: choice between escaping only backslashes or curlies as well.
   must escape curlies (for scope parsing).

-  \% could return a vararg if the access sequence maps to sth
   without a value, or should it become optional argument?

#? apparently, readFile searches for inline files, but these are
   only made by yamReadFile.
   made quick fix for this.

-  inspect: acts on zoem data. perhaps it should be able to act
   on 'raw' data -- that would require a primitive I guess.
   mm, pbb not a good idea. Right now raw data can be obtained
   by escaping every backslash, and that's fine.

-  would there be a use in zoem for user-defined named dictionaries,
   other than the d-tree? Would it have a persistency logic different
   from or extending pop/push?

-  check use of mcxTingEnsure where mcxTingEmpty should be used instead.

-  maybe more context should be avaible to the match.
   like, what the whole line was.
   can I now implement grepping in zoem?

-  can yam error functionality be replaced by general util/err stuff?

-  why do openscope and endscope differ wrt to ting and char* argument?

-  in \begin and \end, should I check for forbidden characters?

?  add warning at EOD(ocument) if a \begin scope is not closed.

?  make it possible to unformat a package

?  make sure that '_' is captured as a token, not as some
   undefined user key.

-  maybe I need a way to enforce match between block #k and
   nr of args of apply. nother primitive?

-  the many empty [>] filters are a bit annoying (all squashing ws).
   think of a way to show a one-line initial prefix of what's filtered,
   especially wrt ws.

-  traceput c argument is funny. better (symbolic) interface needed.

-  adding (various?) 'strict' behaviour; e.g. in relationship to
   the data tree (warn if access fails).

-  zoem data manipulation: need a way to turn of space munging ..
   or is \@{\w} sufficient?

-  maybe trace output should be more legible.

-  replace the oft-seen couple yamSegFree/mcxTingFree with yamSegInit.


primitive candidates:
length
substr