Subject: Re: writing out expressions prepended by #.
From: Erik Naggum <>
Date: Sat, 28 Apr 2001 02:34:52 GMT
Newsgroups: comp.lang.lisp
Message-ID: <>

* 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/ could mean the address and a 26-bit mask for
  routing or matching purposes, whild #/ip/ 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.

  I found no peace in solitude.
  I found no chaos in catastrophe.
			-- :wumpscut: