HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
17.48k stars 428 forks source link

Variable scoping changes on import #733

Open kentslaney opened 1 month ago

kentslaney commented 1 month ago

Reproducing the behavior

with the following 2 files...

imported.bend

def test(key):
  return key + 1

def key(seed):
  return seed + 2

def main:
  return test(5)

 

importer.bend

from imported import test

def main:
  return test(5)

running the two files gives different results, when the expected result is the same since they're making the same call (using bend run)

System Settings

Additional context

I think this might be related to #729 but I opened a new issue since it doesn't fail at compile time

kentslaney commented 1 month ago

It might be a separate issue, but I've also found that importing functions that use fold and bend or list concatenations have altered behavior.

TODO: minimum reproducible example