From ed1163370cd37f15d18e2b3d6cb6ecc13cd50243 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 9 Apr 2015 02:04:54 -0400 Subject: - Function names & parameters now take prefixes into account. - Added more cases for totality checking in pattern-matching. - Fixed a bug when type-checking function application that used the exo-type for both the function being applied as to the application itself. - Fixed a few minor bugs scattered around that had to do with wrong number of arguments being passed to functions. --- source/lux.lux | 78 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'source/lux.lux') diff --git a/source/lux.lux b/source/lux.lux index b1ff13c16..34d766b52 100644 --- a/source/lux.lux +++ b/source/lux.lux @@ -204,46 +204,46 @@ (#TupleT (#Cons [CompilerState (#Cons [SyntaxList #Nil])]))])])]))) -## ## Base functions & macros -## ## (def (_meta data) -## ## (All [a] (-> a (Meta Cursor a))) -## ## (#Meta [["" -1 -1] data])) -## (def' _meta -## (check' (#AllT [#Nil "" "a" -## (#LambdaT [(#BoundT "a") -## (#AppT [(#AppT [Meta Cursor]) -## (#BoundT "a")])])]) -## (lambda' _ data -## (#Meta [["" -1 -1] data])))) - -## ## (def' let' -## ## (check' Macro -## ## (lambda' _ tokens -## ## (lambda' _ state -## ## (case' tokens -## ## (#Cons [lhs (#Cons [rhs (#Cons [body #Nil])])]) -## ## (#Right [state -## ## (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "case'"])) -## ## (#Cons [rhs (#Cons [lhs (#Cons [body #Nil])])])]))) -## ## #Nil])]) - -## ## _ -## ## (#Left "Wrong syntax for let'")) -## ## )))) +## Base functions & macros +## (def (_meta data) +## (All [a] (-> a (Meta Cursor a))) +## (#Meta [["" -1 -1] data])) +(def' _meta + (check' (#AllT [#Nil "" "a" + (#LambdaT [(#BoundT "a") + (#AppT [(#AppT [Meta Cursor]) + (#BoundT "a")])])]) + (lambda' _ data + (#Meta [["" -1 -1] data])))) + ## (def' let' -## (lambda' _ tokens -## (lambda' _ state -## (case' tokens -## (#Cons [lhs (#Cons [rhs (#Cons [body #Nil])])]) -## (#Right [state -## (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "case'"])) -## (#Cons [rhs (#Cons [lhs (#Cons [body #Nil])])])]))) -## #Nil])]) - -## _ -## (#Left "Wrong syntax for let'")) -## ))) -## ## (declare-macro' let') +## (check' Macro +## (lambda' _ tokens +## (lambda' _ state +## (case' tokens +## (#Cons [lhs (#Cons [rhs (#Cons [body #Nil])])]) +## (#Right [state +## (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "case'"])) +## (#Cons [rhs (#Cons [lhs (#Cons [body #Nil])])])]))) +## #Nil])]) + +## _ +## (#Left "Wrong syntax for let'")) +## )))) +(def' let' + (lambda' _ tokens + (lambda' _ state + (case' tokens + (#Cons [lhs (#Cons [rhs (#Cons [body #Nil])])]) + (#Right [state + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "case'"])) + (#Cons [rhs (#Cons [lhs (#Cons [body #Nil])])])]))) + #Nil])]) + + _ + (#Left "Wrong syntax for let'")) + ))) +## (declare-macro' let') ## ## ## (All 21268 ## ## ## (-> 21268 -- cgit v1.2.3