From ... Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!134.222.94.5!npeer.kpnqwest.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: writing out expressions prepended by #. References: <3AE9EEC3.13F4B3ED@genworks.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3197414092128104@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 33 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 28 Apr 2001 02:34:52 GMT X-Complaints-To: newsmaster@Norway.EU.net X-Trace: nreader1.kpnqwest.net 988425292 195.0.192.66 (Sat, 28 Apr 2001 04:34:52 MET DST) NNTP-Posting-Date: Sat, 28 Apr 2001 04:34:52 MET DST Xref: newsfeed.google.com comp.lang.lisp:9409 * Kent M Pitman > The only disadvantage of #.(...) is that a lot of people bind *read-eval* > when reading forms, and in that case you'll lose on the re-read. To > counteract that, you might be better off to take some other dispatch on # > and make something similar to #S but with user-definable characteristics. : > I seem to recall I tried to get the committee to generalize its effect > but for some reason it didn't go through--maybe it was after the feature > freeze... I have taken to define #/ as a reader-macro akin to the format control, to read _registered_ types with associated functions, as I ran out of convenient ways to specify classes and such. In this particular case, #/point/(1 2 3), would require a registered type named point with an associated reader function that that would read as many arguments as it needs using whatever printer controls and reader functions it pleased, but it would of course be the question of more or less reasoanble usages, as with every other powerful mechanism. E.g., #/ip/192.168.150.155/26 could mean the address and a 26-bit mask for routing or matching purposes, whild #/ip/192.168.150.155:5555 could mean an address and a port number. And #/md5/0123456789abcdeffedcba9876543210 could mean the hexadecimal representation of an MD5 sum. Given this framework, would be a very simple task to supply macros that defined and registered reader functions and corresponding print-object methods for new classes. #:Erik -- I found no peace in solitude. I found no chaos in catastrophe. -- :wumpscut: