From p.boekholt at gmail.com Sun Jan 31 14:37:56 2010 From: p.boekholt at gmail.com (Paul Boekholt) Date: Sun, 31 Jan 2010 15:37:56 +0100 Subject: [slang-users] cgi library Message-ID: Hi, I've written a CGI library for S-Lang. You can get version 0.1.0 from http://www.cheesit.com/downloads/slang/cgilib.html From marcel at telka.sk Thu Feb 11 19:45:35 2010 From: marcel at telka.sk (Marcel Telka) Date: Thu, 11 Feb 2010 20:45:35 +0100 Subject: [slang-users] [PATCH] You should not set the value of DESTDIR in your Makefile at all Message-ID: <20100211194535.GS2374@tortuga.telka.sk> Hi, Please find attached simple patch to remove DESTDIR setting from all Makefiles. According the http://www.gnu.org/prep/standards/html_node/DESTDIR.html page the DESTDIR variable should not be set in Makefiles at all. Thanks. -- +-------------------------------------------+ | Marcel Telka e-mail: marcel at telka.sk | | homepage: http://telka.sk/ | | jabber: marcel at jabber.sk | +-------------------------------------------+ -------------- next part -------------- diff -urN slang-2.2.2.orig/autoconf/Makefile.in slang-2.2.2/autoconf/Makefile.in --- slang-2.2.2.orig/autoconf/Makefile.in 2009-12-05 20:03:51.000000000 +0100 +++ slang-2.2.2/autoconf/Makefile.in 2010-02-11 20:26:14.298051227 +0100 @@ -13,7 +13,6 @@ #--------------------------------------------------------------------------- # DESTDIR is designed to facilitate making packages. Normally it is empty #--------------------------------------------------------------------------- -DESTDIR = DEST_PKGCONFIGDIR = $(DESTDIR)$(pkgconfigdir) # MKINSDIR = autoconf/mkinsdir.sh diff -urN slang-2.2.2.orig/mkfiles/makefile.m32 slang-2.2.2/mkfiles/makefile.m32 --- slang-2.2.2.orig/mkfiles/makefile.m32 2009-12-05 20:03:51.000000000 +0100 +++ slang-2.2.2/mkfiles/makefile.m32 2010-02-11 20:28:34.355694627 +0100 @@ -4,7 +4,6 @@ MFLAGS = COPY="cmd /c copy" RM=del # DESTDIR is used for building a package for use on another machine. -DESTDIR = PREFIX = /mingw/local CONFDIR = /mingw/local/etc # @@ -26,7 +25,7 @@ # # Note the use of X- below. Windows regards '=' as a commandline whitespace # and needs to be quoted. However I have not been able to figure out how to -# do that in th econtext of the mingw32-make command parser. As a major hack +# do that in the context of the mingw32-make command parser. As a major hack # I added the X- prefix and modified mkfiles/install.sl to remove the X-. install: all mkfiles/runslsh.bat -i mkfiles/install.sl --destdir="X-$(DESTDIR)" --prefix="$(PREFIX)" install diff -urN slang-2.2.2.orig/modules/Makefile.in slang-2.2.2/modules/Makefile.in --- slang-2.2.2.orig/modules/Makefile.in 2009-12-05 20:03:51.000000000 +0100 +++ slang-2.2.2/modules/Makefile.in 2010-02-11 20:29:13.850685238 +0100 @@ -67,7 +67,6 @@ #--------------------------------------------------------------------------- # DESTDIR is designed to facilitate making packages. Normally it is empty #--------------------------------------------------------------------------- -DESTDIR = DEST_MODULEDIR = $(DESTDIR)$(MODULE_INSTALL_DIR) DEST_SLSH_DIR = $(DESTDIR)$(SLSH_DIR) DEST_CMAPSDIR = $(DESTDIR)$(CMAPS_DIR) diff -urN slang-2.2.2.orig/slsh/Makefile.in slang-2.2.2/slsh/Makefile.in --- slang-2.2.2.orig/slsh/Makefile.in 2009-12-05 20:03:51.000000000 +0100 +++ slang-2.2.2/slsh/Makefile.in 2010-02-11 20:25:49.207004191 +0100 @@ -46,7 +46,6 @@ #--------------------------------------------------------------------------- # DESTDIR is designed to facilitate making packages. Normally it is empty #--------------------------------------------------------------------------- -DESTDIR = BIN_DIR = @bindir@ MAN_DIR = @mandir@/man1 DEST_LIB_DIR = -L$(DESTDIR)@libdir@ diff -urN slang-2.2.2.orig/src/Makefile.in slang-2.2.2/src/Makefile.in --- slang-2.2.2.orig/src/Makefile.in 2009-12-05 20:03:51.000000000 +0100 +++ slang-2.2.2/src/Makefile.in 2010-02-11 20:25:06.858830195 +0100 @@ -51,7 +51,6 @@ #--------------------------------------------------------------------------- # DESTDIR is designed to facilitate making packages. Normally it is empty #--------------------------------------------------------------------------- -DESTDIR = DEST_LIBDIR = $(DESTDIR)$(install_lib_dir) DEST_DOCDIR = $(DESTDIR)$(install_doc_dir) DEST_INCDIR = $(DESTDIR)$(install_include_dir) From valere_monseur at hotmail.com Thu Mar 4 21:29:32 2010 From: valere_monseur at hotmail.com (=?iso-8859-1?B?VmFs6HJlIE1vbnNldXI=?=) Date: Thu, 4 Mar 2010 22:29:32 +0100 Subject: [slang-users] underlined string with blank characters Message-ID: Hi, When writing a string using the underline attribute and a background color which is the same as the terminal one, the blank characters of the string are not underlined. But when it's another background color than the terminal one, then the blank characters are well underlined. So far, I have found no way to solve this problem i.e. to underline blank chars having the same background color as the terminal. Any idea on how this can be done (I think it might be somewhere in SLtt_smart_puts) ? Thanks Regards Valere Monseur --- This is a small test program that shows the problem: #include #include int main (int argc, char **argv) { SLutf8_enable(1); SLtt_get_terminfo(); SLkp_init(); SLang_init_tty(-1, 1, 0); SLsmg_init_smg(); SLsmg_cls(); SLtt_set_color(1, NULL, "lightgray", "black"); SLtt_add_color_attribute(1, SLTT_ULINE_MASK); SLsmg_set_color(1); SLsmg_write_string("underlined string 1 "); SLsmg_refresh(); SLtt_set_color(2, NULL, "lightgray", "blue"); SLtt_add_color_attribute(2, SLTT_ULINE_MASK); SLsmg_set_color(2); SLsmg_write_string("underlined string 2"); SLsmg_refresh(); getchar(); SLsmg_reset_smg(); SLang_reset_tty(); return 0; } _________________________________________________________________ Hotmail: Free, trusted and rich email service. https://signup.live.com/signup.aspx?id=60969 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20100304/2ac950f7/attachment.html From p.boekholt at gmail.com Mon Mar 22 07:34:10 2010 From: p.boekholt at gmail.com (Paul Boekholt) Date: Mon, 22 Mar 2010 08:34:10 +0100 Subject: [slang-users] slsqlite 0.5.0 Message-ID: Hi, Version 0.5.0 of the sqlite module is out. You can get it from http://www.cheesit.com/downloads/slang/slsqlite.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20100322/da72bdfe/attachment.html From joerg at alea.gnuu.de Tue Apr 6 19:18:55 2010 From: joerg at alea.gnuu.de (=?UTF-8?Q?J=C3=B6rg?= Sommer) Date: Tue, 6 Apr 2010 19:18:55 +0000 (UTC) Subject: [slang-users] Lookup of terminfo files Message-ID: Hi, due to a bug in ncurses in Debian, my attention was drawn to the lookup of terminfo files in S?Lang. Currently, the list in sltermin.c is static SLCONST char *Terminfo_Dirs [] = { "", /* $HOME/.terminfo */ "", /* $TERMINFO */ #ifdef MISC_TERMINFO_DIRS MISC_TERMINFO_DIRS, #endif "/usr/share/terminfo", "/usr/lib/terminfo", "/usr/share/lib/terminfo", "/etc/terminfo", "/lib/terminfo", "/usr/local/lib/terminfo", NULL, }; Wouldn't it be better to check /etc/terminfo and /usr/local/lib/terminfo before the other directories? This would give system administrators the possibility to override terminfo files from the distribution system. The library ncurses looks at the directory given in $TERMINFO before looking at $HOME/.terminfo; see ncurses(3). Maybe, S?Lang should also do it this order. Bye, J?rg. -- Real programmers don't comment their code. It was hard to write, it should be hard to understand. From blacktrash at gmx.net Sat May 15 12:53:30 2010 From: blacktrash at gmx.net (Christian Ebert) Date: Sat, 15 May 2010 14:53:30 +0200 Subject: [slang-users] svn repository broken? Message-ID: <20100515125330.GC656@krille.blacktrash.org> Hi, Recently I get the following when I try to access the s-lang svn repository: svn: PROPFIND request failed on '/jedsoft/slang/trunk' svn: PROPFIND of '/jedsoft/slang/trunk': 405 Method Not Allowed (http://opensvn.csie.org) Is it just me, or ... ? c -- theatre - books - texts - movies Black Trash Productions at home: http://www.blacktrash.org/ Black Trash Productions on Facebook: http://www.facebook.com/blacktrashproductions From davis at space.mit.edu Sun May 16 03:32:14 2010 From: davis at space.mit.edu (John E. Davis) Date: Sat, 15 May 2010 23:32:14 -0400 Subject: [slang-users] svn repository broken? In-Reply-To: <20100515125330.GC656@krille.blacktrash.org> References: <20100515125330.GC656@krille.blacktrash.org> Message-ID: <201005160332.o4G3WEXw020970@aluche.mit.edu> Christian Ebert wrote: > Recently I get the following when I try to access the s-lang svn > repository: I switched to using git about a year or more ago. For a while, I was maintaining the svn repository but stopped after the 2.2.2 release. It was a good decision because it appears that the svn host (opensvn.csie.org) is no longer hosting svn repositories. You can find links to my git repositories at . Thanks, --John From Manfred.Hanke at sternwarte.uni-erlangen.de Sun May 16 08:57:27 2010 From: Manfred.Hanke at sternwarte.uni-erlangen.de (Manfred Hanke) Date: Sun, 16 May 2010 10:57:27 +0200 Subject: [slang-users] svn repository broken? In-Reply-To: <201005160332.o4G3WEXw020970@aluche.mit.edu> References: <20100515125330.GC656@krille.blacktrash.org> <201005160332.o4G3WEXw020970@aluche.mit.edu> Message-ID: <4BEFB377.7090404@sternwarte.uni-erlangen.de> Hi, John E. Davis wrote: > I switched to using git about a year or more ago. For a while, I was > maintaining the svn repository but stopped after the 2.2.2 release. It > was a good decision because it appears that the svn host > (opensvn.csie.org) is no longer hosting svn repositories. > > You can find links to my git repositories at > . I saw that http://www.s-lang.org/download.html still shows the old subversion link, while http://www.jedsoft.org/slang/download.html doesn't. I thought that http://www.s-lang.org/ is physically the same as http://www.jedsoft.org/slang/. Cheers, Manfred From blacktrash at gmx.net Sun May 16 10:29:30 2010 From: blacktrash at gmx.net (Christian Ebert) Date: Sun, 16 May 2010 12:29:30 +0200 Subject: [slang-users] svn repository broken? In-Reply-To: <201005160332.o4G3WEXw020970@aluche.mit.edu> References: <20100515125330.GC656@krille.blacktrash.org> <201005160332.o4G3WEXw020970@aluche.mit.edu> Message-ID: <20100516102930.GC656@krille.blacktrash.org> * John E. Davis on Saturday, May 15, 2010 at 23:32:14 -0400 > Christian Ebert wrote: >> Recently I get the following when I try to access the s-lang svn >> repository: > > I switched to using git about a year or more ago. For a while, I was > maintaining the svn repository but stopped after the 2.2.2 release. It > was a good decision because it appears that the svn host > (opensvn.csie.org) is no longer hosting svn repositories. > > You can find links to my git repositories at > . Ah, thanks. I infered the switch from one of your messages to nsr iirc, but could not find this link. While we are at it: The List-Post header says: mailto:slang-users-l at jedsoft.org, which is also what mailman gave me when subscribing. Apparently slang-users at jedsoft.org is also valid. Has this changed? Which one is preferred? c -- theatre - books - texts - movies Black Trash Productions at home: http://www.blacktrash.org/ Black Trash Productions on Facebook: http://www.facebook.com/blacktrashproductions From jeanmichel.gens at free.fr Thu Jun 17 15:03:53 2010 From: jeanmichel.gens at free.fr (jean-michel.voicechat_fan) Date: Thu, 17 Jun 2010 17:03:53 +0200 Subject: [slang-users] hello to the whole list Message-ID: <4C1A3959.5010407@free.fr> i am a new comer in the list but i use jed from very long time i have modified my .jedrc some years ago and not so much afterward. sorry for my english. I am working now on speech adaptation for jed for that reason i am interested by slang but it is a bit hard . otherwise i use mainly shell ,PHP, AS, JS and C contact me for any subject i use a lot voice or VOIP programs mainly TS3 ( teamspeak ) my server is jmg78.hd.free.fr a popup will prevent me of a connection so if i am in front of my linux PC i will answer bye From jeanmichel.gens at free.fr Wed Jun 23 06:26:45 2010 From: jeanmichel.gens at free.fr (jean-michel.voicechat_fan) Date: Wed, 23 Jun 2010 08:26:45 +0200 Subject: [slang-users] socket example Message-ID: <4C21A925.60600@free.fr> hello i have done a small TCP client in C http://jeanmichel.gens.free.fr/src/say.c i wonder how to translate in slang language i have found some functions in documentation socket , connect but not read and write somebody has worked with that thanks From davis at space.mit.edu Wed Jun 23 07:38:10 2010 From: davis at space.mit.edu (John E. Davis) Date: Wed, 23 Jun 2010 03:38:10 -0400 Subject: [slang-users] socket example In-Reply-To: <4C21A925.60600@free.fr> References: <4C21A925.60600@free.fr> Message-ID: <201006230738.o5N7cAdu006567@aluche.mit.edu> Hi Jean-Michel, > hello i have done a small TCP client in C > http://jeanmichel.gens.free.fr/src/say.c > i wonder how to translate in slang language > i have found some functions in documentation > socket , connect > but not read and write The `read', and `write' functions are documented at . You can also use `fdopen' to get a stdio file descriptor and use the stdio functions. The stdio functions hide much of the detail that you would have to worry about with the read/write functions. Here is an example of the latter approach based upon your c code. Note that I changed the port to 25 (smtp) for testing purposes. I hope that this helps. Thanks, --John require ("socket"); private variable PORT=25; define slsh_main () { variable msg = __argv[1] + "\n", msglen = strbytelen (msg); variable s = socket (AF_INET, SOCK_STREAM, 0); connect (s, "127.0.0.1", PORT); variable fp = fdopen (s, "r+"); if ((msglen != fwrite (msg, fp)) || (-1 == fflush (fp))) throw WriteError, "write failed: " + errno_string(); % Read 56 bytes if (56 != fread_bytes (&msg, 56, fp)) throw ReadError, "read failed: " + errno_string (); vmessage ("Read: %s", msg); () = close (s); } From jeanmichel.gens at free.fr Sat Jun 26 09:52:11 2010 From: jeanmichel.gens at free.fr (jean-michel.voicechat_fan) Date: Sat, 26 Jun 2010 11:52:11 +0200 Subject: [slang-users] socket example In-Reply-To: <4C21A925.60600@free.fr> References: <4C21A925.60600@free.fr> Message-ID: <4C25CDCB.5090702@free.fr> ok socket TCP works finally just added a \n on the string str french vocal synthesis is on going ( and some translation too ) http://jeanmichel.gens.free.fr/.jedrc jean-michel.voicechat_fan a ?crit : > hello i have done a small TCP client in C > http://jeanmichel.gens.free.fr/src/say.c > i wonder how to translate in slang language > i have found some functions in documentation > socket , connect > but not read and write > > somebody has worked with that > thanks > > _______________________________________________ > slang-users-l mailing list > slang-users-l at jedsoft.org > http://mailman.jedsoft.org/mailman/listinfo/slang-users-l > > > From mnoble at space.mit.edu Fri Jul 9 12:50:18 2010 From: mnoble at space.mit.edu (Michael Noble) Date: Fri, 9 Jul 2010 08:50:18 -0400 Subject: [slang-users] GIF module for S-Lang Message-ID: <20100709125018.GA23765@space> I'm pleased to announce that a GIF module for S-Lang is now available: space.mit.edu/cxc/slgif SLgif provides a high-level interface to the GIF format, supporting the easy creation of S-Lang arrays from GIF files and vice versa. One of the most useful features of the module is that it provides a lightweight mechanism for reading and writing movie-like animations, in vectorized fashion: multiple image frames may be written to, or read from, a GIF file in a single call. This feature is now used in the "imdisplay" visualization tool bundled with SLgtk (and to be released shortly). Low-level I/O is handled internally through bindings to GIFSICLE, much of which may be called directly from SLgif, although most users should need only two functions in the interface: gif_read() and gif_write(). Regards, Michael S. Noble From mnoble at space.mit.edu Wed Jul 21 19:18:56 2010 From: mnoble at space.mit.edu (Michael Noble) Date: Wed, 21 Jul 2010 15:18:56 -0400 Subject: [slang-users] SLgtk v0.7.6 released Message-ID: <20100721191856.GA14714@space> After months of simmering SLgtk v0.7.6 has been released to http://space.mit.edu/cxc/slgtk The main highlights in this version are: imdisplay 0.5.0 Can animate a 2D sequence of images into a movie via the new "anim" option, with Play/Pause/Prev/Next buttons 3D volumes may also be animated as a series of 2D slices Pressing any mousebutton while the mouse is positioned over an image will show the coordinates for that pixel and its color value in RGB or RGBA format Options may also be given as qualifiers, not just quoted strings, when calling imdisplay() as a S-Lang function. VWhere 1.3.11 Better support for visualizing namespace-qualified variables, as well as references to struct field names & local variables Gif Module Bundled, to provide default support for animations. For more information on imdisplay do "man imdisplay" or "imdisplay --help" or "imdisplay help" at your Linux prompt (after installation). The full list of changes in this release is given on the website. Regards, Mike From mnoble at space.mit.edu Sat Jul 31 16:05:00 2010 From: mnoble at space.mit.edu (Michael Noble) Date: Sat, 31 Jul 2010 12:05:00 -0400 Subject: [slang-users] S-Lang xpa module 0.5.2 released Message-ID: <20100731160500.GA13655@space> Version 0.5.2 of the S-Lang XPA module has been posted to the website space.mit.edu/cxc/slxpa/ reflecting the changes described below. Thanks go to Drs. Mike Nowak and John Houck (both of MIT) for testing and code contributions. Regards, Mike ---------------------------- Version v0.5.2 1. Upgrade config.guess and config.sub scripts. 2. Better use of $(CC), $(CFLAGS) and $(LDFLAGS) in configure & Makefile Version v0.5.1 1. When single string is passed to put_regions(), and it does not refer to a file, transparently convert to 1-element string array. 2. Include XPA server code contributed by John Houck. From mbj at spamcop.net Fri Oct 8 13:50:08 2010 From: mbj at spamcop.net (Morten Bo Johansen) Date: Fri, 8 Oct 2010 15:50:08 +0200 Subject: [slang-users] Preserving order in an associative array Message-ID: <20101008135008.GA10402@gatsby.mbjnet.dk> Hi, It seemed to me that it could be useful to split a file into a number of strings and then split these strings into an associative array, do something on one of these strings based on its linkage to the other and then finally assemble it all back into the file. But if, just to illustrate, I do; variable S = Assoc_Type[String_Type]; variable k, v, s, file; variable a = String_Type[0]; S["a"] = "b"; S["b"] = "c"; S["d"] = "e"; foreach k, v (S) using ("keys", "values") { s = strcat (k, v); a = [a, s]; } file = strjoin (a, "\n"); and I output this, I get; ab de bc i.e. the order in which I entered the pairs is not preserved. Please note, that I do not want any kind of sorting, I just want to preserve the original order in which the keys and values were entered into the array. Thanks, Morten From Manfred.Hanke at sternwarte.uni-erlangen.de Fri Oct 8 16:12:19 2010 From: Manfred.Hanke at sternwarte.uni-erlangen.de (Manfred Hanke) Date: Fri, 08 Oct 2010 18:12:19 +0200 Subject: [slang-users] Preserving order in an associative array In-Reply-To: <20101008135008.GA10402@gatsby.mbjnet.dk> References: <20101008135008.GA10402@gatsby.mbjnet.dk> Message-ID: <4CAF42E3.3050506@sternwarte.uni-erlangen.de> Hi Morten, I don't think you can use associative arrays for your purpose. I believe that the order of the keys in a hash is undefined in other programming languages as well. Consider, e.g., Perl: my %S; $S{"b"} = "c"; $S{"d"} = "e"; $S{"a"} = "b"; my @a; foreach my $k (keys %S) { push(@a, $k . $S{$k}); } print( join("\n", @a) ); (note that I had to change the input to non-alphabetical order) gives me ab bc de But as a solution for S-Lang, I'd suggest to use data types which have a defined ordering, i.e., arrays, or even better: lists. variable S = {}; list_append(S, struct { key="a", value="b" }); list_append(S, struct { key="b", value="d" }); list_append(S, struct { key="d", value="e" }); variable k_v, a = {}; foreach k_v (S) list_append(a, strcat(k_v.key, k_v.value)); variable file = strjoin(list_to_array(a), "\n"); Note that the `a = [a, s];' statement you had in your loop works, but becomes very slow as `a' becomes larger. I'd chose a list as in the above example, if I don't know how long `a' is going to become (and convert it only at the end back to an array). In this example, we know what `length(a)' will be before we construct it, so we can just create the array from the beginning. In addition, one can avoid the overhead of many structures with the same fields when using separate lists for "keys" and "values": variable key={}, value={}; list_append(key, "a"); list_append(value, "b"); list_append(key, "b"); list_append(value, "d"); list_append(key, "d"); list_append(value, "e"); variable i, n = length(key); variable a = String_Type[n]; _for i (0, n-1, 1) a[i] = strcat(key[i], value[i]); variable file = strjoin(a, "\n"); Cheers and happy S-Lang scripting, :-) Manfred -- Manfred Hanke Manfred.Hanke(at)sternwarte.uni-erlangen.de Dr. Karl Remeis-Observatory, University of Erlangen-Nuremberg Sternwartstrasse 7, 96049 Bamberg, Germany phone: ++49 951 95222-34 fax: ++49 951 95222-22 web: http://pulsar.sternwarte.uni-erlangen.de/hanke -- Morten Bo Johansen wrote: > Hi, > > It seemed to me that it could be useful to split a file into a number of > strings and then split these strings into an associative array, do something > on one of these strings based on its linkage to the other and then finally > assemble it all back into the file. But if, just to illustrate, I do; > > variable S = Assoc_Type[String_Type]; > variable k, v, s, file; > variable a = String_Type[0]; > > S["a"] = "b"; > S["b"] = "c"; > S["d"] = "e"; > > foreach k, v (S) using ("keys", "values") > { > s = strcat (k, v); > a = [a, s]; > } > > file = strjoin (a, "\n"); > > and I output this, I get; > > ab > de > bc > > i.e. the order in which I entered the pairs is not preserved. Please > note, that I do not want any kind of sorting, I just want to preserve the > original order in which the keys and values were entered into the array. > > > Thanks, > > Morten From mbj at spamcop.net Fri Oct 8 16:59:09 2010 From: mbj at spamcop.net (Morten Bo Johansen) Date: Fri, 8 Oct 2010 18:59:09 +0200 Subject: [slang-users] Preserving order in an associative array In-Reply-To: <4CAF42E3.3050506@sternwarte.uni-erlangen.de> References: <20101008135008.GA10402@gatsby.mbjnet.dk> <4CAF42E3.3050506@sternwarte.uni-erlangen.de> Message-ID: <20101008165909.GA16364@gatsby.mbjnet.dk> Manfred Hanke wrote: > Hi Morten, > I don't think you can use associative arrays for your purpose. > I believe that the order of the keys in a hash is undefined in other > programming languages as well. Consider, e.g., Perl: A great many thanks Manfred, there is something for me to go on. Too bad not more people ask questions here. Morten From Manfred.Hanke at sternwarte.uni-erlangen.de Fri Oct 8 18:14:57 2010 From: Manfred.Hanke at sternwarte.uni-erlangen.de (Manfred Hanke) Date: Fri, 08 Oct 2010 20:14:57 +0200 Subject: [slang-users] Preserving order in an associative array In-Reply-To: <20101008165909.GA16364@gatsby.mbjnet.dk> References: <20101008135008.GA10402@gatsby.mbjnet.dk> <4CAF42E3.3050506@sternwarte.uni-erlangen.de> <20101008165909.GA16364@gatsby.mbjnet.dk> Message-ID: <4CAF5FA1.5010801@sternwarte.uni-erlangen.de> Morten Bo Johansen wrote: > A great many thanks Manfred, there is something for me to go on. Don't mention it; you're welcome! I forgot to say that list_to_array was only introduced in S-Lang pre2.2.0-62, but as this was already back in April 2009, most S-Lang users should already have v2.2... > Too bad not more people ask questions here. Well, everybody who has one is invited to post it. Otherwise, there won't be answers either... ;-) Cheers, Manfred -- Manfred Hanke Manfred.Hanke(at)sternwarte.uni-erlangen.de Dr. Karl Remeis-Observatory, University of Erlangen-Nuremberg Sternwartstrasse 7, 96049 Bamberg, Germany phone: ++49 951 95222-34 fax: ++49 951 95222-22 web: http://pulsar.sternwarte.uni-erlangen.de/hanke -- From davis at space.mit.edu Mon Dec 13 07:58:02 2010 From: davis at space.mit.edu (John E. Davis) Date: Mon, 13 Dec 2010 02:58:02 -0500 Subject: [slang-users] slang 2.2.3 released Message-ID: <201012130758.oBD7w26w002131@aluche.mit.edu> Version 2.2.3 of the slang library has been released. In addition to bug-fixes to the previous version, it adds several new features while maintaining backward binary compatibility with previous version 2 releases. A copy of the NEWS file is appended below. See for downloading options. It may take a day or so for the mirror sites to pick up the latest version. Enjoy. --John NEWS for version 2.2.x --- Search for (v2.2.3) for items specific to this release. Interpreter Enhancements ======================== 1. The ternary expression was added: expression = condition ? val1 : val2 If condition is non-zero, then expression = val1, otherwise expression = val2 2. The break and condition statements support an optional integer that indicates how many loop levels the statement affects, e.g., the break statement in while (1) { loop (10) { break 2; } } will cause both loops to be terminated. 3. Multiline strings have been added: "This is a \ multiline \ string" `This is another multiline string that does not require a \ for continuation` 4. List_Type objects may be indexed using an array of indices instead of just a single scalar index. 5. (v2.2.3) Binary literal integers of the form 0bxx...x are supported. Here, x is 0 or 1. The printf "%B" format specifier was added to format integers as binary. 6. (v2.2.3) The dereference operator (@) may be used in a structure definition to include the fields from the dereferenced structure, e.g., space = struct {x, y, z}; spacetime = struct {@space, t}; 7. (v2.2.3) Dereferencing a scalar or vector class type now results in duplication of the object, e.g, @7 will produce 7. 8. (v2.2.3) Mergesort was made the default sorting algorithm. See the array_sort for details. Modules ======= 1. zlib: A module that wraps the popular z compression library. 2. fork: A module that wraps the fork, exec*, and waitpid functions. slsh/lib/process.sl utilizes this module to allow an application to easily create subprocesses and pipelines. 3. sysconf: Module that implements interfaces to the posix sysconf, pathconf, etc. functions. 4. (2.2.3) csv: A module that supports the reading and writing of so-called Comma Separated Values files. Intrinsic Functions =================== The following intrinsic functions have been added for 2.2.x: sumsq equivalent to sum(x*x) expm1 More accurate version of exp(x)-1 for x near 0. log1p More accurate version of log(1+x) for x near 0 list_to_array Creates an array from a list. string_matches A convenient alternative to string_match and string_match_nth functions. strskipbytes (v2.2.3) Skip a range of bytes in a byte string. is_substrbytes (v2.2.3) Like is_substr except this works with binary strings containing embedded null characters. strskipchar, strbskipchar (v2.2.3) Analogous to C ch=*p++ and ch=*p-- for UTF-8 encoded strings. _close Close an integer descriptor _fileno Returns the descriptor as an integer dup2, getsid, killpg, getpriority/setpriority Wraps the corresponding system functions. utime (v2.2.3) Change a file's last access and modification time. ldexp, frexp: If x == a*2^b, where 0.5<=a<1.0 then (a,b)=frexp(x), and x=ldexp(a,b). islower, isupper, isxdigit, isalnum, isalpha, iscntrl, isprint, isgraph, ispunct, isblank, isascii, isspace (v2.2.3): Character classification functions. list_append, list_join (v2.2.3) Functions for merging two lists together. ttyname (v2.2.3) Get the name of the terminal timegm (v2.2.3) Inverse of gmtime The following functions have been enhanced: hypot If given a single array argument, it returns the equivalent of sqrt(sum(X*X)). Support for N arrays added for e.g., the Euclidean norm in an N dimensional space (v2.2.3) _min, _max: (v2.2.3) Added support for more than two elements. polynom The calling interface to this function was changed and support added for arrays. strjoin (v2.2.3) delimiter made optional strreplace (v2.2.3) New usage designed to facilitate the most common case where one wants to replace all the substrings. strtrans (v2.2.3) Additional character classes added (see documentation). string_match, string_matches (v2.2.3) The position argument made optional The following string functions have been vectorized to act upon arrays of strings (v2.2.3): is_substr str_delete_chars strbytelen strcharlen strcmp strcompress strlen strlow strnbytecmp strncharcmp strncmp strtrans strtrim strtrim_beg strtrim_end strup slsh ==== slang readline enhancements: New functions: rline_up/down_hist Behaves similar to zsh up/down-line-or-search functions (v2.2.3). rline_call_editor rline_edit_history rline_edit_line Call external editor for line/history editing. (v2.2.3) Structure field completion. (v2.2.3) Instead of scrolling horizontally when editing a line, attempt to wrap the line. (v2.2.3) setfuns.sl: Various set functions: unique, intersection, complement,union (v2.2.3) Misc ==== Unicode tables updated to version 5.1. From joerg at alea.gnuu.de Sun Dec 19 12:48:29 2010 From: joerg at alea.gnuu.de (=?UTF-8?Q?J=C3=B6rg?= Sommer) Date: Sun, 19 Dec 2010 12:48:29 +0000 (UTC) Subject: [slang-users] slang 2.2.3 released References: <201012130758.oBD7w26w002131@aluche.mit.edu> Message-ID: "John E. Davis" wrote: > Interpreter Enhancements > ======================== > > 1. The ternary expression was added: > > expression = condition ? val1 : val2 > > If condition is non-zero, then expression = val1, > otherwise expression = val2 Does it support the Syntax: expression = condition ? : val2 which should be the same as tmp = condition if (condition != 0) expression = condition; else expression = val2; This is handy for non?simple expression as condition. return sql_query("select * from table") ? : sql_query("select * from table2"); > 2. The break and condition statements support an optional integer > that indicates how many loop levels the statement affects, e.g., > the break statement in > > while (1) > { > loop (10) > { > break 2; > } > } > > will cause both loops to be terminated. This is very useful! Thanks. Bye, J?rg. -- And 1.1.81 is officially BugFree(tm), so if you receive any bug-reports on it, you know they are just evil lies. (Linus Torvalds)