support ifix in pattern matching (draft)
This is based on this issue https://github.com/coalton-lang/coalton/issues/423.
This is just a draft but I was able to run the example that @eliaslfox provided in the issue.
for example:
CL-USER> (in-package :coalton-user)
#<COMMON-LISP:PACKAGE "COALTON-USER">
COALTON-USER> (coalton-toplevel
(declare f (IFix -> String))
(define (f x)
(match x
(5 "five")
(_ "not five"))))
; No value
COALTON-USER> (coalton (f 5))
"five"
Some things I am thinking about is if theres a better way to distinguish the positive fixnums from integers.
I am aware that by doing the length of the integer. but I am still thinking how to distinguish better.
(integer-length most-positive-fixnum)
(deftype bignum () `(and integer (not fixnum)))
Where do we need to take this PR? Any intent on completing it?
this will require a lot more work to get literals appropriately inferred/etc. in a more generic way
my bad. I was going to work on this until my other pr was done. but I havent had much time. But its ok if you closed this. thanks