translating underscore.js to clojurescript

211 views
Skip to first unread message

Jason Hickner

unread,
Apr 11, 2012, 6:11:27 PM4/11/12
to clo...@googlegroups.com
Hello,

I'm working on porting underscore.js to clojurescript (at least the parts that aren't made redundant by clojurescript already). Mostly it's pretty straightforward, but for some of the trickier functions I'm having trouble finding an idiomatic translation.

Here's the throttle and bounce functions for example (alongside the original js):


I don't like how I've had to use so many atoms in throttle, but you can't set! a local var. Is there a better way to go about this? Maybe I should just have one map in an atom, for instance.

- Jason

David Nolen

unread,
Apr 11, 2012, 7:42:35 PM4/11/12
to clo...@googlegroups.com
It might be worth investigating a more functional solution. RxJS looks like a promising project to steal ideas from.

David


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Jason Hickner

unread,
Apr 11, 2012, 9:22:55 PM4/11/12
to clo...@googlegroups.com
Thanks, I'll check it out.

- Jason
David

David Nolen

unread,
Apr 12, 2012, 2:37:55 PM4/12/12
to clo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages