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

Readtables



   I have a question about readtables. Forgive me if this is an already
   discussed topic.

   I have a program, in package FOO. It sets a macro character via
   (set-macro-character) using the default readtable.

   Problem: now all programs on the machine will call the macro function
   regardless of whether they USE the package.

   One solution: do (set-macro-character char function nil (setq my-readtable
               (copy-readtable nil)))
   which will put it in a readtable "separate" from everyone elses. Problem:
   have no way of determining when the "new" readtable should be used. Either have
   to have separate read loop just for this program, or do something else
   crufty like recognize the current default package isn't the one we want.

   It seems, at first blush, the desired feature would be to somehow
   associate readtables with packages. That
   is, if the readtable I use is associated with my current package, my current
   problem is solved. This seems pretty general. Hierarchical packages would also
   have hierarchical readtables. You could still change readtables while IN a 
   package, but the big win is on most machines, making the package with your
   program in it (or a child of that one) the default means your macro is in
   effect. Packages which do not inherit from your special one won't know about
   your macro.

   Thanks for your help,
   Brad Miller

Brad Miller	 ARPA:	lab@rochester.arpa	UUCP:rochester!lab
			(also miller@rochester for grad student stuff)
			Title:	CS Technical Operations Manager
			 Snail:	University of Rochester Computer Science Department
			617 Hylan Building	Rochster, NY 14627