Environment variables: Difference between revisions

Content deleted Content added
No edit summary
Line 732: Line 732:


=={{header|Scala}}==
=={{header|Scala}}==
{{libheader|Scala}}
<lang scala>object Environment_variables extends App {
<lang scala>object Environment_variables extends App {


val variablesToUse = List("PATH", "HOME", "HOMEPATH", "USERNAME")
def variablesToUse = Seq("USERPROFILE", "java.library.path", "PATH", "HOME", "HOMEPATH", "USERNAME")
println(sys.env.filter(p => variablesToUse contains p._1).toMap.mkString("\n"))
println((for {
println
y <- sys.env
println (System.getProperty("java.library.path").split(";").mkString("\n"))
x <- variablesToUse

if y._1 == x
} yield y).sorted.toMap.mkString("\n"))
}</lang>
}</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],