squiggle icon indicating copy to clipboard operation
squiggle copied to clipboard

Document imports/exports

Open OAGr opened this issue 2 years ago • 5 comments

  • x Concerns documentation

Description of suggestion or shortcoming:

We should have a documentation page about how imports and exports work.

This should include details like:

  • Basic syntax.
  • Are random values from imports cached?
  • Does it work in VS Code? (I assume no)

OAGr avatar Nov 06 '23 02:11 OAGr

Does it work in VS Code?

Not right now; each environment needs its own linker setup. In VS Code it's going to be somewhat complicated because it's not clear if imports should be read from disk or from VS Code buffers which could be unsaved.

berekuk avatar Nov 06 '23 04:11 berekuk

That was my impression. My point was just that this detail should be added to the docs.

OAGr avatar Nov 07 '23 19:11 OAGr

Is there a specific reason why variables cannot be exported? It seems to only support parameterized functions at this time.

export version = "0.0.0"
export laborRates = {fte: 10-20, contract: 20-30}

mlao-pdx avatar Jan 03 '24 00:01 mlao-pdx

@mlao-pdx both of those examples work for me.

Do you mean you're trying something like,

xport version = "0.0.0"
export laborRates = {fte: 10-20, contract: 20-30}
foo = 45

export foo

We don't support the above syntax yet, but can add that as a feature for the future.

The import/export functionality is fairly limited now.

OAGr avatar Jan 03 '24 00:01 OAGr

Apologies, operator error. I guess I did not properly refresh the page, or I had the same page open in different tabs or something similar.

Looks like I cannot close the issue, but feel free to do so.

mlao-pdx avatar Jan 03 '24 04:01 mlao-pdx