This makes perfect sense. I reached for this strategy initially but
got lost along the way trying to consider how to enable N inputs via a
-main function.
I'm all set now.
Many thanks,
Avram


On Apr 15, 11:11 am, Alan <a...@malloys.org> wrote:
> You never "need" & when you are defining your own functions. It's
> equivalent to declaring that your function takes one argument, a
> vector, and then always wrapping up in a vector whatever args you want
> to use.
>
> On Apr 15, 11:05 am, Avram <aav...@me.com> wrote:
>
>
>
> > Thank-you, I think that works for me!  I do need the & to be able to
> > take in a variable number of arguments, but it looks like I can call
> > "vec" to convert this to a vector, then call the read-files-into-
> > memory function that now will take a single argument. Such an elegant
> > language but difficult to search for things like args or % or & to
> > find answers ;)
>
> > Best,
> > Avram
>
> > On Apr 15, 1:10 am, Alan <a...@malloys.org> wrote:
>
> > > I would do it by making read-files-into-memory take a single argument,
> > > a list of filenames, rather than N arguments, each of which is a
> > > filename. Just drop the & in the function's definition and you should
> > > be done.
>
> > > On Apr 14, 4:21 pm, Avram <aav...@me.com> wrote:
>
> > > > Yes, I am missing a way to turn the [& filenames] into something like
> > > > "name1" "name2" …
>
> > > > How might this be done?  (I am not certain what "type" this would be,
> > > > a stringified version of each item in the sequence, not a sequence
> > > > itself! )
>
> > > > (defn read-files-into-memory
> > > >   [ & filenames ]
> > > >   (print filenames)
> > > >   (map #(read-json-filename %1) filenames))
>
> > > > Many thanks,
> > > > Avram

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to