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

Defstruct doldrums



Question concerning structures:

I need to know how to map over the slots of random structures. Supposing
this were called MAPSTRUCT, taking a function and a structure, it would
feed the contents of each slot (and perhaps also the slot-name) to the 
function.

This is how it has to behave:

> (mapstruct #'(lambda (slot slotname) (list slot slotname))
	     (make-flibber :a 1 :b 2))
    
((A 1) (B 2))

I need this because I'm trying to port something originally written in
KCl to Allegro. In KCl structures are vectors, and you can figure out
everything you need from the structure plist, but in Allegro the plist
is, I see, also a structure whose print form doesn't tell me anything.

I'm using Allegro on the Next.

Thanks for any help.

--Eliot Handelman
  Music Dept,
  Princeton U.