|
to PropTwoLevel :prop :level
localmake "nproperties
count glist :prop
localmake "proplists
glist :prop
localmake "underlevel []
localmake "abovelevel []
for [i 1 :nproperties][if lessp
(last item :i :proplists) :level
[make "underlevel lput item :i :proplists :underlevel]]
for [i 1 :nproperties][if not
lessp (last item :i :proplists) :level
[make "abovelevel lput item :i :proplists :abovelevel]]
op list :underlevel "__
:abovelevel
end
TO GLIST
:PROP
localmake "vvvv last plists
LOCALMAKE "NLISTs COUNT :vvvv
localmake "listarray []
for
[i 1 :nlists][localmake "elmlists item :i :vvvv
if (memberp :prop plist :elmlists) [make "listarray lput
testlist :elmlists :prop
:listarray)]]
op :listarray
end
to testlist :propa :prop
localmake "alphaprop plist
:propa
localmake "nalphaprop count
plist :propa
for [j 1 :nalphaprop ][if (item :j
:alphaprop) = :prop [ op
(list :propa :prop gprop
:propa :prop) ]]
end
|
show glist "tall
[[ali tall 130] [faiez tall 90] [hoda tall 110]
[saied tall 100]]
show glist "weight
[[ali weight 36] [faiez weight 27] [hoda weight 40]
[saied weight 28]]
show PropTwoLevel "tall 100
[[[faiez tall 90]] __ [[ali tall 130] [hoda tall
110] [saied tall 100]]]
show PropTwoLevel "tall 80
[[] __ [[ali tall 130] [faiez tall 90] [hoda tall
110] [saied tall 100]]
show PropTwoLevel "weight 30
[[[faiez weight 27] [saied weight 28]] __ [[ali
weight 36] [hoda weight 40]]]
|