From joerg at alea.gnuu.de Sun Jan 11 23:37:16 2009 From: joerg at alea.gnuu.de (=?utf-8?q?J=C3=B6rg=20Sommer?=) Date: Sun Jan 11 23:49:39 2009 Subject: [slang-users] [PATCH] Documentation of _featurep, provides and require Message-ID: <1231717036-21562-1-git-send-email-joerg@alea.gnuu.de> This documentation was taken from the functions used in Jed until 0.99.19pre82. The documentation of require was adopted for the new parameter namespace that wasn't present in Jed's version. --- slsh/lib/require.sl | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/slsh/lib/require.sl b/slsh/lib/require.sl index 02fff51..03abab3 100644 --- a/slsh/lib/require.sl +++ b/slsh/lib/require.sl @@ -15,6 +15,16 @@ private define pop_feature_namespace (nargs) return strcat (ns, ".", f); } +%!%+ +%\function{_featurep} +%\synopsis{Test whether or not a feature is present} +%\usage{Int_Type _featurep (String_Type feature)} +%\description +% The \sfun{_featurep} function returns a non-zero value if the specified +% feature is present. Otherwise, it returns 0 to indicate that the feature +% has not been loaded. +%\seealso{require, provide} +%!%- define _featurep () { variable f; @@ -22,12 +32,56 @@ define _featurep () return Features[f]; } +%!%+ +%\function{provide} +%\synopsis{Declare that a specified feature is available} +%\usage{provide (String_Type feature)} +%\description +% The \sfun{provide} function may be used to declare that a "feature" has +% been loaded. See the documentation for \sfun{require} for more information. +%\seealso{require, _featurep} +%!%- define provide () { variable f = pop_feature_namespace (_NARGS); Features[f] = 1; } +%!%+ +%\function{require} +%\synopsis{Make sure a feature is present, and load it if not} +%\usage{require (String_Type feature [,String_Type namespace [,String_Type file]]) +%\description +% The \sfun{require} function ensures that a specified "feature" is present. +% If the feature is not present, the \sfun{require} function will attempt to +% load the feature from a file. If the \exmp{namespace} argument is present +% and non-NULL, the specified namespace will be used. The default is to use +% the current non-anonymous namespace. If called with three arguments, the +% feature will be loaded from the file specified by the third argument +% if it does not already exist in the namespace. Otherwise, the feature +% will be loaded from a file given by the name of the feature, with +% ".sl" appended. +% +% If after loading the file, if the feature is not present, +% a warning message will be issued. +%\examples +%#v+ +% require ("histogram"); +% require ("histogram", "foo"); +% require ("histogram", "foo", "/home/bob/hist.sl"); +% require ("histogram", , "/home/bob/hist.sl"); +%#v- +%\notes +% "feature" is an abstract quantity that is undefined here. +% +% A popular use of the \sfun{require} function is to ensure that a specified +% file has already been loaded. In this case, the feature is the +% filename itself. The advantage of using this mechanism over using +% \ifun{evalfile} is that if the file has already been loaded, \sfun{require} +% will not re-load it. For this to work, the file must indicate that it +% provides the feature via the \sfun{provide} function. +%\seealso{provide, _featurep, evalfile} +%!%- define require () { variable feat, file; -- 1.6.0.6 From mnoble at space.mit.edu Wed Jan 28 16:59:40 2009 From: mnoble at space.mit.edu (Michael Noble) Date: Wed Jan 28 17:00:23 2009 Subject: [slang-users] slgtk 0.7.4 released Message-ID: <20090128165940.GA6213@svoboda.mit.edu> Version 0.7.4 of the Gtk module for S-Lang is now available at http://space.mit.edu/cxc/slgtk This release adds EXCLUDE filtering and a terminal-like interactive prompt to the VWhere data mining tool, more accurate file saving in imdisplay, compatibility with Gtk 2.14.7, and portability enhancements for the FreeBSD package. Pre-compiled binaries are available for Mac OX (compatible with PPC 10.4 & 10.5, and Intel 10.4 & 10.5) and 32-bit x86 Linux. Regards, Mike Noble -------------------------------- Version 0.7.4: . Renamed PACKAGES macro in Makefiles, to avoid conflicts with FreeBSD build env (reported/fixd by Alexey Shuvaev) . Established compatibility w/ Gtk 2.14.7, which introduced several functions with same names as wrappers SLgtk has provided for years i.e. gtk_widget_get_window(), gtk_adjustment_get_upper() etc; SLgtk now provides these only for Gtk < 2.14 (reported by Alexey Shuvaev) . Imdisplay 0.3.6: - Ensure that saved files reflect size/orientation/etc of final rendered image, not that of source image(s). . Added OO-like connect()/disconnect()/block()/unblock() methods to GtkPlotDescriptor, for more elegant signal management . VWhere 1.3.10: - Upgrade SLang prompt field from a simple text entry widget to the full gprompt terminal widget (described below). - Region filters now support exclusion: pressing the 'e' key while creating a region (or after selecting one) marks it with a slash so as to exclude the points it contains From mnoble at space.mit.edu Mon Feb 2 18:46:02 2009 From: mnoble at space.mit.edu (Michael Noble) Date: Mon Feb 2 18:46:11 2009 Subject: [slang-users] hdf5 module v0.3.9 released Message-ID: <20090202184602.GA26365@svoboda.mit.edu> Version 0.3.9 of SLh5, the S-Lang HDF5 module, has been released to space.mit.edu/cxc/slh5 SLh5 is a set of S-Lang bindings to the HDF5 file format and I/O library. It provides an importable module and associated .sl scripts which make HDF5 callable directly from the S-Lang interpreter. HDF5 is widely used in data- and CPU-intensive science and engineering projects -- such as the FLASH simulator of thermonuclear explosions in stars -- because it combines data and compiler portability with very high performance, scalability to terabyte-size datasets, and support for parallel I/O. SLh5 boils the complexity of the HDF5 interface -- which consists of hundreds of functions -- down to a few simple methods, making it very easy to create multidimensional S-Lang arrays from HDF5 files or vice versa. With one exception, the top-level SLh5 interface has also been vectorized: this allows multiple HDF5 files to be opened or created, or multiple datasets or attributes to be read, in a single call. Regards, Michael S. Noble From jon at indelible.org Fri Mar 6 07:08:42 2009 From: jon at indelible.org (Jon Parise) Date: Fri Mar 6 07:09:21 2009 Subject: [slang-users] [PATCH] Small slstd.c SLang_Doc_Dir warning fix Message-ID: <1aff89d70903052308j2cc2f2eehbb5b16ea4dd55bda@mail.gmail.com> Attached is a small patch to correct a compilation warning when SLANG_DOC_DIR is now defined. When that was the case, SLang_Doc_Dir was being implicitly typed as an int* instead of as a char*. -- Jon Parise (jon of indelible.org) :: "Scientia potentia est" -------------- next part -------------- A non-text attachment was scrubbed... Name: slstd.c.patch Type: application/octet-stream Size: 358 bytes Desc: not available Url : http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20090305/518a634e/slstd.c.obj From jon at indelible.org Fri Mar 6 07:17:09 2009 From: jon at indelible.org (Jon Parise) Date: Fri Mar 6 07:17:19 2009 Subject: [slang-users] [PATCH] Visual C build improvements Message-ID: <1aff89d70903052317h79cecd6bmca46750341cea385@mail.gmail.com> I have two simple patches that improve the build under recent versions of Visual Studio. The first limits the vsnprintf/_vsnprintf hack to versions of Visual Studio prior to the 2005 release. It's possible this could be moved back even further, but I don't have copies of those older versions handy with which to test. Index: slconfig.h =================================================================== --- src/slconfig.h (revision 297) +++ src/slconfig.h (working copy) @@ -243,9 +243,11 @@ #ifdef _MSC_VER # define HAVE_VSNPRINTF 1 # define HAVE_SNPRINTF 1 -/* Grrr, Visual Studio has vnsprintf, but with an '_'. */ +#if _MSC_VER < 1400 +/* Grrr, older versions of Visual Studio have vnsprintf, but with an '_'. */ # define vsnprintf _vsnprintf #endif +#endif #if defined(__unix__) || defined(__DECC) || defined(__BORLAND_V5__) #else This second patch defines the $(RM) build tool to be 'del' for the Visual C environment: Index: mkfiles/makefile.all =================================================================== --- src/mkfiles/makefile.all (revision 297) +++ src/mkfiles/makefile.all (working copy) @@ -235,6 +235,7 @@ LIBDEPS = $(RSPFILE) $(OBJDIR)\comp.rsp # This needs changing for Windows NT on non-Intel processors CPU = _X86_ +RM = del TOUCH = touch COPY = copy #}}} -- Jon Parise (jon of indelible.org) :: "Scientia potentia est" From jon at indelible.org Wed Apr 15 05:18:38 2009 From: jon at indelible.org (Jon Parise) Date: Wed Apr 15 05:20:32 2009 Subject: [slang-users] [PATCH] More Visual C build improvements Message-ID: <1aff89d70904142218q4cd601b2u60d7920cdd3b56d3@mail.gmail.com> The following patch makes two changes to the Visual C build environment: First, it removes the /YX compiler option. This option, which used to trigger implicit generation of precompiled headers, is not available in newer versions of the compiler. Microsoft says: The /YX compiler option generated automatic precompiled headers support. It was used by default from the development environment. If you remove /YX from your build configurations and replace it with nothing, it can result in faster builds. In addition to performance issues, /YX introduces the possibility of unexpected runtime behavior, it is preferable to use /Yc (Create Precompiled Header File) and /Yu (Use Precompiled Header File), which give you more control on how precompiled headers are used. In other words, these days you need to maintain your own precompiled header files explicitly if you decide to use them in your project. I assume that's not worth the effort here. Second, we now define "_CRT_SECURE_NO_WARNINGS", which disables compile-time warnings when "insecure" functions like strcpy() are used. The Visual C runtime provides "safe" alternatives, such as strcpy_s(), but updating S-Lang to reference them probably won't improve things much (unless there's low confidence in the current code's security with regard to things like buffer overflows). Alternatively, "_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" could be defined, which would cause the runtime to define strcpy() in terms of strcpy_s(), for example. That also feels like too much of an intrusive change here, but I mention it for completeness. Index: src/mkfiles/makefile.all =================================================================== --- src/mkfiles/makefile.all (revision 303) +++ src/mkfiles/makefile.all (working copy) @@ -551,8 +551,9 @@ !ifdef VC $(OBJDIR)\comp.rsp: - echo /nologo /W3 /YX /O2 /D "NDEBUG" /D $(CPU) > $(OBJDIR)\comp.rsp - echo /D "WIN32" /I "." /ML >> $(OBJDIR)\comp.rsp + echo /nologo /W3 /O2 /D "NDEBUG" /D $(CPU) > $(OBJDIR)\comp.rsp + echo /D "WIN32" /I "." /MT >> $(OBJDIR)\comp.rsp + echo /D "_CRT_SECURE_NO_WARNINGS " >> $(OBJDIR)\comp.rsp ! ifdef DLL echo /D SLANG_DLL >> $(OBJDIR)\comp.rsp ! endif -- Jon Parise (jon of indelible.org) :: "Scientia potentia est" From davis at space.mit.edu Mon Jul 20 00:40:37 2009 From: davis at space.mit.edu (John E. Davis) Date: Mon Jul 20 00:41:23 2009 Subject: [slang-users] slang 2.2.0 release candidate 1 available Message-ID: <200907200040.n6K0eb5C012051@aluche.mit.edu> I am pleased to announce the availability of the first release candidate of slang-2.2.0. It is available from the snapshots webpage at . I intend publically release slang-2.2.0 at the end of the month. This version is binary compatible with previous version 2 releases. It includes bug-fixes and performance enhancements. A brief description of some new features is given below. For a detailed list of changes, consult the changes.txt file in the distribution. Thanks, --John 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. 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. Intrinsic Functions =================== The following intrinsic functions have been added for 2.2: 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. _close Close an integer descriptor _fileno Returns the descriptor as an integer dup2, getsid, killpg, getpriority/setpriority: Wraps the corresponding system functions. ldexp, frexp: If x == a*2^b, where 0.5<=a<1.0 then (a,b)=frexp(x), and x=ldexp(a,b). The following functions have been enhanced: hypot If given a single array argument, it returns the equivalent of sqrt(sum(X*X)). polynom The calling interface to this function was changed and support added for arrays. Misc ==== Unicode tables updated to version 5.1. From joerg at alea.gnuu.de Mon Jul 20 23:01:26 2009 From: joerg at alea.gnuu.de (=?UTF-8?Q?J=C3=B6rg?= Sommer) Date: Tue Jul 21 08:07:51 2009 Subject: [slang-users] Re: slang 2.2.0 release candidate 1 available References: <200907200040.n6K0eb5C012051@aluche.mit.edu> Message-ID: Hello John, "John E. Davis" wrote: > Interpreter Enhancements > ======================== It's greate to hear S?Lang gets these enhancements. I very welcome them. > > 1. The ternary expression was added: > > expression = condition ? val1 : val2 > > If condition is non-zero, then expression = val1, > otherwise expression = val2 Can you extend this expression to evaluate to condition if val1 isn't present? I find it very helpful to write exp = container.get(10) ? : default_object instead of exp = container.get(10) != NULL ? container.get(10) : default_object Bye, J?rg. -- Was ist das blo? f?r eine Welt, in der es mehr Mut braucht ehrlich zu weinen als St?rke vorzut?uschen? From davis at space.mit.edu Tue Jul 21 15:11:37 2009 From: davis at space.mit.edu (John E. Davis) Date: Tue Jul 21 15:11:57 2009 Subject: [slang-users] Re: slang 2.2.0 release candidate 1 available In-Reply-To: References: <200907200040.n6K0eb5C012051@aluche.mit.edu> Message-ID: <200907211511.n6LFBb02003809@aluche.mit.edu> J?rg Sommer wrote: > Can you extend this expression to evaluate to condition if val1 isn't > present? I find it very helpful to write > > exp = container.get(10) ? : default_object > > instead of > > exp = container.get(10) != NULL ? container.get(10) : default_object I do not want to add any new features to 2.2.0, but I will consider this for 2.2.1. FWIW, here is an ugly hack that mimics the above: exp = (container.get(10), dup()) ? () : (pop(), default_object); Note that NULL evaluates to 0 in a boolean context. Thanks, --John From davis at space.mit.edu Sun Aug 2 21:13:14 2009 From: davis at space.mit.edu (John E. Davis) Date: Sun Aug 2 21:13:42 2009 Subject: [slang-users] slang 2.2.0 released Message-ID: <200908022113.n72LDEPB007275@aluche.mit.edu> Version 2.2.0 of the slang library is now available. See for downloading options. It may take a day or so for the mirror sites to pick up the latest version. The relevant MD5 sums are: 2593b390c6db81b840f6b48b0e768fa0 slang-2.2.0.tar.bz2 d98089cbb1c8ecac57e3fffee0d5db11 slang-2.2.0.tar.bz2.asc 219ae3d8de7f2f4fc52047a7902d1542 slang-2.2.0.tar.gz.asc 81cd7456c70a21937497f4b04b77433c slang-2.2.0.tar.gz a4b091de1da12255019f8bcac86b463f 2.1.4__2.2.0.diff.bz2 bdc14ffa3bd4d1e2d9323d481e03c5af 2.1.4__2.2.0.diff.bz2.asc 67732b06e4ee929992da23230c811526 2.1.4__2.2.0.diff.gz.asc f423c261fe523bfa86702a96ac13edf3 2.1.4__2.2.0.diff.gz This version contains a number of new features, as well as bug fixes. Version 2.2.0 is binary compatible with previous slang-2 versions. Enjoy, --John NEWS for version 2.2 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. 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. Intrinsic Functions =================== The following intrinsic functions have been added for 2.2: 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. _close Close an integer descriptor _fileno Returns the descriptor as an integer dup2, getsid, killpg, getpriority/setpriority: Wraps the corresponding system functions. ldexp, frexp: If x == a*2^b, where 0.5<=a<1.0 then (a,b)=frexp(x), and x=ldexp(a,b). The following functions have been enhanced: hypot If given a single array argument, it returns the equivalent of sqrt(sum(X*X)). polynom The calling interface to this function was changed and support added for arrays. Misc ==== Unicode tables updated to version 5.1. From laurent.perez at unicaen.fr Thu Aug 6 13:46:55 2009 From: laurent.perez at unicaen.fr (Laurent Perez) Date: Thu Aug 6 13:47:55 2009 Subject: [slang-users] slang 2.2.0 released In-Reply-To: <200908022113.n72LDEPB007275@aluche.mit.edu> References: <200908022113.n72LDEPB007275@aluche.mit.edu> Message-ID: <20090806134655.GA2017@unicaen.fr> Hello John, Many thanks for these new features ! Perhaps you should start thinking about an animal for a book cover ;-) Regards ; Laurent. From davis at space.mit.edu Mon Sep 7 01:57:07 2009 From: davis at space.mit.edu (John E. Davis) Date: Mon Sep 7 01:57:32 2009 Subject: [slang-users] slang 2.2.1 released Message-ID: <200909070157.n871v7M8011814@aluche.mit.edu> Hi, Version 2.2.1 of the slang library has been released. This is primarily a bug-fix release that addresses a few minor problems in version 2.2.0. The details are listed below. See for downloading options. It may take a day or so for the mirror sites to pick up the latest version. Thanks, --John Changes since 2.2.0 1. modules/socket-module.c: glibc-2.8 removed the h_addr macro. 2. src/slclass.c: Call clearerr before performing the stdio_fread/fwrite functions. 3. src/slstdio.c: typeo in the fputs intrinsic fixed (n instead of dn was compared to 0). 4. src/slscanf.c: sscanf will treat NaN and Inf in a case-insensitive manner. Also, the NaN([a-zA-Z0-9]*) form is also supported. 5. src/slang.h: SLclass_set_aelem_init_function was missing from the API. 6. src/slmath.c: The expm1 and log1p functions were returning NaN when given Inf arguments. 7. src/slmath,c: log1p(-1) produced nan instead of -inf. 8. configure: Added pkg-config support (based upon a debian patch sent to me by Luca Bigliardi). 9. doc/tm/rtl/math.tm: Updated the help for set_float_format and added documentation for the get_float_format function. 10. autoconf/slangpc.in: Added URL and Libs.private entries to the slang.pc pkg-config file. 11. src/slang.h: prototype for SLang_create_array1 missing from slang.h. 12. src/slcurses.c: Added debian patch that adds support for additional graphics characters (DIAMOND, DEGREE, etc...). 13. doc/tm/slang.tm: Added a small section about arrays of arrays. 14. src/slang.c: __builtin_expect is used for the stack functions if compiled with gcc. 15. src/*.c: A few public variables were not explicitly initialized to 0. Apparantly not doing so causes them not be be exported from the windows DLL. From sergey_feo at mail.ru Sat Oct 10 23:32:59 2009 From: sergey_feo at mail.ru (sergey) Date: Sat Oct 10 23:34:10 2009 Subject: [slang-users] 256 color support in midnight commander compiled with s-lang Message-ID: <20091011033259.c61048c0.sergey_feo@mail.ru> (excuse me for my bad English) I believe that many people know Midnight commander file manager. It can use s-lang or ncurses for terminal handling. Now it can use only 16 colors and can not use "gray" color for background. It is archaic in 2009. Are any chances exist to enable 256 or more colors support in Midnight commander and other s-lang-based applications? From davis at space.mit.edu Sun Oct 11 00:53:55 2009 From: davis at space.mit.edu (John E. Davis) Date: Sun Oct 11 00:54:11 2009 Subject: [slang-users] 256 color support in midnight commander compiled with s-lang In-Reply-To: <20091011033259.c61048c0.sergey_feo@mail.ru> References: <20091011033259.c61048c0.sergey_feo@mail.ru> Message-ID: <200910110053.n9B0rtqT019213@aluche.mit.edu> sergey wrote: > Are any chances exist to enable 256 or more colors support in Midnight > commander and other s-lang-based applications? S-Lang has had such support for a number of years. Perhaps your terminfo file or terminal needs to be updated. What terminal are you using? Feel free to reply to me off the list. Thanks, --John From B.Schoenhammer at bit-field.de Wed Nov 18 20:10:30 2009 From: B.Schoenhammer at bit-field.de (=?ISO-8859-15?Q?Bernhard_Sch=F6nhammer?=) Date: Wed Nov 18 20:10:14 2009 Subject: [slang-users] keyword "then" Message-ID: <4B0454B6.5050402@bit-field.de> Hello, it's probably that I'm a bit stupid in the moment, but I can't get it working. When I do: variable x; foreach x ([1,2,3]) { ()=printf("%d\n", x); } then ()=printf("done\n"); I think it should print 1 2 3 done but it prints the numbers only. slsh version 0.8.4-0; S-Lang version: 2.1.4 Thanks Bernhard From Manfred.Hanke at sternwarte.uni-erlangen.de Wed Nov 18 21:35:26 2009 From: Manfred.Hanke at sternwarte.uni-erlangen.de (Manfred Hanke) Date: Wed Nov 18 21:36:15 2009 Subject: [slang-users] keyword "then" In-Reply-To: <4B0454B6.5050402@bit-field.de> References: <4B0454B6.5050402@bit-field.de> Message-ID: <1112_1258580115_4B046893_1112_780199_1_20091118223526.qj3x7vnago0wog88@webmail.esac.esa.int> Hallo Bernhard, > variable x; > foreach x ([1,2,3]) { > ()=printf("%d\n", x); > } then ()=printf("done\n"); > > [...] prints the numbers only. > > slsh version 0.8.4-0; S-Lang version: 2.1.4 This bug was fixed with change #23 after version 2.1.4: 23. src/slang.c, slparse.c: "then" clauses were not being executed for top-level looping statements (statements occuring outside function definitions). Sch?ne Gr??e, 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 -- ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ================================================================================================ This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is prohibited. If you received this message in error, please delete it from your system and notify the sender. E-mails can be altered and their integrity cannot be guaranteed. ESA shall not be liable for any e-mail if modified. ================================================================================================= From B.Schoenhammer at bit-field.de Thu Nov 19 08:19:40 2009 From: B.Schoenhammer at bit-field.de (=?UTF-8?B?QmVybmhhcmQgU2Now7ZuaGFtbWVy?=) Date: Thu Nov 19 08:20:22 2009 Subject: [slang-users] keyword "then" In-Reply-To: <1112_1258580115_4B046893_1112_780199_1_20091118223526.qj3x7vnago0wog88@webmail.esac.esa.int> References: <4B0454B6.5050402@bit-field.de> <1112_1258580115_4B046893_1112_780199_1_20091118223526.qj3x7vnago0wog88@webmail.esac.esa.int> Message-ID: <4B04FF9C.8060801@bit-field.de> Guten Morgen Manfred, > > This bug was fixed with change #23 after version 2.1.4: > Yes, with 2.2.1 it works. Thank you Bernhard From davis at space.mit.edu Sat Dec 5 19:30:54 2009 From: davis at space.mit.edu (John E. Davis) Date: Sat Dec 5 19:31:48 2009 Subject: [slang-users] slang 2.2.2 released Message-ID: <200912051930.nB5JUsjJ004933@aluche.mit.edu> Hi, Version 2.2.2 of the slang library has been released. This is a bug-fix release that addresses a few issues in version 2.2.1. The details are listed below. See for downloading options. It may take a day or so for the mirror sites to pick up the latest version. Thanks, --John Changes since 2.2.1 1. src/slsmg.c: Call SLutf8_enable if UTF8 mode has not been setup. 2. src/slutty.c: Allow the hook that gets called when the read function gets interrupted to change the read file descriptor. Before, if this happened, the SLang_getkey function would return SLANG_GETKEY_ERROR. 3. lib/slsh/print.sl: Turn off buffering of the pager pipe. 4. modules/tm/*.tm: A couple of typos corrected (John Houck) 5. src/slmath.c: The round function was not correctly rounding values between 0.5 and 1.0. 6. src/slstdio.c,slclass.c: If a call to fwrite produces errno=EPIPE, then do not bother trying the write again. 7. modules/fork-module.c: Use WIFCONTINUED only if it is defined. 8. slsh/Makefile.in: Change the order of the libraries such that the newly built ones will be found first. (Markus Hennecke) 9. src/slagetput.inc: Avoid possible access violation when using a range array as an index. 10. doc/tm/rtl/lists.tm: Documented the optional argument to the list_to_array function (Manfred Hanke). From river at loreley.flyingparchment.org.uk Sun Dec 20 03:13:06 2009 From: river at loreley.flyingparchment.org.uk (River Tarnell) Date: Sun Dec 20 03:13:26 2009 Subject: [slang-users] Incorrect terminfo offsets for HP-UX Message-ID: <20091220031306.GA4586@loreley.flyingparchment.org.uk> Hi, The terminfo offsets in src/sltermin.c are wrong for HP-UX; at least AF and AB are off by two, which makes S-Lang wrongly determine that the terminal doesn't support colours. - {"AB", 360 UNTIC_COMMENT("set ANSI color background")}, - {"AF", 359 UNTIC_COMMENT("set ANSI color foreground")}, + {"AB", 362 UNTIC_COMMENT("set ANSI color background")}, + {"AF", 361 UNTIC_COMMENT("set ANSI color foreground")}, It may be that other offsets are wrong as well - is there a program to generate this table, or does someone need to go through it by hand? - river. From davis at space.mit.edu Sun Dec 20 09:24:09 2009 From: davis at space.mit.edu (John E. Davis) Date: Sun Dec 20 09:24:29 2009 Subject: [slang-users] Incorrect terminfo offsets for HP-UX In-Reply-To: <20091220031306.GA4586@loreley.flyingparchment.org.uk> References: <20091220031306.GA4586@loreley.flyingparchment.org.uk> Message-ID: <200912200924.nBK9O9iS032267@aluche.mit.edu> River Tarnell wrote: > The terminfo offsets in src/sltermin.c are wrong for HP-UX; at least AF > and AB are off by two, which makes S-Lang wrongly determine that the > terminal doesn't support colours. > > - {"AB", 360 UNTIC_COMMENT("set ANSI color background")}, > - {"AF", 359 UNTIC_COMMENT("set ANSI color foreground")}, >+ {"AB", 362 UNTIC_COMMENT("set ANSI color background")}, >+ {"AF", 361 UNTIC_COMMENT("set ANSI color foreground")}, > > It may be that other offsets are wrong as well - is there a program to > generate this table, or does someone need to go through it by hand? I did it more or less manually a number of years ago. ncurses can be configured to use the native tables via a configure option. It contains a set of Cap files that define the native terminfo binary formats for several systems, including HP-UX. If the configure option is not given, it assumes a standardized same binary layout. It is this standardized format that slang currently assumes. I will look into providing an option to use a specified binary layout. It is possible to allow the format to be specified at run-time instead of assuming a statically specified layout, but I am not sure that will actually be useful. Thanks, --John From davis at space.mit.edu Sun Dec 20 21:44:53 2009 From: davis at space.mit.edu (John E. Davis) Date: Sun Dec 20 21:45:38 2009 Subject: [slang-users] Incorrect terminfo offsets for HP-UX In-Reply-To: <20091220031306.GA4586@loreley.flyingparchment.org.uk> References: <20091220031306.GA4586@loreley.flyingparchment.org.uk> Message-ID: <200912202144.nBKLirl1025007@aluche.mit.edu> River Tarnell wrote: > The terminfo offsets in src/sltermin.c are wrong for HP-UX; at least AF > and AB are off by two, which makes S-Lang wrongly determine that the > terminal doesn't support colours. Hi River, If you have git installed, I would appreciate it if you test pre2.2.3-1 and configure it as follows: # git clone git://git.jedsoft.org/git/slang.git # cd slang # ./configure --prefix=whatever --with-terminfo=hpux11 I have not yet pushed these changes to the svn repository. Thanks, --John From Manfred.Hanke at sternwarte.uni-erlangen.de Fri Dec 25 17:20:13 2009 From: Manfred.Hanke at sternwarte.uni-erlangen.de (Manfred Hanke) Date: Sat Dec 26 16:14:21 2009 Subject: [slang-users] edit_var (X-mas present) Message-ID: <7748_1261764845_4B3500EC_7748_120759_2_20091225182013.6o78x0e3dws0ckkw@webmail.esac.esa.int> Dear all, this is meant as a Christmas present for all S-Lang (& jed) users. I hope that the edit_var function will turn out to be similiarly useful for interactively editing variables (especially complex nested data structures) as the edit_par function is for ISIS model parameters. Enjoy! A few features are still missing. For example, different integer data types (Char_Type, Integer_Type, Long_Type, ...) are not distinguished yet. Merry Christmas and then a Happy New Year 2010, too! 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 -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% private define assoc_has_default_value(hash, defaultvalref) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% { variable min_char = 32; % ' ' variable max_char = 126; % '~' % find a string that is no key of hash variable N = 0; variable key = ""; while(assoc_key_exists(hash, key)) { N++; variable a = UChar_Type[N]; a[*] = min_char; key = ""; loop(N) key += char(min_char); while(assoc_key_exists(hash, key)) { variable i = -1; do i++, a[i] = min_char+((a[i]-min_char+1) mod (max_char-min_char+1)); while(a[i]==min_char && i0); % qualifier_exists("fold"); indent++; switch(type) { case String_Type or case BString_Type: sprintf("\"%S\"%s", val, (type==BString_Type ? "B" : "")); % left on stack } { case Array_Type or case List_Type: (type==Array_Type ? "[" : "{") + sprintf(" %% %S", val) + (fold ? " %{{{" : "") + "\n"; % left on stack last = length(val)-1; _for i (0, last, 1) () + sp+" " + datatype_to_string(val[i]; indent=indent) + (i 'Folding' => 'Enable Folding') % for nested data structures, which can hence be % very easily investigated. % % The S-Lang code for x can be modified. After % saving the temporary file and closing the editor, % the file is evaluated, which should return an % S-Lang object that is either stored in x % (if passed by reference) or returned. %!%- { variable is_ref = (typeof(x)==Ref_Type); variable xx = ( is_ref ? @x : x ); variable t = typeof(xx); variable tmpfile = qualifier("tmpfile", sprintf("/tmp/edit_var_%d_%d", getuid(), getpid())); variable fp = fopen(tmpfile, "w"); ()=fputs("% -*- mode: SLang; mode: fold -*-\n\n" +(t==List_Type ? "($0=" : "") +datatype_to_string(xx) +(t==List_Type ? ", $0)" : ""), fp); ()=fclose(fp); variable e = getenv("EDITOR"); if(e==NULL) e = "jed"; if(system(e+" "+tmpfile)) if(is_ref) return; else return x; try(e) ()=evalfile(tmpfile); % S-Lang code produces return value that is left on stack catch AnyError: { vmessage("\"%s\" exception:\n%s\n%s:%d", e.descr, e.message, e.file, e.line); if(is_ref) return; else return NULL; } finally ()=remove(tmpfile); if(is_ref) @x = (); } ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ================================================================================================ This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is prohibited. If you received this message in error, please delete it from your system and notify the sender. E-mails can be altered and their integrity cannot be guaranteed. ESA shall not be liable for any e-mail if modified. ================================================================================================= -------------- next part -------------- A non-text attachment was scrubbed... Name: edit_var.sl Type: text/vnd.wap.sl Size: 4962 bytes Desc: not available Url : http://mailman.jedsoft.org/pipermail/slang-users-l/attachments/20091225/cac7bb66/edit_var.bin