Path: utzoo!utgpu!attcan!uunet!husc6!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: more on permutations Keywords: forth, prolog, binary, files, input, avocados Message-ID: <298@quintus.UUCP> Date: 20 Aug 88 07:18:56 GMT References: <1161@tuhold> <6850@well.UUCP> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 21 In article <6850@well.UUCP> jax@well.UUCP (Jack J. Woehr) writes: > May I have an example of a predicate that would accept >keystroke input and return via the predicate name/2 a list of >ascii chars, i presume in single-quotes? Is this serious? name/2 is used for converting constants to lists of character codes and vice versa. You wouldn't use it in this context, but would just read the characters using get0/1. Single quotes go around atoms; it is double quotes which indicate a list of codes ("it" = [105,116]). You mention keystrokes: arrangements for reading from the terminal vary from operating system to operating system, hence also from Prolog to Prolog. If line-buffering + echoing is ok, get0/1 should do. > May I please have a predicate that would write to a file >a list of binary ops, say the code for AX AX MOV in assembler? Sounds as though you are using a PC. Your Prolog will probably have some equivalent of C's open(filename, "wb"); just use put/1 to write bytes to that.