If you need to test your software on a different implementations I recommend Ikarus. (Though both chicken and gambit has good compilers too)

Statistics: Posted by sylwester — Fri Feb 06, 2015 5:07 pm

]]>

http://racket-lang.org/

Many other good Scheme implementations are able to run SICP code, but I think they require a bit more work to get started.

Here's a guide that uses MIT Scheme.

http://hackerretreat.com/why-how-start-sicp/

Statistics: Posted by nuntius — Mon Feb 02, 2015 3:11 pm

]]>

I am a novice going through the book SICP. When doing the exercises, I would like to easily switch between the MIT course materials, some relevant webpages and my code. Preferably, I would like to have a compiler such as Eclipse for Java, i.e. a program that highlights my code and at the same time compiles it (in a split screen). Is there anything comparable in regards of Lisp/Scheme? I am working on a Mac OS X 10.10 (Yosemite).

I have downloaded GNU Emacs from http://emacsformacosx.com/ however this seems to require much knowledge to get into a decent working flow. I hope you can finally get me started, I have struggled now for some time with that... If there is simply no such compiler could anyone tell me how to compile a file using terminal?

Thank you so much for your help.

P.S.: As of now, I have not found a decent tutorial on how to get started with Scheme. Did I miss anything?

Statistics: Posted by trefixxx — Mon Feb 02, 2015 8:11 am

]]>

Is my function gaining anything by calling the recursion last at the expense of function length?

Also is it inefficient to nest function definitions like that? Does the second function get redefined each time the outside function is called or does it get stored once when compiled?

- Code:
`;; Function by user "dsm" on stackoverflow`

(define get-n-items

(lambda (lst num)

(if (> num 0)

(cons (car lst) (get-n-items (cdr lst) (- num 1)))

'()))) ;'

;; Return first n number of items

(define (get-n-items num lst)

(define (loop lst num results)

(if (< num 1)

(reverse results)

(loop (cdr lst) (- num 1) (cons (car lst) results))))

(loop lst num '()))

Statistics: Posted by Pixel_Outlaw — Fri Jan 30, 2015 12:29 am

]]>

]]>

Yes, no sort yet.

I clearly have to learn to think different, more simply.

Statistics: Posted by Datagrace — Mon Jan 05, 2015 10:15 am

]]>

If not, than there is also a way. You can find out the minimum and the maximum, sum all up and subtract those extremes and divide by 3. No need for defining of variables.

The solution:

- Code:
`(define (f a b c d e)`

(/ (- (+ a b c d e)

(min a b c d e)

(max a b c d e))

3))

and its online preview.

Statistics: Posted by Goheeca — Mon Jan 05, 2015 7:26 am

]]>

This would normally not be a very challenging exercise in any environment where I am comfortable, but it's very early in the book. We have no logical branching yet, and no loop structure. Sub-routines have been hinted at, but not yet explained, and let() is the next section. All we have learned so far is mathematical operators (so we do have min and max), and function and variable definition.

Although later chapters provide exercise answers, there are none for this chapter. Any suggestions for how to proceed, but without loops, let(), or if() statements?

Thank you,

John Weinshel

Statistics: Posted by Datagrace — Thu Jan 01, 2015 11:31 am

]]>

]]>

- Code:
`(define (predecessor element tree)`

(cond

((null? tree) (node tree) ) ; If the tree is null result is the needed element

((> element (node tree)) (mem element (right-branch tree))); if the element is greater than node element, we search it in the right-branch tree

((< element (node tr)) (mem element (left-branch tree))) ; if element is lesser than node element, we search it in the left-branch tree

)

)

Statistics: Posted by Lulu — Sat Nov 22, 2014 1:43 pm

]]>