Conversation
|
I like that this cleans up the overwritten It does seem annoying to introduce yet another layer as a new primitive. One possibility is to go back to just using |
|
I missed that there is another copy in "prims.ss". I'll take another look. In particular |
|
I considered that maybe The worst that goes wrong with a bad |
|
Sorry for the delay, I was super busy. Now I'm digging so deep that I'm worry to find the Balrog. In particular I just found this related corner case: The problem is clear in the code once you notice it, so I'll fix it. But I'll need a few more days to take a deeper look. |
|
How is it possible to make a But to implement the My current idea is to use the second method (that is likee the item 3 in the previos message), that is to create a new specialized primitive that is always unsafe. [1] The table in Lines 3123 to 3126 in 902a100 |
|
Two options with almost the same code, that just call Option 1: Option 2: In both cases, I like that |
The expansion used `cisco#3%$real->flonum` that is marked as `discard` in primdata, so it was incorrectly deleted in contexts where the result was ignored.
9eacb27 to
718715c
Compare
|
[Rebase after version and submodule change. Not changes in my PR code.] |
|
The I would just elaborate the |
mflatt
left a comment
There was a problem hiding this comment.
Looks ready to merge after a small comment update — which I'm happy to do myself when merging, if you'd prefer.
My understanding is that there's no need for a release-note change here, because it's a repair to a new change that's already explained in the release notes. Correct me if that's not right.
|
Two small changes:
The idea is to be more conservative to move the expression outside the tail position. I was checking The function is currently used only when If you are happy with this version, feel free to squash everything and fix the comments in case it's necessary. |
The expansion used
#3%$real->flonumthat is marked asdiscardin primdata.ss, so it was incorrectly deleted in contexts where the result was ignored. See example in cptypes.msThe new expansion use
#2%$real->flonum, so I added a handler for "#2%$real->flonum" in cpprim.ss that calls library.ss. But library.ss had a call#2%$real->flonumthat produces a cycle. So I added a new primitive$real->flonum*that is like$real->flonumbut it has no handler in cpprim.ssI tried a few different approaches, but I couldn't make it work otherwise. Anyway, I don't like to use yet another primitive.
Some ideas:
Option 1: Keep the code in the PR as is. It works.
Option 2: Rename
#2%$real->flonum*to#2%$real->flonumand use#3%$app/no-inlinein library.ss (I tried this approach and failed, perhaps there is a similar method that works.)Option 3: Simplify
$real->flonum*in 5_3.ss so it just callsfloatinstead of checking the types first. This auxiliary function should be called only when all the other handlers gave up, because the argument is abignumorratnum. IIRCfloathad strange results for not numeric arguments, perhaps the result was infinite or something, I don't remember, but it's not a problem.Option 4: Any better idea is welllcome.