Re: Use of io!

2013-05-30 Thread dennis zhuang
Yep,wrap code that has side effects, prevent it to be evaluated in STM
transaction.


2013/5/30 Maik Schünemann maikschuenem...@gmail.com

 I think It stops other code to wrap around the code with the explicit io!
 call.
 Its declarative way of saying: I am doing io! DONT USE me inside a dosync.


 On Thu, May 30, 2013 at 7:47 AM, Josh Kamau joshnet2...@gmail.com wrote:

 Hi ;

 Whats the point of using io! inside dosync if all it does is make an
 exception to be thrown? Please someone make me understand.

 Regards.
 Josh

 --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
庄晓丹
Email:killme2...@gmail.com xzhu...@avos.com
Site:   http://fnil.net
Twitter:  @killme2008

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-30 Thread Michael Klishin
2013/5/30 Josh Kamau joshnet2...@gmail.com

 Whats the point of using io! inside dosync if all it does is make an
 exception to be thrown?


The point is to mark side-effecting code so that you can't accidentally use
it in a transaction.
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-30 Thread Alex Baranosky
Do any of you ever use io! ?  I've never used it, but could see using it if
I had a transaction-heavy application.

On Wed, May 29, 2013 at 11:43 PM, Michael Klishin 
michael.s.klis...@gmail.com wrote:

 2013/5/30 Josh Kamau joshnet2...@gmail.com

 Whats the point of using io! inside dosync if all it does is make an
 exception to be thrown?


 The point is to mark side-effecting code so that you can't accidentally
 use it in a transaction.
 --
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin

 --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-30 Thread Josh Kamau
Thanks guys. Now i understand its for marking functions containing io so
that they blow up if they are used inside transactions.  I am still
learning clojure and i have decided to take some time to understand every
function in the core API.

Josh.


On Thu, May 30, 2013 at 11:10 AM, Alex Baranosky 
alexander.barano...@gmail.com wrote:

 Do any of you ever use io! ?  I've never used it, but could see using it
 if I had a transaction-heavy application.


 On Wed, May 29, 2013 at 11:43 PM, Michael Klishin 
 michael.s.klis...@gmail.com wrote:

 2013/5/30 Josh Kamau joshnet2...@gmail.com

 Whats the point of using io! inside dosync if all it does is make an
 exception to be thrown?


 The point is to mark side-effecting code so that you can't accidentally
 use it in a transaction.
 --
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin

 --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-30 Thread Sean Corfield
On Thu, May 30, 2013 at 1:10 AM, Alex Baranosky
alexander.barano...@gmail.com wrote:
 Do any of you ever use io! ?  I've never used it, but could see using it if
 I had a transaction-heavy application.

 On Wed, May 29, 2013 at 11:43 PM, Michael Klishin
 michael.s.klis...@gmail.com wrote:
 The point is to mark side-effecting code so that you can't accidentally
 use it in a transaction.

I gather the intent is for *all* side-effecting code to be wrapped in
io! so that you can't accidentally use it with STM transactions?

The only places in Clojure and its contribs that use this are:
* await - clojure.core
* await-for - clojure.core
* transaction - java.jdbc (deprecated)
* db-transaction - java.jdbc

It sounds like all inserts and updates in java.jdbc should also be
wrapped in io! and I would expect io! to be needed in a lot of other
places in Clojure libraries across the board...?
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-30 Thread Gary Trakhman
What if you really want the 'bad' effects on retries?  We need io! versions
and non-io! versions of side-effect functions :-)


On Thu, May 30, 2013 at 1:24 PM, Sean Corfield seancorfi...@gmail.comwrote:

 On Thu, May 30, 2013 at 1:10 AM, Alex Baranosky
 alexander.barano...@gmail.com wrote:
  Do any of you ever use io! ?  I've never used it, but could see using it
 if
  I had a transaction-heavy application.
 
  On Wed, May 29, 2013 at 11:43 PM, Michael Klishin
  michael.s.klis...@gmail.com wrote:
  The point is to mark side-effecting code so that you can't accidentally
  use it in a transaction.

 I gather the intent is for *all* side-effecting code to be wrapped in
 io! so that you can't accidentally use it with STM transactions?

 The only places in Clojure and its contribs that use this are:
 * await - clojure.core
 * await-for - clojure.core
 * transaction - java.jdbc (deprecated)
 * db-transaction - java.jdbc

 It sounds like all inserts and updates in java.jdbc should also be
 wrapped in io! and I would expect io! to be needed in a lot of other
 places in Clojure libraries across the board...?
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

 --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-30 Thread Gary Trakhman
Well, more seriously, I would be against any facility that prevents me from
doing something potentially useful that I might want to do.  Sprinkling
potential problem spots with io! might make more sense in an application
than a library.


On Thu, May 30, 2013 at 1:27 PM, Gary Trakhman gary.trakh...@gmail.comwrote:

 What if you really want the 'bad' effects on retries?  We need io!
 versions and non-io! versions of side-effect functions :-)


 On Thu, May 30, 2013 at 1:24 PM, Sean Corfield seancorfi...@gmail.comwrote:

 On Thu, May 30, 2013 at 1:10 AM, Alex Baranosky
 alexander.barano...@gmail.com wrote:
  Do any of you ever use io! ?  I've never used it, but could see using
 it if
  I had a transaction-heavy application.
 
  On Wed, May 29, 2013 at 11:43 PM, Michael Klishin
  michael.s.klis...@gmail.com wrote:
  The point is to mark side-effecting code so that you can't accidentally
  use it in a transaction.

 I gather the intent is for *all* side-effecting code to be wrapped in
 io! so that you can't accidentally use it with STM transactions?

 The only places in Clojure and its contribs that use this are:
 * await - clojure.core
 * await-for - clojure.core
 * transaction - java.jdbc (deprecated)
 * db-transaction - java.jdbc

 It sounds like all inserts and updates in java.jdbc should also be
 wrapped in io! and I would expect io! to be needed in a lot of other
 places in Clojure libraries across the board...?
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

 --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Use of io!

2013-05-29 Thread Josh Kamau
Hi ;

Whats the point of using io! inside dosync if all it does is make an
exception to be thrown? Please someone make me understand.

Regards.
Josh

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Use of io!

2013-05-29 Thread Maik Schünemann
I think It stops other code to wrap around the code with the explicit io!
call.
Its declarative way of saying: I am doing io! DONT USE me inside a dosync.


On Thu, May 30, 2013 at 7:47 AM, Josh Kamau joshnet2...@gmail.com wrote:

 Hi ;

 Whats the point of using io! inside dosync if all it does is make an
 exception to be thrown? Please someone make me understand.

 Regards.
 Josh

 --
 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.