Subject: Re: Small read macro issue
From: Erik Naggum <erik@naggum.no>
Date: 08 Oct 2002 01:10:58 +0000
Newsgroups: comp.lang.lisp
Message-ID: <3243028258838806@naggum.no>

* Adam Warner
| Are there advantages to choosing a wrapper class instead of a struct?
| It seems that a struct may be more suitable because it has a readable
| representation by default.

  That is what they specialized method on print-object was for.

  I prefer structs only when there is no possible need to change the layout
  of the class.  Redefining a structure generally does not work, and code
  that uses structures is generally inlined.  You are much better off using
  classes until you know very precisely what you are doing.

  One reason to use a wrapper class that adds a new type to the string in
  question is that keyword arguments in Common Lisp follow a fixed number
  of arguments.  You have to write your own parser functions to find the
  options if they are flagged with keywords.  This is silly and is more of
  an abuse of the feature than reasonable use of it.  If you have to do
  some kind of dispatch, avoiding a property list that has a tail of non-
  properties is a really good thing.  Your need is to recognize options
  when something like this is passed around, and that is fully satisfied
  with a new "type" around the string.

  There are many problems when processing TeX code.  I really suggest you
  do something that is easier to accomplish than to force a bright idea
  that does not work to work.
            
-- 
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.