DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Computer Science (http://www.daniweb.com/forums/forum14.html)
-   -   Lisp Programming defparameter (http://www.daniweb.com/forums/thread41231.html)

coolman2006 Mar 16th, 2006 10:52 am
Lisp Programming defparameter
 
Does anyone know about LISP Programming

I am trying to make this program where I have 3 types of cars, which are ford bmw merc

ford has focus and fiesta BMW has 1series and 2series and the merc has SK100 and SK200

well basically i am trying to put them in the correct list for example focus will go into ford list and SK100 will go to the merc list

at the moment to store the data i will use defparameter

example

(defparameter *cars* ' ( focus fiesta 1series 2series SK100 SK200))

so now i want to create a funtion where the cars will go into the correct list

if u have any idea please help

Rashakil Fol Mar 16th, 2006 11:03 am
Re: Lisp Programming defparameter
 
just store the data in an organized fashion in the first place.

coolman2006 Mar 16th, 2006 11:06 am
Re: Lisp Programming defparameter
 
no i gota use a proper function for it so (defun test-a-car 2) and den it puts these items in a list

coolman2006 Mar 16th, 2006 11:09 am
Re: Lisp Programming defparameter
 
the 2 means 2 items per list and in the correct list

Rashakil Fol Mar 16th, 2006 11:30 am
Re: Lisp Programming defparameter
 
Writing a function for this is less efficient than writing a list with these organized into sublists; in fact, a properly written procedure will contain such a list anyway.

coolman2006 Mar 16th, 2006 11:42 am
Re: Lisp Programming defparameter
 
there gota be a way i mean i wanana do it so i run a funtion and i have a list of cars and those have got to go into the right type of cars at the moment there just in a list i want to put them in another list so fiesta goes to the ford list

so its sort it out. Sorting is the keyword here. u have a list of ramdon cars and u want to sort it into the correct category

please help!!! :lol:

Rashakil Fol Mar 16th, 2006 12:47 pm
Re: Lisp Programming defparameter
 
So you'll need to use a list of categories in your function.

coolman2006 Mar 16th, 2006 1:16 pm
Re: Lisp Programming defparameter
 
how do I do that

coolman2006 Mar 17th, 2006 6:35 am
Re: Lisp Programming defparameter
 
Please man u gota give some sort of code so i can work on it i dont know nothing about lisp

if (test-a-list 2) the two means put two cars in a list, but they must be sorted to the correct list, that what i have to do because i need to learn this staff i tried the internet and everything but i cant find nothing

Rashakil Fol Mar 17th, 2006 12:45 pm
Re: Lisp Programming defparameter
 
Quote:

Originally Posted by coolman2006
i dont know nothing about lisp

Then learn something about it.


All times are GMT -4. The time now is 1:57 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC