Re: [twincling] Re: Println

2009-07-12 Thread nikhil m
Hi Guys, Sorry I couldnt reply sooner. Was travelling. Looks like you guys had a lot of fun :) Regards, Nikhil [Non-text portions of this message have been removed]

[twincling] Re: Println

2009-07-10 Thread rajkumargoel_786
--- In twincling@yahoogroups.com, nikhil nik_...@... wrote: Hi rkg, I dont know abt an error but I do get a warning from compiler, if I use '+', as shown below, but the program still runs( with wrong o/p) warning: there were deprecation warnings; re-run with -deprecation for details

Re: [twincling] Re: Println

2009-07-10 Thread nikhil m
Hi rkg, The mkString() way was cool. I found another easy way. I think all collections have a toString method. So instead we can just use that. ex: println( nums.toString + nums.tail.toString + nums.tail.tail.toString) The advantage of this method is that you can easily preserve the formatting

Re: [twincling] Re: Println

2009-07-10 Thread Mukund Deshpande
Hi nik, In your mail you say that we actually invoke + method for List and not for String. But String in scala is java.lang.String(You won't find String in Scala API)... scala val k=SMS k: java.lang.String = SMS All dataypes like int,folat...have a class in scala but not string as it was

[twincling] Re: Println

2009-07-10 Thread rajkumargoel_786
Hi Nikhil, The way you said was cool .I was playing with now and I was hit by another new observation. this is what Happened scala List(3,3) res0: List[Int] = List(3, 3) scala res0.toString() res1: String = List(3, 3) scala res0 res2: List[Int] = List(3, 3) scala res1.length res3: Int = 10

[twincling] Re: Println

2009-07-10 Thread rajkumargoel_786
Hi sms, Actually there is one more implementation of String which scala has Rich String ,RichString class is scala's implementation of a class like a String class in Java.But it is always not used it used only when certain functionalities can't be provided by Java's String class. It is a

[twincling] Re: Println

2009-07-10 Thread rajkumargoel_786
Hi sms, Actually there is one more implementation of String which scala has Rich String ,RichString class is scala's implementation of a class like a String class in Java.But it is always not used it used only when certain functionalities can't be provided by Java's String class. It is a

Re: [twincling] Re: Println

2009-07-10 Thread Mukund Deshpande
Hi RKG, I have already looked into RichString ..In Scala API RichString has only *,++ methods having special characters thanks, SMS On Fri, Jul 10, 2009 at 6:44 PM, rajkumargoel_786 rajkumargoel_...@yahoo.co.in wrote: Hi sms, Actually there is one more implementation of String which scala

Re: [twincling] Re: Println

2009-07-10 Thread Mukund Deshpande
Hi RKG, Yes Rich* classes provide extra functionality.If you peek into scala API you'll find + method is in Int class itself not RichInt ...so similarly it should have been in String class but not in RichString... And String class is not there.. thanks, SMS On Fri, Jul 10, 2009 at 6:42

[twincling] Re: Println

2009-07-10 Thread rajkumargoel_786
HI sms, String is there in scala .Since it imports java.lang package of java it has String class of Java. the complete to path in Java.lang package is java.lang.String. As far as + operator is concerned i am peeping in to the Object class of Scala seeeing whether it has a overloaded version of +

Re: [twincling] Re: Println

2009-07-10 Thread Mukund Deshpande
Hi Rkg, Yes thats what i was pointed when i said In your mail you say that we actually invoke + method for List and not for String. But String in scala is java.lang.String(You won't find String in Scala API)... scala val k=SMS k: java.lang.String = SMS Looking forward for your reply...

[twincling] Re: Println

2009-07-10 Thread rajkumargoel_786
Hi sms, What you said I didnot understand in the previous mail but however I came to know the mystery of +. For finding the answer I went to Scala channel of IRC.and here is the log. [19:20] rkg Hi [19:20] RSchulz Finally! I thought maybe the Earth was finally deserted. [19:21] rkg I've got a

Re: [twincling] Re: Println

2009-07-10 Thread Mukund Deshpande
Hi rkg, Thanks,Actually the method you adopted to get the answer...is gr8. I'll try that from nxt time..thanks a lot! SMS On Fri, Jul 10, 2009 at 7:37 PM, rajkumargoel_786 rajkumargoel_...@yahoo.co.in wrote: Hi sms, What you said I didnot understand in the previous mail but

Re: [twincling] Re: Println

2009-07-10 Thread Mukund Deshpande
Hi Rkg, I tried out the any2stringadd function in Predef. it worked but could'nt understand the relation between + and any2stringadd so went to #scala [21:07] SMSD yeah [21:07] SMSD got it [21:08] SMSD but how does the scala compiler [21:08] SMSD know [21:08] SMSD + is any2stringadd [21:08] SMSD