Help understanding Scheme's syntax, procedures and calls

Peter Hickman peter at semantico.com
Thu Aug 12 07:41:44 EDT 2004


Unfortunately it looks more like 'broken scheme'.

Fran wrote:
> (define (this n)
> 	(if (=n 0)
> 	         0
> 	          (= n (this (- n 1)))))

That looks fine, however:

> (define (f1 a b)
> 	(if >b a)
> 	       0
> 	       (+ b (f1 a (+ b 1)))))

Has 6 (s and 7 )s. I expect that the seconds line should read
	(if (> b a)

> (define (that n)
> (f1 n1)

Again there is an imbalance in the ( and ), I think the second line should read 
(f1 n 1)), note the space between then 'n' and the '1'.

Is this someone's homework by any chance?



More information about the Python-list mailing list