Dag Sverre Seljebotn wrote:
> (1): cdef char* chbuf = get_something(as_str=True) # chbuf = "asdf"
> (2): cdef object s = get_something(as_str=True) # s = str("asdf")
> (3): cdef object o_n = get_something(as_str=False) # o_n = int(3423)
> (4): cdef int i_n = get_something(as_str=False) # i_n = int(3423)
This is all well and good in a simple case like that where
you're directly assigning the result to something of a
known type.
But what if the result is being passed to another function
whose argument type is "generic"? If there is more than
one way of instantiating that function, it can easily
become ambiguous.
C++ disallows overloading a function based solely on the
return type, probably because of the ambiguities it can
lead to.
Also, in Haskell I think it's always possible to deduce
the return type of a function if you know the types of
its arguments.
Can you relate what you have in mind to some existing
well-understood parametric type system, such as Haskell's?
If you could, it would help tremendously in being able
to tell what it is and isn't capable of doing.
--
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev