Rework module system
Don't require/allow naming a module, instead require that the importer names it. Allow importing into the local scope with the name !Local. Simplify namespacing logic. Updates all tests to reflect these changes.
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
!module Equality
|
||||
|
||||
!import "lib/base.tri" Lib
|
||||
!import "lib/base.tri" !Local
|
||||
|
||||
main = lambdaEqualsTC
|
||||
|
||||
@ -28,7 +26,7 @@ not_Lambda? = demo_matchBool demo_false demo_true
|
||||
-- to different tree representations even if they share extensional behavior.
|
||||
|
||||
-- Let's see if these are the same:
|
||||
lambdaEqualsTC = Lib.equal? not_TC? not_Lambda?
|
||||
lambdaEqualsTC = equal? not_TC? not_Lambda?
|
||||
|
||||
-- Here are some checks to verify their extensional behavior is the same:
|
||||
true_TC? = not_TC? demo_false
|
||||
@ -37,5 +35,5 @@ false_TC? = not_TC? demo_true
|
||||
true_Lambda? = not_Lambda? demo_false
|
||||
false_Lambda? = not_Lambda? demo_true
|
||||
|
||||
bothTrueEqual? = Lib.equal? true_TC? true_Lambda?
|
||||
bothFalseEqual? = Lib.equal? false_TC? false_Lambda?
|
||||
bothTrueEqual? = equal? true_TC? true_Lambda?
|
||||
bothFalseEqual? = equal? false_TC? false_Lambda?
|
||||
|
Reference in New Issue
Block a user