Cptypes: more types for conditions [WIP]#4538
Draft
gus-massa wants to merge 2 commits intoracket:masterfrom
Draft
Cptypes: more types for conditions [WIP]#4538gus-massa wants to merge 2 commits intoracket:masterfrom
gus-massa wants to merge 2 commits intoracket:masterfrom
Conversation
Use the rtd of conditions to create the type for cptypes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first commit is almost mergeable. I'm still finding a few more signatures of primitives that can be improved.
The idea is to mark the
conditionsas records in cptype. This allows a few reductions likeI don't expect many of them, but it's almost free because all the logic is already implemented for other types.
Edit: I'm assuming that in primdata.ss the
conditionandcondition-objectare equivalent, the only difference is in the test not in the actual types. And thatsyntax-violationis similar toi/o-filename-errorandirritants-conditionand other similarsomething-condition.The second commit causes an error, but I can't find the problem.
The idea is to use the
rtdof a condition to make apred-$record/rtdand use it as the type for all the conditions. This is a subtype of$recordso it would enable a few more reductions.I'm not sure why there is an error. Is it possible to use the
rtdof the code running the compiler and compare it to thertdof the objects in the compiled code? Or perhaps there is a wrong signature. Or perhaps there is a silly mistake somewhere.(If this is fixed, I'd like to add later a similar detailed type for
rtd, that are currently tracked only as a subtype ofrecords. A better tracking ofrtdwould be more useful than a better tracking ofconditions.)