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

automata (scheme)

By: a guest on Oct 3rd, 2010  |  syntax: Scheme  |  size: 0.26 KB  |  hits: 279  |  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))