Cronox1
04-15-2004, 07:12 PM
Hi im new to schemce and Im trying out a couple of things.
Im trying to do two different functions
For the first I'm trying to do the reverse of cons so basically I was write a function called revcon that could do this
(revcon '(a b) '(c d))
and give me
(c d a b)
I thought about doing a cons then doing a reverse on it but that didnt work and i was gonna see if any ideas were available for this.
As for my other function I want to make a function that will take a number and an atom will make a copy of the atom however many times of the number given.
So for instance if i called it copy I would have
(copy 4 'd)
and I would get
d d d d
I have tried different things with this but no luck.
If anyone could help me with this I would greatly appreciate it thanks in advance.
Im trying to do two different functions
For the first I'm trying to do the reverse of cons so basically I was write a function called revcon that could do this
(revcon '(a b) '(c d))
and give me
(c d a b)
I thought about doing a cons then doing a reverse on it but that didnt work and i was gonna see if any ideas were available for this.
As for my other function I want to make a function that will take a number and an atom will make a copy of the atom however many times of the number given.
So for instance if i called it copy I would have
(copy 4 'd)
and I would get
d d d d
I have tried different things with this but no luck.
If anyone could help me with this I would greatly appreciate it thanks in advance.