« Return to Thread: [scala] Option vs null

Re: [scala] Option vs null

by Jamie Webb-2 :: Rate this Message:

Reply to Author | View in Thread

On 2008-07-09 19:35:36 Barry Kelly wrote:
> > 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):

No, it shouldn't be. You have two methods that do different things, so
they should have different names. (I agree that Tony's implicits are a
really dumb idea, just not for this reason.)

On 2008-07-10 07:12:12 Tony Morris wrote:
> I'm serious (and so is Jesper it seems). The sentence "Strings aren't
> Files" doesn't parse for me because I reason about software using a
> different method and without labels. The structure of a File
> (java.io.File) as an algebra is isomorphic to a String (which happens
> to contradict the statement "Strings aren't Files" - yes they most
> definitely are!). Given this isomorphism, I have no problem writing an
> implicit inverse.

This is utter nonsense. If you don't like your sequences of bits being
labelled to indicate their purpose, perhaps you should go back and
program in BCPL.

/J

 « Return to Thread: [scala] Option vs null

LightInTheBox - Buy quality products at wholesale price!