Round up of Little Schemer book club meeting seven?

Skip to first unread message

Joel Chippindale

May 21, 2014, 3:01:40 AM5/21/14

I was going to knock together a brief round up of meeting seven this morning but it doesn't look like you've pushed the commits we made to Github yet. Would you be able to push them?


Joel Chippindale

Jun 2, 2014, 2:14:25 AM6/2/14
7 of us met two weeks ago today for the 7th book club meeting and we made good progress.

We started by discussing whether we wanted to push on into Chapter 4 and implement numbers for our interpreter or to refactor some of the existing code and in particular List#evaluate which looked like it was becoming increasingly complex. This time we decided that refactoring was overdue and started work on this first and then moved on to Chapter 4.

@tomstuart drove the laptop and projector and together did some refactoring first

* We removed support for evaluating lists that start with lists ( because this was not required by the book and supporting it was introducing extra complexity.

* We added a comment to the 'else' in the case statement in List#evaluate ( because we regularly need to explain to one another how this worked.

* We added the quote, lambda, cond, and or keywords to the environment ( and enabled us to replace the case statement in List#evaluate with our environment hash look up.

This highlighted the fact that our interpreter allows you to redefine these keywords whereas many scheme interpreters appear to have a separate spaces for variables and keywords i.e. in chicken scheme [1]

    #;1> (or (quote a) (quote b))
    #;2> (define or (quote my-or))
    #;3> or
    #;4> (or (quote a) (quote b))

This made some of us feel uncomfortable about this implementation. The Little Schemer book does not suggest one approach or another and we didn't come to agreement on the reason why this might be the case in many scheme interpreters (i.e. is it just an implementation detail or specific language design and if so why).

Note: although we didn't try this out in the meeting, mit-scheme [2] works like our interpreter does in the sense that if you can redefine a keyword [3].

* We made Atom#== and List#== tolerant of other classes (

* Which enabled us to make 'else' only have special meaning within a 'cond' rather than everywhere (

* We added the primitives car, cdr, cons, null?, atom? and eq? to the environment ( to match our implementation of keywords.

This made our primitives much more explicit.

There was some discussion of how much this refactoring of List#evaluate (both putting keywords and primitives in the environment) had reduced complexity vs. just moving complexity about in the system.

* We renamed one of our #evaluate methods to #apply to make it clearer that they were different (

Then on to chapter 4

* We started by adding the rspec examples for chapter 4 that @tomstuart had prepared earlier (

* Then after some(!) discussion of whether -3 constituted a number given the ambiguity in the Little Schemer book (it appears to be possible to read the book as saying it will not cover negative/non integer numbers or as saying that only non-negative integers are considered numbers) we agreed to delay the decision by pending and then skipping these specs ( and

* We refactored Atom to ensure that its symbol was always a symbol (

* We refactored to consolidate implementations of number? (

* We updated 'sub1' so that it would fail rather than return a negative number (

These meeting notes are a little later than usual and have just made it out in time for our next meeting which is tonight. See you there,


Reply all
Reply to author
0 new messages