Search found 9 matches

by gayelle
Wed Oct 05, 2011 5:35 pm
Forum: Common Lisp
Topic: Help with a lisp program
Replies: 12
Views: 15698

Re: Help with a lisp program

i finally got it. I defined a seperate function that compare x and y and plugged it into the minimum function! thanks so much for all the help
by gayelle
Wed Oct 05, 2011 5:07 pm
Forum: Common Lisp
Topic: symbols in lisp
Replies: 2
Views: 4745

Re: symbols in lisp

I have this question to answer for a quiz and im at an impass. At first i couldnt figure out the E but now I cant figure out how to use a condition... This was the question: 4. Use cond and exp to define (activation type sum) which returns the activation value of a connectionist unit given a sum of ...
by gayelle
Wed Oct 05, 2011 2:00 pm
Forum: Common Lisp
Topic: symbols in lisp
Replies: 2
Views: 4745

symbols in lisp

Hello,
I was wondering if anyone could let me know how I can have allegro common lisp recognize the mathematical symbol 'e' as the mathematical e and not a letter or something
thank you
by gayelle
Tue Oct 04, 2011 7:14 pm
Forum: Common Lisp
Topic: Help with a lisp program
Replies: 12
Views: 15698

Re: Help with a lisp program

Well for my function I was thinking of it this way, 1. Take the inputted list 2. Assign the first number to the a list and assign the second variable to the b list 3. if a is smaller than b store it in a list, otherwise store b in the list 4. Take the next number and compare it to the list and do th...
by gayelle
Tue Oct 04, 2011 6:28 pm
Forum: Common Lisp
Topic: Seeking some advice
Replies: 11
Views: 25566

Re: Seeking some advice

Also for the fourth question, we need to approach it like the Standard Deviation. So you define each part of the formula with a different function, and then total them all together.
by gayelle
Tue Oct 04, 2011 6:17 pm
Forum: Common Lisp
Topic: Help with a lisp program
Replies: 12
Views: 15698

Re: Help with a lisp program

I thought of maybe using set f to define two variables and compare them, but i don't know if im on the right track...

Code: Select all

(defun minimum (lst)
  "(lst)
return the minimum of a list"
  (do (x lst (cdr x))
      (setf 'a (car x))
    (setf 'b (car (cdr x))
      
by gayelle
Tue Oct 04, 2011 6:03 pm
Forum: Common Lisp
Topic: Help with a lisp program
Replies: 12
Views: 15698

Re: Help with a lisp program

Here is how far along I got in the code. I know that I have to take the first number but I don't know how to compare it to each other value in the list individually...

Code: Select all

(defun minimum (lst)
  "(lst)
return the minimum of a list"
  (do (x lst (cdr x))
      (result 0 (car x))
by gayelle
Tue Oct 04, 2011 5:31 pm
Forum: Common Lisp
Topic: Seeking some advice
Replies: 11
Views: 25566

Re: Seeking some advice

For the Odd numbers function, I think the teacher wanted us to use an if function to have it say 'none. Kind of like Marcel's third practice question, but I could be wrong.
by gayelle
Mon Oct 03, 2011 8:38 pm
Forum: Common Lisp
Topic: Help with a lisp program
Replies: 12
Views: 15698

Help with a lisp program

hello!
I am new to lisp and I am trying to figure out DO loops. I simply do not understand how to create them, and I must create a Do function which finds the minimum in a list and also use an if function but i am stuck. Can anyone help?