-
Notifications
You must be signed in to change notification settings - Fork 77
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
[enhancement] add C style casts #155
Comments
I agree that there should probably be a way to "just" typecast without adding any opcodes, but I'm not sure if I like having two separate "casting" syntaxes. The only cast where this applies is casting to |
Currently some casts will actually call conversion like int() resulting in compiled bytecode using OP_BIN2NUM.
In some cases, when the user knows that the hex will be a valid script number this will be terribly wasteful.
Consider this:
it would compile to
OP_1 OP_1 OP_EQUALVERIFY
while
would compile to
OP_1 OP_1 OP_NUMEQUALVERIFY
.What if b is not a valid int encoding? Then still compile the same but compiled Script would fail due to OP_NUMEQUALVERIFY erroring.
The text was updated successfully, but these errors were encountered: