mkent@violet.berkeley.edu (06/23/87)
Well, I've been messing around with the 1.3 release of Metacomco's Cambridge Lisp for a couple of weeks now, so I thought I'd drop a line to tell anyone who's interested what I've seen, and ask anyone who's knowledgeable one serious question. Summary: Looks like the result of a graduate class project written by folks who've never actually written anything substantial in lisp. If I were in any way connected with this project, I'd be very embarassed now. Still, if you want compileable lisp on the amiga, what other choice do you have? In many ways the 1.3 release is the same as 1.0, with mangled, shitty documentation, brain-damaged default syntax tables, and NO break package whatsoever. (However, the lisp supports the creation of and discrimination between ~10 different types of cons cells, called "acons", "bcons" etc. Why you might want to make use of such a facility is something I haven't been able to figure out yet...) Why we had to wait almost two years between 1.0 and 1.3 is another big mystery; the image date in 1.3 is from late *1985*, 3 months younger than 1.0. The earlier version had a half-baked "resident" structure editor; rather than improve that editor, they've just thrown it away (i.e. 1.3 has NO editor). On the plus side, the compiler seems to do a reasonable amount of optimization (at least it eliminates tail-recursion) and the compiled code is pretty fast. The big pluses of this system are the pluses of lisp in general, which include the ability to freely intermix compiled and interpreted code. A key problem with cambridge lisp is that it was written for the 68000, and it's never known anything about the amiga (e.g. NO graphics, NO sound, NO windows...) There was a very narrow, low-level system interface in 1.0, but its apparent inconvenience of use was rendered academic by the fact that it just plain didn't work. In 1.3, it works. As my father says, "far out." This system interface consists of a pair of functions that let you call routines in opened libraries, passing the functions the lib base ptr, the offset of the routine entry, and a vector of args to be stuffed into D0-3 and A0-3 (if you want to use other registers, you're screwed, but that's irrelvant unless you want to call something arcane like CreateProc or anything involving a bitblt...) This seems like a reasonable way to access system routines, but there seems to be one big hole in it: there are no (documented) functions which do a general "peek" or "poke." So, for instance, you can open a window by opening the intuition lib and calling the OpenWindow routine (I felt real clever when it occured to me to build a NewWindow struct to pass it by concatenating the struct together as a string, byte by byte) and the routine will return the base address of a Window struct. But now, if you want to do something with the window, like draw on it, you need the address of the RPort. You can get the address of that address by just adding 50 to the window address, but there you're stopped, because there's no way to read the contents of that address! So, while you're able to call system routines, there doesn't seem to be any support for parsing the structures the sytem builds (and returns pointers to). I'm currently getting around this with a horrible kludge: I've written C programs to do peeks and pokes, taking their args from the command line *and writing the result to a special file in ram: * When I want to do one of these operations from lisp, I Execute the appropriate routine, open and read the file, close the file and return the value!! Yuck. SO, HERE'S MY BIG QUESTION: DOES ANYONE KNOW HOW TO DO A PEEK OR A POKE FROM CAMBRIDGE LISP?? I would be more than glad to have anyone come out and tell me what a jerk I am for putting down cambridge lisp; how there are obvious ways to do these things I'm asking about. Any suggestions of any kind will be greatly appreciated... By the way, I'm trying to do some real work in cambridge lisp, and I'm evolving a body of code, including a simple window package and some file tools... Let me know if you're also interested in building some kind of workable *environment* around lisp on the amiga, perhaps we can get something together... Marty Kent . . . . . . ... . . . . . . MKent@violet.berkeley.edu School of Education / 4527 Tolman Hall / UC Berkeley / Berkeley, Ca. 94720 415/ 642 0288 . . . ... . . . . . . . ... . . .