Singleton.k 437 B

1234567891011121314151617181920
  1. invoke {
  2. type A = singleton
  3. type B = singleton
  4. assert A is Type
  5. assert B is Type
  6. assert A is A
  7. assert B is B
  8. assert A is not B
  9. assert B is not A
  10. assert A <!=> B
  11. assert A !~ B
  12. assert Nil is Nil
  13. assert Void is Void
  14. assert NotFound is NotFound
  15. let h = {}
  16. assert h.key? ~~ Nil
  17. assert (invoke { do nothing }) ~~ Void
  18. assert ([1,2,3,4] -> find -> .{ .x == 5 }) ~~ NotFound
  19. }