Author: coke
Date: Wed Jul 23 17:21:08 2008
New Revision: 29712

Modified:
   trunk/languages/tcl/runtime/builtin/info.pir
   trunk/languages/tcl/runtime/builtin/namespace.pir
   trunk/languages/tcl/runtime/builtin/proc.pir
   trunk/languages/tcl/runtime/builtin/subst.pir
   trunk/languages/tcl/runtime/builtin/upvar.pir
   trunk/languages/tcl/runtime/builtin/variable.pir
   trunk/languages/tcl/runtime/conversions.pir
   trunk/languages/tcl/runtime/options.pir
   trunk/languages/tcl/runtime/variables.pir

Log:
[tcl] http://code.google.com/p/partcl/issues/detail?id=58
Eliminate some more __foo style sub names



Modified: trunk/languages/tcl/runtime/builtin/info.pir
==============================================================================
--- trunk/languages/tcl/runtime/builtin/info.pir        (original)
+++ trunk/languages/tcl/runtime/builtin/info.pir        Wed Jul 23 17:21:08 2008
@@ -77,12 +77,12 @@
   .local string procname
   procname = shift argv
 
-  .local pmc __namespace
-  __namespace = get_root_global ['_tcl'], '__namespace'
+  .local pmc splitNamespace
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
 
   .local pmc    ns
   .local string name
-  ns   = __namespace(procname)
+  ns   = splitNamespace(procname)
   name = pop ns
   name = '&' . name
 
@@ -116,12 +116,12 @@
   .local string procname
   procname = argv[0]
 
-  .local pmc __namespace
-  __namespace = get_root_global ['_tcl'], '__namespace'
+  .local pmc splitNamespace
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
 
   .local pmc    ns
   .local string name
-  ns   = __namespace(procname)
+  ns   = splitNamespace(procname)
   name = pop ns
   name = '&' . name
 
@@ -186,12 +186,12 @@
   .local pmc setVar
   setVar = get_root_global ['_tcl'], 'setVar'
 
-  .local pmc __namespace
-  __namespace = get_root_global ['_tcl'], '__namespace'
+  .local pmc splitNamespace
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
 
   .local pmc    ns
   .local string name
-  ns   = __namespace(procname)
+  ns   = splitNamespace(procname)
   name = pop ns
   name = '&' . name
 

Modified: trunk/languages/tcl/runtime/builtin/namespace.pir
==============================================================================
--- trunk/languages/tcl/runtime/builtin/namespace.pir   (original)
+++ trunk/languages/tcl/runtime/builtin/namespace.pir   Wed Jul 23 17:21:08 2008
@@ -76,9 +76,9 @@
   argc = argv
   if argc goto bad_args
 
-  .local pmc ns, __namespace
-  __namespace = get_root_global ['_tcl'], '__namespace'
-  ns  = __namespace('')
+  .local pmc ns, splitNamespace
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
+  ns  = splitNamespace('')
   $S0 = join '::', ns
   $S0 = '::' . $S0
   .return($S0)
@@ -95,15 +95,15 @@
   # no arg delete does nothing
   if argc == 0 goto return
 
-  .local pmc __namespace, ns_root
-  __namespace = get_root_global ['_tcl'], '__namespace'
+  .local pmc splitNamespace, ns_root
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
   ns_root = get_root_namespace ['tcl']
 
   $I0 = 0
 delete_loop:
   if $I0 == argc goto return
   $S0 = argv[$I0]
-  $P0 = __namespace($S0)
+  $P0 = splitNamespace($S0)
   $I1 = 0
   $I2 = elements $P0
   dec $I2
@@ -245,11 +245,11 @@
   unshift $P0, 'namespace'
   unshift info_level, $P0
 
-  .local pmc ns, __namespace
-  __namespace = get_root_global ['_tcl'], '__namespace'
+  .local pmc ns, splitNamespace
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
 
   ns = shift argv
-  ns = __namespace(ns, 1)
+  ns = splitNamespace(ns, 1)
 
   .local string namespace
   namespace = ''
@@ -322,15 +322,15 @@
   .local pmc list
   list = new 'TclList'
 
-  .local pmc __namespace, ns, ns_name
+  .local pmc splitNamespace, ns, ns_name
   .local string name
-  __namespace = get_root_global ['_tcl'], '__namespace'
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
   name = ''
   if argc == 0 goto getname
 
   name = argv[0]
 getname:
-  ns_name  = __namespace(name, 1)
+  ns_name  = splitNamespace(name, 1)
 
   unshift ns_name, 'tcl'
   ns = get_root_namespace ns_name
@@ -450,9 +450,9 @@
   name = argv[0]
 
 get_parent:
-  .local pmc ns, __namespace
-  __namespace = get_root_global ['_tcl'], '__namespace'
-  ns  = __namespace(name)
+  .local pmc ns, splitNamespace
+  splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
+  ns  = splitNamespace(name)
   if $S0 != '' goto no_pop
   # for when someone calls [namespace current] from ::
   push_eh current_in_root

Modified: trunk/languages/tcl/runtime/builtin/proc.pir
==============================================================================
--- trunk/languages/tcl/runtime/builtin/proc.pir        (original)
+++ trunk/languages/tcl/runtime/builtin/proc.pir        Wed Jul 23 17:21:08 2008
@@ -21,11 +21,11 @@
   args      = argv[1]
   body      = argv[2]
 
-  .local pmc pir_compiler, compileTcl, toList, __namespace
+  .local pmc pir_compiler, compileTcl, toList, splitNamespace
   pir_compiler = compreg 'PIR'
   compileTcl     = get_root_global ['_tcl'], 'compileTcl'
   toList       = get_root_global ['_tcl'], 'toList'
-  __namespace  = get_root_global ['_tcl'], '__namespace'
+  splitNamespace  = get_root_global ['_tcl'], 'splitNamespace'
 
   .local pmc code, args_code, defaults
   .local string namespace
@@ -41,7 +41,7 @@
 
   if full_name == '' goto create
 
-  ns   = __namespace(full_name, 1)
+  ns   = splitNamespace(full_name, 1)
   $I0  = elements ns
   if $I0 == 0 goto create
   name = pop ns

Modified: trunk/languages/tcl/runtime/builtin/subst.pir
==============================================================================
--- trunk/languages/tcl/runtime/builtin/subst.pir       (original)
+++ trunk/languages/tcl/runtime/builtin/subst.pir       Wed Jul 23 17:21:08 2008
@@ -35,10 +35,10 @@
     astgrammar = new 'TclExpr::PAST::Grammar'
     pirgrammar = new 'TclExpr::PIR::Grammar'
 
-    .local pmc __namespace, ns
+    .local pmc splitNamespace, ns
     .local string namespace
-    __namespace = get_root_global ['_tcl'], '__namespace'
-    ns          = __namespace('', 2)
+    splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
+    ns          = splitNamespace('', 2)
     namespace   = ''
     $I0 = elements ns
     if $I0 == 0 goto loop

Modified: trunk/languages/tcl/runtime/builtin/upvar.pir
==============================================================================
--- trunk/languages/tcl/runtime/builtin/upvar.pir       (original)
+++ trunk/languages/tcl/runtime/builtin/upvar.pir       Wed Jul 23 17:21:08 2008
@@ -87,7 +87,7 @@
 
   .local pmc ns
   .local string name
-  ns   = __namespace(new_var, 1)
+  ns   = splitNamespace(new_var, 1)
   name = pop ns
   name = '$' . name
 

Modified: trunk/languages/tcl/runtime/builtin/variable.pir
==============================================================================
--- trunk/languages/tcl/runtime/builtin/variable.pir    (original)
+++ trunk/languages/tcl/runtime/builtin/variable.pir    Wed Jul 23 17:21:08 2008
@@ -11,10 +11,10 @@
     argc = elements argv
     if argc == 0 goto bad_args
 
-    .local pmc findVar, storeVar, __namespace
+    .local pmc findVar, storeVar, splitNamespace
     findVar  = get_root_global ['_tcl'], 'findVar'
     storeVar = get_root_global ['_tcl'], 'storeVar'
-    __namespace = get_root_global ['_tcl'], '__namespace'
+    splitNamespace = get_root_global ['_tcl'], 'splitNamespace'
 
     .local pmc iter, name, value, ns
     iter = new 'Iterator', argv
@@ -37,7 +37,7 @@
     unless iter goto no_value
     value = shift iter
 
-    ns = __namespace(name)
+    ns = splitNamespace(name)
     $S0 = ns[-1]
     # store as a lexical *and* a global
     storeVar($S0, value)
@@ -45,7 +45,7 @@
     goto loop
 
 no_value:
-    ns = __namespace(name)
+    ns = splitNamespace(name)
     $S0 = ns[-1]
     # if the variable exists, just insert it as a lexical
     # otherwise, create a new Undef and insert it as both lexical and global

Modified: trunk/languages/tcl/runtime/conversions.pir
==============================================================================
--- trunk/languages/tcl/runtime/conversions.pir (original)
+++ trunk/languages/tcl/runtime/conversions.pir Wed Jul 23 17:21:08 2008
@@ -475,13 +475,13 @@
     tcl_error $S0
 .end
 
-=head2 _Tcl::__namespace
+=head2 _Tcl::splitNamespace
 
 Given a string namespace, return an array of names.
 
 =cut
 
-.sub __namespace
+.sub splitNamespace
   .param string name
   .param int    depth     :optional
   .param int    has_depth :opt_flag

Modified: trunk/languages/tcl/runtime/options.pir
==============================================================================
--- trunk/languages/tcl/runtime/options.pir     (original)
+++ trunk/languages/tcl/runtime/options.pir     Wed Jul 23 17:21:08 2008
@@ -63,7 +63,7 @@
   error .= ' "'
   error .= choice
   error .= '": must be '
-  $S1 = __options_to_string(options)
+  $S1 = optionsToString(options)
   error .= $S1
   tcl_error error
 
@@ -73,8 +73,7 @@
   error .= ' "'
   error .= choice
   error .= '": must be '
-  # $S1 = __options_to_string(partials)  # Now, I like this better...
-  $S1 = __options_to_string(options)
+  $S1 = optionsToString(options)
   error .= $S1
   tcl_error error
 .end
@@ -187,7 +186,7 @@
   $S1 .= ' "-'
   $S1 .= arg
   $S1 .= '": must be '
-  $S2 = __switches_to_string(switches)
+  $S2 = switchesToString(switches)
   $S1 .= $S2
   tcl_error $S1
 loop_next:
@@ -204,7 +203,7 @@
   .return (results)
 .end
 
-.sub __options_to_string
+.sub optionsToString
   .param pmc options
 
   # uncomment this if folks start passing in un-ordered lists...
@@ -240,8 +239,8 @@
   .return (error)
 .end
 
-# Similar to __option_to_string. Refactor??
-.sub __switches_to_string
+# Similar to optionsToString. Refactor??
+.sub switchesToString
   .param pmc switches
 
   # uncomment this if folks start passing in un-ordered lists...

Modified: trunk/languages/tcl/runtime/variables.pir
==============================================================================
--- trunk/languages/tcl/runtime/variables.pir   (original)
+++ trunk/languages/tcl/runtime/variables.pir   Wed Jul 23 17:21:08 2008
@@ -307,7 +307,7 @@
   absolute = 1
 global_var:
   depth += 2
-  ns = __namespace(name, depth)
+  ns = splitNamespace(name, depth)
   $S0 = pop ns
   $S0 = '$' . $S0
 
@@ -393,7 +393,7 @@
 
 global_var:
   depth += 2
-  ns = __namespace(name, depth)
+  ns = splitNamespace(name, depth)
   name = pop ns
   name = '$' . name
 

Reply via email to