Comments (5)
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.
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.
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.
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.
No problem. Welcome to Tcl.
from jimtcl.
Related Issues (20)
- Appveyor build warnings HOT 2
- Bug in reference counting or garbage collection HOT 8
- regexp: end of word match is broken. HOT 1
- Buffer overflow when building jimtcl with jimtcl installed HOT 1
- Confusing error message from oo.tcl
- CRTSCTS: requires _GNU_SOURCE or _BSD_SOURCE HOT 3
- Bug in regexp library may lead to out-of-bounds read HOT 1
- vi key bindings in jimsh HOT 3
- file.test fail on 32 bit systems HOT 5
- Jimtcl 0.82 test failed on some architectures HOT 9
- strncasecmp and strcasecmp in jim-signal.c w/o strings.h include
- Some return values ignored HOT 1
- configure does not/wrongly detect missing zlib and openssl with diet libc HOT 1
- Commenting JIM_OPTIMIZATION Breaks Build
- Provide a way to pass arbitrary strings to executed commands (likely with TIP 424) HOT 3
- Constant comparison HOT 1
- Feature request: add umask (or os.umask) command HOT 2
- documentation syntax examples are different than actual results HOT 6
- timer-3.2 test failure when building with tcl on osx HOT 3
- $(...) vs [expr {...}] HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jimtcl.