"Polymorphic" in OSL manual


Blair Zajac <bl...@...>
 

Hey guys,

Reading through the OSL manual, on page 20 there's this paragraph:

"""Functions may be polymorphic. That is, multiple functions may be defined to have the same name, as long as they have differently-typed parameters, so that when the function is called the list of arguments can disambiguate which version of the function is desired."""

In C++ terminology, do you mean overloaded? Polymorphic to me means that the function takes a type parameter, or is a templated function.

Regards,
Blair


Larry Gritz <l...@...>
 

I believe you are correct. Polymorphism should refer to types, what I was talking about is really "overloading."

-- lg


On Feb 1, 2010, at 10:46 AM, Blair Zajac wrote:

Hey guys,

Reading through the OSL manual, on page 20 there's this paragraph:

"""Functions may be polymorphic. That is, multiple functions may be
defined to have the same name, as long as they have differently-typed
parameters, so that when the function is called the list of arguments
can disambiguate which version of the function is desired."""

In C++ terminology, do you mean overloaded? Polymorphic to me means
that the function takes a type parameter, or is a templated function.

Regards,
Blair

--
You received this message because you are subscribed to the Google Groups "OSL Developers" group.
To post to this group, send email to osl...@....
To unsubscribe from this group, send email to osl...@....
For more options, visit this group at http://groups.google.com/group/osl-dev?hl=en.

--
Larry Gritz
l...@...


Iliyan <iliyan....@...>
 

I think one of the reasons for this extensive explanation was meant to
make the point that functions cannot be overloaded only by return
type, in contrast to RSL :) This, along with many other "restrictions"
of OSL, makes sense, I'd argue.

On Feb 1, 7:54 pm, Larry Gritz <l...@...> wrote:
I believe you are correct.  Polymorphism should refer to types, what I was talking about is really "overloading."

        -- lg

On Feb 1, 2010, at 10:46 AM, Blair Zajac wrote:



Hey guys,
Reading through the OSL manual, on page 20 there's this paragraph:
"""Functions may be polymorphic.  That is, multiple functions may be
defined to have the same name, as long as they have differently-typed
parameters, so that when the function is called the list of arguments
can disambiguate which version of the function is desired."""
In C++ terminology, do you mean overloaded?  Polymorphic to me means
that the function takes a type parameter, or is a templated function.
Regards,
Blair
--
You received this message because you are subscribed to the Google Groups "OSL Developers" group.
To post to this group, send email to osl...@....
To unsubscribe from this group, send email to osl...@....
For more options, visit this group athttp://groups.google.com/group/osl-dev?hl=en.
--
Larry Gritz
l...@...


Larry Gritz <l...@...>
 

RSL and OSL both are able to overload functions by return type.

So, do the terminology purists out there think that this makes it "polymorphic" or merely "overloaded"?

-- lg


On Feb 1, 2010, at 1:43 PM, Iliyan wrote:

I think one of the reasons for this extensive explanation was meant to
make the point that functions cannot be overloaded only by return
type, in contrast to RSL :) This, along with many other "restrictions"
of OSL, makes sense, I'd argue.

On Feb 1, 7:54 pm, Larry Gritz <l...@...> wrote:
I believe you are correct. Polymorphism should refer to types, what I was talking about is really "overloading."

-- lg
--
Larry Gritz
l...@...


Blair Zajac <bl...@...>
 

Reading these two

http://en.wikipedia.org/wiki/Type_polymorphism
http://www.haskell.org/haskellwiki/Ad-hoc_polymorphism

suggests that what OSL provides is ad-hoc polymorphism, or otherwise known as overloading. I guessing adding "ad-hoc" or changing to "overloaded" would be fine, though I think the later is more familiar. I know if I saw "ad-hoc polymorphism" I would Google it.

Blair

On 02/01/2010 01:49 PM, Larry Gritz wrote:
RSL and OSL both are able to overload functions by return type.

So, do the terminology purists out there think that this makes it "polymorphic" or merely "overloaded"?

-- lg


On Feb 1, 2010, at 1:43 PM, Iliyan wrote:

I think one of the reasons for this extensive explanation was meant to
make the point that functions cannot be overloaded only by return
type, in contrast to RSL :) This, along with many other "restrictions"
of OSL, makes sense, I'd argue.

On Feb 1, 7:54 pm, Larry Gritz<l...@...> wrote:
I believe you are correct. Polymorphism should refer to types, what I was talking about is really "overloading."

-- lg
--
Larry Gritz
l...@...


Larry Gritz <l...@...>
 

"polymorphic" appears exactly once in the docs, I have changed to "overloaded." No biggie.


On Feb 1, 2010, at 4:52 PM, Blair Zajac wrote:

Reading these two

http://en.wikipedia.org/wiki/Type_polymorphism
http://www.haskell.org/haskellwiki/Ad-hoc_polymorphism

suggests that what OSL provides is ad-hoc polymorphism, or otherwise
known as overloading. I guessing adding "ad-hoc" or changing to
"overloaded" would be fine, though I think the later is more familiar.
I know if I saw "ad-hoc polymorphism" I would Google it.

Blair
--
Larry Gritz
l...@...