Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added POSTPONE error handling. Drive-by code simplifications. #446

Merged
merged 3 commits into from
Jul 25, 2022

Conversation

jkotlinski
Copy link
Owner

No description provided.

: postpone bl word dup find ?dup 0= if
count rvs type '?' emit cr abort then
rot drop -1 = if [ ' literal compile,
' compile, literal ] then compile,
Copy link
Owner Author

@jkotlinski jkotlinski Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, I don't really understand what the ' literal compile, ' compile, literal twister does anymore. But it seems to work fine.

Copy link
Contributor

@lonetech lonetech Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still the same two logical parts. The first three words were already there, and the last three replace ['] compile,; the brackets perform things at compile time of postpone, it still looks up compile,, and literal transfers the result from the compile time stack to the run time stack. The ' and literal do the same job as inside the compiled [']. I do agree it's a little boggling to see the long string of 3 words 7 times in rapid succession. It's because we don't yet have postpone and [']; the block would read if postpone literal ['] compile, then with them.

Copy link
Owner Author

@jkotlinski jkotlinski Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I get it now. Thank you!

@lonetech
Copy link
Contributor

Looks like a move of rot from base.fs to core.asm was mixed in. That code change also looks okay, though it wasn't mentioned. I suppose it will build faster, but there's no asm calling it, no label to do so, and base.fs still depends on asm words. The only difference at run time will be the order of words.

@jkotlinski
Copy link
Owner Author

The move of rot was so it could be used in postpone!

@lonetech
Copy link
Contributor

Thank you for the rot clarification, and pardon my confusion. I didn't spot that dependency. And asm in turn depends on does> etc so I guess this was the smaller move. Not a problem it is done, I just didn't see why at the time.

@jkotlinski jkotlinski merged commit 036dfd2 into master Jul 25, 2022
@jkotlinski jkotlinski deleted the postpone-tweaks branch July 25, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants