-
Notifications
You must be signed in to change notification settings - Fork 76
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
⚙️ __AS=$? on every command also if the status isn't checked #183
Comments
I think that should be enough to check on https://github.com/Ph0enixKM/Amber/blob/69e96ae3867091bcd374ff3cf42909324e73646e/src/modules/expression/literal/status.rs#L28 if the command is unsafe to not print that |
But if developer uses I think this should be a part of rendered code optimisation for Amber |
If the status is not used after why add code anyway? This is kind of a compiler optimization to generate only useful code. |
So checking my experimental script to evaluate improvements to Amber https://github.com/Mte90/My-Scripts/blob/master/dev/lsp-installer/install.sh We can see as today tons of |
So https://github.com/amber-lang/amber/blob/master/src/modules/condition/failed.rs#L95 adds the useless variable. |
Maybe the approach should be the apposite looking at the code. We add We can't do it on https://github.com/amber-lang/amber/blob/master/src/modules/expression/literal/status.rs#L30 as it is just a replace so how we can do that (I am saying just to understand how works)? |
So the amber script is:
Generate this bash script:
Create that variable also if not used is not helpful at all in the bash script generated.
I think that if
unsafe
it is used that variable shouldn't be added.The text was updated successfully, but these errors were encountered: