« Return to Thread: [scala] Option vs null

Re: [scala] Option vs null

by Barry Kelly-2 :: Rate this Message:

Reply to Author | View in Thread

Tony Morris <tmorris@...> wrote:

> Personally, I'd delete the String function and write a String -> File
> implicit

I sincerely hope you aren't serious. Strings aren't files, and
implicitly converting one to the other is a gross sanity violation -
consider a lexical analyzer that can scan string text or source from a
file (and thus might be overloaded on both): in this case, the string
isn't a logical pointer to the file, but rather the other way around,
the file is a pointer to the source text.

Would you then suggest a File -> String implicit? So that there is an
asymmetrical bidirectional conversion between strings and files?

> (if that is not to your liking, I'd abstract it in away such
> that it does).

I don't understand that sentence.

(I also wish someone would fix the missing Reply-To header in this
mailing list...)

-- Barry

--
http://barrkel.blogspot.com/

 « Return to Thread: [scala] Option vs null

LightInTheBox - Buy quality products at wholesale price!