Re: How to convert a list to arguments?
Another way: suppose test-list - (list 1 2 3) `(max ~...@test-list) can translate the form to what you want so you can use eval or define a macro to handle it. On Jul 5, 11:38 am, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Sun, 4 Jul 2010 20:21:22 -0700 (PDT) dennis killme2...@gmail.com wrote: For example: (max 1 2 3) = 3 (max (list 1 2 3)) = (1 2 3) How to convert (list 1 2 3) to arguments for function? Sounds like you want apply: (apply max (list 1 2 3)) = 3 mike -- Mike Meyer m...@mired.org http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O ascii ribbon campaign - stop html mail -www.asciiribbon.org -- 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
Re: How to convert a list to arguments?
On Wed, Jul 7, 2010 at 4:12 AM, Cachou tangtong...@gmail.com wrote: Another way: suppose test-list - (list 1 2 3) `(max ~...@test-list) can translate the form to what you want so you can use eval or define a macro to handle it. But, most of the time, it is a bad idea. (Except if you are in situations that call for that) eval is very rarely useful in a program. And doing this in a macro probably won't do what you want, except if test-list is known at compile time. -- 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
How to convert a list to arguments?
For example: (max 1 2 3) = 3 (max (list 1 2 3)) = (1 2 3) How to convert (list 1 2 3) to arguments for function? Thanks a lot. -- 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
Re: How to convert a list to arguments?
I think you want the apply function: user= (apply max (list 1 2 3)) 3 On Jul 4, 10:21 pm, dennis killme2...@gmail.com wrote: For example: (max 1 2 3) = 3 (max (list 1 2 3)) = (1 2 3) How to convert (list 1 2 3) to arguments for function? Thanks a lot. -- 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
Re: How to convert a list to arguments?
On Sun, 4 Jul 2010 20:21:22 -0700 (PDT) dennis killme2...@gmail.com wrote: For example: (max 1 2 3) = 3 (max (list 1 2 3)) = (1 2 3) How to convert (list 1 2 3) to arguments for function? Sounds like you want apply: (apply max (list 1 2 3)) = 3 mike -- Mike Meyer m...@mired.org http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O ascii ribbon campaign - stop html mail - www.asciiribbon.org -- 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