Re: how can i do this in clojure

2009-02-19 Thread Nathan Kitchen
On Feb 19, 2:39 pm, Phil Hagelberg wrote: > linh writes: > > # ruby code > > def foo(x, y) > > x + y > > end > > > def bar > > [1, 2] > > end > > > foo(*bar) # this is fine, the result will be 3 > > foo(bar) # this is not ok, will raise exception > > > bar returns an array of size 2, but foo

Re: how can i do this in clojure

2009-02-19 Thread Phil Hagelberg
linh writes: > # ruby code > def foo(x, y) > x + y > end > > def bar > [1, 2] > end > > foo(*bar) # this is fine, the result will be 3 > foo(bar) # this is not ok, will raise exception > > bar returns an array of size 2, but foo expects 2 parameters not an > array. In Clojure, this would lo

Re: how can i do this in clojure

2009-02-19 Thread Mark Volkmann
On Thu, Feb 19, 2009 at 4:28 PM, linh wrote: > > hi, > how can i do this in clojure? > > # ruby code > def foo(x, y) > x + y > end (defn foo [x y] (+ x y)) > def bar > [1, 2] > end (def bar [1 2]) > foo(*bar) # this is fine, the result will be 3 (appl

how can i do this in clojure

2009-02-19 Thread linh
hi, how can i do this in clojure? # ruby code def foo(x, y) x + y end def bar [1, 2] end foo(*bar) # this is fine, the result will be 3 foo(bar) # this is not ok, will raise exception bar returns an array of size 2, but foo expects 2 parameters not an array