Skip to content

Add a filter function for g= #51

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

idbrii
Copy link
Contributor

@idbrii idbrii commented Jul 21, 2020

Allows you to clean up your selected code -- like deleting f suffixes,
semicolons, etc.

I expect various programming languages have a bunch of weird other ways of representing numbers (suffixes indicating type, prefixes indicating base) and this is intended to allow users to make g= work for them. However, maybe you'd prefer to
incorporate this logic into scriptease?

Likely they're language-specific, so I'm not sure if these should be b: or g: variables (or support both). Due to overlap between languages, it might be easier to define replacements for all of the possibilities in one function and use &ft to determine which are applicable (C# and C++ both use f suffixes, etc).

Allows you to clean up your selected code -- like deleting f suffixes,
semicolons, etc.
@tpope
Copy link
Owner

tpope commented Jul 26, 2020

Are f suffixes new? I've never seen one.

@idbrii
Copy link
Contributor Author

idbrii commented Jul 28, 2020

f suffixes aren't new for C++ or C#, but if you don't use them then your literals are doubles so you could easily write a lot of code without ever encountering them.

There's lots of other ones: C++ has l/L suffixes for longs and c# has 0b prefix for binary and underscore separators (e.g., 0b_0010_1010 33_554_432).

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