[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On reading zl syntax files from cl --



    From: starnet!apple!Think.COM!barmar (Barry Margolin)
    Date: Wed, 6 Nov 91 22:35:52 EST
    To: starnet!bass!lakin@apple.com
    Cc: slug@ai.sri.com
    Subject: reading zl syntax files from cl

       Date: Wed, 6 Nov 91 16:48:08 PST
       From: starnet!bass!lakin@apple.com (Fred Lakin)

       Is there a way to temporarily change (let-bind?) the 
       prevailing lisp-syntax for the duration of a read from file?

    (let ((*readtable* si:standard-readtable))
      ...)

yes, it works. thanks again, barmar.


of course, one of the first things i tried was

  (let ((*readtable* zl:readtable))
   ...)

which didnt. Thus i spent much time looking for more obscure solutions,
finally gave up and msged slug. This must be a frequently answered question,
but why does si:standard-readtable work and not zl:readtable when my
machine says they are EQ?


    Actually, what you might want to do is obey the -*- line, so that your
    program will adapt to any file, just as LOAD does.  Look at the source to
    SI:READFILE-INTERNAL to see how it does it.  The important operations are
    :GENERIC-PATHNAME-AND-PLIST (the fourth value), FS:READ-ATTRIBUTE-LIST,
    and FS:FILE-ATTRIBUTE-BINDINGS.
						    barmar

good idea. truth is, i was *hoping* CL syntax was "the last syntax i would
ever use," so i could just automatically convert all the old data files
once and be done with it ... OK, OK; i'll check out the -*- stufff.

tnx,
-f