HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > Software / Tools > Programming, Coding, (Web)Design


Programming, Coding, (Web)Design Discuss all your programming or design needs with likeminded people.

Reply
 
Thread Tools
Old Nov 27, 2004, 06:37 AM   #1
DriverHeaven Extreme Member
 
Join Date: Jun 2004
Location: Floatin'...
Posts: 4,957
Rep Power: 0
Drakon will become famous soon enough

Donator
??? Anyone know LISP?

Is anyone here good at LISP? I got some homework due next tues and i haven't started it as yet mainly because i have absolutely no idea what to do. i am currently reading the lecture notes and i am completely lost. so can anyone help with my hw, please? not asking for someone to do it for me (althought that would be appreciated ), but some help will do, if possible. Thanks...

link to hw assignment:
http://www.csee.umbc.edu/331/fall04/homework/hw9/
Drakon is offline   Reply With Quote


Old Nov 27, 2004, 04:41 PM   #2
Delete Me
 
Join Date: Mar 2004
Posts: 14,648
Rep Power: 0
pr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to all

ewww 'Lost In Senseless Parenthesis'

if it isn't due for a while I can have ms. Vandevenne look at it monday, as she knows LISP
pr0digal jenius is offline   Reply With Quote
Old Nov 27, 2004, 08:56 PM Threadstarter Thread Starter   #3
DriverHeaven Extreme Member
 
Join Date: Jun 2004
Location: Floatin'...
Posts: 4,957
Rep Power: 0
Drakon will become famous soon enough

Donator
Quote:
Originally Posted by pr0digal jenius
ewww 'Lost In Senseless Parenthesis'

if it isn't due for a while I can have ms. Vandevenne look at it monday, as she knows LISP
well it's due next tues which is the 30th at 4 pm. if u get back to me
before that would be great, John. Thanks for helping...
Drakon is offline   Reply With Quote
Old Nov 28, 2004, 04:56 AM   #4
Delete Me
 
Join Date: Mar 2004
Posts: 14,648
Rep Power: 0
pr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to all

haha....can't help you then....as I won't see her until monday the 29th at 2pm and am busy all day monday
pr0digal jenius is offline   Reply With Quote
Old Nov 28, 2004, 04:23 PM Threadstarter Thread Starter   #5
DriverHeaven Extreme Member
 
Join Date: Jun 2004
Location: Floatin'...
Posts: 4,957
Rep Power: 0
Drakon will become famous soon enough

Donator
Quote:
Originally Posted by pr0digal jenius
haha....can't help you then....as I won't see her until monday the 29th at 2pm and am busy all day monday
oh darn...
Drakon is offline   Reply With Quote
Old Nov 28, 2004, 10:03 PM   #6
Delete Me
 
Join Date: Mar 2004
Posts: 14,648
Rep Power: 0
pr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to allpr0digal jenius is a name known to all

you want her email?
pr0digal jenius is offline   Reply With Quote
Old Nov 29, 2004, 01:07 AM   #7
Anti-Piracy Poster Boy
 
YAYitsAndrew's Avatar
 
Join Date: Oct 2004
Location: NJ
Posts: 2,605
Rep Power: 79
YAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seen
System Specs

1. Look at the definition and usage of cons and list. You need to construct the lists in the first column using only cons for the second column and only list for the third column.
(a b c) for instance is (cons (cons (cons 'a nil) b) c) and (list 'a 'b 'c)

2. Look at the definition and usage of car and cdr. car returns the first element in a list and cdr returns the rest of the list. Play around in lisp with expressions like (car (list 'a 'b 'c)) and (cdr (list 'a 'b 'c)).

Everything else should be pretty standard assuming you already know how to program in some other language. It takes time to get used to programming and thinking in lisp, but you're only conquering a syntax hurdle.
__________________
"It is because the resistance to paying for copyrighted material, although often characterized as arising from a supposed technical burden or principled concern for the public interest, arises rather from exactly the same segment of the brain that is dominant in shoplifters."
- Mark Helprin, Digital Barbarism

In other words, it's never okay to steal even if you think you have a good reason!

www.yayitsandrew.com
YAYitsAndrew is offline   Reply With Quote
Old Nov 29, 2004, 06:17 AM Threadstarter Thread Starter   #8
DriverHeaven Extreme Member
 
Join Date: Jun 2004
Location: Floatin'...
Posts: 4,957
Rep Power: 0
Drakon will become famous soon enough

Donator
thanks for the help, andrew. it seems to figure out #1 and #2 is by trial and error. try different expressions until i get it right. must be a better way of figuring out these things. anyways i managed to figure out the first 2 rows of #1 by pure luck. one answer troubles me though, it's for (a b c). for the cons i put :[color=white] (cons ‘a ‘(b c) ). is this a possible answer or is the answer u provided the only one? thanks again, andrew... [/color]
Drakon is offline   Reply With Quote
Old Nov 29, 2004, 12:39 PM   #9
Anti-Piracy Poster Boy
 
YAYitsAndrew's Avatar
 
Join Date: Oct 2004
Location: NJ
Posts: 2,605
Rep Power: 79
YAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seen
System Specs

The instructions for number 1 dictate that you aren't allowed to use a quoted list.
__________________
"It is because the resistance to paying for copyrighted material, although often characterized as arising from a supposed technical burden or principled concern for the public interest, arises rather from exactly the same segment of the brain that is dominant in shoplifters."
- Mark Helprin, Digital Barbarism

In other words, it's never okay to steal even if you think you have a good reason!

www.yayitsandrew.com
YAYitsAndrew is offline   Reply With Quote
Old Nov 29, 2004, 04:14 PM Threadstarter Thread Starter   #10
DriverHeaven Extreme Member
 
Join Date: Jun 2004
Location: Floatin'...
Posts: 4,957
Rep Power: 0
Drakon will become famous soon enough

Donator
ok. btw, i checked and ur suggestion for (a b c) for the cons was wrong. it's (cons 'a (cons 'b (cons 'c nil))).
Drakon is offline   Reply With Quote
Old Nov 29, 2004, 08:18 PM   #11
Anti-Piracy Poster Boy
 
YAYitsAndrew's Avatar
 
Join Date: Oct 2004
Location: NJ
Posts: 2,605
Rep Power: 79
YAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seen
System Specs

Sorry looks like I forgot the single quots before b and c, so it thought they were variable names. Try what I had before but with 'b and 'c. If it still doesn't work, then there's something special about cons in lisp that I don't know about and doesn't exist in scheme.

I really know scheme and not lisp, but they're pretty similar.
__________________
"It is because the resistance to paying for copyrighted material, although often characterized as arising from a supposed technical burden or principled concern for the public interest, arises rather from exactly the same segment of the brain that is dominant in shoplifters."
- Mark Helprin, Digital Barbarism

In other words, it's never okay to steal even if you think you have a good reason!

www.yayitsandrew.com
YAYitsAndrew is offline   Reply With Quote
Old Nov 29, 2004, 10:45 PM   #12
Anti-Piracy Poster Boy
 
YAYitsAndrew's Avatar
 
Join Date: Oct 2004
Location: NJ
Posts: 2,605
Rep Power: 79
YAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seenYAYitsAndrew has a divinity and aura the likes we have never seen
System Specs

as per your IM:

nil is an empty list. ()
cons joins an element with a list. (cons element list). This may be why mine didn't work before I was doing (cons list element). Anyway, (cons 'a nil) will be the element 'a added to the nil list. You get (a). (cons 'a (cons 'b nil)) is tricky. Work inside out just like in algebra. First (cons 'b nil) is (b). now we have (cons 'a (b)) which is (a b). If we wanted to get mor confused we could do (cons (cons 'a nil) (cons 'b nil)). That breaks to (cons (a) (b)) and should give the list ((a) b). I think you need (cons (cons 'a nil) (cons (cons 'b nil) nil)) to get ((a) (b)). Play around with it.

list is a little different, you specify all the elements of the list in the declaration. (list element1 element2 element3 ...). So (list a b c) is (a b c) and (list (list a) (list b)) is (list (a) (b)) is ((a) (b)).

When working in Lisp you need to be able to get your bearings straight when surrounded by parenthesis. Think of the algebraic equation (4 + (2 * (4 + 7 + (2 - 6) * (2 + 4)))). You'd solve that the same way you go about working in lisp. From the inside out.
__________________
"It is because the resistance to paying for copyrighted material, although often characterized as arising from a supposed technical burden or principled concern for the public interest, arises rather from exactly the same segment of the brain that is dominant in shoplifters."
- Mark Helprin, Digital Barbarism

In other words, it's never okay to steal even if you think you have a good reason!

www.yayitsandrew.com
YAYitsAndrew is offline   Reply With Quote
Reply

Thread Tools