[plt-scheme] find out return type of a function in typed scheme

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Sun May 16 17:18:42 EDT 2010

On Sun, May 16, 2010 at 1:00 PM, keydana at gmx.de <keydana at gmx.de> wrote:
> Hi Sam,
>
>
>> What form of reflection would you want?  I don't think I'm going to
>> give access to the internal type representation, since I want to be
>> able to change that in the future.
>
> I'd need the return type of a function, as I'm tagging objects depending on
> that. Right now I'm using a workaround, I'm evaluating the expression and
> then test the result for its type, but I wouldn't need this if I could find
> out the operator's return type.

What are you using this information for?  That might help me make it
easier for you.

> I can get along with the workaround, only the other way would be more
> natural (if possible).
> Would there be a way to offer this information by some "convenience
> function", not necessitating exposal of the internal representation? But
> really it's not that urgent, I was just asking to be sure I don't oversee it
> in the documentation :-;

The problem with that is that if I changed the internal
representation, your code would break, since I'd just be returning
some struct from the implementation that might be different from
release to release.

-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.