December 30, 2009 5

String Calculator – Scheme

By Enrique Comba Riepenhausen in Katas, Software Craftsmanship

Next in the series ’same Kata, different language’ I wanted to post my very own Kata in Scheme.

Currently I am learning Scheme. Due to my lack of knowledge in Scheme I could not write the tests (nor code) for the negative numbers part of the string calculator. I would have loved to get there, but I was reading about exception handling in Scheme and could not get my head around it in a short time to make this Kata work.

I might post in the future a polished String Calculator Kata in Scheme adding this elements.

For now, I hope you like this Kata as much as I did recording it. Special thanks as always goes to Camtasia, without them I would not have recorded the Kata so easily.

Enjoy! And, as usual, feel free to comment. If you are inspired to do your own kata, please let me know; I’d love to work with you on it.

KataCast: StringCalculator in Scheme from Enrique Comba Riepenhausen on Vimeo.

Update!

I have added a git repository with the skeleton of the project in scheme in case you want to fork/clone it and try yourself http://github.com/ecomba/String-Calculator.

5 Responses to “String Calculator – Scheme”

  1. Eric says:

    Are you running the scheme interpreter with a Rake task here?

    • Hey Eric!

      Yes I run rake. Basically it makes it easier to run the tests while performing the kata.

      Here the Rakefile content:


      require 'rake'

      task :default => :test

      desc 'Run the tests for the project'
      task :test do
      sh %Q{mit-scheme --batch-mode
      --eval "(set! load/suppress-loading-message? #t)"
      --load test/all-tests.scm
      --eval "(%exit (run-registered-tests))"}
      end

      The all-tests.scm file looks like so:

      ; Testing template for running the tests (aka. suite)
      ;
      ; author: Enrique Comba Riepenhausen
      ; ecomba.github.com
      ;
      (load "lib/test-manager/load.scm")
      ;
      ; To test add the test classes below
      ;
      (load "test/string-calculator.scm")

  2. PotHix says:

    Æ!!

    The video quality is not so good. Is difficult to read. :(

    Cheers,

    PotHix

  3. Sorry for that PotHix!

    I had difficulties actually exporting it with camtasia to the right quality. I will try to export it again and see if I can get it to a better quality…

    Thanks a lot for the feedback though!

Leave a Reply