README

tcl

Tcl (Tool Command Language) is a very powerful but easy to learn dynamic programming language, suitable for a very wide range of uses, including web and desktop applications, networking, administration, testing and many more.

Expand ▾ Collapse ▴

Documentation

Overview

    Package tcl is a port of the Tool Command Language.

    A sperate Tcl shell is in the gotclsh directory.

    Do not use in production.

    Changelog:

    2020-08-04: beta2 released for linux/amd64 only. Support for threads, sockets and fork is not yet implemented. Some tests still crash, those are disabled at the moment.

    Index

    Examples

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func Library

    func Library(directory string) error

      Library writes the Tcl library to directory.

      func LibraryFileSystem

      func LibraryFileSystem() http.FileSystem

        LibraryFileSystem returns a http.FileSystem containing the Tcl library.

        Types

        type CmdProc

        type CmdProc func(clientData interface{}, in *Interp, args []string) int

          CmdProc is a Tcl command implemented in Go.

          type Command

          type Command struct {
          	// contains filtered or unexported fields
          }

            Command represents a Tcl command.

            type DeleteProc

            type DeleteProc func(clientData interface{})

              DeleteProc is a function called when CmdProc is deleted.

              type Interp

              type Interp struct {
              	// contains filtered or unexported fields
              }

                Interp represents a Tcl interpreter.

                func MustNewInterp

                func MustNewInterp() *Interp

                  MustNewInterp is like NewInterp but panics on error.

                  func NewInterp

                  func NewInterp() (*Interp, error)

                    NewInterp returns a newly created Interp or an error, if any.

                    func (*Interp) Close

                    func (in *Interp) Close() error

                      Close invalidates the interpreter and releases all its associated resources.

                      func (*Interp) Eval

                      func (in *Interp) Eval(script string) (string, error)

                        Eval evaluates script and returns the interpreter; result and error, if any.

                        Example
                        Output:
                        
                        43
                        

                        func (*Interp) MustClose

                        func (in *Interp) MustClose()

                          MustClose is like Close but panics on error.

                          func (*Interp) MustEval

                          func (in *Interp) MustEval(script string) string

                            MustEval is like Eval but panics on error.

                            func (*Interp) MustNewCommand

                            func (in *Interp) MustNewCommand(name string, proc CmdProc, clientData interface{}, del DeleteProc) *Command

                              MustNewCommand is like NewCommand but panics on error.

                              func (*Interp) NewCommand

                              func (in *Interp) NewCommand(name string, proc CmdProc, clientData interface{}, del DeleteProc) (*Command, error)

                                NewCommand returns a newly created Tcl command or an error, if any.

                                Example
                                Output:
                                
                                123 foo bar 42
                                42
                                

                                func (*Interp) SetResult

                                func (in *Interp) SetResult(s string) error

                                  SetResult sets the result of the interpreter.

                                  Source Files

                                  Directories

                                  Path Synopsis
                                  internal