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

Support for environment variables #92

Closed
xvxx opened this issue May 13, 2019 · 4 comments
Closed

Support for environment variables #92

xvxx opened this issue May 13, 2019 · 4 comments

Comments

@xvxx
Copy link
Collaborator

xvxx commented May 13, 2019

I don't think there's a way to get ENV variables in LDPL currently, right?

If not, they could either be pre-set like argv and argc, or there could be a new statement like STORE ENV AT "PATH" IN $path to do a lookup.

@xvxx
Copy link
Collaborator Author

xvxx commented May 13, 2019

Okay, you can do it this way:

$ cat env.ldpl
DATA:
$name is text
PROCEDURE:
execute "echo $NAME" and store output in $name
display "Your name is: " $name
$ ./env-bin
Your name is:
$ env NAME=Bobby ./env-bin
Your name is: Bobby

Maybe that's good enough? It's nice to keep the language small.

@Lartu
Copy link
Owner

Lartu commented May 13, 2019

The language is growing beyond what I've thought it would. It's still not a really usable language though. What I'm saying here is: if you'd like to add something to the language it's ok to do so.

In this particular case, I don't feel this is a necessary thing, as you can do that, but the main problem here is that environmental variables are different in Windows and in Unix/BSD, so making something that works for both would be kind of a chore.

@xvxx
Copy link
Collaborator Author

xvxx commented May 14, 2019

In this particular case, I don't feel this is a necessary thing, as you can do that, but the main problem here is that environmental variables are different in Windows and in Unix/BSD, so making something that works for both would be kind of a chore.

Makes sense! I like this reasoning. 👍

@Lartu
Copy link
Owner

Lartu commented May 15, 2019

Awesome! Thank you! I'll be closing this then.

@Lartu Lartu closed this as completed May 15, 2019
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

2 participants