Email: nem AT cs.nott.ac.uk Web: http://www.cs.nott.ac.uk/~nem/ Location: Nottingham, UK. Date of Birth: 27 October 1980. I am a PhD student at the University of Nottingham[http://www.cs.nott.ac.uk] in the UK. Pages I have created: * [Monads] - a hopefully much clearer explanation of this tricky concept. * [A higher-level channel API]. * [Wrapping a procedure]. * [Using namespace ensemble without a namespace]. * [A lambda calculus interpreter with arithmetic]. * [A little learning decision tree]. * C# [using] construct in Tcl. * [A little database with unification]. * [A little logic notation editor]. * A description of [polymorphism]. * A proposal: [A generic collection traversal interface]. * Experimenting with a [Compositional Tk]. * A write-up of [Traits]: a compositional approach to [OO]. * Contributed some thoughts about the crucial reasons why [everything is a string]. * My take on [OO] - [TOOT]: [Transparent OO for Tcl]. (or Transparent Object Oriented Tcl). * The "philosophy" behind TOOT: [Interpreting TOOT] (but see also the comments on EIAS above). * Taking from ideas from [Haskell]: [Monadic TOOT] leads to [Parser Combinators]. * [Non-deterministic search] : A little play with automatic backtracking. * '''A vision for Tcl 9''': I am working on an essay with some ideas for Tcl 9. [http://www.cs.nott.ac.uk/~nem/fanatcl.html]. Update: this is a bit out of date, but most of the points are still valid. I've moved the essay to my univerity hosting for the time being: beware broken links! * [TkPool] (with a little help from [dkf]). * [Artificial Intelligence] * Old notes: [StarSite]/[ArTcl] * A little [BibTeX parser]. * [Parser Combinators]. * [Infix arithmetic with XOTcl]. * [Hello World as a C extension]. * [More functional programming] is my take on functional programming in Tcl. Ideas and discussion with Miguel and others lead to TIP 194 [http://tip.tcl.tk/194] and then to the generalisation that is [TOOT]. * [Simple Newsreader]. * [split and join for nested lists]. * [Simple Download Progress Widget] * Quickly knocked up [Transparent Toplevel] code for Windows... * [A Snit News Ticker Widget]. * Older: [Artificial Intelligence with Tcl], [State Space Searching in Tcl], [Heuristic Searches] ([RS] has a better version of these at [Searching A Star In Space]). These were partly based on psuedocode from the classic textbook "Artificial Intelligence: A Modern Approach" by Stuart Russell and Peter Norvig[http://aima.cs.berkeley.edu/], and were written while I was an undergraduate. A nice example of the usefulness of higher-order functions, even if I didn't know what that term meant at the time! * [Simple TkHTML Web Page Displayer]. * [Interfacing Tcl with Haskell]. * [Simple XML report writer]. ---- Experimenting with a Tcl version of 3-Lisp's reflective lambdas. In 3-Lisp, a reflective function receives 2 extra arguments: the environment of the caller and the continuation of the caller. IIRC, it also receives the other arguments in unevaluated form. This allows you to do ''loads'' of things: lazy evaluation, various kinds of meta programming etc. They are pretty much as powerful as Lisp macros, but I think they fit Tcl's model much better - e.g. they could be a replacement for [uplevel] that doesn't explicitly reference the stack. Anyway, here's a first stab at emulating them in current Tcl using uplevel/upvar: namespace eval meta { namespace export proc apply namespace ensemble create ::proc proc {name params body} { interp alias {} $name {} ::meta::apply [list $params $body ::] } ::proc apply {proc args} { set env [capturelevel 1] uplevel 1 [linsert $args 0 ::apply $proc $env] } ::proc capturelevel level { incr level set env [dict create] foreach name [uplevel $level { info vars }] { upvar $level $name value catch { dict set env $name $value } ;# no arrays } return $env } } This version is very limited: it captures the caller's variable environment as a [dict] and passes it to the meta-proc. So, read-only and variables-only. Still, it demonstrates the idea. Now, imagine this was read/write, and that the environment contained vars and commands. (Perhaps if we unified command/var names in Tcl 9?) Now also imagine that you get the current continuation as another arg... Example: % meta proc get {env name} { dict get $env $name } get % proc foo {a b} { puts "a = [get a], b = [get b]" } % foo 1 2 a = 1, b = 2 ---- [[ [Category Home Page] | [Category Person] ]]