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

Printing of functions with one argument #114

Open
NeuralCoder3 opened this issue Oct 14, 2022 · 1 comment
Open

Printing of functions with one argument #114

NeuralCoder3 opened this issue Oct 14, 2022 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@NeuralCoder3
Copy link
Collaborator

Functions with only one argument are printed without brackets:

    .cn return_178710 _178716: [%mem.M, .Idx 4294967296]  = {
        return_178715 _178716
    };

In cases like the one above, this is correct.
But this hinders readability in some cases (name_num vs name _num) and prevents simply adding/printing a filter @filter at the end.

In some cases like continuation arguments, the invalid code

.cn fun_name .Cn ... = ...

is generated.

Suggestion: always print brackets.

@NeuralCoder3 NeuralCoder3 added bug Something isn't working enhancement New feature or request labels Oct 14, 2022
@leissa
Copy link
Member

leissa commented Oct 14, 2022

A related thing is the following oddity: The FE currently uses the name _ as magic name to indicate that we are not interested in this entity and will happily name many things internally as _. But on top of that Def::unique_name() will generate a name consisting of Def::name() + _ + Def::gid(). For this reasons some variables end up named like __12345 (note the double underscore) in the output Oo
I think the output could be improved if we used a different separator in Def::unique_name(). Then, we would have sth like this:

.cn name_num.23 num.42: T

or

.cn name_num.23 .42: T

or

.cn name_num.23 _.42: T

This should mitigate at least some of the complaints. Now, using . doesn't really work. We would have to agree on a different separator. This was just an example to bring the point (pun intented XD) across.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants