Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

automata (scheme)

By: a guest on Oct 3rd, 2010  |  syntax: Scheme  |  size: 0.26 KB  |  views: 296  |  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. (define (v s)
  2.   ((if (eq? (first s) 'c)
  3.        (letrec ((init (accept 'c loop))
  4.                 (loop (accept 'a loop
  5.                               'd loop
  6.                               'r end))
  7.                 (end (accept 'r end)))
  8.          init)
  9.        (letrec ((see0 (accept '0 see1))
  10.                 (see1 (accept '1 see0)))
  11.          see0))
  12.    s))
clone this paste RAW Paste Data