=head1 Administrative Issues

=over 4

=item [interpinfo name]

how to do this from inside parrot?

=item migrate all these issues to RT.

TODO tests would also suffice, where possible.

=item update docs/* 

=item add pod to all .imc

=back

=head1 Programming Issues

=head2 C-level tasks

=over 4

=item List to String (KJ?)

The current list to string logic in C<dynclasses/tcllist.pmc> is missing logic
to properly escape string elements.

=item PMC based parser

Instead of the current PIR level parsing, we should instead use
a pmc - not only should this improve speed slightly, but will help
us implement the [parser] builtin.

=item string to list 

Should be moved to tcllist's set_string method. (but this requires first
moving the parser into a pmc.)

=item tclword

An object is probably too heavyweight for this. A PMC with a few overloaded
methods is probably sufficient.

=item Use PMCs to handle numifying

not the pir routines we now have. Verify that [expr 2a + 2b] behaves
appropriately when doing this. Include proper numification of octal and
hex.

=back

=head2 PIR-level tasks

=over 4

=item globals vs. lexicals

Right now, globals are done with lexicals. get_var/set_var needs to be 
updated to check the call_level - if we're at 0, then use a global. [global]
and [upvar] may need attention once this is done.

=item interactive tclsh

interactive tclsh mode currently only waits for EOF and then runs all
commands entered. should have sane defaults for tcl_prompt1, tcl_prompt2
and respect them, and process intermediate input.

=item implement default globals, etc.

global variables provided by tcl libary. L<tclvars>.

global variables provided by tcl interpreter. L<tclsh>

source per-user settings. L<tclsh>

=item misc

hex & unicode escapes are not supported in C<lib/parser.imc>

=item unimplemented commands/subcommands

[after] [array get]* [array names] [array unset] 
[array statistics] [array anymore] [array donesearch]
[array nextelement] [array startsearch] [bgerror] [binary] 
[case] [clock] [close] [cd] [dde] [encoding] [eof] [exec]
[fblocked] [fconfigure] [fcopy] [file] [fileevent]
[flush] [gets] [glob] [http] [info]* [interp] [library]
[lindex] [load] [lreplace] [lsearch]* [lset] [lsort] 
[memory] [msgcat] [namespace] [open] [package] [pid] [pwd]
[read] [registry] [regexp] [regsub] [resource] 
[safe] [scan] [seek] [socket] [subst]
[string replace] [string tolower] [string totitle] [string toupper]
[string trim] [string trimleft] [string trimright]
[string compare] [string equal] [string last]
[string bytelength] [string is] [string map]
[string wordstart] [string wordend] [switch] [tcltest]
[tell] [update] [variable] [vwait]

* - assigned

=back

=head2 Tests

=over 4

=item standards

Any future tests, write more like t/tcl_var_subst.t. Eventually cleanup
tests so they're consistent.

=item Add tests for...

tclword.imc, PMCs, the macros, expr's precedence and parens,
[puts]'s ability to write to other channels, the C<compreg> compiler.

[uplevel] [upvar] [lrange] [inline] [string repeat] 

=item pass tcl test suite

=back

=head1 Uncategorized Issues

=over 4

=item From leo - cleanup of tcl objects.

C<tclobject> is an abstract object, it doesn't have a vtable. But the
bundling code *does* C<pmc_register> this PMC. This leads to an empty
vtable slot, dereferencing that NULL is an operation, which many systems
don't like.

=item Remove Perl*

Mostly done. All that seems to be left is PerlUndef. Much was already
converted to the internal types. PerlUndef removal will probably result
(finally) in the use of null checks where it's being used for that, and
TclObject where it's being used for shimmering.

=item Freeze/Thaw of TclWord would ...

allow us to build a braindead compile
option - given a chunk of tcl, generate a chunk of PIR that we can 
emit to be saved, compiled, and then run again.

=item tail call optimizations

tail call optimizations - there are several cases where I could use this
and save myself a call. Possible to do right now with PASM - wait for
PIR support before welding in.

=item provide a way to access existing library PIR from Tcl.

=item add benchmarks?

=item given freeze/thaw for objects...

Once freeze/thaw is working for tclwords (currently waiting on parrot
support), rewrite proc to preparse
once and cache the result in the generated sub rather than reparsing
each time.

(Though this seems evil, too. There must be a better way.)

=item TclWord

implement C<is_const> to allow for some optimizations in the compiler. 
(which isn't written yet.)
when adding words, default to true, but if at any point we add a variable
or a command, invalidate that. (mostly done!)

Move TclWord namespace into _Tcl::Word, less clutter?

=item multiple level lists

This will be much easier to do when we can call into the parser from
the TclList PMC. (is this already doable?)

=item compiler vs. interpreter

it should be possible to further extend our interpreter
this to make an actual compiler,
where the _compiler emits PIR. So, the resulting call from, say, [source]
would be:

	# Note this a change from _parse's current signature 
	(parsed_data_structure,tcl_status,error) = _parse(tcl_code)
	(pir_code,tcl_status,error) = _compile(parsed_data_structure)

And now that we have the pir_code, we can either emit the necessary
PIR (ala parrot's -o option) or we can compile and run it.

Caveat: how to support -o with user defined procs - right now, proc is defining
the sub on the fly, where, with a compiler, we may want to defer compilation,
and simply be able to extract the generated PIR.

=item (LOW) speed

Comparing examples/fact.tcl with parrot vs. tclsh (OSX)

 ??/??/??: 8-12 x slower, single call
 05/14/04: 500 calls in a loop slows us down to 60x!
 11/22/04: 500 calls in a loop: only 10x slower!

=item expr

Clean up expr. MUUUUCH room for improvement there.

expr - parse/interpret split - This is working for expr - change any other 
thing that calls __expression to use the _p, _i variants, delete the original 
proc. Once we've done that, determine a better structure to use as the inter
mediate representation between the two.

clean up expr so that it's not passing around
type indicators. - just use PMCs everywhere. (Though we may still need
to have CONST vs. VARIABLE types.

The type indicator is also used to disambiguate operators and function calls
from operands. We can easily remove it for operands, but how to cleanly
remove this for operators? 

TBD: strings, floats as operands - (many of the math funcs return floats
but you can't specify them, and not everything takes them 
(try, for example, [expr sin(1) + sin(1)] vs [expr sin(1) * sin(1)].)

TBD: blocks, commands, and strings as operands

TBD: logical binary ops & ternary op (need deferred evaluation) ; unary ops;
ops that work on strings only.

TBD: functions that take > 1 arg.

TBD: Argument type requirements - Currently works ONLY on bitand - esp need
to get any that require int-only args, as we can now /generate/ floats,
even if we cannot specify them. {This probably requires switching to Tcl*
PMCs and putting the logic in there hidden under MMD}

=item misc

complete [error] (need global var support)

=back

=cut
