Path: utzoo!attcan!uunet!dalsqnt!pollux!ti-csl!pf@csc.ti.com From: pf@csc.ti.com (Paul Fuqua) Newsgroups: comp.lang.lisp Subject: Re: Common Lisp Problems with Hash-table in Macros Message-ID: <65699@ti-csl.CSNET> Date: 14 Dec 88 21:30:09 GMT References: <701@crin.crin.fr> Sender: news@ti-csl.CSNET Organization: TI Computer Science Center, Dallas Lines: 34 Date: Tuesday, December 13, 1988 1:15pm (CST) From: stephan at crin.crin.fr (Stephan BRUNESSAUX) Subject: Re: Common Lisp Problems with Hash-table in Macros Newsgroups: comp.lang.lisp On Explorer, the hash table seems to be dumped but no longer works since you cannot add or remove any entries. The problem is that the quoted-constant hash-table is being compiled into a read-only area, and MAPHASH errors when it tries to write to the hash-table-lock. Our compiler guy entered a bug-report on the problem, since MAPHASH is not a destructive operation, so hash-tables ought to be special-cased. His further comments: "This is interesting because the ANSI Common Lisp compiler subcommittee is currently discussing rules for how constants are to be dumped and loaded and one of the stickiest problems has been deciding which attributes of a hash table need to be preserved. I had thought the issue was rather academic since I hadn't ever seen anyone try to use a hash table as a constant before." My second question is : Am I right to write that kind of macro ? I would not write such a macro because any quoted constant is likely to be write-protected -- you shouldn't be modifying a quoted constant in your program, it's "constant." I have a distaste for dumping complex structures as constants in any case, preferring to write macros that expand into construction forms that are evaluated at load time. Paul Fuqua Texas Instruments Computer Science Center, Dallas, Texas CSNet: pf@csc.ti.com (ARPA too, sometimes) UUCP: {smu, texsun, cs.utexas.edu, rice}!ti-csl!pf