JSI 15feb05 -- Exactly: It was and isn't anymore. Welcome back in the virtual world, castle!

TP I have a copy snagged. See also scwsd "Static Content Web Server Daemon"

Doc

Castle - Clever Application Server/Tcl Language Environment

Castle is a web application server - it serves static content, but it can also execute tcl scripts that can generate dynamic web page content. One such application, macro.tcl, is included in this distribution. This application will execute any tcl expressions found in .src files and insert their results back in the source file. macro.tcl provides a set of markup commands similar in many respects to expand (http://www.wjduquette.com/tcl/index.html). Like expand, macro.tcl allows you to use macros to maintain a consistent set of web pages, but unlike expand, it does so on the fly, and does not require pre-processing to create .html files.

Castle uses the file extension to determine which application to use. You can define your own set of macros in a new file (for example, myapp.tcl) and then inform castle how to use it by adding your new extension (.mya) to the servicetypes array at the begining of castle program thusly:

array set servicetypes {
.src {macro}
.mya {myapp}
}

and restart the server. Now whenever the server gets a request for a .mya file, any tcl expression it contains will be executed using myapp as a library.

Castle also has a more general system of accessing applications. Whenever the specified url does not exist as a static file, castle will clip off the first subdirectory and look for an application by that name with a .tcl extension. If it exists, it is called, with succeeding subdirectories turned into named parameters. Thus:

/test/a=2/b=c

Will result in the call: [::test::process a=2 b=c]

These parameters can be scanned using Castle's "getparams" function. Here is a simple example you can use with the above "test" app: