[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [KAHLE@Aquinas.Think.COM: common lisp question]

How about defining a print-function for your structure that printed

#.(make-death-row :person 2 :crime 3 :allow-other-keys t)

It's the simplest solution I can think of.  In the current CLtL you
can't use &key in a boa-constructor lambda-list, and besides, you
couldn't make #S use it anyway (it only uses the 'standard'
constructor {whatever that is}).  So, the next easiest solution is
probably redefine the dispatch-reader-macro for S to handle a list
beginning with DEATH-ROW as a special case.

-- Nick

    Date: Fri, 18 Sep 87 15:33:21 EDT
    From: gls@Think.COM
    Date: Wed, 16 Sep 87 17:25 EDT
    From: Brewster Kahle <KAHLE@Aquinas.Think.COM>
    Subject: common lisp question
    To: gls@godot.think.com, mincy@godot.think.com
    Moon: 1 day, 13 hours, 32 minutes since the last quarter of the moon.
    I want to make a stucture that is printed as
    #S(death-row :person 2 :crime 3)
    but I want it to be readable by a machine that thinks 
    there is only the :person slot. ie
    (defstruct (death-row :constructor 'something-special)
    Basically I would like to specify the arguments to the constructor to be 
    (defun make-death-row (&rest keywords &key person &allow-other-keys)
    is this possible?  If it isnt then structures are limited as a
    communication medium between potentially different software versions.