These are sheme codes.I intend to put the first two values in a list.. Everytime I run the codes,I get some
(#<promise> . #<promise>)
..I am pretty sure of my codes bt nt so sure y am nt getting the intended results..I would be highly obliged to those who cn help me understand the stuff about #promise and how I cn achieve my results ..
Thanks in adv

(define (rec x) 
(if (null? x) 0 (cons (car x) (car(cdr x)))))


(rec '(1 2 3 4))

This should be a thread, not a code snippet. What Scheme interpreter are you running?

I am running Dr scheme version 4.2.2

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.