Re: feedback on this code

2009-10-28 Thread ataggart
I second Tim's comment regarding holding onto calculated values. That's at best a performance optimization, and likely an unnecessary one. Also, by using the product itself as a key simplifies the case where you try to "add" the same product as multiple line-items (though this may be what you wan

Re: feedback on this code

2009-10-27 Thread eyeris
Or you can stick (sku, quantity) pairs in a cookie. However, personally I prefer sessions. On Oct 27, 9:54 am, Robert Campbell wrote: > Wow, thank you very much. That's definitely a lot simpler. I'm going > to try reimplementing it via your suggestions and see how it goes. > > I like your idea

Re: feedback on this code

2009-10-27 Thread Robert Campbell
Wow, thank you very much. That's definitely a lot simpler. I'm going to try reimplementing it via your suggestions and see how it goes. I like your idea about not maintaining cart state on the server, because it would make my functions easier to test and debug (no need to setup & teardown a fake

Re: feedback on this code

2009-10-27 Thread Timothy Pratley
Hi Robert On Oct 27, 9:48 pm, Robert Campbell wrote: > Hey guys, I'm looking for _any_ feedback/thoughts on this Clojure code > I wrote. I just feel like the entire thing is way too complex, but I'm > not sure about how to simplify it. I wanted to try something "real > world" so I made a simple

feedback on this code

2009-10-27 Thread Robert Campbell
Hey guys, I'm looking for _any_ feedback/thoughts on this Clojure code I wrote. I just feel like the entire thing is way too complex, but I'm not sure about how to simplify it. I wanted to try something "real world" so I made a simple shopping cart ref to put in a session: (defstruct cart :line-