Thu 13 Oct 2011 12:46:00 AM UTC, original submission:
TXR uses a hack in its @(next) and @(output) directives. If a filename is prefixed with a ! it is a command process pipe to be opened for reading or writing. If it begins with $, it is a directory to be opened such that the directory entries are read as if they were lines of a text file.
Since we have keyword arguments, this hack is unnecessary and should be deprecated.
Secondly, there should be a way to specify to append to a file, rather than to overwrite it.
Furthermore, the directory reading functionality should be richer. It should allow the directory entries to be sorted, so the query doesn't have to resort to piping the output of "ls".
Furthermore, the directory stream can provide more information in the form of fields which the TXR query can capture with pattern matching. Instead of just the name of every directory entry, we can stat() the entry and provide arbitrary inode information: object type, permissions, timestamp, et cetera.
Perhaps a special syntax can specify exactly what fields to be made available and in what form. For instance
@(next :directory "." :format `@type:@uid:@name`)
Where the directory stream would then look like
dir:503:txr
file:503:.bashrc
That's just one idea.
|