Re: How To Supply Multiple Values To Function In Map

2011-07-01 Thread John Palgut
map actually accepts any number of collections, as show in the official documentation. Your function passed to map just needs to accept parameters equal to the number of collections passed. So you could write something li

Re: How To Supply Multiple Values To Function In Map

2011-06-28 Thread Mark Rathwell
coll is the vector defined at the top of each code listing in the examples given, and is used as the second argument to map in all examples. Sent from my iPhone On Jun 28, 2011, at 3:20 PM, octopusgrabbus wrote: > Thanks. I've followed most of what you've written except how the > symbol col f

Re: How To Supply Multiple Values To Function In Map

2011-06-28 Thread octopusgrabbus
Thanks. I've followed most of what you've written except how the symbol col fits into this, unless you're using it as map values. On Jun 28, 3:11 pm, Mark Rathwell wrote: > map takes a function and a collection.  So, that function can be: > >  1. named: >    - define the function on it own, using

Re: How To Supply Multiple Values To Function In Map

2011-06-28 Thread Mark Rathwell
map takes a function and a collection. So, that function can be: 1. named: - define the function on it own, using the defn macro - pass it as first argument to map (def coll [[1 2] [3 4] [4 5]]) (defn foo [x y] (println x y)) (map foo coll) 2. anonymous: - use shorthan

How To Supply Multiple Values To Function In Map

2011-06-28 Thread octopusgrabbus
Given this sample: (ns test-csv (:gen-class) (:use clojure.contrib.command-line) (:use clojure-csv.core)) (defn x1 [val1 val2] (println val1 val2)) (defn process-file "Process csv file and prints a column in every row" [file-name] (let [data (slurp file-name) rows (pa