Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!swrinde!ucsd!ames!amelia!orville.nas.nasa.gov!raible From: raible@orville.nas.nasa.gov (Eric Raible) Newsgroups: comp.lang.lisp Subject: Re: exploratory system for unix system calls/facilities Message-ID: <3514@amelia.nas.nasa.gov> Date: 20 Oct 89 20:59:14 GMT References: <1753@xyzzy.UUCP> <4139@hplabsz.HPL.HP.COM> Sender: news@amelia.nas.nasa.gov Reply-To: raible@orville.nas.nasa.gov (Eric Raible) Organization: NASA Ames Research Center, Moffett Field, CA Lines: 33 In article <4139@hplabsz.HPL.HP.COM> mayer@hplabs.hp.com (Niels Mayer) writes: >In article <1753@xyzzy.UUCP> kan@tom.dg.com () writes: >>Does anyone know of an interactive environment for playing around with >>all those wonderful Unix system calls? >> >>I guess what I'd like is something that will let me try things out without >>having to write/compile/debug C code. For example, a simple client/server >>using shared memory, semaphores, etc. implemented in a few Lisp expressions >>would run in a couple of terminals (or windows). >>Doing this junk in C, needless to say, is a real pain in the butt. > >I'd certainly be interested in getting any enhancements to xlisp for >supporting some of the uglier aspects of unix hacking in a cleaner fashion. I've built something along these lines for xscheme, but I'm sure that it could easily be adapted for xlisp. Before I explain it, here are some examples: (define (system string) (%call-c-function 'system string)) (%call-c-function 'printf "%s%d%c" (symbol->string 'eric) 10 #\newline) %call-c-function gets the address using nlist (it also caches it on the plist of the name of the function for speed), and then calls the C function with the "C" values of each of the arguments. Of coure argument checking could easily be added, but I haven't had the need. Presently %call-c-function returns only integers, but that could also be easily added. Mail me if you want the code. - Eric (raible@orville.nas.nasa.gov)