Talk:Environment variables: Difference between revisions

→‎Get or display: Too many broken.
(→‎Get or display: Too many broken.)
 
(7 intermediate revisions by 4 users not shown)
Line 13:
::: though i am not sure if the syntax is correct.--[[User:EMBee|eMBee]] 12:07, 21 November 2011 (UTC)
 
::::Thanks EMBee. Looks good to me. CRGreathouse, if your amenable and could do a further checks that this is valid PARI/GP then this could form the basis of a better solution? --[[User:Paddy3118|Paddy3118]] 13:19, 21 November 2011 (UTC)
 
::::: I still fundamentally disagree on this issue. No gain? It shows readers how to do the task in GP; isn't that the whole idea of the site?
::::: But I'm happy to improve the code, so I'll add a version as eMBee suggests.
::::: [[User:CRGreathouse|CRGreathouse]] 22:55, 21 November 2011 (UTC)
 
== Get or display ==
 
Many of the examples seem just to display an environment variable. That is not very useful. It would be better to show how to get an environment variable into an internal variable so that it can be processed further in the program code. --[[User:PauliKL|PauliKL]] 09:18, 6 March 2013 (UTC)
 
:Could you state some examples please? Thanks. --[[User:Paddy3118|Paddy3118]] 12:07, 6 March 2013 (UTC)
 
::If I understand them correctly, at least the following examples do not specify any variable where the data is read: C, C++, Clojure, Delphi/Pascal, E, Eiffel, Euphoria, Factor, Icon, Java, Joy, Lua, Mathematica, MATLAB / Octave, Perl, etc.
::Maybe some languages do not use variables. For example Forth stores the data in stack I guess. Anyway, the purpose of reading an environment variable is that you do something with it, for example check if it has a specific value. --[[User:PauliKL|PauliKL]] 16:40, 6 March 2013 (UTC)
 
:::I guess it is a simple task and their interpretations fit. I see your point too and maybe the task should have been enhanced from the outset, but it is too late for a change now.
 
::::Getting the environment variable into an internal variable is still within the scope of the existing task description. Individual solutions can be enhanced to encompass utilization via an internal variable where needed, without the need for a mandate. [[User:Markhobley|Markhobley]] 21:11, 6 March 2013 (UTC)
:::::A task change for assigning an environment variable to a simple program variable would break too many examples. --[[User:Paddy3118|Paddy3118]] 22:02, 6 March 2013 (UTC)
 
:::I queried your question as I thought you might be referring to "shelling out" when running on Unix toouse the shell to print an environment variable. --[[User:Paddy3118|Paddy3118]] 20:46, 6 March 2013 (UTC)
Anonymous user