[Lift] Re: LoanWrapper

2009-05-11 Thread Charles F. Munat

Just exploring in Lift. (Reading the Lift book, Chapter 7.)

Chas.

Timothy Perrett wrote:
> Out of interest - what is your use case? What are you trying to do
> that you think LoanWrapper might be appropriate for? Or are you just
> exploring lift? :-)
> 
> Cheers, Tim
> 
> On May 10, 9:03 pm, "Charles F. Munat"  wrote:
>> It will after I review some stuff about types and look through some more
>> source code. Thanks!
>>
>> Chas.
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: LoanWrapper

2009-05-11 Thread Timothy Perrett

Out of interest - what is your use case? What are you trying to do
that you think LoanWrapper might be appropriate for? Or are you just
exploring lift? :-)

Cheers, Tim

On May 10, 9:03 pm, "Charles F. Munat"  wrote:
> It will after I review some stuff about types and look through some more
> source code. Thanks!
>
> Chas.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: LoanWrapper

2009-05-10 Thread Charles F. Munat

It will after I review some stuff about types and look through some more 
source code. Thanks!

Chas.

Timothy Perrett wrote:
> Here's an example:
> 
> S.addAround(List(new LoanWrapper {
>  def apply[T](f: => T): T = {
>   val (time,result) = TimeHelpers.calcTime(f)
>   def logTime = Log.info("test took "+time+" Milliseconds")
>   result match {
>  case (_,Full(_)) => logTime
>  case Full(_) => logTime
>  case _ =>
>   }
>   result
>}}))
> 
> Does that help?
> 
> Cheers, Tim
> 
> On May 10, 6:52 pm, "Charles F. Munat"  wrote:
>> Hmmm. Very interesting. I get the gist of it, but I'm going to have to
>> play with it a bit before I understand how it really works.
>>
>> Thanks! I figured there was a good reason for the name, but didn't think
>> to look for a design pattern.
>>
>> Chas.
>>
>>
>>
>> Timothy Perrett wrote:
>>> I think you'll find it's called that because it's a part of a pattern.  
>>> If you google "loan pattern" you'll get a scala wiki answer that  
>>> should help you :-)
>>> Cheers, Tim
>>> Sent from my iPhone
>>> On 10 May 2009, at 07:59, "Charles F. Munat"  wrote:
 Why is it called "LoanWrapper"?
 Chas.
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: LoanWrapper

2009-05-10 Thread Timothy Perrett

Here's an example:

S.addAround(List(new LoanWrapper {
 def apply[T](f: => T): T = {
  val (time,result) = TimeHelpers.calcTime(f)
  def logTime = Log.info("test took "+time+" Milliseconds")
  result match {
 case (_,Full(_)) => logTime
 case Full(_) => logTime
 case _ =>
  }
  result
   }}))

Does that help?

Cheers, Tim

On May 10, 6:52 pm, "Charles F. Munat"  wrote:
> Hmmm. Very interesting. I get the gist of it, but I'm going to have to
> play with it a bit before I understand how it really works.
>
> Thanks! I figured there was a good reason for the name, but didn't think
> to look for a design pattern.
>
> Chas.
>
>
>
> Timothy Perrett wrote:
> > I think you'll find it's called that because it's a part of a pattern.  
> > If you google "loan pattern" you'll get a scala wiki answer that  
> > should help you :-)
>
> > Cheers, Tim
>
> > Sent from my iPhone
>
> > On 10 May 2009, at 07:59, "Charles F. Munat"  wrote:
>
> >> Why is it called "LoanWrapper"?
>
> >> Chas.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: LoanWrapper

2009-05-10 Thread Charles F. Munat

Hmmm. Very interesting. I get the gist of it, but I'm going to have to 
play with it a bit before I understand how it really works.

Thanks! I figured there was a good reason for the name, but didn't think 
to look for a design pattern.

Chas.

Timothy Perrett wrote:
> I think you'll find it's called that because it's a part of a pattern.  
> If you google "loan pattern" you'll get a scala wiki answer that  
> should help you :-)
> 
> Cheers, Tim
> 
> Sent from my iPhone
> 
> On 10 May 2009, at 07:59, "Charles F. Munat"  wrote:
> 
>> Why is it called "LoanWrapper"?
>>
>> Chas.
>>
> 
> > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: LoanWrapper

2009-05-10 Thread Timothy Perrett

For completeness:

http://scala.sygneca.com/patterns/loan

Cheers, Tim

On May 10, 10:41 am, Timothy Perrett  wrote:
> I think you'll find it's called that because it's a part of a pattern.  
> If you google "loan pattern" you'll get a scala wiki answer that  
> should help you :-)
>
> Cheers, Tim
>
> Sent from my iPhone
>
> On 10 May 2009, at 07:59, "Charles F. Munat"  wrote:
>
>
>
>
>
> > Why is it called "LoanWrapper"?
>
> > Chas.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: LoanWrapper

2009-05-10 Thread Timothy Perrett

I think you'll find it's called that because it's a part of a pattern.  
If you google "loan pattern" you'll get a scala wiki answer that  
should help you :-)

Cheers, Tim

Sent from my iPhone

On 10 May 2009, at 07:59, "Charles F. Munat"  wrote:

>
> Why is it called "LoanWrapper"?
>
> Chas.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---