Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!ucsd!ucbvax!pasteur!jwz@teak.berkeley.edu From: jwz@teak.berkeley.edu (Jamie Zawinski) Newsgroups: comp.lang.lisp Subject: Re: Communicating with foreign hosts from MACL Message-ID: <22133@pasteur.Berkeley.EDU> Date: 15 Feb 90 21:44:14 GMT Sender: news@pasteur.Berkeley.EDU Lines: 25 In-reply-to: <1331@zipeecs.umich.edu> In article <1331@zipeecs.umich.edu> arie@dip.eecs.umich.edu (Arie Covrigaru) writes: > > The TI Explorer I am using for the same project doesn't have this problem, > yet it must follow the same definition of read-line. On the Mac, I had to > add a form to take care of the #\Linefeed character after a read-line, but > this makes the code incompatible with the TI version. The issue of "what read-line should do" aside, there is no reason that such an implementation difference should make your code non-portable. The read-macros #+ and #- let you conditionally compile things into your code, much like C's #ifdef form. (let ((line (read-line stream))) #-EXPLORER (read-char stream) ; if not a TI, discard a newline. line) Or, a more general solution: (let ((line (read-line stream))) ;; If the next character is LF, ditch it. (when (char= #\Linefeed (peek-char nil stream nil #\Null)) (read-char stream)) line) -- Jamie