Author: coke
Date: Sun Jun  5 07:40:19 2005
New Revision: 8275

Added:
   trunk/languages/tcl/lib/commands/namespace.imc
Log:
Add a stub for namespace so anyone working on it will have a place to stick
code.



Added: trunk/languages/tcl/lib/commands/namespace.imc
==============================================================================
--- (empty file)
+++ trunk/languages/tcl/lib/commands/namespace.imc      Sun Jun  5 07:40:19 2005
@@ -0,0 +1,78 @@
+=head2 [namespace]
+
+=cut
+
+.namespace [ "Tcl" ]
+
+.sub "namespace"
+   .local pmc argv 
+  argv = foldup
+
+  unless argv goto failure
+  .local pmc subcommand
+  subcommand = shift argv
+
+  if subcommand == "children"   goto children
+  if subcommand == "code"       goto code 
+  if subcommand == "current"    goto current
+  if subcommand == "delete"     goto delete
+  if subcommand == "ensemble"   goto ensemble
+  if subcommand == "eval"       goto eval
+  if subcommand == "exists"     goto exists
+  if subcommand == "export"     goto export
+  if subcommand == "forget"     goto forget
+  if subcommand == "import"     goto import
+  if subcommand == "inscope"    goto inscope
+  if subcommand == "origin"     goto origin
+  if subcommand == "parent"     goto parent
+  if subcommand == "qualifiers" goto qualifiers
+  if subcommand == "tail"       goto tail
+  if subcommand == "which"      goto which
+
+children:
+code:
+  goto failure
+
+current:
+  $P1 = new TclString
+  $P1 = "::"
+  .return(TCL_OK,$P1)
+
+delete:
+  if argv goto failure #XXX todo
+ 
+  # No arg delete does nothing.
+  $P1 = new String
+  $P1 = ""
+  .return(TCL_OK,$P1)
+
+
+ensemble:
+eval:
+  goto failure
+
+exists:
+  # canonicalize namespace.
+  $P1 = new TclInt
+  $P1 = 0
+  .return(TCL_OK,$P1)
+
+export:
+forget:
+import:
+inscope:
+origin:
+parent:
+qualifiers:
+tail:
+which:
+failure:
+  # XXX lame error handling
+  .return(TCL_ERROR,"bad call to namespace")
+.end
+
+.namespace [ "_Tcl" ]
+
+.sub "_canon_namespace"
+ ## this sub should convert the variable name to its canonical repr.
+.end

Reply via email to