Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)

Untitled

By: yeah568 on Jan 11th, 2014  |  syntax: Scheme  |  size: 0.33 KB  |  hits: 42  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ;; String -> Boolean
  2. ;; determines if string s begins with n
  3.  
  4. (check-expect (start-with-n? "no") true)
  5. (check-expect (start-with-n? "yes") false)
  6.  
  7. ;(define (start-with-n? s) "") ; this is the stub
  8.  
  9. ;(define (start-with-n? s) ; this is the template
  10. ;  (... s))
  11.  
  12. (define (start-with-n? s)
  13.   (string=? (substring s 0 1) "n"))