PreviousUpNext

5.5.28  Select first/second element of each of a list of pairs

Select first/second element of each of a list of pairs:

    eval:  posix::uname ();                              # Generate example list of pairs
    [("sysname", "Linux"), ("nodename", "maw"), 
     ("release", "2.6.14"), 
     ("version", "#9 SMP Sat Jan 28 22:31:10 CST 2006"), 
     ("machine", "i686")]

    eval:  map #1 (posix::uname());                       # First elements from above pairs.
    ["sysname", "nodename", "release", "version", "machine"]

    eval:  map #2 (posix::uname());                       # Second elements from above pairs.
    ["Linux", "maw", "2.6.14", 
     "#9 SMP Sat Jan 28 22:31:10 CST 2006", "i686"]

Comments and suggestions to: bugs@mythryl.org

PreviousUpNext