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

data.xsl:26-29: This code tests for both org.eolang.TYPE... #1111

Closed
0pdd opened this issue Aug 29, 2022 · 9 comments
Closed

data.xsl:26-29: This code tests for both org.eolang.TYPE... #1111

0pdd opened this issue Aug 29, 2022 · 9 comments
Assignees

Comments

@0pdd
Copy link

0pdd commented Aug 29, 2022

The puzzle 1104-f29eb2d4 from #1104 has to be resolved:

@todo #1104:30m This code tests for both org.eolang.TYPE and TYPE.
This is unnecessary. Investigate why add-default-package.xsl
is not always called from eo-maven-plugin and use
only qualified object names.

The puzzle was created by @rultor on 29-Aug-22.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

@yegor256
Copy link
Member

@mximp please, help us resolve this

@mximp
Copy link
Contributor

mximp commented Aug 29, 2022

@OlesiaSub could you please have a look

@mximp mximp assigned OlesiaSub and unassigned mximp Aug 29, 2022
@OlesiaSub
Copy link
Contributor

I have an explanation but I don't have a good solution yet.
@yegor256 @mximp please have a look.

Let's take a look at this piece of code located in your bool.eo file

# NOT
[] > not
  eq. > @
    ^
    FALSE

We are particularly interested in usage of FALSE.
In transpiled .xmir FALSE will look like this:

<o base="bool" data="bytes" line="43" pos="6" ref="29">00</o>

Note that it has a ref attribute because it's abstract object bool is located in the same file (bool.eo).
But add-default-package.xsl reasonably does not add default packages to the objects with ref attributes, so in all cases like this default package won't be added.

Same situation occurs when we use numbers representing int in int.eo file, etc. It does not occur in any other cases, so maybe removing this TYPE checks is not necessary?

@mximp
Copy link
Contributor

mximp commented Aug 31, 2022

@yegor256 @OlesiaSub This corresponds to the the description in add-default-package.xsl:

  <!--
  Here we go through all objects that DON'T have @ref attributes
  and add default package to them.

  We ignore objects that are present in aliases with their exact
  names. For example, this object 'hello' won't be touched, we
  won't think that it belongs to org.eolang package:

  +alias hello
  [] > app
    hello > @
  -->

So it looks like current behaviour is in line with common logic.
I can't think of any solution for fixing it rather than hardcode specific logic for data types in add-default-package.xsl, but I don't think it's worth to do.
I suggest to keep it as is.

@OlesiaSub
Copy link
Contributor

@mximp yes, that's what meant. And I have the same opinion about it, I'd rather keep it

@mximp
Copy link
Contributor

mximp commented Sep 1, 2022

@yegor256 Can we remove the puzzle and close it as "won't fix"?

@yegor256
Copy link
Member

yegor256 commented Sep 1, 2022

@mximp sure, we just need to submit a pull request that removes the puzzle

@mximp
Copy link
Contributor

mximp commented Sep 1, 2022

@OlesiaSub please do

@0pdd
Copy link
Author

0pdd commented Sep 14, 2022

The puzzle 1104-f29eb2d4 has disappeared from the source code, that's why I closed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants