From marko.mahnic at email.si Tue Oct 4 06:11:40 2005 From: marko.mahnic at email.si (Marko Mahnic) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] slirp 1.7.5 released In-Reply-To: <20050928172336.GA24417@svoboda.mit.edu> References: <20050928172336.GA24417@svoboda.mit.edu> Message-ID: <4342555C.6050907@email.si> Michael Noble wrote: > Hello Folks, > > Version 1.7.5 of SLIRP is now available at ... > 13. SLIRP now installs files to its own directory within $prefix/share, > instead of $prefix/share/slsh, in part to fix the autoloading bug It still does not work for me. I am working on cygwin. I installed with: $ ./configure $ make $ make install prefix = /usr/local exec_prefix = ${prefix} install_bin_dir = ${exec_prefix}/bin install_pkg_dir = ${prefix}/share/slirp $ slsh --version slsh version 0.7.3-0 S-Lang Library Version: 2.0.4 $ slsh -v Loading /usr/local/etc/slsh.rc Loading /usr/local/share/slsh/autoload.sl Loading /usr/local/share/slsh/slshrl.sl $ slirp -v Unable to locate autoload.sl on load path Traceback: evalfile /usr/local/etc/slsh.rc:43::Open failed If I run slirp from /usr/local/share/slirp, it works. If I remove /usr/local/etc/slsh.rc, I get $ slirp -v require is undefined /usr/local/share/slirp/slirp.sl:31::Undefined Name I guess the problem is in the directory search list: /usr/local/etc/slsh.rc is found, but /usr/local/share/slirp/slsh.rc isn't. How to fix this? Marko From marko.mahnic at email.si Tue Oct 4 07:04:45 2005 From: marko.mahnic at email.si (Marko Mahnic) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] slirp 1.7.5 released In-Reply-To: <4342555C.6050907@email.si> References: <20050928172336.GA24417@svoboda.mit.edu> <4342555C.6050907@email.si> Message-ID: <434261CD.7020700@email.si> Marko Mahnic wrote: > Michael Noble wrote: > >>Hello Folks, >> >>Version 1.7.5 of SLIRP is now available at > > ... > >>13. SLIRP now installs files to its own directory within $prefix/share, >> instead of $prefix/share/slsh, in part to fix the autoloading bug > > > It still does not work for me. I am working on cygwin. > I installed with: > Sory. This was an installation problem on my side. I had slirp 1.7.4 installed and after calling make uninstall (1.7.4) it did not uninstall properly: the file slirpsh.exe was left behind. The problem was in the hard-coded search path list. Default search path: /usr/local/share/slsh/local-packages:.:/cygdrive/f/build/slirp-1.7.4 After removing slirpsh.exe, all is well. Marko From mnoble at space.mit.edu Tue Oct 4 08:54:27 2005 From: mnoble at space.mit.edu (Michael Noble) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] slirp 1.7.5 released In-Reply-To: <434261CD.7020700@email.si> References: <20050928172336.GA24417@svoboda.mit.edu> <4342555C.6050907@email.si> <434261CD.7020700@email.si> Message-ID: <20051004125427.GA8724@svoboda.mit.edu> > This was an installation problem on my side. I had slirp > 1.7.4 installed and after calling make uninstall (1.7.4) it did > not uninstall properly: the file slirpsh.exe was left behind. Thanks, Marko. I'm away at a conference now, but have made a note of this and will ensure it does not persist. -Mike From joerg at alea.gnuu.de Fri Oct 7 07:50:56 2005 From: joerg at alea.gnuu.de (Joerg Sommer) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Bug in namespace allocation Message-ID: Hi John, #v+ $ cat /tmp/test.sl % autoload("foo", "/tmp/test1.sl"); autoload("_test->bar", "/tmp/test1.sl"); % foo(); _test->bar(); $ cat /tmp/test1.sl % try whether reevaluation works in SLANG 2 implements("_test"); message(current_namespace()); public define foo() { message("foo"); } define bar() { message("bar"); } $ slsh /tmp/test.sl Namespace _test already exists /tmp/test1.sl:2::Namespace Error #v- I've added a debug output to implements_ns() and saw that: ns->name = " *** internal ns <1> *** " name = "/tmp/test1.sl" in the error case. I think the allocation of the namespace by autoload() is the problem. Bye, J?rg. BTW: Do you have a Bug Tracking System? -- Die meisten Menschen wollen lieber durch Lob ruiniert als durch Kritik gerettet werden. From davis at space.mit.edu Fri Oct 7 11:48:17 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Bug in namespace allocation In-Reply-To: References: Message-ID: <200510071548.j97FmHFR020112@aluche.mit.edu> Joerg Sommer wrote: >$ cat /tmp/test.sl >% autoload("foo", "/tmp/test1.sl"); >autoload("_test->bar", "/tmp/test1.sl"); > >% foo(); >_test->bar(); >$ cat /tmp/test1.sl >% try whether reevaluation works in SLANG 2 >implements("_test"); >message(current_namespace()); > >public define foo() >{ > message("foo"); >} > >define bar() >{ > message("bar"); >} >$ slsh /tmp/test.sl >Namespace _test already exists >/tmp/test1.sl:2::Namespace Error >#v- > >I've added a debug output to implements_ns() and saw that: >ns->name = " *** internal ns <1> *** " >name = "/tmp/test1.sl" > >in the error case. I think the allocation of the namespace by autoload() >is the problem. I am not convinced that it is a problem. For example, try removing the implements line from test1.sl. You will find it works: $ slsh /tmp/test.sl _test bar As I see it, the real problem is the use of `implements`, which I regard as unnecessary for most purposes. For example, by omitting the implements line, test.sl can be changed to: autoload("foo->bar", "/tmp/test1.sl"); foo->bar(); to produce the output: foo bar The upshot is that I think that it is far better for the "loader" to specify the namespace because only the "loader" can know what namespaces already exist. >BTW: Do you have a Bug Tracking System? Yes and no. No, I do not use any sort of automated bug tracking software. Yes, because when a bug report comes in, I make a note of the problem and attempt to fix it. It is also worth pointing out systems like debian do track bugs on all of its "upstream" packages. For example, look at debian's bug tracking lists for slang1 and slang2: --John From joerg at alea.gnuu.de Fri Oct 7 18:56:39 2005 From: joerg at alea.gnuu.de (=?iso-8859-1?Q?J=F6rg?= Sommer) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Bug in namespace allocation In-Reply-To: <200510071548.j97FmHFR020112@aluche.mit.edu> References: <200510071548.j97FmHFR020112@aluche.mit.edu> Message-ID: <20051007225639.GA3213@alea.gnuu.de> Hello John, John E. Davis schrieb am Fri 07. Oct, 11:48 (-0400): > I am not convinced that it is a problem. For example, try removing > the implements line from test1.sl. You will find it works: > > $ slsh /tmp/test.sl > _test > bar But this leads to very strange errors: #v+ $ cat /tmp/test.sl autoload("foo", "/tmp/test1.sl"); autoload("_test->bar", "/tmp/test1.sl"); define bar() { message("bar not in test1.sl"); } bar(); foo(); bar(); _test->bar(); message(""); foreach (_get_namespaces()) { loop ( _apropos( (), "bar", 0xF) ) { "->"; exch(); () + () + (); message( () ); } } $ cat /tmp/test1.sl % try whether reevaluation works in SLANG 2 % implements("_test"); message(current_namespace()); public define foo() { message("foo"); } define bar() { message("bar"); } $ slsh /tmp/test.sl bar not in test1.sl foo bar _test bar _test->bar Global->bar #v- Global->bar from test.sl gets overwritten because no namespace is given to the autoload() for foo. So you can't refer to the public functions in a unit with autoload(), otherwise other functions in the Global namespace may become overwritten. Regards, J?rg. -- Perfection is reached, not when there is no longer anything that can be added, but when there is no longer anything to take away. (Antoine de Saint-Exupery) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 477 bytes Desc: not available Url : http://mailman.jtan.com/pipermail/slang-users-l/attachments/20051008/f9dbc0c9/attachment.bin From davis at space.mit.edu Sat Oct 8 16:44:21 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Bug in namespace allocation In-Reply-To: <20051007225639.GA3213@alea.gnuu.de> References: <200510071548.j97FmHFR020112@aluche.mit.edu> <20051007225639.GA3213@alea.gnuu.de> Message-ID: <200510082044.j98KiLVD011466@aluche.mit.edu> J?rg Sommer wrote: >But this leads to very strange errors: I would not call this behavior "strange" nor an "error". It works as it is documented to work. What you seem to be looking for is a way to autoload a public function from a file evaluated in a specified namespace. Currently there exists no simple mechanism to perform such a task. However, it is rather easy to create a function that achieves this result. Let's call it "autoload_public". Then in test.sl replace autoload("foo", "/tmp/test1.sl"); with autoload_public ("foo", "/tmp/test1.sl", "_test"); This statement says to autoload "foo" from "/tmp/test.sl" evaluated in the "_test" namespace. Here is an implementation of such a function: define autoload_public (fun, file, ns) { if (is_defined (fun)) return; eval ("public define $fun();"$ + "public define $fun(){"$ + "variable args=__pop_args(_NARGS);" + "()=evalfile(\"$file\",\"$ns\");"$ + "return $fun(__push_args(args));}"$); } --John From davis at space.mit.edu Mon Oct 17 13:17:20 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] slang 2.0.5 released Message-ID: <200510171717.j9HHHK1Z028923@aluche.mit.edu> Version 2.0.5 is available. Although it is primarily a bug-fix release, it contains some performance tweaks and some new intrinsic functions. See for download options. Here are the relevant MD5 sums: 377ccd8232bd3c240f51a4a41ae0a426 2.0.4__2.0.5.diff.bz2 8ae18681473f3c0c5771245b2e380df9 2.0.4__2.0.5.diff.gz 8b6afa085f76b1be29825f0c470b6cad slang-2.0.5.tar.bz2 a80801b10453ca317e8a9ae8e270163e slang-2.0.5.tar.gz Changes since 2.0.4 1. slsh/slsh.c: Error messages were not being printed if an error occured during an atexit hook. 2. src/slstrops.c: Use _pSLstring_bytelen instead of strlen to get the number of bytes. 3. src/slstring.c: Several tweaks were made for faster string handling. 4. src/slparse.c: A negative integer literal raised to a power was not being properly parsed. 5. doc/tm/cslang.tm: Documentation updated to reflect the changed SLang_pop_double API, as well as other C API documentation tweaks (Doug Burke). 6. doc/tm/rtl/type.tm: Documentation for "integer" changed to indicate that integer throws a SyntaxError exception if the string does not have a valid syntax. (Joshua Kempner jkempner at bowdoin, edu) 7. src/slmath.c: Added nint (round to the nearest integer) intrinsic. 8. src/slarray.c: NULL arguments to array_map were not getting converted to arrays of NULL. 9. src/slang.h: Added SLclass_set_length_function for setting the length method of application-defined classes. 10. src/slang.ver: A versioning script is used to restrict the visibility of the _pSL* symbols. (Alastair McKinstry mckinstry at computer, org) 11. slsh/slsh.c: Ignore SIGPIPE. 12. src/slutf8.c: If SLutf8_decode is passed an inproperly encoded UTF-8 sequence, then set the target of the SLwchar_Type pointer to the ascii value of the byte, in addition to returning NULL. 13. src/slposdir.c: Added "access" intrinsic. 14. src/slsmg.c: Fixed a buffer-overflow in the SLsmg_write_chars function. 15. src/slsig.c: A missing return statement was causing sigsuspend to fail when called with 0 arguments. 16. src/slarray.c: Added wherefirst and wherelast intrinsics. 17. src/slang.c: Inline attribute removed from some functions that were failing to be inlined by the compiler. 19. src/slstdio.c: SLang_get_fileptr added to permit an application to get the FILE* object associated with a SLANG_FILE_PTR_TYPE. 20. src/slang.c: It was failing to compile when SLANG_HAS_DEBUGGER_SUPPORT was set to 0. 21. src/sltime.c: strftime intrinsic added. From giva at bgnett.no Mon Oct 17 16:11:09 2005 From: giva at bgnett.no (Gisle Vanem) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] [Patch] slvideo.c Message-ID: <094701c5d356$e9e45270$0600000a@broadpark.no> A little patch for djgpp is needed in slvideo.c. I haven't checked the other DOS compilers. Is OpenWatcom on DOS still possible? --- orig/slvideo.c 2005-10-17 05:00:18.000000000 +0200 +++ ./slvideo.c 2005-10-17 21:22:08.000000000 +0200 @@ -818,18 +818,16 @@ static void write_attributes (SLsmg_Char_Type *src, unsigned int count) { - register unsigned short pair; unsigned int n; /* write into a character/attribute pair */ n = Cursor_Col; while (count) { - pair = SLSMG_CHAR_TO_USHORT(*src);/* character/color pair */ - src++; - SLtt_reverse_video (pair >> 8); /* color change */ - ScreenPutChar ((int)pair & 0xFF, Attribute_Byte, n, Cursor_Row); + SLtt_reverse_video (src->color); /* color change */ + ScreenPutChar (src->wchars[0] & 0xFF, Attribute_Byte, n, Cursor_Row); n++; + src++; count--; } } ---------------------- --gv From perez.l at free.fr Tue Oct 18 15:35:29 2005 From: perez.l at free.fr (Laurent Perez) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Import Error with PNG module Message-ID: <20051018193529.GB2495@lincoln.org> Hi, I got this error when importing png module : slsh> require ("png"); Error linking to /home/laurent//lib/slang/v2/modules/png-module.so: /usr/lib/libpng.so.3: undefined symbol: deflate /home/laurent/share/slsh/png.Sl:2::Import Error As far as I know, deflate is defined in the zlib library used by png. I don't know if it is a system error (Slackware 10.1) but changing the Makefile to force linking with zlib ( PNG_LIB = -lpng -lz ) made a working png module. ldd png-module.so libpng.so.3 => /usr/lib/libpng.so.3 (0x4001a000) libz.so.1 => /usr/lib/libz.so.1 (0x4004c000) libm.so.6 => /lib/libm.so.6 (0x4005d000) libc.so.6 => /lib/libc.so.6 (0x40080000) /lib/ld-linux.so.2 (0x80000000) Laurent. From davis at space.mit.edu Tue Oct 18 17:14:06 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Import Error with PNG module In-Reply-To: <20051018193529.GB2495@lincoln.org> References: <20051018193529.GB2495@lincoln.org> Message-ID: <200510182114.j9ILE6OQ022043@aluche.mit.edu> Laurent Perez wrote: >As far as I know, deflate is defined in the zlib library used by png. I >don't know if it is a system error (Slackware 10.1) but changing the >Makefile to force linking with zlib ( PNG_LIB = -lpng -lz ) made a >working png module. I will add -lz to the Makefile for the next release. FWIW, debian sarge does not have this problem because of the way zlib was built and installed: # ldd /usr/lib/libpng.so.2 libz.so.1 => /usr/lib/libz.so.1 (0x4002c000) libm.so.6 => /lib/tls/libm.so.6 (0x4003e000) libc.so.6 => /lib/tls/libc.so.6 (0x40061000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000) Thanks, --John From perez.l at free.fr Thu Oct 20 08:34:18 2005 From: perez.l at free.fr (Laurent Perez) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] slgtk with slang-2 Message-ID: <20051020123418.GA18316@lincoln.org> Hi, Did anybody succeed in compiling slgtk with slang-2 ? I tried using slirp 1.7.5 and slirp included with slgtk-0.5.14 but it failed with this error : Generating Gtk wrapper code: make[1]: *** [.gencode] Error 30 I don't ever know if slirp can be used with slang-2. Thanks for your help. Laurent. From mnoble at space.mit.edu Thu Oct 20 09:42:07 2005 From: mnoble at space.mit.edu (Michael Noble) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] slgtk with slang-2 In-Reply-To: <20051020123418.GA18316@lincoln.org> References: <20051020123418.GA18316@lincoln.org> Message-ID: <20051020134207.GA22968@svoboda.mit.edu> > Did anybody succeed in compiling slgtk with slang-2 ? I tried using slirp > 1.7.5 and slirp included with slgtk-0.5.14 but it failed with this error : Yes, I build it on a regular basis against SLang2. In fact, at ftp://space.mit.edu/pub/mnoble/slgtk/binaries/ you'll find that slgtk-0.5.14-i686-slang2.tar.gz is a set of binaries for such (built on Debian Woody, with GCC 2.95). > Generating Gtk wrapper code: make[1]: *** [.gencode] Error 30 Can you tell me what platform you're on? What compiler you're using? And what version of Gtk? Also, what does tail -20 ignoredfuncs.txt (in the src subdirectory) show? Thanks, Mike From robertlipe at usa.net Sun Oct 23 18:09:50 2005 From: robertlipe at usa.net (Robert Lipe) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Advice on "complex" data type integration Message-ID: <20051023220950.GA23481@rjloud.sco.com> Hello, I've been prototyping integration of S-Lang into GPSBabel. I'm impressed with the power of the presented language; it's an nice piece of work. Unfortunately, I'm getting all tripped up in integrating it and am looking for some advice beyond the "C Programmer's Guide". I have several internal data types. They aren't horribly complicated, but they're not trivial. Some are dynamically generated (a waypoint from Delorme software may have additional traits that are different from the additional traits of a waypoint from certain XML formats). Internally, there is extensive use of linked lists and structures hooked together with other linked lists. Since my "real" structures have a number of enumerated types, structures containing structures, and other things that make themn a clunky fit to MAKE_[IC]STRUCT_FIELD and friends, I'm kind of stumped on how to map these on the way across the Slang border. I'd considered making a "visible to slang" structure and exposing an interator to the language that did a copy from the "real" C struct to the the type I expose to make_[ci]struct_table, but that seems pretty klunky and performance would have to be a killer. variable i = 0; for (i = gb_waypt_start(); i; i = gb_waypt_next()) { messsage(string(wpt.shortname)); } So if I plumb the "gb_" brothers above to call SLadd_istruct_table on the struct and I copy every single member on the way in and out, it's workable but really kind of gross. The internal structure has things like enumerations that should probably be exposed to slang as strings. I have things like a time that's a time_t plus an int for hundredths of a second, so I'd need to be able to "shim" the timestamps on the way in and out. So given my data types at http://cvs.sourceforge.net/viewcvs.py/gpsbabel/gpsbabel/defs.h?view=markup for struct waypoint, I'd like to be able to write Slang fragments like: wpt.icon = "Foo"; to set wpt_flags.icon_descr_is_dynamic, call my free routine if it was set before, and then morph your SLang_create_slstring'ed object into one created by my xmalloc object. blah = string(wpt.gc_container); would have to read the gc_data structure in the waypoint structure, see that gc_container is a bitfield, then call an internal function to get the string representation of it. routewpt.format("an1", "line_color") = rgb I haven't come to grips with the syntax there, but this would have to walk through the extra data list until it found the 'an1' items attached to this routewpt, then find the 'line_color' member in THAT struct and generate a store to it. Additionally, I have my own internal memory management and requiring every string field be set and cleared via SLang_create_slstring and SLang_free_slstring is a problem. Is there a a way I can chain into those two in my allocator? I guess I could do the whole conversion at the very entry point and exit points of the interpreter, copying the entire list to Slang-compat types and then "undoing" it on the way back, but it just seems like I'm getting further off balance here. What's the most sensible way to map these things to Slang? I've looked through several of the examples and I'm not seeing anything at a glance that maps very well to my case that I can use for guidance. I'd love to be able to get the power of SLang, but I'm not going to replace my data structures and all accesses to them to get it. Given the elgance of the interfaces, I'm supposing there's a way to get there from here, so I'd appreciate any pointers that can be offered. Do you have a good example on file of mapping things beyond simple C structs into Slang? Thanx in advance, RJL From davis at space.mit.edu Sun Oct 23 18:40:14 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Advice on "complex" data type integration In-Reply-To: <20051023220950.GA23481@rjloud.sco.com> References: <20051023220950.GA23481@rjloud.sco.com> Message-ID: <200510232240.j9NMeEJg027391@aluche.mit.edu> Robert Lipe wrote: >So given my data types at > http://cvs.sourceforge.net/viewcvs.py/gpsbabel/gpsbabel/defs.h?view=markup >for struct waypoint, I'd like to be able to write Slang fragments like: [...] >from here, so I'd appreciate any pointers that can be offered. Do you >have a good example on file of mapping things beyond simple C structs >into Slang? Have you considered using slirp to wrap the functions and data structures in this file? It should produce something that is more or less a straightforward mapping of your interface, and handle all the memory management for you. Mike Noble is the slirp expert and can probably provide additional details. Thanks, --John From robertlipe at usa.net Sun Oct 23 21:27:29 2005 From: robertlipe at usa.net (Robert Lipe) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Advice on "complex" data type integration In-Reply-To: <200510232240.j9NMeEJg027391@aluche.mit.edu> References: <20051023220950.GA23481@rjloud.sco.com> <200510232240.j9NMeEJg027391@aluche.mit.edu> Message-ID: <20051024012729.GR3824@rjloud.sco.com> > > http://cvs.sourceforge.net/viewcvs.py/gpsbabel/gpsbabel/defs.h?view=markup > >for struct waypoint, I'd like to be able to write Slang fragments like: > [...] > > Have you considered using slirp > to wrap the functions and data structures in this file? It should Thanx for the tip. I'm still digesting it to see how that would improve things. I was hoping to not actually expose the bits and the bytes of the internal data structures out to the Slang side. I have comparitively little _code_ I want to expose, I'm mostly interested in data. Another approach (which doesn't thrill me) that came to me after struggling with this for a while was to just bring out acessors with arguments of strings. linkylink = gb_get_wpt(wpt, "url"); gb_set_wpt(wpt, "url", "http://" + linkylink); ...and have the C code look up the data thingy being accessed and Do The Right Thing. That's not real nice from either the linguistic or maintenance view on either the SLang side or the C side. I'll continue trying to get my head around slirp. Thanx. RJL From davis at space.mit.edu Sun Oct 23 22:16:43 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Advice on "complex" data type integration In-Reply-To: <20051024012729.GR3824@rjloud.sco.com> References: <20051023220950.GA23481@rjloud.sco.com> <200510232240.j9NMeEJg027391@aluche.mit.edu> <20051024012729.GR3824@rjloud.sco.com> Message-ID: <200510240216.j9O2Ghf5030703@aluche.mit.edu> Robert Lipe wrote: >Another approach (which doesn't thrill me) that came to me after >struggling with this for a while was to just bring out acessors with >arguments of strings. > > linkylink = gb_get_wpt(wpt, "url"); > gb_set_wpt(wpt, "url", "http://" + linkylink); It is fairly easy to construct an interface that permits the above to be written: wpt = gb_new_wpt (); wpt.url = "http://" + wpt.url; and have the wpt object to be automatically freed when it goes out of scope or reassigned. To do the above, you would use the sput and sget class methods. Is this something more akin to what you are looking for? Thanks, --John From robertlipe at usa.net Mon Oct 24 08:52:12 2005 From: robertlipe at usa.net (Robert Lipe) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Advice on "complex" data type integration In-Reply-To: <200510240216.j9O2Ghf5030703@aluche.mit.edu> References: <20051023220950.GA23481@rjloud.sco.com> <200510232240.j9NMeEJg027391@aluche.mit.edu> <20051024012729.GR3824@rjloud.sco.com> <200510240216.j9O2Ghf5030703@aluche.mit.edu> Message-ID: <20051024125212.GV3824@rjloud.sco.com> > wpt = gb_new_wpt (); > wpt.url = "http://" + wpt.url; > > and have the wpt object to be automatically freed when it goes out of > scope or reassigned. To do the above, you would use the sput and sget > class methods. Is this something more akin to what you are looking If I could "hook" the read and the writes of the structure members (and, presumably, the creation and destruction of wpt) I think I could work with that. I see references to cl_s(ge|pu)t and SLclass_set_s(ge|pu)t_function in slang.h but I don't see them in http://www.s-lang.org/doc/html/cref.html#toc5 . I recall being intrigued by the class functions in Chapter 5, but they punted to http://www.s-lang.org/doc/html/cslang.html#toc5 for more information, yet I couldn't find any and none of the S-Lang-using projects I checked used them. So I assumed these were internals that just leaked out. If you have doc or examples on these, and think this is a pond worth fishing in, I'd like to check them out. Thanx for the response, John. RJL From davis at space.mit.edu Mon Oct 24 13:05:22 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:09 2007 Subject: [slang-users] Advice on "complex" data type integration In-Reply-To: <20051024125212.GV3824@rjloud.sco.com> References: <20051023220950.GA23481@rjloud.sco.com> <200510232240.j9NMeEJg027391@aluche.mit.edu> <20051024012729.GR3824@rjloud.sco.com> <200510240216.j9O2Ghf5030703@aluche.mit.edu> <20051024125212.GV3824@rjloud.sco.com> Message-ID: <200510241705.j9OH5MQt009853@aluche.mit.edu> Robert Lipe wrote: >If you have doc or examples on these, and think this is a pond worth >fishing in, I'd like to check them out. JED makes use of the sget functions for its "Mark_Type" objects representing buffer positions. It also defines a number of binary operators for these objects allowing comparisons of buffer positions, e.g., if (m1 > m2) (m1, m2) = (m2, m1); % swap the marks The marks are represented as SLANG_CLASS_TYPE_MMT objects so that the memory associated with them is managed by the interpreter. This means that such objects will automatically be freed (by calling the appropriate destroy method) when nolonger used. The code may be found in paste.c in the jed distribution. Perhaps this coming weekend I will add a more complete example to the demo directory. But I think the code in paste.c should be enough to get you started. --John