Posted to tcl by bjorkintosh at Thu Nov 16 03:53:22 GMT 2023view raw

  1. # fancyspace.tcl starts here
  2.  
  3. namespace eval fancyspace {
  4. variable var1
  5. variable var2
  6.  
  7. proc foo { } {
  8. variable var1 "Hello from fancyspace"
  9. variable var2 42
  10.  
  11. puts $var1
  12. puts [expr $var2 + 10 - 10]
  13. }
  14.  
  15. namespace export *
  16. }
  17.  
  18. #source2.tcl starts here
  19.  
  20. source fancyspace.tcl
  21. namespace eval lave {
  22. variable var1
  23. variable var2
  24.  
  25. proc bar { } {
  26. variable var1 44
  27. variable var2 "this is just space"
  28.  
  29. ::fancyspace::foo
  30. }
  31. }