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

Extend macros to be able to copy a value from another macro #69

Open
delphidabbler opened this issue Sep 2, 2024 · 1 comment
Open

Comments

@delphidabbler
Copy link
Owner

For example there may be cases, particularly if issue #68 is implemented (conditional compilation), where it is useful to set one macro value from another.

For example, say we have the macro

Include:data=info.dat

with contents

one=1
two=two
some-long-name=42

then we have to refer to some-long-name as data.some-long-name within the .vi file.

It may be clearer to use another variable for that name, such as answer. So having the set macro type would be useful:

set:answer=data.some-long-name

so that answer would now be set to 42, the value of data.some-long-name.

Whether the data should be copied or whether the new name is a simple alias needs some thought.

@delphidabbler
Copy link
Owner Author

If the new name is a simple alias then a better name for the macro type would be Alias:

alias:answer=data.some-long-name

Conversely, if the intention is to copy one value to another then Let may be a better name than Set, which could be confused with a mathematical set:

let:answer=data.some-long-name

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

No branches or pull requests

1 participant