This program should implement a LISP interpreter that is able to get LISP commands from a Telnet connection and send back its results also through the same Telnet connection. The server must be able to handle more than one client at the same time.
The LISP interpreter must be able to parse and execute, at least, the following lisp commands:
(CAR list>) X= <string>,<list>
(CDR <list>)
(LIST X {X} )
(SET <string> X)
(GET <string>) For instance:
Client: (LIST A B 2)
Server: (A B 2)
Client: (CAR (LIST A B 2))
Server: A
Client: (CDR (LIST A B 2))
Server: (B 2)
Client: (SET LIXO AB)
Server: AB
Client: (GET LIXO)
Server: AB
Client: (CAR (CDR (LIST AB CD EF)))
Server: CD
Client: (CDR (CAR (LIST (LIST HY HJ I) HJ)))
Server: (HJ I)
NOTE: The program must use shared memory and threads in its implementation (take care to protected shared memory areas with mutex and/or semaphores). The LISP variables should be accessed by all users at the same time. The program does not need to keep information on files, it does not have to be persistent.