This would be great. I'm not doing PyKE right now but I remember
defining a rule to handle deffacts that allowed the personal-data
expression you give, and then it used assert_ and list hacking to
generate each individual (age Andrew 20) fact.
In fact, here's the rule....no idea if it still works in current PyKE
but perhaps it is helpful....what's nice is that your real rules just
match facts normally. Of course it all hinges on having a unique
ID. In your case, I'd generate a unique ID (e.g, andrew35) and have
(name andrew) as one of the pairs. Note also that the "pairs" can
be any length tuple IIRC -- e.g., (fullname, John, Quincy, Public)
# Permits a single deffacts to produce a variety of facts
#
#
# deffacts(testco, ((biztype,consulting), (location,boston),
(startyear,2001) ))
# expands to:
# biztype(testco, consulting)
# location(testco, boston)
# ...
#
expand_deffacts
foreach
xxx.deffacts($deff, (*$pairs))
xxx.infeng($infeng)
($f1,*$frest) in $pairs
assert
# wish I could just write:
# xxx.f1($frest)
# but instead I have to do the following
python
fargs = ($deff,) + $frest
$infeng.assert_('xxx', $f1, fargs)