This page is no longer maintained — Please continue to the home page at

Fwd: Re: types of strings

No replies
H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
exactly what i was looking for. :)

-------- Original-Nachricht -------- Betreff: Re: [scala-user] types of strings Datum: Sun, 18 Dec 2011 20:22:14 +0530 Von: missingfaktor rahul [dot] phulore [dot] 999 [at] gmail [dot] com (<rahul [dot] phulore [dot] 999 [at] gmail [dot] com>) An: HamsterofDeath h-star [at] gmx [dot] de (<h-star [at] gmx [dot] de>)

On Sun, Dec 18, 2011 at 8:06 PM, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star [at] gmx [dot] de> wrote:

i regularly encounter situations where strings are used. for example it
might be an url. or a resource key. or a string that is supposed to be
sent to a brower and has to be escaped.
and i regularly see errors caused by the fact that you cannot ask a
string if it has already been resolved (if it's a resource key) or
escaped, or if it is a relative or absolute url. if it even is one.

in java, i try to make this a bit safer by creating simple wrappers like
"class ResourceKey(val key:String)" to make sure i don't accidently mix
them up. is there a way to achieve this in scala without wrapper
classes? can i somehow (mis)use abstract types for this?

basically i want to say :

type AbsoluteUrl = ???
def iAmAbsolutelySureThisIsAnAbsoluteUrl(url:String) =

Cheers, missingfaktor.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland