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

[no subject]



How about

(DEFMACRO MAPF (STRUCT FIELDS LIST)
    (DO ((F FIELDS (CDR F))
         (J 0 (+ J 1))
         (SETS '() (CONS `(SETF (,(CAR F) %%STRUCT%%) (NTH ,J %%LIST%%)) SETS)))
        ((NULL F)
         `(LET ((%%STRUCT%% ,STRUCT) (%%LIST%% ,LIST)) ,@SETS))))

(MAPF A-FOO (FOO-REG FOO-VAL FOO-INDEX) (HACK-UP-A-3-LIST))

?