From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!news2.kpn.net!news.kpn.net!nslave.kpnqwest.net!nloc2.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Save to file/restore from file - Lisp structures References: Mail-Copies-To: never From: Erik Naggum Message-ID: <3213563112883750@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 32 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Nov 2001 00:25:14 GMT X-Complaints-To: newsmaster@Norway.EU.net X-Trace: nreader2.kpnqwest.net 1004574314 193.71.66.49 (Thu, 01 Nov 2001 01:25:14 MET) NNTP-Posting-Date: Thu, 01 Nov 2001 01:25:14 MET Xref: archiver1.google.com comp.lang.lisp:18962 * Bruce Lester | After entries are created, the tutorial says that the state of the hash | table can be written to a file by using print. : | Is this because the tutorial I am reviewing is old or that Franz did | something differrent than the standard. Your tutorial is lying to you. If you want the truth about the standard, consult the standard and only the standard. The first problem is that there is no (standard) reader macro that builds and returns a hash table. And since each of the hash-tables are of type hash-table, not of type structure-object, #S shall _not_ be used to build one. You could easily write a print-object method for hash-tables, but that is not quite kosher, either. (See ANSI X3.226 11.1.2.1.2 item 19.) If you create your own streams class sub-type, you can get around this, and since you can create classes at run-time, you can conceivably write a class that does only hash-table printing and use it as a mixin with the class of the stream in a particular instance. This gets to be a little bit more work than you probably expected, and is thus a typical case for vendor initiative, but the standard is restrictive on what a conforming implementation can do in this case. I think this is unfortunate, but if the vendors agree on how to do this, the standard will be extended in letter but maintained in spirit, just as it would be if this were added with the appropriate standards committee blessing. /// -- Norway is now run by a priest from the fundamentalist Christian People's Party, the fifth largest party representing one eighth of the electorate. -- Carrying a Swiss Army pocket knife in Oslo, Norway, is a criminal offense.