Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - hugh.jf.chen

#1
Whither newLISP? / Re: Is true symbol?
June 24, 2014, 11:34:44 PM
True is a symbol. (eval 'true) is a expression. Since symbols are also expressions,so the = return true. I feel make sense.
#2
You need to modify the firewall function to return a new complete object with the modified value, and then set the original object to the returned new object.
 
(define (Plane:firewall)
  (list Plane 2700 (self 2)))


Then,

(set 'planes (map (curry : firewall) planes))


You will get:

> planes
((Plane 2700 0) (Plane 2700 1250) (Plane 2700 900))
#3
I met the same problem when I'd tried to build 10.6.0 under archlinux with the same version of gcc. Forturnately,I found this: http://pastebin.com/bY4hjEfZ">http://pastebin.com/bY4hjEfZ. I'm wondering if all linux distributions with gcc 4.8.2 have the smae problem. If yes,I think a patch need to be provided.
#4
newLISP and the O.S. / Re: Porting newLISP (AIX)
August 12, 2013, 07:56:48 PM
Well,I did more tests and found that the built executable just runs find on some aix machines while hung on some aix machines. So looks like there're some execution restrictions on some machines. I'll go to our sys admin for this problem. Thanks
#5
newLISP and the O.S. / Re: Porting newLISP (AIX)
August 12, 2013, 07:15:24 PM
All right,I was back and got the access to the aix machine so I did some test based on lutz's suggestions.



I built the util/types.c and run it,following is the output of types.c:

type      bytes
---------------
char        1
char *      4
void *      4
short int   2
int         4
long        4
long int    4
long long int  8
size_t      4
float       4
double      8
long double 8
wchar_t     2
size_t      4
off_t       4
time_t      4

format input              output
------------------------------------------------
%d     0xffffffff               -1
%u     0xffffffff               4294967295
%d     0x7fffffff               2147483647
%u     0x7fffffff               2147483647
%d     0x80000000               -2147483648
%u     0x80000000               2147483648
%lld     0x7fffffffffffffffLL   9223372036854775807
%llu     0x7fffffffffffffffLL   9223372036854775807
%llx     0xffffffffffffffffLL   ffffffffffffffff
%llX     0x7fffffffffffffffLL   7fffffffffffffff
%llX     0x8000000000000000LL   8000000000000000
%llX   0xFFFFFFFFFFFFFFFFLL     ffffffffffffffff
%llX   0x7FFFFFFFFFFFFFFFLL     7fffffffffffffff
%llX   0x8000000000000000LL     8000000000000000
%lld   0xffffffffffffffffLL -1
%llu   0xffffffffffffffffLL 18446744073709551615
%lld   0x7fffffffffffffffLL 9223372036854775807
%llu   0x7fffffffffffffffLL 9223372036854775807
%lld   0x8000000000000000LL -9223372036854775808
%llu   0x8000000000000000LL 9223372036854775808

CPU is big endian
The constant __BIG_ENDIAN__ is defined by the compiler

size of struct {char, short int, int} is: 8
size of struct {char, int, short int} is: 12
size of struct {char, short int, long, int} is: 12
size of struct {char, long, short int, int} is: 16

9223372036854775807 * 1000 = -1000
11 % -4 = 3


Following are the changes I'd made to nl_filesys.c:
*** newlisp-10.5.3/nl-filesys.c Wed Jul 10 00:13:06 2013
--- newlisp-10.5.3.new/nl-filesys.c Wed Jul 31 14:06:39 2013
***************
*** 1615,1622 ****
--- 1615,1624 ----
  #if defined(SUNOS) || defined(LINUX) || defined(CYGWIN)
  memcpy(&thisFdSet, &myFdSet, sizeof(fd_set));
  #else
+ #ifndef AIX
  FD_COPY(&myFdSet, &thisFdSet);
  #endif
+ #endif
 
  if(mode == SELECT_READ_READY)
      ready = select(FD_SETSIZE, &thisFdSet, NULL, NULL, &tv);
***************
*** 2584,2593 ****
--- 2586,2597 ----
  struct tm *ltm;
  #ifndef SUNOS
  #ifndef OS2
+ #ifndef AIX
  INT gmtoff;
  UINT isdst;
  #endif
  #endif
+ #endif
  #else /* WINDOWS */
  TIME_ZONE_INFORMATION timeZone;
  #endif
***************
*** 2607,2618 ****
--- 2611,2626 ----
  ltm = localtime((time_t *)&tv.tv_sec);
  #ifndef SUNOS
  #ifndef OS2
+ #ifndef AIX
  isdst = ltm->tm_isdst;
+ #endif
 
  #ifdef CYGWIN
  gmtoff = _timezone/60;
  #else
+ #ifndef AIX
  gmtoff = ltm->tm_gmtoff/60;
+ #endif
  #endif
 
  #endif


I still can't figure out the hung problem. If any one can give some suggestions?
#6
newLISP and the O.S. / Re: Porting newLISP (AIX)
August 11, 2013, 07:52:27 PM
I've tried the makefiles for gcc and xlc but they both generated the same result. The executale newlisp works fine on the machine I built newlisp but hung on other aix machines.



For the changes to nl_filesys.c,I will give the details once i get access to the machine.



All aix machines are 64 bits and I built it with 64 bit makefile,I just can figure out why this would happen.
#7
newLISP and the O.S. / Re: Porting newLISP (AIX)
August 11, 2013, 09:05:13 AM
I tried to build newlisp on AIX days ago. I managed to build it successfully after having cleaned up some macro statement in nl_filesystem.c and the result executable, newlisp, runs just fine in the machine where I built newlisp. However,when I copy the executable newlisp to another aix box and try to launch it, it just hung there and doesn't give me the prompt. After I press ctrl+c,it give me a option list with continue,abort,etc and I presss (c)ontinue, then the newlisp prompt just show up. Does any one meet such a problem and have any clue how to fix it?