Bill Page <bill.p...@newsynthesis.org> writes: | Doesn't the compiler already know that the value of res is returned | from the function?
No. At the point where the compiler is processing the local assignment res := 1 it has no clue that it will be used later as the retuned value. | Therefore infers that res must be of type % ? Nope, that is not the way the compiler works in all AXIOMs. | Even | in | | zero? n => 1 | | you have the question of what is type of 1. No. That line says "return this value", consequently, it checks the return value (1) in the context of expected return type. That does not hold for the assignment, because at that point, the assignment is not type checked in the context of return type. Rather, it is type checked in the context of "don't care about value" -- technically $NoValueMode in the compiler. -- Gaby ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel