2
我有這樣的結構適合人羣:參數對於結構方案
(define-struct person
(
first ; a string: first name
last ; a string: last name
sex ; a symbol: 'male, 'female
eyes ; a symbol: 'blue, 'brown', 'green
hair ; a symbol: 'blonde, 'brown, 'black, 'red
mother ; a person: empty if not known
father ; a person: empty if not known
born ; a number: year of birth
)
)
,然後我讓人們:
(define P-00000 (make-person "Alexandra" "Harper" 'female 'blue 'red empty empty 1897))
(define P-10000 (make-person "Joshua" "Sherman" 'male 'green 'blonde empty empty 1881))
; ... etc
如何我現在可以訪問特定段的結構。舉個例子,我想顯示P-00000的姓氏,我該怎麼做?
感謝
標準方案沒有結構,所以我把增加球拍標籤的自由。如果你正在使用別的東西,請糾正它。 – sepp2k 2010-10-24 19:21:07