On Mon, Nov 2, 2009 at 12:27 PM, Jim Barrows <[email protected]> wrote:

>
>
> On Mon, Nov 2, 2009 at 1:15 PM, Vesa <[email protected]> wrote:
>
>>
>> Hi,
>>
>> I was wondering few thing while reading lift examples. Could the Link
>> class be turned into a case class so reading would improve? new Link
>> ("a" :: "b" :: nil, false) could be RecursiveLink("a", "b") and new
>> Link("a" :: "b" :: Nil) could be something like AbsoluteLink("a",
>> "b"). This would at least eliminate the need to explain scala's list
>>
>
> Shouldn't the reader already be aware of Scala's list construction, since
> that is in fact the language we're using?
> If you think Scala's list construction is difficult to for a new reader, I
> think explaining a case class would be even more confusing.
>

Plus, there are a ton of helpers and implicits that build Link() for you.
There is a Link companion object that will build a Link, just as if it was a
case class.


>
> You might want to look at how case classes differ from a normal 
> class<http://www.scala-lang.org/node/258>as well.
>
>  construction syntax to the reader. I found out extremely unintuitive
>> the syntax to create Links with dsl like ("help" :: "" :: Nil) ->
>> true. This syntax is usually associated with generation of key-value
>> pairs even in lift APIs and creates confusion (at least on my case). I
>> guess varargs might be out of question if scala backward compatibility
>> is considered, but I don't see a reason not to use case classes here.
>>
>> - Vesa
>>
>>
>>
>
>
> --
> James A Barrows
>
>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

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

Reply via email to