Environment variables: Difference between revisions
Content deleted Content added
Added Erlang |
added Scala |
||
Line 702: | Line 702: | ||
</pre> |
</pre> |
||
=={{header|Scala}}== |
|||
<lang scala>object Environment_variables extends App { |
|||
val variablesToUse = List("PATH", "HOME", "HOMEPATH", "USERNAME") |
|||
println((for { |
|||
y <- sys.env |
|||
x <- variablesToUse |
|||
if y._1 == x |
|||
} yield y).sorted.toMap.mkString("\n")) |
|||
}</lang> |
|||
=={{header|Seed7}}== |
=={{header|Seed7}}== |
||
Seed7 provides the function [http://seed7.sourceforge.net/manual/os.htm#getenv getenv], |
Seed7 provides the function [http://seed7.sourceforge.net/manual/os.htm#getenv getenv], |