From s-lang at ottolander.nl Thu Dec 8 17:10:52 2005 From: s-lang at ottolander.nl (Leonard den Ottolander) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] AIX is unix Message-ID: <1134079852.2550.19.camel@athlon> Hello, AIX is not recognized as unix. This caused problems for the midnight commander on this platform. For the internal copy of slang 1 this was fixed by defining __unix__ if _AIX is defined: http://savannah.gnu.org/cgi-bin/viewcvs/mc/mc/slang/include/slang.h.diff?r1=1.3&r2=1.4 The same might still be true for __MACH__ and __NetBSD__. Please take a look at the patches the midnight commander team applied to slang 1: http://savannah.gnu.org/cgi-bin/viewcvs/mc/mc/slang/include/slang.h . There might be some patches that still have relevance for slang 2. Leonard. P.S. Is it possible to view the current state of slang somewhere? I cannot find a reference to a CVS repository on www.s-lang.org. -- mount -t life -o ro /dev/dna /genetic/research From davis at space.mit.edu Sun Dec 11 12:32:42 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] AIX is unix In-Reply-To: <1134079852.2550.19.camel@athlon> References: <1134079852.2550.19.camel@athlon> Message-ID: <200512111732.jBBHWgGT016450@aluche.mit.edu> Leonard den Ottolander wrote: >AIX is not recognized as unix. This caused problems for the midnight >commander on this platform. For the internal copy of slang 1 this was >fixed by defining __unix__ if _AIX is defined: >http://savannah.gnu.org/cgi-bin/viewcvs/mc/mc/slang/include/slang.h.diff?r1=1.3&r2=1.4 I believe this is a midnight commander issue. If you compile the slang library on AIX as distributed, then I believe you will find that the resulting config.h defines __unix__. >P.S. Is it possible to view the current state of slang somewhere? I >cannot find a reference to a CVS repository on www.s-lang.org. Eventually I will make current snapshots of slang available via svn. With the exception of the patch that was recently posted to this list, version 2.0.5 more or less reflects the current development snapshot. --John From dburke at cfa.harvard.edu Mon Dec 19 11:23:57 2005 From: dburke at cfa.harvard.edu (Doug Burke) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] _NARGS is not set when calling an "overloaded" function (ie one set by __add_string) Message-ID: <1c2ba09294c8186349d48ed8c2c96408@cfa.harvard.edu> John, I can easily imaging that _NARGS is not meant to be set in the following situation, so I just wanted to know whether it was intentional behavior or a bug. The following is with S-Lang 2.0.5 on a OS-X machine: slsh> typedef struct { a } A_Type; slsh> p.a = 43; slsh> p; A_Type with 1 fields I now define a routine for customizing the string representation of this type: slsh> define A_string (x) { sprintf ("A_Type: a=%S (_NARGS=%d)", x.a, _NARGS); } If I call it directly then _NARGS is set: slsh> A_string (p); A_Type: a=43 (_NARGS=1) However, if the routine is called "indirectly", then _NARGS is not set: slsh> __add_string (A_Type, &A_string); slsh> p; A_Type: a=43 (_NARGS=0) Doug From davis at space.mit.edu Mon Dec 19 23:35:29 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] _NARGS is not set when calling an "overloaded" function (ie one set by __add_string) In-Reply-To: <1c2ba09294c8186349d48ed8c2c96408@cfa.harvard.edu> References: <1c2ba09294c8186349d48ed8c2c96408@cfa.harvard.edu> Message-ID: <200512200435.jBK4ZTxk000574@aluche.mit.edu> Doug Burke wrote: >following situation, so I just wanted to know whether it was >intentional behavior or a bug. The following is with S-Lang 2.0.5 on a A little of both. The function will always be called with exactly one argument; hence there is nothing to be gained by checking the value of _NARGS in it. Nevertheless, it is a bug since _NARGS should be 1. Here is the patch: --- slstruct.c~ 2005-12-16 16:21:18.000000000 -0500 +++ slstruct.c 2005-12-19 14:09:53.000000000 -0500 @@ -1259,10 +1259,10 @@ return SLmake_string (buf); } - if (-1 == _pSLang_push_struct (s)) - return NULL; - - if (-1 == SLexecute_function (f)) + if ((-1 == SLang_start_arg_list ()) + || (-1 == SLang_push_struct (s)) + || (-1 == SLang_end_arg_list ()) + || (-1 == SLexecute_function (f))) return NULL; if (-1 == SLpop_string (&str)) Thanks, --John From mnoble at space.mit.edu Tue Dec 20 13:40:36 2005 From: mnoble at space.mit.edu (Michael Noble) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] slirp 1.7.7 released Message-ID: <20051220184036.GA1486@svoboda.mit.edu> Friends, Version 1.7.7 of SLIRP has been released to http://space.mit.edu/CXC/software/slang/modules/slirp The main driver for this release is that the use of f2c has been discontinued, in favor of SLIRP parsing fortran source directly. SLIRP now has zero external dependencies, other than S-Lang, and has been verified compatible with at least 8 different Fortran compilers. This release also features a powerful new mechanism for ignoring functions based upon their argument signatures (rather than merely their names), as well as transparent support for morphing S-Lang string arrays into arrays of C++ string objects. Details on these and other enhancements are available in the CHANGELOG on the website. Regards, Mike Noble From lpe540 at yahoo.com Fri Dec 23 09:35:14 2005 From: lpe540 at yahoo.com (Joe Miller) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] possible returns values for where Message-ID: <20051223143514.35876.qmail@web54411.mail.yahoo.com> Hi all, This is more for a sanity check than anything else. I'm reviewing a slang script written by someone else and trying to decipher a section of it. The author of the script does essencially the following index = where (x < y); if ((length (index) == 1) and (index[0] != -1)){ .... } As far as I know there's no way for the 'where' function to return a negative value. But I wanted to double check before I took it out. Thanks. -joe __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From davis at space.mit.edu Fri Dec 23 11:49:21 2005 From: davis at space.mit.edu (John E. Davis) Date: Tue Jan 30 08:52:10 2007 Subject: [slang-users] possible returns values for where In-Reply-To: <20051223143514.35876.qmail@web54411.mail.yahoo.com> References: <20051223143514.35876.qmail@web54411.mail.yahoo.com> Message-ID: <200512231649.jBNGnLet003627@aluche.mit.edu> Joe Miller wrote: >the script does essencially the following > index = where (x < y); > if ((length (index) == 1) and (index[0] != -1)){ > .... > } >As far as I know there's no way for the 'where' >function to return a negative value. But I wanted to >double check before I took it out. The elements of the array returned by `where` will be >= 0. Note that the above is also flawed because `where` can return an array with no elements, and since the `and` operator does not short-circuit, the execution of index[0] will result in a range-error if index has no elements. --John