[concurrency-interest] Ops type names

Joshua Bloch josh at bloch.us
Tue Jan 15 11:12:10 EST 2008


Gregg,

Hmmm... the onInt and withInt don't really feel right to me.  If people
don't like intOp (or intFn), then I think we should go with David's
inclination (intToInt).

          Josh

On Jan 15, 2008 8:06 AM, Gregg Wonderly <gergg at cox.net> wrote:

> Joshua Bloch wrote:
> > Hi.  I understand your desire consistency.  That said, I was
> > inconsistent "with my eyes open."  Worse, I violated the norms in
> > mathematics.  When a mathematician speaks of a real-function, he speaks
> > of the range (result type), irrespective of the domain.  That said, when
> > it comes to designing APIs, I like to take the nice, short names for the
> > common cases, and I believe that the case of functions whose range and
> > domain types are the same will predominate (whether it's int-to-int,
> > long-to-long, or double-to-double).  So, I stole the nice names for the
> > common homogeneous function types.
>
> Is there any useful readability gains from using more prepositional words
> like
> "with" or "on" instead of "Op", as in
>
> onInt( 42 ).onInt( doubleToInt( 45.0 ) )
>
> or
>
> withInt( 42 ).withInt( doubleToInt( 45.0 ) )
>
> since "to" is already prepositional in english?
>
> Gregg Wonderly
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20080115/e68f5726/attachment.html 


More information about the Concurrency-interest mailing list