Re: splat operator

2008-10-17 Thread Martin DeMello
On Oct 16, 5:13 pm, Timothy Pratley <[EMAIL PROTECTED]> wrote: > Maybe something along these lines? > > (defn myreplace [str [a b]] >   (.replace str a b)) > (myreplace target search-replace) > -> "heo world" Same problem - it doesn't work within a doto block. This is where JRuby-style reopening

Re: splat operator

2008-10-17 Thread Michel Salim
On Thu, Oct 16, 2008 at 8:13 PM, Timothy Pratley <[EMAIL PROTECTED]> wrote: > > Maybe something along these lines? > > (defn myreplace [str [a b]] > (.replace str a b)) > (myreplace target search-replace) > -> "heo world" > Clojure's ML/Haskell-style deconstructing of sequences takes a while to si

Re: splat operator

2008-10-16 Thread Timothy Pratley
Maybe something along these lines? (defn myreplace [str [a b]] (.replace str a b)) (myreplace target search-replace) -> "heo world" I can see how it would be nice to 'splice in' from a variable like the [EMAIL PROTECTED] splicing from within a macro --~--~-~--~~~---

Re: splat operator

2008-10-15 Thread Martin DeMello
On Oct 15, 8:07 pm, Michel Salim <[EMAIL PROTECTED]> wrote: > > Ah, so to clarify, you need some way to say > > (. "hello" (replace \l \m)) > > but if \l and \m are given in a list, rather than as two separate > things? Sounds like you might need to write a function to do that. Yes, apply works i

Re: splat operator

2008-10-15 Thread Michel Salim
On Oct 15, 9:08 pm, Martin DeMello <[EMAIL PROTECTED]> wrote: > On Oct 15, 5:49 pm, Martin DeMello <[EMAIL PROTECTED]> wrote: > > > Is there any sort of "splat" operator that expands a list into an > > inline sequence of arguments? Failing that, is there any way to use > > apply within a doto bl

Re: splat operator

2008-10-15 Thread Michel Salim
On Oct 15, 9:08 pm, Martin DeMello <[EMAIL PROTECTED]> wrote: > On Oct 15, 5:49 pm, Martin DeMello <[EMAIL PROTECTED]> wrote: > > > Is there any sort of "splat" operator that expands a list into an > > inline sequence of arguments? Failing that, is there any way to use > > apply within a doto bl

Re: splat operator

2008-10-15 Thread Martin DeMello
On Oct 15, 5:49 pm, Martin DeMello <[EMAIL PROTECTED]> wrote: > Is there any sort of "splat" operator that expands a list into an > inline sequence of arguments? Failing that, is there any way to use > apply within a doto block? > > e..g > > (def search-replace '("ll" "") > (def target "hello worl