scheme test

July 7th 2008 04:29 pm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(define (make-queue)
  (let ([front-ptr '()]
        [rear-ptr '()])
    (define (empty-queue?) (empty? front-ptr))
    (define (insert-queue! new)
      (if (empty-queue?)
          (begin
            (set-front-ptr! new)
            (set-rear-ptr! new))
          (begin
            (set-cdr rear-ptr new)
            (set-rear-ptr! new))))
    (define (dispatch m)
      (cond
        [(equal? m 'insert-queue!) insert-queue!]))
    dispatch))
1
2
3
4
5
public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

Posted by Jason under Uncategorized | No Comments »

Trackback URI | Comments RSS

Leave a Reply