tcloo | Tcl OO Package | Script Programming library

 by   tcltk C Version: Current License: Non-SPDX

kandi X-RAY | tcloo Summary

kandi X-RAY | tcloo Summary

tcloo is a C library typically used in Programming Style, Script Programming applications. tcloo has no bugs, it has no vulnerabilities and it has low support. However tcloo has a Non-SPDX License. You can download it from GitHub.

TclOO is an object system for Tcl that has been designed to provide high performance while still allowing as much flexibility as possible, and to be a core for other object systems. It supports a single-rooted class-based object system where classes are themselves subclassable objects, with multiple inheritance, mixins, procedure-like and forwarded methods, filter methods, dynamic reconfiguration, etc. It does not come with a large class library, and it does not force its use upon user scripts. Some of the packages in Tcllib use TclOO, but these may be dependent on other Tcl 8.6 features. The heritage of TclOO can be traced back to a number of other object systems, notably including XOTcl, incr Tcl, and Snit. It also draws on experience with object systems in other languages like C++, Java and Ruby (despite being somewhat different from each of them).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tcloo has a low active ecosystem.
              It has 14 star(s) with 10 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              tcloo has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of tcloo is current.

            kandi-Quality Quality

              tcloo has no bugs reported.

            kandi-Security Security

              tcloo has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              tcloo has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              tcloo releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tcloo
            Get all kandi verified functions for this library.

            tcloo Key Features

            No Key Features are available at this moment for tcloo.

            tcloo Examples and Code Snippets

            No Code Snippets are available at this moment for tcloo.

            Community Discussions

            QUESTION

            upvar, TclOO, and next - explanation of (perhaps) unexpected behaviour
            Asked 2021-Feb-15 at 08:39

            I'm wondering if anyone can explain the behind-the-scene details of why I can chain upvars successfully in nested procs, but it does not work in nested TclOO methods (those methods overridden in child classes). (I've been told that calling [next] in a TclOO class method acts a bit like a "temporary tailcall", in that a new stack level is not created. Is it this the case? If so, what is the complete picture?)

            For example, the following three approaches do not all give the same result:

            ...

            ANSWER

            Answered 2021-Feb-15 at 08:39

            The next command internally is a bit like uplevel (specifically uplevel 1) in that it temporarily removes the stack frame of the method calling next while running the superclass implementation, restoring the stack frame when next returns (of course).

            This means that you can override methods from superclasses without those superclasses needing to be especially prepared for it. That was a major problem with some other older object systems for Tcl, where you needed a special call to get the depth argument for upvar and uplevel, and it was ever so easy to forget that, so I changed things for TclOO. However, a direct consequence of that change means that what you're doing in S1 » addone won't work; it creates/overwrites an additional variable, xx, in the calling scope. S2 » addone is what I'd consider idiomatic.

            If you're passing an internal variable around between a method and the method it overrides — which by definition requires the two to cooperate — use a variable in the object's state namespace; your classes have complete control over that. Or invoke a method via my or [self]; that's a standard method call (with all that implies).

            Source https://stackoverflow.com/questions/66201923

            QUESTION

            How do we find what packages exist in our tcl environment and where they are stored and how to include new packages?
            Asked 2020-Aug-05 at 14:39

            My objective was to carry out log base 2 in my tcl script but it has raised some questions about how tcl works. I need to do these things:

            1. Find list of available packages in my tcl environment
            2. Find list of procedures available in package
            3. Find "information" or "description" of procedure like we do using -h or --help switch in Shell
            4. How to add new package into our tcl environment? Are there packages to be download for tcl as they are for Python (where we use pip)?

            Now I have tried to carry out some command execution myself and the trace is below:

            ...

            ANSWER

            Answered 2020-Aug-05 at 14:39
            Finding Packages
            1. Tcl waits to build the package list until you ask for a package whose name it does not currently know. catch {package require thereisnosuchpackage} should mostly populate the list.

              However, there are some packages that are stored as Tcl modules and that never get entered into the list. They use a more efficient loading mechanism, but are somewhat restricted in format. tcl::tm::path list will give a list of directories where they can be found, and the package name and version are built from that into a file.

              I don't like that there isn't a way to get a list of those modules neatly, even if just for maintenance and discovery purposes.

            Functions in Expressions
            1. The expr command rewrites the call to the log(1.23) function from:

            Source https://stackoverflow.com/questions/63266177

            QUESTION

            How does one access a derived classes member variables from within the superclass in Tcl?
            Asked 2019-Dec-03 at 16:30

            Code:

            ...

            ANSWER

            Answered 2019-Dec-01 at 10:37

            You can get the name of the object with self object, or just self. You can then get the class of the object with info object class. And finally, you can get the member variables of a class with info class variables.

            Putting it all together results in:

            Source https://stackoverflow.com/questions/59119524

            QUESTION

            What is the correct usage of the mixin classs for TCL language?
            Asked 2019-Nov-18 at 09:36

            Im attempting to update an old version of the selenium-tcl package to work with the new W3C WebDriver (or Selenium 4.0).

            Original packages uses a few mixins for the webdriver class.

            So I modeled what I saw and created a mixin file named mixin_action_chains.tcl [1] which has a mixin class called Mixin_Action_Chains.

            Whenever I attempt to use it I get the error:

            ...

            ANSWER

            Answered 2019-Nov-18 at 09:36

            Im not sure what else must be done for TclOO. Any thoughts.

            Update

            pkgIndex.tcl: The placement of the mixin-defining script mixin_action_chains.tcl is wrong, it comes after the mixin has already been required in the previously sourced script webdriver.tcl, like entering directly:

            Source https://stackoverflow.com/questions/58844593

            QUESTION

            gpg-agent not found for homebrew
            Asked 2019-Feb-20 at 20:28

            I'm attempting to install gpg-agent, but I am getting an error that the formula doesn't exist:

            ...

            ANSWER

            Answered 2019-Feb-20 at 20:28

            The gpg-agent formula was removed by commit 965e1. The reason is given in the commit message:

            Source https://stackoverflow.com/questions/52435650

            QUESTION

            TclOO: object equals
            Asked 2018-May-19 at 14:09

            What is idiomatic pattern for TclOO object equals implementation?

            Perhaps compare concatenated sorted lists of all properties?

            Are there analogs to Scala case classes?

            ...

            ANSWER

            Answered 2018-May-18 at 20:34

            TclOO defines no equality system for you by design; as the objects are in general modifiable, there's no automatic notion that would apply other than object identity, and you can just compare the name of the object to get that (or the results of info object namespace $theObj, if you're being very paranoid; I think Tcl 8.7 will provide more options, but that's not yet accepted).

            If you want to define an equality system such as you are proposing, you could do this:

            Source https://stackoverflow.com/questions/50418361

            QUESTION

            TclOO: class logger mixin
            Asked 2018-May-16 at 20:23

            Please recommend TclOO class logger mixin/trait.

            Logger included with tcllib 1.19 breaks when used as class logger:

            ...

            ANSWER

            Answered 2018-May-16 at 13:33

            This is a bug in ::logger::utils::createLogProc in loggerUtils.tcl in that the %M substitution is not aware of TclOO. If it was, it wouldn't be using the name of the object that the method was invoked on, but rather the name of the method. (It appears that it was designed to work with [incr Tcl], which does name methods like you appear to want.)

            Ideally you'd be setting up the logger once per class, not once per instance. Here's how you'd do that:

            Source https://stackoverflow.com/questions/50352363

            QUESTION

            TclOO: cross-object namespace export/import
            Asked 2018-May-15 at 12:21

            How can one setup TclOO cross-object namespace transfer?

            Specifically, in the example below:

            • runner object needs to export its method namespace as commands
            • and invoker object needs to import runner namespace for use as DSL

            The following example in Tcl 8.6:

            ...

            ANSWER

            Answered 2018-May-15 at 12:21

            TclOO methods are not commands. (Technically, it's because they have a different C signature.) To make this work, you need to create an extra command in the object that acts as a delegate for the method; the trick to doing this efficiently is to use tailcall my to do the dispatch.

            Source https://stackoverflow.com/questions/50349912

            QUESTION

            how to link to the tclOO functions in the Tcl C API
            Asked 2018-Jan-21 at 15:57

            As a short example of what I can't do:

            ...

            ANSWER

            Answered 2018-Jan-21 at 15:57

            The TclOO API, unlike much of the rest of Tcl, only exports itself via a stubs table. You should #define the symbol USE_TCL_STUBS to be 1 before you #include the Tcl header file, and link against the tclstub library. (This is the recommended way of building extensions anyway.)

            [EDIT]: If you're embedding Tcl within your program, you need a more complex procedure. Basically, you need to partition your program into the parts that are an application and the parts that are an internal extension. The parts that call Tcl_CreateInterp are most likely the application part, and the parts that access the TclOO API are the extension (and will need to call Tcl_InitStubs and Tcl_OOInitStubs in an initialisation function).

            The extension parts need to be compiled with USE_TCL_STUBS defined. (As it is critical, you might put that as a #define at the top of the file. The wiki page mentions USE_TCLOO_STUBS as well, but that's implied by USE_TCL_STUBS.) The extension parts need to be built without it. You can call the initialisation function that installs your internal extension immediately after the Tcl_CreateInterp call, before you start running any (non-built-in) scripts. Then when you link everything you link both against libtclstub and libtcl.

            The reason for this complexity is that TclOO started out as a separate extension itself, and that never supported external API references. I probably ought to relax those restrictions for Tcl 8.7…

            Source https://stackoverflow.com/questions/48361869

            QUESTION

            TCLOO: Private Method And Method As Callback
            Asked 2017-Nov-28 at 11:54

            Using Tcloo (self compiled TCL 8.6.7) I implemented a client socket.

            I have the folowing issues:

            1. I how can make a method private when declare using only oo::create class
            2. How can I register the method of the class as the event callback for the socket. I have tried the following:

              chan event $sock readable [list readSocket $sock] Error: invalid command name "readSocket"...

              chan event $sock readable [list [self] readSocket $sock] Error: invalid command name "self"...

            Any help will be appreciated.

            ...

            ANSWER

            Answered 2017-Nov-28 at 11:54

            Methods with names that start with a lower-case letter are public, others are private. You can also use export and unexport.

            Source https://stackoverflow.com/questions/47527830

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tcloo

            You can download it from GitHub.

            Support

            Please file bug reports, feature requests and patches on core.tcl.tk under the Tcl package. http://core.tcl.tk/tcl/tktnew To ensure attention from the relevant maintainer, please use "35. TclOO Package" for the Category field. Remember, it is better to file a bug report twice than not at all!.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/tcltk/tcloo.git

          • CLI

            gh repo clone tcltk/tcloo

          • sshUrl

            git@github.com:tcltk/tcloo.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link