View Single Post
Old 03-20-2006, 10:05 PM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Lisp is god's programming language.

You could make an a-list that relates each car to it's manufacturor (Why you would have an exercise relating cars in a language with a primitive called CAR is beyond me). Anyway, an a-list relates data like this (key1 value1 key2 value2 ...) . There's a function for finding the value of a key called GETF. so for this example you could do something like this.
Code:
(defparameter *models* '(fiesta ford sk100 merc focus ford))
(getf *models* 'fiesta)
=> FORD
(getf *models* 'sk100)
=> MERC
(getf *models* 'focus)
=>FORD
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote