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

Main result doesn't get fully expanded if a top-level variable is in list #382

Open
Janiczek opened this issue Jun 8, 2024 · 0 comments

Comments

@Janiczek
Copy link

Janiczek commented Jun 8, 2024

Reproducing the behavior

Running command hvm run out.hvm
With code (Bend)

add = (@a @b (+ a b))
x = (add 1 1)
main = [(x),(x)]

With code (HVM)

@List/Cons = (a (b ((@List/Cons/tag (a (b c))) c)))

@List/Cons/tag = 1

@List/Nil = ((@List/Nil/tag a) a)

@List/Nil/tag = 0

@add = ($([+] $(a b)) (a b))

@main = b
  & @List/Cons ~ (@x (a b))
  & @List/Cons ~ (@x (@List/Nil a))

@x = a
  & @add ~ (1 (1 a))

Error:

  • Returns [x, x] (if ran via bend run)
  • or ((@List/Cons/tag (@x (((@List/Cons/tag (@x (@List/Nil v5))) v5) va))) va) (if ran via hvm run)

Expected behavior:

  • Returns [2, 2] (if ran via bend run)
  • or ((@List/Cons/tag (2 (((@List/Cons/tag (2 (@List/Nil v10))) v10) v1e))) v1e) (if ran via hvm run)

Note: When you instead use

add = (@a @b (+ a b))
x * = (add 1 1)
main = [(x *),(x *)]

everything is fine (as in the expected block above)

System Settings

OS: Windows WSL2 / macOS
CPU: AMD Ryzen 7 5800X3D / Apple M1 Pro
GPU: not used in this example
Cuda Version: not used in this example

Additional context

No response

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

No branches or pull requests

1 participant