- top.ss
  - commented out compile-failure tests for now
- cce-notes.txt
  - added my preliminary notes about the Honu codebase
- examples/*-test.ss
  - added *-test.ss files for all *.honu files

svn: r943
This commit is contained in:
Carl Eastlund 2005-09-29 16:14:54 +00:00
parent a31d901061
commit 365754f55c
12 changed files with 96 additions and 2 deletions

View File

@ -0,0 +1,25 @@
doc.txt: implementation notes
tool.ss: definition of language level
compile.ss: top-level compilation functions
util.ss: general functions (similar to list.ss)
tenv.ss: definition of type environment
- don't understand all the types defined
tenv-utils.ss: manipulate environments
base.ss: top-level honu definitions
ast.ss: ast structs
private/typechecker/type-utils.ss: simple type operations
------------------------------------------------------------
Mixins: new form NYI
------------------------------------------------------------
3 phases:
- parser tools (-> AST)
- post-parsing
- static references to "my" references (my.x for static fields, etc.)
- references to "this" only in member access (this.x) or in casts ((IFace)this)
- adds casts to this.x
- simplify-ast : gather asts/sequences into big lets/sequences

View File

@ -0,0 +1,8 @@
(define EO (new EvenOddC%))
(list (interface? EvenOdd<%>)
(class? EvenOddC%)
(send EO EvenOdd<%>-even 4)
(not (send EO EvenOdd<%>-even 5))
(send EO EvenOdd<%>-odd 7)
(not (send EO EvenOdd<%>-odd 6)))

View File

@ -0,0 +1,19 @@
(define MT (new MTList%))
(define (Cons first rest) (new ConsList% [car first] [cdr rest]))
(define l0 MT)
(define l1 (Cons 0 l0))
(define l2 (Cons 1 l1))
(define l3 (Cons 2 l2))
(list (interface? List<%>)
(class? MTList%)
(class? ConsList%)
(send l0 List<%>-empty '())
(not (send l1 List<%>-empty '()))
(not (send l2 List<%>-empty '()))
(not (send l3 List<%>-empty '()))
(equal? (send l0 List<%>-length '()) 0)
(equal? (send l1 List<%>-length '()) 1)
(equal? (send l2 List<%>-length '()) 2)
(equal? (send l3 List<%>-length '()) 3))

View File

@ -0,0 +1,7 @@
(list (interface? T<%>)
(class? Y%)
(= (main 5) 120)
(= ((fix (lambda (f)
(lambda (n)
(if (zero? n) 0 (+ n (f (- n 1))))))) 5)
15))

View File

@ -0,0 +1 @@
(list (= x 3) (= y 4))

View File

@ -0,0 +1 @@
(list (= x 2))

View File

@ -0,0 +1,4 @@
(list (even 4)
(not (even 5))
(not (odd 4))
(odd 5))

View File

@ -0,0 +1,19 @@
(define (testfact fact)
(list (= (fact 1) 1)
(= (fact 2) 2)
(= (fact 3) 6)
(= (fact 4) 24)
(= (fact 5) 120)))
(define (testfib fib)
(list (= (fib 0) 0)
(= (fib 2) 1)
(= (fib 4) 3)
(= (fib 6) 8)))
(append (testfact fact)
(testfact fact2)
(testfact impfact)
(testfact (lambda (n) (cadr (fibfact n))))
(testfib fib)
(testfib (lambda (n) (car (fibfact n)))))

View File

@ -0,0 +1,3 @@
(append (map interface? (list Color<%> Posn<%> ColorPosn<%>))
(map class? (list PosnC% ColorC% ColorPosnC%))
(map mixin? (list $ColorPosnC-mixin)))

View File

@ -0,0 +1,5 @@
(list (interface? T<%>)
(class? C%)
(equal? (f 'dummy) '(dummy dummy))
(= (send (new C%) T<%>-x-get '()) 3)
(= (send (new C%) T<%>-y-get '()) 3))

View File

@ -0,0 +1 @@
(map interface? (list t1<%> t2<%> t3<%>))

View File

@ -112,9 +112,10 @@
"examples/point.honu"
"examples/struct.honu"
"examples/tup-bind.honu"
"examples/types-error.honu"
; "examples/types-error.honu"
"examples/types.honu"
"examples/nonexistent.honu"))
; "examples/nonexistent.honu"
))
(define (program-syntax file)
(let* ([port (open-input-file file)])