Adding ??? to Predef?

If people don't hold me back I will commit the following addition to Predef.

/** Throws an UnsupportedOperationException.
* Convenient as a placeholder for a missing right-hand-side of a method.
*/
def ??? : Nothing = throw new UnsupportedOperationException("not implemented")

I have been defining this method myself in more and more projects
because I find it both cute and convenient to use

def foo(x: String): String = ???

for a not-yet implemented method. Also makes for a great teaching
tool. Just tell you class to replace the ???'s.

What do you think?

Cheers

Re: Adding ??? to Predef?

I also prefer TODO.

Re: Adding ??? to Predef?

I would prefer you didn't commit this for a couple of reasons.

* I am not sure ??? is so much better than for example a method called "notImplemented", "TODO" or something else that it warrants the introduction of a new symbolic method globally available in all scala programs.
* I dislike encouraging the use of UnsupportedOperationException. Like casting (asInstanceOf[T] vs (T) from java) it really shouldn't be used much and its ok that it screams at you and is somewhat clumsy to type.
* If one really wants this and like using UnsupportedOperations its as simple as adding it to your own package object with the added benefit that you can remove it too when you don't want it anymore.

I wouldn't mind having it available in a trait, ready to be mixed into my own package object for example in the context of teaching, but I really don't want a ??? lurking among the !!, !? and ?s and all the other symbols in my production code.

/j

On Oct 1, 2011, at 10:46 AM, David Hall wrote:

> +1. FWIW, I've been using TODO, which might be a little more transparent...
>

Re: Adding ??? to Predef?

Brilliant, I'd love it personally. So often I want to get some outline structure to compile then come back and fill in some details - nice idea, I'd use it immediately!

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