Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site bcsaic.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!fluke!ssc-vax!bcsaic!michaelm From: michaelm@bcsaic.UUCP (michael b maxwell) Newsgroups: net.lang.prolog Subject: "name" and type conversion Message-ID: <382@bcsaic.UUCP> Date: Tue, 19-Nov-85 15:26:00 EST Article-I.D.: bcsaic.382 Posted: Tue Nov 19 15:26:00 1985 Date-Received: Thu, 21-Nov-85 05:42:45 EST Organization: Boeing Computer Services AI Center, Seattle Lines: 20 In playing around with Poplog, we had a program which would sometimes read in integers, but they were read in as atoms (because at the point of reading in we weren't sure whether we would be reading in atoms or integers). For instance, we would have the atom '12', which was not the same as the integer 12. We wanted to convert such atoms into integers. We were about to play around with all kinds of complicated schemes for conversion (or with doing something like a "peek" at the input stream), when one of our programmers discovered that the following succeeds: ...name ('12', X), name (Y, X), integer (Y)... In other words, running such an atom into and then back out of "name" converts it from an atom to an integer! Now this is a very handy thing to have. However, I suspect that it's not supposed to work that way, and probably doesn't in other Prologs. Any comments? Does anyone have another (simple) way of doing such a conversion? -- Mike Maxwell Boeing Artificial Intelligence Center ...uw-beaver!uw-june!bcsaic!michaelm