GithubHelp home page GithubHelp logo

C API documentation about jimtcl HOT 5 CLOSED

msteveb avatar msteveb commented on May 25, 2024
C API documentation

from jimtcl.

Comments (5)

msteveb avatar msteveb commented on May 25, 2024

There is no official API documentation. Use the source as a guide. The philosophy is very similar to Tcl, so that is useful as a starting point.

The "aio" module is probably a good example of creating objects (file handles) that are backed by real objects (file descriptors) using an oo-like interface.

from jimtcl.

jameswalmsley avatar jameswalmsley commented on May 25, 2024

Hi

Thanks I just discovered the aio module a moment ago. So as you suggest I'm basing my module around that.

One question that I have. The AIO file handles are added to the global namespace. Is there a way to not do this so that the object is simply deleted when it goes out of scope?

E.g.

set my_camera [camera.open]
unset my_camera

Currently I do:

camera.open
::camera_1

rename camera_1 ""

Is this the normal way to delete an "object" in tcl?

Many thanks for your help

James

from jimtcl.

msteveb avatar msteveb commented on May 25, 2024

Would be better to discuss this on the Jim Tcl mailing list so that others can provide input.

I think you want:

set my_camera [camera.open]
$my_camera delete

i.e. provide a delete operation on your returned object/command.

from jimtcl.

jameswalmsley avatar jameswalmsley commented on May 25, 2024

I'm just getting into the world of tcl, so learning how the language works at the same time as diving into the internals.

Anyway thanks for your time and help.

James

from jimtcl.

msteveb avatar msteveb commented on May 25, 2024

No problem. Welcome to Tcl.

from jimtcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.