[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: Confused about Scheme...???

William James

5/1/2015 2:26:00 AM

> In short, 'reduce-list', is take a list of variable length, 'b',
> below and reduce it if the (caar ls) and (caadr ls) are equal...this
> is the first atom within the pair of consecutive sublists and if this
> is true contruct a list, (list (caar ls) (+ (cadar ls) (cadadr ls)))
> , and add second atom of the consective pairs. For example,
> (reduce-list b) ==> ((4 3) (3 7) (2 1) (1 2) (0 1)). I can get it to
> work for the first two terms without using recursion, produces (4 3),
> but when I implement recursion it barfs. Could some one tell me what
> I'm doing wrong because I know that I'm trying to do to much at once?
>
>
> -Conrad
>
>
> (define (reduce-list ls)
> (cond ((null? ls) ls)
> (else
> (cond ((null? (cadr ls)) ls)
> (else
> (cond ((eq? (caar ls) (caadr ls))
> (list (caar ls) (+ (cadar ls) (cadadr ls)))
> (reduce-list (cdr ls)))
> (else (list (car ls) (reduce-list (cdr ls)))))))))))
>
>
> (define b '((4 1) (4 2) (3 3) (3 4) (2 1) (1 2) (0 1)))
>
> (reduce-list b)

Gauche Scheme:

(use util.match :only (match))

(define b '((4 1) (4 2) (3 3) (3 4) (2 1) (1 2) (0 1)))

;; Can blow the stack.
(let go ((pairs b))
(match pairs
([(a b) (c d) more ...]
(if (eq? a c) (cons (list a (+ b d)) (go more))
(cons (list a b) (go (cdr pairs)))))
(tail tail)))

===>
((4 3) (3 7) (2 1) (1 2) (0 1))


;; Can't blow the stack.
(let go ((pairs b) (acc '()))
(match pairs
([(a b) (c d) more ...]
(if (eq? a c) (go more (cons (list a (+ b d)) acc))
(go (cdr pairs) (cons (list a b) acc))))
(tail (reverse acc tail))))

--
20 Africans raped 11-year-old Swedish girls:
eutimes.net/2011/03/20-refugees-suspected-of-gang-rape-at-stockholm-public-swimming-pool/
What I would most desire would be the separation of the white and
black races. --- A. Lincoln, July 17, 1858
24 Answers

TheInquirer

12/5/2013 1:01:00 PM

0

On 12/5/2013 4:41 PM, auwe digidauw wrote:
> aeh.chua@auckland.ac.nz wrote in news:6b4132ae-fccc-47ec-99d1-3da1e198d4c5
> @googlegroups.com:
>
>> I support the legalisation of marijuana.
>
> and I condemn TheInquirer's stupidity !
>
> ha ha


wanna Legalise Mary-wanna?

acceptable answer can be "i support legalisation of Mary-wanna, because ..."
acceptable answer can be "i am against legalisation of Mary-wanna,
because ..."
these are some examples of acceptable answers.

personal attacks / remarks constitute a non-acceptable answer
e.g. "and I condemn TheInquirer's stupidity !"
once the "TheInquirer" is being used in the response, there
is a probability of 0.999999 of it being not-acceptable.
even if the answer is a flattering ass-kissing answer like
"TheInquirer is very handsome" it is not an acceptable answer, because
it is off-topic. the topic is wanna Mary-wanna.

remember: Just answer the damn question, not the questioner!
Don't get personal. Don't presume. Let's try again.

wanna Legalise Mary-wanna?

--
Just answer the damn question, not the questioner! Don't
presume. My personal matters/beliefs are none of your
business. I ask, you answer. If you think I am stupid,
you have already proven that you are stupid, not me. If
you don't know the answer, can you please "pass" to other
people to answer? thanks.

baldeagle

12/6/2013 8:39:00 PM

0

On Thursday, 5 December 2013 06:31:08 UTC+8, aeh....@auckland.ac.nz wrote:
> On Thursday, December 5, 2013 10:12:24 AM UTC+13, TheInquirer wrote:

>
>
> I support the legalisation of marijuana. It has medical use, other parts of the plant have commercial value, and a marijuana-stoned individual is relaxed. As compared to (e.g.,) alcohol, where they can turn violent.

-------

Is it really harmless?
I remember, opium was also touted as harmless. Opium was touted as harmless ...it too has it good use...it can be refined into pain killer ...for stopping the pain of people dying of cancer...and other medical use. But is it good for the society...as recreation drug.

Opium was sold to China ...made millions and millions of Chinese into opium addicts...addicts who did not care about anything in life except to get their hands on opium. They did no care about national pride and honour, ...the need to fight the invasion by the white devil...they willingly accepted humiliation by the White devils as long as they could get the next fix.

The same is happening to millions of drug addicts in the USA...and this has indirectly contributed to the decline in the USA.

For us in Singapore, I am worried that it will do the same thing to our kids who could lose their dynamism ..their drive to be the best.
More sinister, there is nothing to stop those who smoke marijuana from graduating to hard core drugs.
I certainly don't want Singapore to become a haven for drugs... accompanied by all the society ills....gang wars, murders, prostitution, kids killed by drug overdose, kids turn into drug pushers, a huge population who will not get a job but choose to live on food stamps (welfare) ...like what is happening to the USA.

To me, this side effects of drug to society is certainly not harmless.



>
>
>
> Marijuana also then beomes taxable.
>
>
>
> Cecil Chua

aehchua

12/7/2013 6:51:00 PM

0

On Saturday, December 7, 2013 9:39:09 AM UTC+13, baldeagle wrote:
> Is it really harmless?

I don't believe it is harmless, but neither is alcohol. It does cause certain physiological changes. I believe it is less harmful than alcohol. Also, what little science has been done (there is legal marijuana in the US, but it is hard to procure) has demonstrated various benefits, such as cancer fighting. So harm must be balanced against benefits.

>
> I remember, opium was also touted as harmless. Opium was touted as harmless ...it too has it good use...it can be refined into pain killer ...for stopping the pain of people dying of cancer...and other medical use. But is it good for the society...as recreation drug.

"Good for society" depends on the implementation. I would have marijuana legalized, taxed, and regulated. I would not have marijuana be completely "open."

Also opium derivatives (e.g., morphine) are still used as painkillers, so I'm not sure where you are going with this argument.

> Opium was sold to China ...made millions and millions of Chinese into opium addicts...addicts who did not care about anything in life except to get their hands on opium. They did no care about national pride and honour, ....the need to fight the invasion by the white devil...they willingly accepted humiliation by the White devils as long as they could get the next fix.

I believe marijuana is a habit forming, not an addictive drug. It leads to psychological, not physical dependency. Again, you can't look at a drug in a vacuum. You have to compare it with others like caffeine, alcohol, methamphetamines, cocaine, heroin. No government in the world bans all mind and body altering substances. The question is WHICH of these should be made legal.

>
> The same is happening to millions of drug addicts in the USA...and this has indirectly contributed to the decline in the USA.

The "decline of the USA" is a very vague term. If the word is used to describe violence, marijuana users are LESS likely to commit violent crimes than the general population. Marijuana RELAXES the individual.
>
> For us in Singapore, I am worried that it will do the same thing to our kids who could lose their dynamism ..their drive to be the best.

Legalizing marijuana doesn't mean allowing everyone to consume it. I would prefer that marijuana be put under the same laws as that of tobacco and alcohol.
>
> More sinister, there is nothing to stop those who smoke marijuana from graduating to hard core drugs.

There's nothing to stop people who use caffeine from graduating to hard core drugs too. Or plain water for that matter.

>
> I certainly don't want Singapore to become a haven for drugs... accompanied by all the society ills....gang wars, murders, prostitution, kids killed by drug overdose, kids turn into drug pushers, a huge population who will not get a job but choose to live on food stamps (welfare) ...like what is happening to the USA.

Blanket statement where no link has been established between the purported cause and claimed effect.

Do you support the criminalization of tobacco, alcohol, betel nut and caffeine too?

Cecil Chua

TheInquirer

12/7/2013 8:16:00 PM

0

On 12/8/2013 2:50 AM, aeh.chua@auckland.ac.nz wrote:
> On Saturday, December 7, 2013 9:39:09 AM UTC+13, baldeagle wrote:
>> Is it really harmless?
>
> I don't believe it is harmless, but neither is alcohol. It does cause certain physiological changes. I believe it is less harmful than alcohol. Also, what little science has been done (there is legal marijuana in the US, but it is hard to procure) has demonstrated various benefits, such as cancer fighting. So harm must be balanced against benefits.


Is it possible that they purposely made marijuana illegal, to that the
prices skyrocket, and so that drug gangs kill each other over it ...
as a form of population control?

;-) ;-) ;-)

If they made marijuana legal, then people get creative ... produce more
songs, poetry, ... etc ... that means more competitors in the music,
arts industry ... that drives down their profits?

;-P ;-P ;-P

auwe digidauw

12/7/2013 8:34:00 PM

0

TheInquirer <always@ask.questions> wrote in news:l7vvmo$pmn$1@dont-
email.me:

> Is it possible that they purposely made marijuana illegal, to that the
> prices skyrocket, and so that drug gangs kill each other over it ...
> as a form of population control?

see now you're presuming (masking it with question)

there are 2 types of question : 1) question question

and 2) masked question (directing question)

most of your questions are masked (directing) questions


you want people to answer according to your preference

you cant stand opposing answer

you play safe, you are not prepared for challenging responses

TheInquirer

12/7/2013 8:36:00 PM

0

On 12/8/2013 4:33 AM, auwe digidauw wrote:
> TheInquirer<always@ask.questions> wrote in news:l7vvmo$pmn$1@dont-
> email.me:
>
>> Is it possible that they purposely made marijuana illegal, to that the
>> prices skyrocket, and so that drug gangs kill each other over it ...
>> as a form of population control?
>
> see now you're presuming (masking it with question)

you are presuming that i am presuming.

the answer to the question can be
"yes, because ...."
or
"no, because ...."

Just answer the damn question, not the questioner!

Is it possible that they purposely made marijuana illegal, to that the
prices skyrocket, and so that drug gangs kill each other over it ...
as a form of population control?

--
Just answer the damn question, not the questioner! Don't
presume. My personal matters/beliefs are none of your
business. I ask, you answer. If you think I am stupid,
you have already proven that you are stupid, not me. If
you don't know the answer, can you please "pass" to other
people to answer? thanks.

auwe digidauw

12/7/2013 9:03:00 PM

0



I bet you cant take NO for an answer in the real life , can you ?

you are a dictator in a miniature form in your mind

TheInquirer

12/7/2013 9:17:00 PM

0

On 12/8/2013 5:02 AM, auwe digidauw wrote:
> I bet you cant take NO


Is it possible that they purposely made marijuana illegal, to that the
prices skyrocket, and so that drug gangs kill each other over it ...
as a form of population control?

yes, or no? why / why not?


Just answer the damn question, not the questioner! Don't
presume. My personal matters/beliefs are none of your
business. I ask, you answer. If you think I am stupid,
you have already proven that you are stupid, not me. If
you don't know the answer, can you please "pass" to other
people to answer? thanks.

auwe digidauw

12/7/2013 10:01:00 PM

0




I post the way I want it to.
who do you think you are ?

just skip my response if it doesnt comply
with your selfish requirements

you are a lil dictator yrself in your mind, huh ?

TheInquirer

12/7/2013 10:05:00 PM

0

On 12/8/2013 6:01 AM, auwe digidauw wrote:
>

please stick to the topic of marijuana.