On Wed, Aug 6, 2008 at 8:09 AM, Gabriel Dos Reis <[EMAIL PROTECTED]> wrote:

> | Why is 'f' in 'f:X->Y' replaced with "*" when I write:
> |
> |   MyCat("*")
>
> Because the category expression MyCat "*" is evaluated.  Evaluating a
> category expression means (among other things) replacing parameters by
> their arguments.  Just like when you evaluate a
> function call, you expect that the actual arguments to be substituted
> for the parameters.
>
> | Wouldn't it be enough to treat 'f' in this context as a constant
> | unrelated to the parameter 'f'?
>
> Why should the 'f' in signature declaration in
>
>   MyCat(f:Symbol):Category == with
>      f:X->Y
>
> should be unrelated to the f in the parameter list?
>
> | Or do you think that this is just an accident of the design of the compiler?
>
> I don't have enough evidence to select `accident' over `logical
> consequence of the design'.

Now, I have enough information to conclude that the compiler's behaviour
and the interpreter behaviour are *contradictory*.  The following function
will always return the integer 1, no matter the value of input integer:

  f(a: Integer): Integer ==
     a: Float := 1.0

As someone who like proper scoping discipline, given the choice between
the interpreter behaviour and the compiler behaviour, I'll chose the interpreter
behaviour.  Given free hands, I'll make both invalid.

-- Gaby

-------------------------------------------------------------------------
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