SlideShare a Scribd company logo
1 of 67
DocOnDev




   An Introduction to
Functional Programming
      with Scheme
           Michael Norton

     michael@docondev.com : mail
     docondev.blogspot.com/ : blog
 twitter.com/DocOnDev : the twitters

                                       CodeMash 2.0.1.0
DocOnDev




SICP Study
  Gamma Group




                CodeMash 2.0.1.0
DocOnDev




        Yes!




Gamma Group Week 1
               CodeMash 2.0.1.0
DocOnDev




   umm...




Gamma Group Week 3
               CodeMash 2.0.1.0
DocOnDev




     Hello?




Gamma Group Week 5
               CodeMash 2.0.1.0
DocOnDev




                        Maths are
                          hard
Second order nonlinear ordinary differential equation




                   Third Order Nonlinear Partial Differential Equation




                                                                         CodeMash 2.0.1.0
DocOnDev




         SICP
I don’t recommend this text to
           start with




                                 CodeMash 2.0.1.0
DocOnDev




Texts I do recommend




                  CodeMash 2.0.1.0
DocOnDev




Functional Programming
                    CodeMash 2.0.1.0
DocOnDev




Consists Entirely of Functions



                         CodeMash 2.0.1.0
DocOnDev




Consists Entirely of Functions
        Higher-order Functions




                                 CodeMash 2.0.1.0
DocOnDev




Favors Immutability



                      CodeMash 2.0.1.0
DocOnDev




Referentially Transparent



                       CodeMash 2.0.1.0
DocOnDev




Limited Loop Structures



                     CodeMash 2.0.1.0
DocOnDev




Functional Programming

• Consists Entirely of Functions
• Favors Immutability
• Referentially Transparent
• Limited Loop Structures

                                   CodeMash 2.0.1.0
DocOnDev




LISP
       CodeMash 2.0.1.0
DocOnDev




Symbolic Expressions



                   CodeMash 2.0.1.0
DocOnDev




Dynamically Typed



                    CodeMash 2.0.1.0
DocOnDev




List Processing
   LISt Processing




                     CodeMash 2.0.1.0
DocOnDev




                 Lisp

• Symbolic Expressions
• Dynamically Typed
• List Processing

                         CodeMash 2.0.1.0
DocOnDev




Scheme
         CodeMash 2.0.1.0
DocOnDev




Static (Lexical) Scope



                     CodeMash 2.0.1.0
DocOnDev




          Static Scope
 (define x 9)
(define (show-x) (display x))
(define test (lambda (x)
              (show-x)
              (display ‘,)(display x))

(test 3) => 9,3


                                   CodeMash 2.0.1.0
DocOnDev




Tail Recursion



                 CodeMash 2.0.1.0
DocOnDev




         Tail Recursion
(define (factorial n)
  (define (fact-tail n m)
    (if (= n 0) m
        (fact-tail (- n 1) (* n m))))
  (fact-tail n 1))

(factorial 4) => 24


                                   CodeMash 2.0.1.0
DocOnDev




Shared Namespace



                   CodeMash 2.0.1.0
DocOnDev




            Scheme

• Static Scope
• Tail Recursion
• Shared Namespace

                     CodeMash 2.0.1.0
DocOnDev




String Calculator Kata
                    CodeMash 2.0.1.0
DocOnDev




          Requirements

Takes a String of integers and returns their sum
Can handle an unknown amount of integers
Can handle a custom delimiter
Delimiter notation “//[delimiter]n[numbers]”



                                          CodeMash 2.0.1.0
DocOnDev




                     First Test
string-calculator-tests.ss
#lang scheme
(require (planet schematics/schemeunit:3)
          (planet schematics/schemeunit:3/text-ui)
          "string-calculator.ss")


(check-equal? (str-calc "") 0
                "Empty string should return 0")




                                                  CodeMash 2.0.1.0
DocOnDev




                      FAIL!


. expand: unbound identifier in module in: str-calc




                                                CodeMash 2.0.1.0
DocOnDev




    String Calculator Code
string-calculator.ss
#lang scheme
;; String Calculator Kata
(define (str-calc input) 0)


;; Expose these functions
(provide str-calc)




                              CodeMash 2.0.1.0
DocOnDev




     PASS!


#t




             CodeMash 2.0.1.0
DocOnDev




                 Second Test

string-calculator-tests.ss
#lang scheme
(require ... "string-calculator.ss")


(check-equal? (str-calc "") 0 "Should return 0")
(check-equal? (str-calc "1") 1 "Should return 1")




                                             CodeMash 2.0.1.0
DocOnDev




                           FAIL!
#t
--------------------
FAILURE
name:       check-equal?
location:   (#<path:/string-calculator-tests.ss> 11 0 219 63)
expression: (check-equal? (str-calc "1") 1)
params:     (0 1)
message:    "Should return 1"
actual:     0
expected:   1
--------------------



                                                    CodeMash 2.0.1.0
DocOnDev




    String Calculator Code
string-calculator.ss
#lang scheme
(define (str-calc input)
  (cond
    ((= (string-length input) 0) 0)
    (else (string->number input))))


(provide str-calc)




                                      CodeMash 2.0.1.0
DocOnDev




     PASS!

#t
#t




             CodeMash 2.0.1.0
DocOnDev




                    Third Test
string-calculator-tests.ss
#lang scheme
(require ... "string-calculator.ss")


(check-equal? (str-calc "") 0 "Should return 0")
(check-equal? (str-calc "1") 1 "Should return 1")
(check-equal? (str-calc "1,2") 3 "Should sum items")




                                             CodeMash 2.0.1.0
DocOnDev




                           FAIL!
#t
#t
--------------------
FAILURE
name:       check-equal?
location:   (#<path:/string-calculator-tests.ss> 10 0 241 52)
expression: (check-equal? (str-calc "1,2") 3)
params:     (#f 3)
message:    "Should sum items"
actual:     #f
expected:   3
--------------------



                                                         CodeMash 2.0.1.0
DocOnDev




    String Calculator Code
string-calculator.ss
(define (str-calc input)
  (cond ((list? input)
          (cond ((null? input) 0)
                 (else (+ (string->number (car input))
                          (str-calc (cdr input))))))
         ((= (string-length input) 0) 0)
         (else (str-calc (str-split input #,)))))



                                               CodeMash 2.0.1.0
DocOnDev




     PASS!

#t
#t
#t




             CodeMash 2.0.1.0
DocOnDev




          Requirements

Takes a String of integers and returns their sum
Can handle an unknown amount of integers
Can handle a custom delimiter
Delimiter notation “//[delimiter]n[numbers]”



                                          CodeMash 2.0.1.0
DocOnDev




                  Fourth Test
string-calculator-tests.ss
#lang scheme
(require ... "string-calculator.ss")


(check-equal? (str-calc "") 0 "Should return 0")
(check-equal? (str-calc "1") 1 "Should return 1")
(check-equal? (str-calc "1,2") 3 "Should sum items")
(check-equal? (str-calc "1,2,3,4") 10 "Should sum all items")




                                                       CodeMash 2.0.1.0
DocOnDev




     PASS!

#t
#t
#t
#t




             CodeMash 2.0.1.0
DocOnDev




          Requirements

Takes a String of integers and returns their sum
Can handle an unknown amount of integers
Can handle a custom delimiter
Delimiter notation “//[delimiter]n[numbers]”



                                          CodeMash 2.0.1.0
DocOnDev




                     Fifth Test
string-calculator-tests.ss
#lang scheme
(require ... "string-calculator.ss")


(check-equal? (str-calc "") 0 "Should return 0")
(check-equal? (str-calc "1") 1 "Should return 1")
(check-equal? (str-calc "1,2") 3 "Should sum items")
(check-equal? (str-calc "1,2,3,4") 10 "Should sum all items")
(check-equal? (str-calc "1*2" #*) 3
               "Should delimit on custom")



                                                       CodeMash 2.0.1.0
DocOnDev




                        FAIL!


. procedure str-calc: expects 1 argument, given 2: "1*2" #*




                                                   CodeMash 2.0.1.0
DocOnDev




    String Calculator Code
string-calculator.ss
(define (str-calc input [delim #,])
  (cond ((list? input)
          (cond ((null? input) 0)
                 (else (+ (string->number (car input))
                          (str-calc (cdr input))))))
         ((= (string-length input) 0) 0)
         (else (str-calc (str-split input delim)))))



                                               CodeMash 2.0.1.0
DocOnDev




     PASS!
#t
#t
#t
#t
#t




             CodeMash 2.0.1.0
DocOnDev




                    Sixth Test
string-calculator-tests.ss
(require ... "string-calculator.ss")
(check-equal? (str-calc "") 0 "Should return 0")
(check-equal? (str-calc "1") 1 "Should return 1")
(check-equal? (str-calc "1,2") 3 "Should sum items")
(check-equal? (str-calc "1,2,3,4") 10 "Should sum all items")
(check-equal? (str-calc "1*2" #*) 3
              "Should delimit on custom")
(check-equal? (str-calc "1*2*3*4" #*) 10
              "Should delimit on custom")



                                                       CodeMash 2.0.1.0
DocOnDev




     PASS!
#t
#t
#t
#t
#t
#t



             CodeMash 2.0.1.0
DocOnDev




          Requirements

Takes a String of integers and returns their sum
Can handle an unknown amount of integers
Can handle a custom delimiter
Delimiter notation “//[delimiter]n[numbers]”



                                          CodeMash 2.0.1.0
DocOnDev




                Change Tests
string-calculator-tests.ss
(require ... "string-calculator.ss")
(check-equal? (str-calc "") 0 "Should return 0")
(check-equal? (str-calc "1") 1 "Should return 1")
(check-equal? (str-calc "1,2") 3 "Should sum items")
(check-equal? (str-calc "1,2,3,4") 10 "Should sum all items")
(check-equal? (str-calc "//*n1*2") 3
              "Should delimit on custom")
(check-equal? (str-calc "//*n1*2*3*4") 10
              "Should delimit on custom")



                                                       CodeMash 2.0.1.0
DocOnDev




    String Calculator Code
string-calculator.ss
(define (str-calc input)
  (cond ((list? input)
          (cond ((null? input) 0)
                 (else (+ (string->number (car input))
                          (str-calc (cdr input))))))
         ((= (string-length input) 0) 0)
         (else (str-calc (str-split
                (rm-delim input) (get-delim input)))))



                                               CodeMash 2.0.1.0
DocOnDev




            Delimiter Parser
delim-parse.ss
(define (rm-delim input) (cadr (split-delim input)))


(define (get-delim input) (car (split-delim input)))


(define (split-delim input)
    (cond ((and (> (string-length input) 2)
                 (string=? (substring input 0 2) "//"))
         (regexp-split #rx"n" (substring input 2)))
        (else (cons "," (list input)))))



                                                       CodeMash 2.0.1.0
DocOnDev




             Delimiter Tests
delim-parse-tests.ss
(require (planet schematics/schemeunit:3)
         (planet schematics/schemeunit:3/text-ui)
         "delimiter-parse.ss")


(check-equal? (get-delim   "1") #, "Default delimiter")
(check-equal? (remove-delim "2,1") "2,1" "String")
(check-equal? (get-delim   "//*n2*1") #* "Delimiter")
(check-equal? (remove-delim "//*n2*1") "2*1" "-Delimiter")




                                                     CodeMash 2.0.1.0
DocOnDev




     PASS!
#t
#t
#t
#t
#t
#t



             CodeMash 2.0.1.0
DocOnDev




          Requirements

Takes a String of integers and returns their sum
Can handle an unknown amount of integers
Can handle a custom delimiter
Delimiter notation “//[delimiter]n[numbers]”



                                          CodeMash 2.0.1.0
DocOnDev




            Ruby - Mario Aquino
  module Calculator
 def self.calculate(expression)
   raise ArgumentError, 'Must be a string' unless expression.is_a? String
   raise ArgumentError, 'Must be numeric' unless expression =~ pattern

   value = nil
   expression.scan(pattern) do |left, operator, right|
     value ||= left
     value = eval(value + operator + right).to_s
   end
   value
 end

  private
  def self.pattern
    /(d+)s?([+-*/])s*(?=(d+))/
  end
end




                                                                            CodeMash 2.0.1.0
DocOnDev




    Python - Gary Bernhardt
def add(string):
    string = _normalize_delimiters(string)
    if string:
        return _add_numbers_in_string(string)
    else:
        return 0

def _normalize_delimiters(string):
    string = _normalize_custom_delimiter(string)
    string = string.replace('n', ',')
    return string

def _normalize_custom_delimiter(string):
    if string.startswith('//'):
        delimiter_spec, string = string.split('n', 1)
        delimiter = delimiter_spec[2:]
        string = string.replace(delimiter, ',')
    return string

def _add_numbers_in_string(string):
    numbers = map(int, string.split(','))
    _validate_numbers(numbers)
    return sum(numbers)

def _validate_numbers(numbers):
    if any(number < 0 for number in numbers):
        raise ValueError




                                                         CodeMash 2.0.1.0
DocOnDev




                   F# - Mark Needham
      module FSharpCalculator
    open System
    open System.Text.RegularExpressions
 
    let split (delimeter:array<string>) (value:string) = value.Split (delimeter, StringSplitOptions.None)
    let toDecimal value = Decimal.Parse value
 
    let (|CustomDelimeter|NoCustomDelimeter|) (value:string) =
        let delimeters (value:string) = Regex.Matches(value, "[([^]]*)]") |> Seq.cast |>
                                        Seq.map (fun (x:Match) -> x.Groups) |>
                                        Seq.map (fun x -> x |> Seq.cast<Group> |> Seq.nth 1) |>
                                        Seq.map (fun x -> x.Value) |>
                                        Seq.to_array
 
        if (value.Length > 2 && "//".Equals(value.Substring(0, 2))) then
            if ("[".Equals(value.Substring(2,1))) then CustomDelimeter(delimeters value)
            else CustomDelimeter([| value.Substring(2, value.IndexOf("n") - 2) |])
        else NoCustomDelimeter(",")
 
    let digits value = match value with
                       | CustomDelimeter(delimeters) -> value.Substring(value.IndexOf("n")) |> split delimeters |> Array.map toDecimal
                       | NoCustomDelimeter(delimeter) -> value.Replace("n", delimeter) |> split [|delimeter |] |> Array.map toDecimal
 
    let buildExceptionMessage negatives =
        sprintf "No negative numbers allowed. You provided %s" (String.Join(",", negatives |> Array.map (fun x -> x.ToString())))
 
    let (|ContainsNegatives|NoNegatives|) digits =
        if (digits |> Array.exists (fun x -> x < 0.0m))
        then ContainsNegatives(digits |> Array.filter (fun x -> x < 0.0m))
        else NoNegatives(digits)
 
    let add value = if ("".Equals(value) or "n".Equals(value)) then 0.0m
                    else match digits value |> Array.filter (fun x -> x < 1000m) with
                         | ContainsNegatives(negatives) -> raise (ArgumentException (buildExceptionMessage negatives))
                         | NoNegatives(digits)          -> digits |> Array.sum




                                                                                                                                CodeMash 2.0.1.0
DocOnDev




                        C# - Anonymous
      using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace TDDFun
{
    public class StringCalculator
    {
         public double Add(string numbers)
         {
             Double sum = 0;
             if (string.IsNullOrEmpty(numbers))
             {
                 sum = 0;
             }
             else
             {
                  const string regex1 = “(//)”;
                  const string regex2 = “(.*?)”;
                  const string regex3 = “(n)”;
                  const string regex4 = “(.*?d)”;

                var delimiters = new List<string>();
                var r = new Regex(regex1 + regex2 + regex3 + regex4, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                Match m = r.Match(numbers);
                if (m.Success)
                {
                    string delimiterCollection = m.Groups[2].ToString();
                    int numberStartIndex = m.Groups[3].Index;
                    const string re5 = “([.*?])”;
                    var r2 = new Regex(re5, RegexOptions.IgnoreCase | RegexOptions.Singleline);




                                                                                                          CodeMash 2.0.1.0
DocOnDev




C# - Anonymous (cont.)
                  MatchCollection m2 = r2.Matches(delimiterCollection);
                  if (m2.Count > 0)
                  {
                       foreach (Match x in m2)
                      {
                           delimiters.Add(x.ToString().Replace(“[", "").Replace("]“, “”));
                      }
                  }
                  else
                  {
                      delimiters.Add(delimiterCollection);
                  }
                  numbers = numbers.Remove(0, numberStartIndex + 1);
            }
            else
            {
                delimiters.Add(“n”);
                delimiters.Add(“,”);
            }

       string[] splittedNumbers = numbers.Split(delimiters.ToArray(), StringSplitOptions.None);
       ValiateNumbers(splittedNumbers);

       foreach (string s in splittedNumbers)
       {
           double ss = Double.Parse(s);
           sum += ss <= 1000 ? ss : 0;
       }
    }
    return sum;
}




                                                                                                  CodeMash 2.0.1.0
DocOnDev




C# - Anonymous (cont.)
    private static void ValiateNumbers(IEnumerable<string> numbers)
    {
        double x;
        var negativeNumbers = new List<string>();
        foreach (string s in numbers)
        {
            Validator.IsRequiredField(Double.TryParse(s, out x), “Validation Error”);
            if (Double.Parse(s) < 0)
            {
                negativeNumbers.Add(s);
            }
        }
        Validator.IsRequiredField(negativeNumbers.Count <= 0,
                                  “Negatives not allowed “ + ShowAllNegatives(negativeNumbers));
    }

private static string ShowAllNegatives(List<string> negativeNumbers)
{
    var sb = new StringBuilder();
    int counter = 0;
    negativeNumbers.ForEach(k =>
                                 {
                                    if (counter == 0)
                                    {
                                        sb.Append(k);
                                        counter++;
                                    }
                                    else
                                    {
                                        sb.Append(“;” + k);
                                    }




                                                                                                   CodeMash 2.0.1.0
DocOnDev




        C# - Anonymous (cont.)
                                            });

            return sb.ToString();
        }
    }

    public static class Validator
    {
        public static void IsRequiredField(bool criteria, string message)
        {
            if (!criteria)
            {
                throw new ValidationException(message);
            }
        }
    }

    public class ValidationException : ApplicationException
    {
        public ValidationException(string message) : base(message)
        {
        }
    }
}




                                                                            CodeMash 2.0.1.0
DocOnDev




        Thank You!
          Michael Norton

    michael@docondev.com : mail
    docondev.blogspot.com/ : blog
twitter.com/DocOnDev : the twitters

                                      CodeMash 2.0.1.0
DocOnDev




                   References
•   Wikipedia
       http://en.wikipedia.org/wiki/Scheme

•   PLT Scheme
       http://plt-scheme.org/

•   MIT Press SICP
       http://mitpress.mit.edu/sicp/

•   MIT Press HTDP
       http://www.htdp.org/

•   U of CA, Berkley
       http://www.cs.berkeley.edu/~bh/ss-toc2.html




                                                     CodeMash 2.0.1.0

More Related Content

What's hot

Heroku Postgres SQL Tips, Tricks, Hacks
Heroku Postgres SQL Tips, Tricks, HacksHeroku Postgres SQL Tips, Tricks, Hacks
Heroku Postgres SQL Tips, Tricks, HacksSalesforce Developers
 
HexRaysCodeXplorer: object oriented RE for fun and profit
HexRaysCodeXplorer: object oriented RE for fun and profitHexRaysCodeXplorer: object oriented RE for fun and profit
HexRaysCodeXplorer: object oriented RE for fun and profitAlex Matrosov
 
HexRaysCodeXplorer: make object-oriented RE easier
HexRaysCodeXplorer: make object-oriented RE easierHexRaysCodeXplorer: make object-oriented RE easier
HexRaysCodeXplorer: make object-oriented RE easierAlex Matrosov
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingLuciano Mammino
 
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL TechnologyLeveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL TechnologyDATAVERSITY
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Agora Group
 
Using QString effectively
Using QString effectivelyUsing QString effectively
Using QString effectivelyRoman Okolovich
 
Let'swift "Concurrency in swift"
Let'swift "Concurrency in swift"Let'swift "Concurrency in swift"
Let'swift "Concurrency in swift"Hyuk Hur
 
Java with a Clojure mindset
Java with a Clojure mindsetJava with a Clojure mindset
Java with a Clojure mindsetDaniel Lebrero
 
Non-blocking synchronization — what is it and why we (don't?) need it
Non-blocking synchronization — what is it and why we (don't?) need itNon-blocking synchronization — what is it and why we (don't?) need it
Non-blocking synchronization — what is it and why we (don't?) need itAlexey Fyodorov
 
Big Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureBig Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureDr. Christian Betz
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivoFabio Kung
 
LatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode FundamentalsLatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode Fundamentalsdenis Udod
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrencyAlex Navis
 

What's hot (20)

Heroku Postgres SQL Tips, Tricks, Hacks
Heroku Postgres SQL Tips, Tricks, HacksHeroku Postgres SQL Tips, Tricks, Hacks
Heroku Postgres SQL Tips, Tricks, Hacks
 
HexRaysCodeXplorer: object oriented RE for fun and profit
HexRaysCodeXplorer: object oriented RE for fun and profitHexRaysCodeXplorer: object oriented RE for fun and profit
HexRaysCodeXplorer: object oriented RE for fun and profit
 
HexRaysCodeXplorer: make object-oriented RE easier
HexRaysCodeXplorer: make object-oriented RE easierHexRaysCodeXplorer: make object-oriented RE easier
HexRaysCodeXplorer: make object-oriented RE easier
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
 
02 basics
02 basics02 basics
02 basics
 
Java mcq
Java mcqJava mcq
Java mcq
 
5 - OOP - Smalltalk in a Nutshell (a)
5 - OOP - Smalltalk in a Nutshell (a)5 - OOP - Smalltalk in a Nutshell (a)
5 - OOP - Smalltalk in a Nutshell (a)
 
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL TechnologyLeveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
 
Parm
ParmParm
Parm
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
Introduction to Linq
Introduction to LinqIntroduction to Linq
Introduction to Linq
 
Using QString effectively
Using QString effectivelyUsing QString effectively
Using QString effectively
 
Let'swift "Concurrency in swift"
Let'swift "Concurrency in swift"Let'swift "Concurrency in swift"
Let'swift "Concurrency in swift"
 
Java with a Clojure mindset
Java with a Clojure mindsetJava with a Clojure mindset
Java with a Clojure mindset
 
Non-blocking synchronization — what is it and why we (don't?) need it
Non-blocking synchronization — what is it and why we (don't?) need itNon-blocking synchronization — what is it and why we (don't?) need it
Non-blocking synchronization — what is it and why we (don't?) need it
 
Stop that!
Stop that!Stop that!
Stop that!
 
Big Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureBig Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and Clojure
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivo
 
LatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode FundamentalsLatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode Fundamentals
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrency
 

Viewers also liked

FRSAD Functional Requirements for Subject Authority Data model
FRSAD Functional Requirements for Subject Authority Data modelFRSAD Functional Requirements for Subject Authority Data model
FRSAD Functional Requirements for Subject Authority Data modelMarcia Zeng
 
PALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYM
PALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYMPALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYM
PALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYMPraveen Kapur
 
The club house usha woods
The club house   usha woodsThe club house   usha woods
The club house usha woodsuinfra
 
Iconic Clubhouse
Iconic ClubhouseIconic Clubhouse
Iconic ClubhouseTaralb14
 
Moments in statistics
Moments in statisticsMoments in statistics
Moments in statistics515329748
 
Skewness & Kurtosis
Skewness & KurtosisSkewness & Kurtosis
Skewness & KurtosisNavin Bafna
 
Land Use, Zoning & Entitlement in Real Estate Development
Land Use, Zoning & Entitlement in Real Estate DevelopmentLand Use, Zoning & Entitlement in Real Estate Development
Land Use, Zoning & Entitlement in Real Estate DevelopmentPloutus Advisors
 
Data and functional modeling
Data and functional modelingData and functional modeling
Data and functional modelingSlideshare
 
Club House Designs by IDEA CENTRE ARCHITECTS
Club House Designs by IDEA CENTRE ARCHITECTSClub House Designs by IDEA CENTRE ARCHITECTS
Club House Designs by IDEA CENTRE ARCHITECTSsupratikrath
 

Viewers also liked (10)

FRSAD Functional Requirements for Subject Authority Data model
FRSAD Functional Requirements for Subject Authority Data modelFRSAD Functional Requirements for Subject Authority Data model
FRSAD Functional Requirements for Subject Authority Data model
 
PALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYM
PALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYMPALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYM
PALM SPRINGS RESIDENCES & RESORTS - CLUB HOUSE WITH SWIMMING POOL & GYM
 
The club house usha woods
The club house   usha woodsThe club house   usha woods
The club house usha woods
 
Iconic Clubhouse
Iconic ClubhouseIconic Clubhouse
Iconic Clubhouse
 
Clubhouse
ClubhouseClubhouse
Clubhouse
 
Moments in statistics
Moments in statisticsMoments in statistics
Moments in statistics
 
Skewness & Kurtosis
Skewness & KurtosisSkewness & Kurtosis
Skewness & Kurtosis
 
Land Use, Zoning & Entitlement in Real Estate Development
Land Use, Zoning & Entitlement in Real Estate DevelopmentLand Use, Zoning & Entitlement in Real Estate Development
Land Use, Zoning & Entitlement in Real Estate Development
 
Data and functional modeling
Data and functional modelingData and functional modeling
Data and functional modeling
 
Club House Designs by IDEA CENTRE ARCHITECTS
Club House Designs by IDEA CENTRE ARCHITECTSClub House Designs by IDEA CENTRE ARCHITECTS
Club House Designs by IDEA CENTRE ARCHITECTS
 

Similar to Introduction to Functional Programming with Scheme

Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConqeTimeline, LLC
 
OpenCog Developer Workshop
OpenCog Developer WorkshopOpenCog Developer Workshop
OpenCog Developer WorkshopIbby Benali
 
Zero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for youZero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for youAndrey Karpov
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live HackingTobias Trelle
 
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun..."ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...Julia Cherniak
 
FPGA design with CλaSH
FPGA design with CλaSHFPGA design with CλaSH
FPGA design with CλaSHConrad Parker
 
Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5SAP Concur
 
Automatically Defined Functions for Learning Classifier Systems
Automatically Defined Functions for Learning Classifier SystemsAutomatically Defined Functions for Learning Classifier Systems
Automatically Defined Functions for Learning Classifier SystemsDaniele Loiacono
 
Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02Spy Seat
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.Mike Brevoort
 
Class 26: Objectifying Objects
Class 26: Objectifying ObjectsClass 26: Objectifying Objects
Class 26: Objectifying ObjectsDavid Evans
 
What is the ServiceStack?
What is the ServiceStack?What is the ServiceStack?
What is the ServiceStack?Demis Bellot
 
Code Contracts In .Net
Code Contracts In .NetCode Contracts In .Net
Code Contracts In .NetBruce Johnson
 
BarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformationsBarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformationswalkmod
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Shehrevar Davierwala
 
Measuring maintainability; software metrics explained
Measuring maintainability; software metrics explainedMeasuring maintainability; software metrics explained
Measuring maintainability; software metrics explainedDennis de Greef
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerAndrey Karpov
 
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2Antonios Giannopoulos
 

Similar to Introduction to Functional Programming with Scheme (20)

Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConq
 
OpenCog Developer Workshop
OpenCog Developer WorkshopOpenCog Developer Workshop
OpenCog Developer Workshop
 
Zero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for youZero, one, two, Freddy's coming for you
Zero, one, two, Freddy's coming for you
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live Hacking
 
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun..."ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
 
FPGA design with CλaSH
FPGA design with CλaSHFPGA design with CλaSH
FPGA design with CλaSH
 
Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5
 
Automatically Defined Functions for Learning Classifier Systems
Automatically Defined Functions for Learning Classifier SystemsAutomatically Defined Functions for Learning Classifier Systems
Automatically Defined Functions for Learning Classifier Systems
 
Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
 
Class 26: Objectifying Objects
Class 26: Objectifying ObjectsClass 26: Objectifying Objects
Class 26: Objectifying Objects
 
What is the ServiceStack?
What is the ServiceStack?What is the ServiceStack?
What is the ServiceStack?
 
Code Contracts In .Net
Code Contracts In .NetCode Contracts In .Net
Code Contracts In .Net
 
BarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformationsBarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformations
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086
 
Measuring maintainability; software metrics explained
Measuring maintainability; software metrics explainedMeasuring maintainability; software metrics explained
Measuring maintainability; software metrics explained
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzer
 
Short Introduction To "perl -d"
Short Introduction To "perl -d"Short Introduction To "perl -d"
Short Introduction To "perl -d"
 
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
 
Getting Input from User
Getting Input from UserGetting Input from User
Getting Input from User
 

More from Doc Norton

Tuckman Was Wrong
Tuckman Was WrongTuckman Was Wrong
Tuckman Was WrongDoc Norton
 
A Practical Guide to Cynefin
A Practical Guide to CynefinA Practical Guide to Cynefin
A Practical Guide to CynefinDoc Norton
 
Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016Doc Norton
 
Codemash pre-compiler - Collaborative Decision Making
Codemash pre-compiler - Collaborative Decision MakingCodemash pre-compiler - Collaborative Decision Making
Codemash pre-compiler - Collaborative Decision MakingDoc Norton
 
Experimentation Mindset
Experimentation MindsetExperimentation Mindset
Experimentation MindsetDoc Norton
 
The Technical Debt Trap
The Technical Debt TrapThe Technical Debt Trap
The Technical Debt TrapDoc Norton
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileDoc Norton
 
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps CultureAutonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps CultureDoc Norton
 
Creative Collaboration: Tools for Teams
Creative Collaboration: Tools for TeamsCreative Collaboration: Tools for Teams
Creative Collaboration: Tools for TeamsDoc Norton
 
Experimentation mindset
Experimentation mindsetExperimentation mindset
Experimentation mindsetDoc Norton
 
The Technical Debt Trap - NDC Oslo 2014
The Technical Debt Trap - NDC Oslo 2014The Technical Debt Trap - NDC Oslo 2014
The Technical Debt Trap - NDC Oslo 2014Doc Norton
 
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014Doc Norton
 
Let's Start An Epidemic
Let's Start An EpidemicLet's Start An Epidemic
Let's Start An EpidemicDoc Norton
 
Teamwork Ain't Easy - RailsConf 2014
Teamwork Ain't Easy - RailsConf 2014Teamwork Ain't Easy - RailsConf 2014
Teamwork Ain't Easy - RailsConf 2014Doc Norton
 
Creating a Global Engineering Culture - Agile india 2014
Creating a Global Engineering Culture - Agile india 2014Creating a Global Engineering Culture - Agile india 2014
Creating a Global Engineering Culture - Agile india 2014Doc Norton
 
Doc That Conference Keynote
Doc That Conference KeynoteDoc That Conference Keynote
Doc That Conference KeynoteDoc Norton
 
Agile Metrics: Velocity is NOT the Goal - Agile 2013 version
Agile Metrics: Velocity is NOT the Goal - Agile 2013 versionAgile Metrics: Velocity is NOT the Goal - Agile 2013 version
Agile Metrics: Velocity is NOT the Goal - Agile 2013 versionDoc Norton
 
Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013
Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013
Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013Doc Norton
 
Velocity is not the goal code palo-usa
Velocity is not the goal   code palo-usaVelocity is not the goal   code palo-usa
Velocity is not the goal code palo-usaDoc Norton
 
Teamwork Ain't Easy
Teamwork Ain't EasyTeamwork Ain't Easy
Teamwork Ain't EasyDoc Norton
 

More from Doc Norton (20)

Tuckman Was Wrong
Tuckman Was WrongTuckman Was Wrong
Tuckman Was Wrong
 
A Practical Guide to Cynefin
A Practical Guide to CynefinA Practical Guide to Cynefin
A Practical Guide to Cynefin
 
Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016Building Blocks of a Knowledge Work Culture - NDC London 2016
Building Blocks of a Knowledge Work Culture - NDC London 2016
 
Codemash pre-compiler - Collaborative Decision Making
Codemash pre-compiler - Collaborative Decision MakingCodemash pre-compiler - Collaborative Decision Making
Codemash pre-compiler - Collaborative Decision Making
 
Experimentation Mindset
Experimentation MindsetExperimentation Mindset
Experimentation Mindset
 
The Technical Debt Trap
The Technical Debt TrapThe Technical Debt Trap
The Technical Debt Trap
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to Agile
 
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps CultureAutonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
 
Creative Collaboration: Tools for Teams
Creative Collaboration: Tools for TeamsCreative Collaboration: Tools for Teams
Creative Collaboration: Tools for Teams
 
Experimentation mindset
Experimentation mindsetExperimentation mindset
Experimentation mindset
 
The Technical Debt Trap - NDC Oslo 2014
The Technical Debt Trap - NDC Oslo 2014The Technical Debt Trap - NDC Oslo 2014
The Technical Debt Trap - NDC Oslo 2014
 
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
Agile Metrics : Velocity is NOT the Goal - NDC Oslo 2014
 
Let's Start An Epidemic
Let's Start An EpidemicLet's Start An Epidemic
Let's Start An Epidemic
 
Teamwork Ain't Easy - RailsConf 2014
Teamwork Ain't Easy - RailsConf 2014Teamwork Ain't Easy - RailsConf 2014
Teamwork Ain't Easy - RailsConf 2014
 
Creating a Global Engineering Culture - Agile india 2014
Creating a Global Engineering Culture - Agile india 2014Creating a Global Engineering Culture - Agile india 2014
Creating a Global Engineering Culture - Agile india 2014
 
Doc That Conference Keynote
Doc That Conference KeynoteDoc That Conference Keynote
Doc That Conference Keynote
 
Agile Metrics: Velocity is NOT the Goal - Agile 2013 version
Agile Metrics: Velocity is NOT the Goal - Agile 2013 versionAgile Metrics: Velocity is NOT the Goal - Agile 2013 version
Agile Metrics: Velocity is NOT the Goal - Agile 2013 version
 
Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013
Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013
Agile Metrics; Velocity is NOT the Goal - ScrumGathering 2013
 
Velocity is not the goal code palo-usa
Velocity is not the goal   code palo-usaVelocity is not the goal   code palo-usa
Velocity is not the goal code palo-usa
 
Teamwork Ain't Easy
Teamwork Ain't EasyTeamwork Ain't Easy
Teamwork Ain't Easy
 

Recently uploaded

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Introduction to Functional Programming with Scheme

  • 1. DocOnDev An Introduction to Functional Programming with Scheme Michael Norton michael@docondev.com : mail docondev.blogspot.com/ : blog twitter.com/DocOnDev : the twitters CodeMash 2.0.1.0
  • 2. DocOnDev SICP Study Gamma Group CodeMash 2.0.1.0
  • 3. DocOnDev Yes! Gamma Group Week 1 CodeMash 2.0.1.0
  • 4. DocOnDev umm... Gamma Group Week 3 CodeMash 2.0.1.0
  • 5. DocOnDev Hello? Gamma Group Week 5 CodeMash 2.0.1.0
  • 6. DocOnDev Maths are hard Second order nonlinear ordinary differential equation Third Order Nonlinear Partial Differential Equation CodeMash 2.0.1.0
  • 7. DocOnDev SICP I don’t recommend this text to start with CodeMash 2.0.1.0
  • 8. DocOnDev Texts I do recommend CodeMash 2.0.1.0
  • 10. DocOnDev Consists Entirely of Functions CodeMash 2.0.1.0
  • 11. DocOnDev Consists Entirely of Functions Higher-order Functions CodeMash 2.0.1.0
  • 12. DocOnDev Favors Immutability CodeMash 2.0.1.0
  • 15. DocOnDev Functional Programming • Consists Entirely of Functions • Favors Immutability • Referentially Transparent • Limited Loop Structures CodeMash 2.0.1.0
  • 16. DocOnDev LISP CodeMash 2.0.1.0
  • 17. DocOnDev Symbolic Expressions CodeMash 2.0.1.0
  • 18. DocOnDev Dynamically Typed CodeMash 2.0.1.0
  • 19. DocOnDev List Processing LISt Processing CodeMash 2.0.1.0
  • 20. DocOnDev Lisp • Symbolic Expressions • Dynamically Typed • List Processing CodeMash 2.0.1.0
  • 21. DocOnDev Scheme CodeMash 2.0.1.0
  • 23. DocOnDev Static Scope (define x 9) (define (show-x) (display x)) (define test (lambda (x) (show-x) (display ‘,)(display x)) (test 3) => 9,3 CodeMash 2.0.1.0
  • 24. DocOnDev Tail Recursion CodeMash 2.0.1.0
  • 25. DocOnDev Tail Recursion (define (factorial n) (define (fact-tail n m) (if (= n 0) m (fact-tail (- n 1) (* n m)))) (fact-tail n 1)) (factorial 4) => 24 CodeMash 2.0.1.0
  • 26. DocOnDev Shared Namespace CodeMash 2.0.1.0
  • 27. DocOnDev Scheme • Static Scope • Tail Recursion • Shared Namespace CodeMash 2.0.1.0
  • 29. DocOnDev Requirements Takes a String of integers and returns their sum Can handle an unknown amount of integers Can handle a custom delimiter Delimiter notation “//[delimiter]n[numbers]” CodeMash 2.0.1.0
  • 30. DocOnDev First Test string-calculator-tests.ss #lang scheme (require (planet schematics/schemeunit:3) (planet schematics/schemeunit:3/text-ui) "string-calculator.ss") (check-equal? (str-calc "") 0 "Empty string should return 0") CodeMash 2.0.1.0
  • 31. DocOnDev FAIL! . expand: unbound identifier in module in: str-calc CodeMash 2.0.1.0
  • 32. DocOnDev String Calculator Code string-calculator.ss #lang scheme ;; String Calculator Kata (define (str-calc input) 0) ;; Expose these functions (provide str-calc) CodeMash 2.0.1.0
  • 33. DocOnDev PASS! #t CodeMash 2.0.1.0
  • 34. DocOnDev Second Test string-calculator-tests.ss #lang scheme (require ... "string-calculator.ss") (check-equal? (str-calc "") 0 "Should return 0") (check-equal? (str-calc "1") 1 "Should return 1") CodeMash 2.0.1.0
  • 35. DocOnDev FAIL! #t -------------------- FAILURE name: check-equal? location: (#<path:/string-calculator-tests.ss> 11 0 219 63) expression: (check-equal? (str-calc "1") 1) params: (0 1) message: "Should return 1" actual: 0 expected: 1 -------------------- CodeMash 2.0.1.0
  • 36. DocOnDev String Calculator Code string-calculator.ss #lang scheme (define (str-calc input) (cond ((= (string-length input) 0) 0) (else (string->number input)))) (provide str-calc) CodeMash 2.0.1.0
  • 37. DocOnDev PASS! #t #t CodeMash 2.0.1.0
  • 38. DocOnDev Third Test string-calculator-tests.ss #lang scheme (require ... "string-calculator.ss") (check-equal? (str-calc "") 0 "Should return 0") (check-equal? (str-calc "1") 1 "Should return 1") (check-equal? (str-calc "1,2") 3 "Should sum items") CodeMash 2.0.1.0
  • 39. DocOnDev FAIL! #t #t -------------------- FAILURE name: check-equal? location: (#<path:/string-calculator-tests.ss> 10 0 241 52) expression: (check-equal? (str-calc "1,2") 3) params: (#f 3) message: "Should sum items" actual: #f expected: 3 -------------------- CodeMash 2.0.1.0
  • 40. DocOnDev String Calculator Code string-calculator.ss (define (str-calc input) (cond ((list? input) (cond ((null? input) 0) (else (+ (string->number (car input)) (str-calc (cdr input)))))) ((= (string-length input) 0) 0) (else (str-calc (str-split input #,))))) CodeMash 2.0.1.0
  • 41. DocOnDev PASS! #t #t #t CodeMash 2.0.1.0
  • 42. DocOnDev Requirements Takes a String of integers and returns their sum Can handle an unknown amount of integers Can handle a custom delimiter Delimiter notation “//[delimiter]n[numbers]” CodeMash 2.0.1.0
  • 43. DocOnDev Fourth Test string-calculator-tests.ss #lang scheme (require ... "string-calculator.ss") (check-equal? (str-calc "") 0 "Should return 0") (check-equal? (str-calc "1") 1 "Should return 1") (check-equal? (str-calc "1,2") 3 "Should sum items") (check-equal? (str-calc "1,2,3,4") 10 "Should sum all items") CodeMash 2.0.1.0
  • 44. DocOnDev PASS! #t #t #t #t CodeMash 2.0.1.0
  • 45. DocOnDev Requirements Takes a String of integers and returns their sum Can handle an unknown amount of integers Can handle a custom delimiter Delimiter notation “//[delimiter]n[numbers]” CodeMash 2.0.1.0
  • 46. DocOnDev Fifth Test string-calculator-tests.ss #lang scheme (require ... "string-calculator.ss") (check-equal? (str-calc "") 0 "Should return 0") (check-equal? (str-calc "1") 1 "Should return 1") (check-equal? (str-calc "1,2") 3 "Should sum items") (check-equal? (str-calc "1,2,3,4") 10 "Should sum all items") (check-equal? (str-calc "1*2" #*) 3 "Should delimit on custom") CodeMash 2.0.1.0
  • 47. DocOnDev FAIL! . procedure str-calc: expects 1 argument, given 2: "1*2" #* CodeMash 2.0.1.0
  • 48. DocOnDev String Calculator Code string-calculator.ss (define (str-calc input [delim #,]) (cond ((list? input) (cond ((null? input) 0) (else (+ (string->number (car input)) (str-calc (cdr input)))))) ((= (string-length input) 0) 0) (else (str-calc (str-split input delim))))) CodeMash 2.0.1.0
  • 49. DocOnDev PASS! #t #t #t #t #t CodeMash 2.0.1.0
  • 50. DocOnDev Sixth Test string-calculator-tests.ss (require ... "string-calculator.ss") (check-equal? (str-calc "") 0 "Should return 0") (check-equal? (str-calc "1") 1 "Should return 1") (check-equal? (str-calc "1,2") 3 "Should sum items") (check-equal? (str-calc "1,2,3,4") 10 "Should sum all items") (check-equal? (str-calc "1*2" #*) 3 "Should delimit on custom") (check-equal? (str-calc "1*2*3*4" #*) 10 "Should delimit on custom") CodeMash 2.0.1.0
  • 51. DocOnDev PASS! #t #t #t #t #t #t CodeMash 2.0.1.0
  • 52. DocOnDev Requirements Takes a String of integers and returns their sum Can handle an unknown amount of integers Can handle a custom delimiter Delimiter notation “//[delimiter]n[numbers]” CodeMash 2.0.1.0
  • 53. DocOnDev Change Tests string-calculator-tests.ss (require ... "string-calculator.ss") (check-equal? (str-calc "") 0 "Should return 0") (check-equal? (str-calc "1") 1 "Should return 1") (check-equal? (str-calc "1,2") 3 "Should sum items") (check-equal? (str-calc "1,2,3,4") 10 "Should sum all items") (check-equal? (str-calc "//*n1*2") 3 "Should delimit on custom") (check-equal? (str-calc "//*n1*2*3*4") 10 "Should delimit on custom") CodeMash 2.0.1.0
  • 54. DocOnDev String Calculator Code string-calculator.ss (define (str-calc input) (cond ((list? input) (cond ((null? input) 0) (else (+ (string->number (car input)) (str-calc (cdr input)))))) ((= (string-length input) 0) 0) (else (str-calc (str-split (rm-delim input) (get-delim input))))) CodeMash 2.0.1.0
  • 55. DocOnDev Delimiter Parser delim-parse.ss (define (rm-delim input) (cadr (split-delim input))) (define (get-delim input) (car (split-delim input))) (define (split-delim input) (cond ((and (> (string-length input) 2) (string=? (substring input 0 2) "//")) (regexp-split #rx"n" (substring input 2))) (else (cons "," (list input))))) CodeMash 2.0.1.0
  • 56. DocOnDev Delimiter Tests delim-parse-tests.ss (require (planet schematics/schemeunit:3) (planet schematics/schemeunit:3/text-ui) "delimiter-parse.ss") (check-equal? (get-delim "1") #, "Default delimiter") (check-equal? (remove-delim "2,1") "2,1" "String") (check-equal? (get-delim "//*n2*1") #* "Delimiter") (check-equal? (remove-delim "//*n2*1") "2*1" "-Delimiter") CodeMash 2.0.1.0
  • 57. DocOnDev PASS! #t #t #t #t #t #t CodeMash 2.0.1.0
  • 58. DocOnDev Requirements Takes a String of integers and returns their sum Can handle an unknown amount of integers Can handle a custom delimiter Delimiter notation “//[delimiter]n[numbers]” CodeMash 2.0.1.0
  • 59. DocOnDev Ruby - Mario Aquino module Calculator def self.calculate(expression) raise ArgumentError, 'Must be a string' unless expression.is_a? String raise ArgumentError, 'Must be numeric' unless expression =~ pattern value = nil expression.scan(pattern) do |left, operator, right| value ||= left value = eval(value + operator + right).to_s end value end private def self.pattern /(d+)s?([+-*/])s*(?=(d+))/ end end CodeMash 2.0.1.0
  • 60. DocOnDev Python - Gary Bernhardt def add(string): string = _normalize_delimiters(string) if string: return _add_numbers_in_string(string) else: return 0 def _normalize_delimiters(string): string = _normalize_custom_delimiter(string) string = string.replace('n', ',') return string def _normalize_custom_delimiter(string): if string.startswith('//'): delimiter_spec, string = string.split('n', 1) delimiter = delimiter_spec[2:] string = string.replace(delimiter, ',') return string def _add_numbers_in_string(string): numbers = map(int, string.split(',')) _validate_numbers(numbers) return sum(numbers) def _validate_numbers(numbers): if any(number < 0 for number in numbers): raise ValueError CodeMash 2.0.1.0
  • 61. DocOnDev F# - Mark Needham module FSharpCalculator open System open System.Text.RegularExpressions   let split (delimeter:array<string>) (value:string) = value.Split (delimeter, StringSplitOptions.None) let toDecimal value = Decimal.Parse value   let (|CustomDelimeter|NoCustomDelimeter|) (value:string) = let delimeters (value:string) = Regex.Matches(value, "[([^]]*)]") |> Seq.cast |> Seq.map (fun (x:Match) -> x.Groups) |> Seq.map (fun x -> x |> Seq.cast<Group> |> Seq.nth 1) |> Seq.map (fun x -> x.Value) |> Seq.to_array   if (value.Length > 2 && "//".Equals(value.Substring(0, 2))) then if ("[".Equals(value.Substring(2,1))) then CustomDelimeter(delimeters value) else CustomDelimeter([| value.Substring(2, value.IndexOf("n") - 2) |]) else NoCustomDelimeter(",")   let digits value = match value with | CustomDelimeter(delimeters) -> value.Substring(value.IndexOf("n")) |> split delimeters |> Array.map toDecimal | NoCustomDelimeter(delimeter) -> value.Replace("n", delimeter) |> split [|delimeter |] |> Array.map toDecimal   let buildExceptionMessage negatives = sprintf "No negative numbers allowed. You provided %s" (String.Join(",", negatives |> Array.map (fun x -> x.ToString())))   let (|ContainsNegatives|NoNegatives|) digits = if (digits |> Array.exists (fun x -> x < 0.0m)) then ContainsNegatives(digits |> Array.filter (fun x -> x < 0.0m)) else NoNegatives(digits)   let add value = if ("".Equals(value) or "n".Equals(value)) then 0.0m else match digits value |> Array.filter (fun x -> x < 1000m) with | ContainsNegatives(negatives) -> raise (ArgumentException (buildExceptionMessage negatives)) | NoNegatives(digits) -> digits |> Array.sum CodeMash 2.0.1.0
  • 62. DocOnDev C# - Anonymous using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace TDDFun { public class StringCalculator { public double Add(string numbers) { Double sum = 0; if (string.IsNullOrEmpty(numbers)) { sum = 0; } else { const string regex1 = “(//)”; const string regex2 = “(.*?)”; const string regex3 = “(n)”; const string regex4 = “(.*?d)”; var delimiters = new List<string>(); var r = new Regex(regex1 + regex2 + regex3 + regex4, RegexOptions.IgnoreCase | RegexOptions.Singleline); Match m = r.Match(numbers); if (m.Success) { string delimiterCollection = m.Groups[2].ToString(); int numberStartIndex = m.Groups[3].Index; const string re5 = “([.*?])”; var r2 = new Regex(re5, RegexOptions.IgnoreCase | RegexOptions.Singleline); CodeMash 2.0.1.0
  • 63. DocOnDev C# - Anonymous (cont.) MatchCollection m2 = r2.Matches(delimiterCollection); if (m2.Count > 0) { foreach (Match x in m2) { delimiters.Add(x.ToString().Replace(“[", "").Replace("]“, “”)); } } else { delimiters.Add(delimiterCollection); } numbers = numbers.Remove(0, numberStartIndex + 1); } else { delimiters.Add(“n”); delimiters.Add(“,”); } string[] splittedNumbers = numbers.Split(delimiters.ToArray(), StringSplitOptions.None); ValiateNumbers(splittedNumbers); foreach (string s in splittedNumbers) { double ss = Double.Parse(s); sum += ss <= 1000 ? ss : 0; } } return sum; } CodeMash 2.0.1.0
  • 64. DocOnDev C# - Anonymous (cont.) private static void ValiateNumbers(IEnumerable<string> numbers) { double x; var negativeNumbers = new List<string>(); foreach (string s in numbers) { Validator.IsRequiredField(Double.TryParse(s, out x), “Validation Error”); if (Double.Parse(s) < 0) { negativeNumbers.Add(s); } } Validator.IsRequiredField(negativeNumbers.Count <= 0, “Negatives not allowed “ + ShowAllNegatives(negativeNumbers)); } private static string ShowAllNegatives(List<string> negativeNumbers) { var sb = new StringBuilder(); int counter = 0; negativeNumbers.ForEach(k => { if (counter == 0) { sb.Append(k); counter++; } else { sb.Append(“;” + k); } CodeMash 2.0.1.0
  • 65. DocOnDev C# - Anonymous (cont.) }); return sb.ToString(); } } public static class Validator { public static void IsRequiredField(bool criteria, string message) { if (!criteria) { throw new ValidationException(message); } } } public class ValidationException : ApplicationException { public ValidationException(string message) : base(message) { } } } CodeMash 2.0.1.0
  • 66. DocOnDev Thank You! Michael Norton michael@docondev.com : mail docondev.blogspot.com/ : blog twitter.com/DocOnDev : the twitters CodeMash 2.0.1.0
  • 67. DocOnDev References • Wikipedia http://en.wikipedia.org/wiki/Scheme • PLT Scheme http://plt-scheme.org/ • MIT Press SICP http://mitpress.mit.edu/sicp/ • MIT Press HTDP http://www.htdp.org/ • U of CA, Berkley http://www.cs.berkeley.edu/~bh/ss-toc2.html CodeMash 2.0.1.0

Editor's Notes

  1. Michael Norton - DocOnDev ThoughtWorks for 6 months - currently out of Chicago Office LeanDog out of Cleveland before that Years of Corporate Living Hell before that; Director/CTO in legal, banking, manufacturing Primary Language (for the moment) is Java, some delivery in Ruby, Scheme for fun I am uniquely qualified to give this presentation based on two criteria; I wrote it and I have the microphone
  2. SICP Study Groups - twitter conversation -&gt; Jim Weirich, Dave Hoover, others; Software Craftsmanship North America; August 2009 Filled up fast; I started the Gamma Group Who has started this book? Who has completed this book?
  3. Had to put a cap on the size of the group Capped at 15; ended up with 18 Week one - we were all excited and ready to go; did our reading. Introduction - read first section of first chapter; Jim Weirich did a kick-off phone call. Week two - Introduced to atoms and pairs. Reading. Exercises were primarily discussion-based.
  4. Fairly significant drop-off rate Week 3 - Iterative versus Recursive; reading; actual problem sets Week 4 - Pairs, car, cdr, anonymous functions (lambda), linear geometry
  5. Group size leveled out at about, well... 3 Week 5/6; lists, recursion over lists, trees, dotted-tail notation Week 7; sets; union, append, add, subtract, compare, etc.
  6. Week 8 was all about differential equations and derivatives I got lost in the math; 20+ years since I studied calculus There were no more than two of us on the weekly phone calls and I was falling way behind the other two guys. Alpha and Beta merged into a single group of about 5 active people; Gamma continues with the two remaining
  7. May be great for some. I found it relatively unapproachable. Even simple problems were presented in a difficult to consume manner. Given the tremendous dropout rate, I suspect many others felt as I did.
  8. I found these texts to be more approachable Little / Seasoned / Reasoned almost too approachable. Can be considered condescending. 50 pages into Little Schemer, I understood the Scheme list structures and their processing. 50 pages into SICP, I had atoms, pairs, and a nagging sense of self-doubt.
  9. Main Program is a function which receives input and provides output Main program is defined in terms of other functions, which are defined in terms of other functions, and so on. At the lowest level, functions are language primitives Functions are first class
  10. Which means it supports Higher-order functions What are higher order functions? Functions which take functions as parameters and functions that return functions
  11. There are no assignment statements; variables are immutable - purely functional A function call takes input and calculates a result; altering no state in the environment As a result, there are no (or at least considerably fewer) side-effects Technically a purely functional application is impossible; with no side-effects, there is no means of providing input or receiving output. If it did exist, nobody would ever know.
  12. A call to a function can be replaced with its value without changing the application behavior
  13. Recursion is a primary control structure for iteration Some functional languages allow no other loop structure In Scheme, recursion is idiomatic, but there are do and for constructs
  14. Symbolic Expression - convention representing semi-structured data in human-readable form a.k.a - s-expressions Originally intended for data only. M-expressions were supposed to be for methods. Formalization came too late and use of s-expressions was idiomatic for data and methods
  15. Type checking at run-time Perl, JavaScript, Ruby, Python, Objective-C
  16. Computer representation of a mathematical finite sequence or tuple We&amp;#x2019;re all familiar with this concept; List Objects, Arrays, Linked Lists Functional Languages favor immutability Static list structures - only allows inspection and enumeration
  17. Static Scope - variable always refers to its top-level environment Bindings are able to be understood in isolation; no concern about context of invocation
  18. Static Scope - variable always refers to its top-level environment Bindings are able to be understood in isolation; no concern about context of invocation
  19. Idiomatic to Scheme Scheme does have a do construct, but tail recursion is preferred Last call of function (tail call) is a recursive call - easily transformed to iterations Optimization of stack space allowing for deeper (infinite?) recursion Improves efficiency for complex calls
  20. Idiomatic to Scheme Scheme does have a do construct, but tail recursion is preferred Last call of function (tail call) is a recursive call - easily transformed to iterations Optimization of stack space allowing for deeper (infinite?) recursion Improves efficiency for complex calls
  21. Common Lisp has different namespaces for functions and data Common Lisp allows function and variable to have the same name - requires special notation to refer to a function as a value Scheme data and procedures can be bound and manipulated by same primitives Scheme does support creation/installation of namespaces; out of scope for presentation
  22. What is a Kata? Relatively simple problem domains; repeat them over and over again, learning and improving as you go Relatively simple Kata put together by Roy Osherove
  23. This is a simple description of the requirements There are additional requirements to fail for negatives, improve error messages, exclude numbers greater than a given size, allow multiple delimiters, allow complex delimiters
  24. schemeunit is a unit testing framework for Scheme. I am running it in DrScheme, available in the PLT Scheme sight. All made available in the &amp;#x201C;show notes&amp;#x201D; Provides capability for test suites. Will show simple tests.
  25. This is exactly what we expected! Let&amp;#x2019;s make it pass.
  26. schemeunit is a unit testing framework for Scheme. I am running it in DrScheme, available in the PLT Scheme sight. All made available in the &amp;#x201C;show notes&amp;#x201D; Provides capability for test suites. Will show simple tests.
  27. Yahoo!
  28. Abbreviated header Added a second test - String with single number should return number
  29. Again; expected. Let&amp;#x2019;s make it pass.
  30. cond =&gt; scheme conditional Like a case or switch statement where the else is our otherwise string-length? =&gt; scheme function returns boolean string-&gt;number =&gt; scheme function
  31. Yahoo!
  32. Abbreviated header Added a second test - String with single number should return number
  33. Again; expected. Let&amp;#x2019;s make it pass.
  34. cond =&gt; scheme conditional Like a case or switch statement where the else is our otherwise string-length? =&gt; scheme function returns boolean string-&gt;number =&gt; scheme function
  35. Yahoo!
  36. This is a simple description of the requirements There are additional requirements to fail for negatives, improve error messages, exclude numbers greater than a given size, allow multiple delimiters, allow complex delimiters
  37. Let&amp;#x2019;s see if it can do strings with more numbers What do you think?
  38. Got one for free - I don&amp;#x2019;t necessarily like when that happens
  39. This is a simple description of the requirements There are additional requirements to fail for negatives, improve error messages, exclude numbers greater than a given size, allow multiple delimiters, allow complex delimiters
  40. Now we&amp;#x2019;ve added the Custom Delimiter
  41. This is exactly what we expected! Let&amp;#x2019;s make it pass.
  42. We&amp;#x2019;ve added a parameter to the str-calc function, but this paramater is optional. When not provided, it defaults to a comma as indicated Hash-Whack Notation - escape sequence
  43. So now we have custom delimiter
  44. Now we&amp;#x2019;ve added the Custom Delimiter
  45. So now we have custom delimiter
  46. Ok - now we have to handle the custom delimiter as a prefix to the string as opposed to as a separate parameter.
  47. Now we&amp;#x2019;ve added the Custom Delimiter as a prefix I&amp;#x2019;m going to ask you to take a leap of faith with me in the interest of time.
  48. We&amp;#x2019;ve added a parameter to the str-calc function, but this paramater is optional. When not provided, it defaults to a comma as indicated Hash-Whack Notation - escape sequence
  49. Delimiter parser was also written as part of this kata Test drove it just as we did all the other code.
  50. I told you....
  51. Yahoo!!
  52. All set.
  53. All set.
  54. All set.
  55. All set.
  56. All set.
  57. All set.
  58. All set.
  59. All set.
  60. Michael Norton - DocOnDev ThoughtWorks for 6 months - currently out of Chicago Office LeanDog out of Cleveland before that Years of Corporate Living Hell before that; Director/CTO in legal, banking, manufacturing Primary Language (for the moment) is Java, some delivery in Ruby, Scheme for fun I am uniquely qualified to give this presentation based on two criteria; I wrote it and I have the microphone