On Wed, Jul 16, 2008 at 12:12 PM, Yixin Cao
<[EMAIL PROTECTED]> wrote:
>
>
> On Wed, Jul 16, 2008 at 11:26 AM, Gabriel Dos Reis
> <[EMAIL PROTECTED]> wrote:
>>
>> On Wed, Jul 16, 2008 at 10:25 AM, Ralf Hemmecke <[EMAIL PROTECTED]> wrote:
>> > I think the whole discussion is misleading.
>> >
>> > A function has a source and target type. So, if there is
>> >
>> > /: (Integer, Integer) -> Fraction Integer
>> >
>> > than the return type is *always* Fraction(Integer), also for something
>> > like 8/4 or 1/1.
>> >
>> > Why you see something else, is probably, because the interpreter adds
>> > some conversions. That is mostly OK if you work as a user on the command
>> > line, but in SPAD I would hate it since you would never know what type
>> > you get if you apply a function like - or /.
>> >
>> > All I want to say is that here are some hidden coercions taking place so
>> > the returned types are just what the interpreter is able to figure out.
>>
>> Yes, this is correct.
>> In the interpreter, everytime you have a result of type Integer, and
>> that integer
>> is a constant that can be coerced into a tighter SubDomain of Integer,
>> that is done.
>> The behaviour is controlled by $useIntegerSubDomain.
>
> I knew the $useIntegerSubDomain.
>
> Is this unacceptable?
>      foo:(Integer,Integer)->Union(Integer,Fraction Integer)
>      foo(nn,dd) ==
>         f := nn / dd
>         denom f = 1 => numer f
>         f

Unless you explain, your point is lost on me.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to