Re: why is io! not enforced?
On Jun 20, 4:59 pm, Rowdy Rednose rowdy.redn...@gmx.net wrote: On a side-note: I actually think it can make sense to do io in transactions in Clojure, and I believe (knowing that transactions can be replayed) it is possible to use that to e.g. implement a transaction log written to disk that could be used to rebuild the data in case of a crash. Use agents. When inside a running transaction, all agent dispatches are held until the transaction commits. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: why is io! not enforced?
This won't work unfortunately, because it means that the in-memory transaction has already commited before the disk write is performed by the agent. If the application crashed at that point, your write was not durable. -- Sent from my Palm Pre ataggart wrote: On Jun 20, 4:59 pm, Rowdy Rednose wrote: On a side-note: I actually think it can make sense to do io in transactions in Clojure, and I believe (knowing that transactions can be replayed) it is possible to use that to e.g. implement a transaction log written to disk that could be used to rebuild the data in case of a crash. Use agents. When inside a running transaction, all agent dispatches are held until the transaction commits. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
why is io! not enforced?
Was it a deliberate decision to make io! optional or is this by accident? I know it came in later I guess it's hard to do considering all access to Java would have to be categorized, which is impossible, I guess. It just seems like Clojure loses a lot by not guaranteeing side-effect- freeness, like optimizations that can be done if functions are free of side-effects. I don't know whether these guarantees are used by the Haskell compiler/run-time system, but I'd guess so. On a side-note: I actually think it can make sense to do io in transactions in Clojure, and I believe (knowing that transactions can be replayed) it is possible to use that to e.g. implement a transaction log written to disk that could be used to rebuild the data in case of a crash. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---