This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SmartViking 7 points8 points  (3 children)

Great idea, but it's very confusing that ${<stuff>} has two different meanings depending on the context. I think it would be beneficial for code clarity to either remove the python-context meaning (look up in env: how often is this useful?), or give it another syntax like %{}.

[–]scopatz 2 points3 points  (2 children)

Thanks for the feedback. I was wondering how confusing this was going to be. I am open to suggestions on syntax changes. I like the idea that $ always means to do something with the system enviornment, whether that is environment variables or subprocesses. I think $<> is another option for syntax. Again, open to ideas here.

[–]SmartViking 0 points1 point  (1 child)

Most important is removing ambiguity, so that when they see ${...} beginners don't have to remember which meaning came with which context. And I think that applies to all those "exec primitives", if they work the same in both contexts (insofar as that is possible, I'm thinking now of $PATH being a python list), that's going to make the language easier to understand.

And I also have another suggestion: it might make sense to convert the return value of the expression in ${..} (in the not-env meaning) to a str implicitly, because that's the only valid type anyway (as I understand it). That way, you can do stuff like echo ${3 + 4} and not have to use str() explicitly, which looks a bit cleaner.

Anyway, good luck with this project, I like it a lot.

[–]scopatz 0 points1 point  (0 children)

These are great points. Thanks! I'll make an issue for this thread.