> You're welcome.  Kudos to Luke Wagner who kindly reported the problem
> and explained how painful to work around when he was working on a class
> project.

Would have been even better if Luke had reported the problem to the 
mailing list.

> I agree with your assessment about the use of `pretend'.  I wish my
> students never heard of `pretend' :-)

You should ask your students to write a one page justification for every 
"pretend" they use in their program. ;-)

>> In Aldor I can use the "keyword arguments" like:
>>
>>  x:Sum(a:Integer,b:Integer) :=  [b==3]
>>
>> or equivalently 'union(b==3)'
>>
>>  http://www.aldor.org/docs/HTML/chap13.html#8
>>
>> but so far I have not found anything equivalent in any flavor of Axiom.

> When you wrote [b == 2], the interpreter understood that you were passing
> in value for an optional argument -- much like value for `keyword parameter'
> in some other programming languages.  I don't like much that double
> interpretation of `==' which depends on whether '==' appears at toplevel or
 > inside expression.
> I would rather use a different symbol for `keyword argument', than a fuzzy
> interpretation of '=='.

Hmm, actually I don't quite understand you here. In union(b==3), the 
"b==" is in some (other) sense also optional. Only in case where the 
types of the union are identical, that part would be necessary.

Clearly, that are to versions of "optional", but I like the equal syntax 
  using "==" of keyword argument and also for the case of the union above.

In fact, if I define a function (sorry, it's again Aldor)

foo(b: Integer): Integer == ...

then it should be possible to call foo via

foo(3)
foo(b==7)

so also here the "b==" is optional similar to the union case. See AUG 
Sections 6.3 + 6.4.

If I define it via

foo(b: Integer == 1): Integer == ...

then also

foo()

will be accepted and be equivalent to foo(1).

Could you clarify what exactly you don't like with that? Yes that is 
overloading of ==, but to me it seems quite intuitive to use "==" for 
the 2 cases: keyword argument, default value for optional argument.

Ralf

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to