~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to sigscheme/bench/bench-takl.scm

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2008-06-25 19:56:33 UTC
  • mfrom: (3.1.18 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080625195633-8jljph4rfq00l8o7
Tags: 1:1.5.1-2
* uim-tcode: provide tutcode-custom.scm, tutcode-bushudic.scm
  and tutcode-rule.scm (Closes: #482659)
* Fix FTBFS: segv during compile (Closes: #483078).
  I personally think this bug is not specific for uim but is a optimization
  problem on gcc-4.3.1. (https://bugs.freedesktop.org/show_bug.cgi?id=16477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(define (listn n)
 
2
  (if (not (= 0 n))
 
3
      (cons n (listn (- n 1)))
 
4
    '()))
 
5
 
 
6
(define l18 (listn 18))
 
7
(define l12 (listn 12))
 
8
(define  l6 (listn 6))
 
9
 
 
10
(define (mas x y z)
 
11
  (if (not (shorterp y x))
 
12
      z
 
13
      (mas (mas (cdr x)
 
14
                 y z)
 
15
            (mas (cdr y)
 
16
                 z x)
 
17
            (mas (cdr z)
 
18
                 x y))))
 
19
 
 
20
(define (shorterp x y)
 
21
  (and (not (null? y))
 
22
       (or (null? x)
 
23
           (shorterp (cdr x)
 
24
                     (cdr y)))))
 
25
 
 
26
;;; call: (mas l18 l12 l6)
 
27
 
 
28
(mas l18 l12 l6)
 
29