~ubuntu-branches/ubuntu/saucy/ruby-erubis/saucy

« back to all changes in this revision

Viewing changes to test/data/users-guide/example_scheme.result

  • Committer: Package Import Robot
  • Author(s): Laurent Bigonville
  • Date: 2012-01-26 15:15:58 UTC
  • Revision ID: package-import@ubuntu.com-20120126151558-9u7mnf9ooqnw3bwz
Tags: upstream-2.7.0
ImportĀ upstreamĀ versionĀ 2.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$ erubis -l scheme example.escheme
 
2
(let ((_buf '())) (define (_add x) (set! _buf (cons x _buf))) (_add "<html>
 
3
 <body>\n")
 
4
 
 
5
(let ((user "Erubis")
 
6
      (items '("<aaa>" "b&b" "\"ccc\""))
 
7
      (i 0))
 
8
 
 
9
(_add "  <p>Hello ")(_add user)(_add "!</p>
 
10
  <table>\n")
 
11
 
 
12
  (for-each
 
13
   (lambda (item)
 
14
     (set! i (+ i 1))
 
15
 
 
16
(_add "   <tr bgcolor=\"")(_add (if (= (modulo i 2) 0) "#FFCCCC" "#CCCCFF"))(_add "\">
 
17
    <td>")(_add i)(_add "</td>
 
18
    <td>")(_add item)(_add "</td>
 
19
   </tr>\n")
 
20
 
 
21
   ) ; lambda end
 
22
   items) ; for-each end
 
23
 
 
24
(_add "  </table>\n")
 
25
 
 
26
) ; let end
 
27
 
 
28
(_add " </body>
 
29
</html>\n")
 
30
  (reverse _buf))