Not totally clear what you are trying to accomplish, but would something
like the following work?

(defn get-value [start-value]
  (loop [updateable start-value line (.readline reader)]
    (if (or (empty? line) (> line-num max-num))
      (+ updateable (somefunc))
      (recur (.readLine reader)))))

(defn do-something []
  (let [updated-value (get-value 0)]
     ...))

On Thu, Jun 11, 2009 at 11:25 AM, BerlinBrown <berlin.br...@gmail.com>wrote:

>
> I do this a lot but can't figure out to change the UPDATEABLE_VALUE, I
> am using some pseudo code because I don't have a clojure solution yet.
>
> SET UPDATEABLE_VALUE = 0
>  (loop [line (.readLine reader)]
>      (if (or (empty? line) (> line-num max-num))
>       SET UPDATEABLE_VALUE = UPDATEABLE_VALUE + (SOME_FUNC)
>        (recur (.readLine reader))))
>
> ------
>
> basically I want to have access to some value UPDATEABLE_VALUE outside
> of the loop but also have the ability to update the
> value.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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