ctor.zy 313 B

123456789101112131415
  1. // types should act as constructors AND as type-variables
  2. (struct truck [(field name:string)])
  3. (def t (truck name:"harley"))
  4. (def pty (* truck))
  5. // check that base type ctors work too.
  6. (def n (int 7))
  7. (assert (== n 7))
  8. (def s (string "hi"))
  9. (assert (== s "hi"))
  10. (assert (== "" (string)))
  11. (assert (== 0 (int)))