racket / ChezScheme

Chez Scheme
Apache License 2.0
110 stars 8 forks source link

Some small improvements to cptypes #20

Closed gus-massa closed 4 years ago

gus-massa commented 4 years ago

After a reduction like (pair? (list <x> <y>)) => (begin (list <x> <y>) #t) make a semi-shallow reduction of the argument, so it is further reduced to (begin <x> <y> #t) and even remove <x> or <y> if they have no side effects.

They had a very strange signature, than needs a special case. So I did't include them in the last big update. Anyway, char-name needs some special types like maybe-symbol that are not currently understand by cptypes, so they are replaced by ptr or some more general type. It must be refined later.

Add some recursion with fuel, so simple? can detect the expansion of not, i.e. (not x) => (if x #f #t) and other easy cases. It detects only the low hanging cases, and it is not as complete as the versions in cp0.

mflatt commented 4 years ago

LGTM