Search code examples
rubylistemacslispelisp

elisp data structures/workflow for constructing a list


arrayA = ["arrayA_1", "arrayA_2", "arrayA_3", "arrayA_4", "arrayA_5"]
arrayB = ["arrayB_1", "arrayB_2", "arrayB_3", "arrayB_4", "arrayB_5"]
arrayC = ["arrayC_1", "arrayC_2", "arrayC_3", "arrayC_4", "arrayC_5"]


arrayA.length.times do |x| 
  p list = [ [arrayA[x]] , [arrayB[x]] , [arrayC[x]] ]                                                                                                                           
end

How to replicate this simple Ruby codeblock in elisp?


Solution

  • ELISP> (cl-mapcar 'concat
            '("firstA" "secondA" "thirdA")
            '("firstB" "secondB" "thirdB")
            '("firstC" "secondC" "thirdC"))
    ("firstAfirstBfirstC" "secondAsecondBsecondC" "thirdAthirdBthirdC")